Yolov2 background affects object score

3 views (last 30 days)
gil
gil on 9 Dec 2021
Edited: Prasanna on 16 Feb 2024
Trained yolov2 detector using resnet50 network on artificial black rectangles (80 images over all 80 objects same rotation, size and content). The train set bounding boxes are a bit smaller than the black rectangle itself.(It happens also when the trained bounding box is a bit larger than the black rectangle.
[detector,~] = trainYOLOv2ObjectDetector(preprocessedTrainingData,lgraph,options);
Running detect and getting high score > 0.9 on specific object in an image see attached.
[bboxes,scores,labels] = detect(detector.detector, resized, "Threshold", 0);
On the same image artificially adding ellipses to the background near the object.
Run detect again and the score drops to < 0.3. see attached.
What can be the reason for the drop in the score? It looks like the close background like elipses impact the object score.
What MATLAB tools can be used to analyze this network?

Answers (1)

Prasanna
Prasanna on 16 Feb 2024
Edited: Prasanna on 16 Feb 2024
Hi Gil,
I understand from your query that you want to understand the reasons for drop in accuracy in yolov2 and want to check new analysis tools for deep learning networks in MATLAB.
The drop in detection scores when adding ellipses to the background of the image could be due to a variety of factors. Here are some potential reasons:
  • Overfitting: Your network may have overfitted to the training data. Since the training images consist of black rectangles without any ellipses in the background, the network might not generalize well to new patterns or objects in the background.
  • Feature Confusion: The addition of ellipses could introduce new features that the network confuses with features of the black rectangles. This can lead to a reduced confidence in the detection of the rectangles.
  • Background Context: YOLO networks consider the context of the surrounding environment. If the ellipses significantly alter the background context, the network might not recognize the scene as containing the object it was trained to detect.
To analyse and diagnose the issues with your network in MATLAB, you can use the Deep Network Designer”. This app allows for an interactive exploration of the layers and structure of the network. You can also edit the network and analyse activations. You may refer the following documentation to learn more about Deep Network Designer: https://www.mathworks.com/help/deeplearning/gs/get-started-with-deep-network-designer.html
To improve your model's performance, consider adding more variability to your training data, including images with ellipses and other background noise. This will help the network learn to generalize better to new situations. Regularization techniques, such as dropout or data augmentation, can also help reduce overfitting.
Hope this helps.
Regards,
Prasanna

Tags

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!