Using multiple features in trainNetwork to determine an artist of a painting

1 visualizzazione (ultimi 30 giorni)
I am using convolutional neural networks to discriminate who is the artist of a painting. I have around 200 images from each artist, all resized to the same size and rgb (so 3 separate color channels). 90% of the images are used as training images and the rest for testing.
When I use trainNetwork I get around 70% accuracy (± 5%). It fluctuates since the selection of the training data i random.
Is it possible to better the accuracy with more "features"? Lets say I use imgradient to find the magnitude and direction of an image. I can use these two separately to train my CNN (just like I would with my original images but magnitude and direction are 2-dimensional data) and I will get different results from using the rgb images. But is it possible to use all 3 in combination to better the accuracy somehow? I hope the question is understandable.
Here is my code if it is needed. I have used this example as a template: https://se.mathworks.com/help/nnet/ref/trainnetwork.html
% Reading the images
digitDatasetPath = fullfile(pwd ,'images', 'NOF', 'XXS');
digitData = imageDatastore(digitDatasetPath,...
'IncludeSubfolders',true,'LabelSource','foldernames');
% Defining the training and testing data
trainingNumFiles = 0.9;
rng(1) % For reproducibility
[trainDigitData,testDigitData] = splitEachLabel(digitData,...
trainingNumFiles, 'randomize');
% Read the size of the image
[n, m, o] = size(digitData.readimage(1));
% Defining the layers
layers = [imageInputLayer([n m o]);
convolution2dLayer(5,20);
reluLayer();
maxPooling2dLayer(2,'Stride',2);
fullyConnectedLayer(2);
softmaxLayer();
classificationLayer()];
% Setting the training options
options = trainingOptions('sgdm','MaxEpochs',20,...
'InitialLearnRate',0.0001, 'ExecutionEnvironment', 'parallel');
% Starting the training
convnet = trainNetwork(trainDigitData,layers,options);
% Testing the result
YTest = classify(convnet,testDigitData);
TTest = testDigitData.Labels;
% Print the result
accuracy = sum(YTest == TTest)/numel(TTest)
% Notify!
beep on
beep

Risposta accettata

Shubham Srivastava
Shubham Srivastava il 23 Mag 2017
Modificato: Shubham Srivastava il 23 Mag 2017
Hi Robin,
You can follow the suggestions below:
1. Use some algorithm that combines a number of features together to yield better classification accuracy.
2. Extract the features from intermediate layers of deep networks like CNN as they can be highly descriptive.
3. Combine the descriptors with some other low level descriptors like PHOG, dictionary based descriptors etc, using descriptor fusion techniques are available in literature.
You can refer the heading 'Descriptors Fusion' in the paper mentioned below:
Hope the above suggestion helps.
Regards,
Shubham

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by