How to interpret the output of a neural network
1 view (last 30 days)
Show older comments
My code:
organelleGroundTruth = selectLabels(gTruth,'organelle');
trainingData = objectDetectorTrainingData(organelleGroundTruth);
summary(trainingData)
acfDetector = trainACFObjectDetector(trainingData,'NegativeSamplesFactor',2);
I = imread('test1.png');
bboxes = detect(acfDetector,I);
annotation = acfDetector.ModelName;
I = insertObjectAnnotation(I,'rectangle',bboxes,'');
figure
imshow(I)
I used Image Labeler to label 21 .png images; an example is shown below, the middle image. I exported these into Matlab as "gTruth" (class is ground truth), and the only label name is "organelle" (because all of the white spots are organelles that I want to detect).
I tested the network on an image (first image shown below). The program gave the third image below.
My first thought is that I labeled not enough images, so the neural network isn't as accurate as it would be with a larger labeled sample size. However, I expected each white spot to be inside 1 large rectangle. Instead, the program placed a high number of small rectangles on the objects. This is my main question: why are the rectangles so small, and can I tweak that? I think that I can solve the accuracy problem by labeling more images, but I don't know why the rectangles that the program produces are so small.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191325/image.png)
<<
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191326/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191327/image.png)
2 Comments
Florian Morsch
on 18 Jun 2018
Well, first this is no neural network, its a ACF object detector, thats a huge difference.
Now for your question, those detectors are normaly used with thousands of training images if you want good results. What happens here is your detector uses the 21 images you have and now starts detecting everything he thinks matches the trained data, which means each of the rectangles is a organelle. If you want better results you have to use a lot more training data.
Also as you label so small object you will need again a lot more data. The example with the stop signs works so "well" with 27 images in training because they have a strong border to other pixels and a more defined color/shape. The smaller your objects are, the more data you need for your detector.
(I use a cascade object detector at the moment to detect a marker with 8x10 cm, i have 600 positiv and 30.000 negative images to do so, and its only ok-ish, if i would use more positives it would get better.)
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!