CNN With unbalanced Data

14 ビュー (過去 30 日間)
Mohanad Alkhodari
Mohanad Alkhodari 2020 年 6 月 21 日
コメント済み: Kenta 2020 年 7 月 11 日
Hello
I have a question regarding CNN in MATLAB
I have a dataset with imbalanced classes. 70 for A 20 for B and 10 for C. How can I reduce the effect of this imbalance during training. The input images are binary images
When performing a leave-one-out scheme, the prediction is mostly going to be A every time.
The network archetecture am using is the exact same as AlexNet network
image_size = 512;
layers = [
imageInputLayer([image_size image_size 1],'Normalization','none')
convolution2dLayer(11,96,'Stride',4,'Padding',0)
reluLayer
crossChannelNormalizationLayer(5)
maxPooling2dLayer(3,'Stride',2)
groupedConvolution2dLayer(5,128,2,'Stride',1,'Padding',2)
reluLayer
crossChannelNormalizationLayer(5)
maxPooling2dLayer(3,'Stride',2)
convolution2dLayer(3,384,'Stride',1,'Padding',1)
reluLayer
groupedConvolution2dLayer(3,192,2,'Stride',1,'Padding',1)
reluLayer
groupedConvolution2dLayer(3,128,2,'Stride',1,'Padding',1)
reluLayer
maxPooling2dLayer(3,'Stride',2)
fullyConnectedLayer(4096)
reluLayer
dropoutLayer(0.5)
fullyConnectedLayer(4096)
reluLayer
dropoutLayer(0.5)
fullyConnectedLayer(3,'WeightLearnRateFactor',1,'BiasLearnRateFactor',1)
softmaxLayer
classificationLayer];
% analyzeNetwork(layers)
options = trainingOptions('sgdm',...
'ExecutionEnvironment','gpu',...
'Minibatchsize',10,...
'MaxEpochs',64,...
'InitialLearnRate',0.0001,...
'Shuffle','every-epoch',...
'Verbose',false,...
'Plots','training-progress');
My main question is how to make the network predicting the other two classes as well instead of just shooting for A because it is the highest amount of data. Is there a command to use or something wrong with the network?
I do not prefer data augmentation for the dataset am using as the shape and size are important factors.
Thank you

回答 (1 件)

Greg Heath
Greg Heath 2020 年 6 月 22 日
Although you do not prefer data augmentation, duplication of the smaller dataset examples is probably the quickest and most reliable way to proceed.
Thank you for formally accepting my answer.
Greg
  4 件のコメント
Mohanad Alkhodari
Mohanad Alkhodari 2020 年 6 月 22 日
編集済み: Mohanad Alkhodari 2020 年 6 月 22 日
Is this example of what you are refering to for augmentation?
Could you please suggest an approach for augmentation in this imbalanced dataset?
Kenta
Kenta 2020 年 7 月 11 日

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by