How do you do multi-class classification with a CNN network?

조회 수: 31 (최근 30일)
Michael Bilenko
Michael Bilenko 2021년 4월 17일
댓글: Mahesh Taparia 2021년 4월 24일
Currently I have a CNN network with a the classification layer.
net = alexnet;
layersTransfer = net.Layers(1:end-3);
numClasses = 5;
layers = [
layersTransfer
fullyConnectedLayer(numClasses,'Name', 'fc','WeightLearnRateFactor',1,'BiasLearnRateFactor',1)
softmaxLayer('Name', 'softmax')
classificationLayer('Name', 'classOutput')];
There are 5 different classes and each image can have multiple classes. However I can not find a way to train a network where each image has more than one possible class. How can I change my network so I can train it with data where there are multiple labels?

채택된 답변

Mahesh Taparia
Mahesh Taparia 2021년 4월 19일
Hi
As per your problem, I am assuming you are having multiple categorical objects in a single image. So the problem is no longer an image classification, it is an object detection problem. You can refer to the documentation of object detection, here are some useful links:
Hope it will help!
  댓글 수: 4
Michael Bilenko
Michael Bilenko 2021년 4월 24일
Thanks for the suggestion. How do I implement a custom loss layer?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Recognition, Object Detection, and Semantic Segmentation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by