Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest updates on performance optimization and validation #88

Open
wants to merge 34 commits into
base: dev
Choose a base branch
from

Conversation

matteobeltrami
Copy link
Collaborator

@matteobeltrami matteobeltrami commented Apr 10, 2024

Description

The object detection recipe has been modified to improve the performance (in terms of mAP) of the networks supported within micromind.
Until the latest version of micromind, the mean average precision (mAP) metric was calculated using a function we implemented, however the performances did not coincide with those calculated with the ultralytics methods. The ultralytics validation and metrics calculation code was therefore adapted to make it compliant with our code and models.
Furthermore, some hyperparameters have been changed that optimize the performance obtained from the training of the object detection models.

To note

  • The recipes/object_detection/validation/ folder contains the revisited ultralytics code that manages the validation of a model.

  • In order to deal with ultralytics validation scripts:

    • the forward method in the training script has been modified in order to differentiate whether the model is in training or validation state and whether it requires to perform preprocessing;

    • the mAP metric is not an instance of the Metric class, it only gets calculated at the end of every training epoch by overwriting (and thus calling) the on_train_epoch_end() function.

  • When using the validation utilities and script you can choose to set the verbose argument to True in order to print details regarding the number of images, instances and metrics for each class of the dataset, and the plots argument to True in order to saves the plots of the confusion matrix, the F1-Confidence, Precision-Confidence, Precision-Recall, Recall-Confidence curves and the predictions and labels of the first three batches of images.

  • The inference script has been modified in order to deal also with images in RGBA format (simply the "transparency" channel gets ignored).

@matteobeltrami matteobeltrami requested a review from fpaissan April 10, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants