ultralytics / yolov3

YOLOv3 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
10.18k stars 3.44k forks source link

Yolov3 with 1 class #1841

Closed karl-gardner closed 2 years ago

karl-gardner commented 3 years ago

Hello Glenn et. al,

I am running yolov3 on 696 images (train,val,test) (416 x 416) before augmentation that mainly look like these few examples: image image image

There are a total of 1,078 total annotations with only 1 class. I am running at batch size 32 and 500 epochs. I feel like this is a pretty easy task for yolov3 however I am not able to get above mAP (0.5-0.95) of 0.74. I can get high mAP for just mAP (0.5 IOU) but not mAP(0.5:0.95). I can report this in my paper but I feel like there is something I am doing wrong or something I can do differently. Would I have to change the loss function since the classification loss would always be 0 or maybe the .yaml file with the names line (names: ['cell']).

Thanks,

Karl Gardner

glenn-jocher commented 3 years ago

@kgardner330 👋 Hello! Thanks for asking about improving YOLOv5 🚀 training results.

Most of the time good results can be obtained with no changes to the models or training settings, provided your dataset is sufficiently large and well labelled. If at first you don't get good results, there are steps you might be able to take to improve, but we always recommend users first train with all default settings before considering any changes. This helps establish a performance baseline and spot areas for improvement.

If you have questions about your training results we recommend you provide the maximum amount of information possible if you expect a helpful response, including results plots (train losses, val losses, P, R, mAP), PR curve, confusion matrix, training mosaics, test results and dataset statistics images such as labels.png. All of these are located in your project/name directory, typically yolov5/runs/train/exp.

We've put together a full guide for users looking to get the best results on their YOLOv5 trainings below.

Dataset

COCO Analysis

Model Selection

Larger models like YOLOv5x and YOLOv5x6 will produce better results in nearly all cases, but have more parameters, require more CUDA memory to train, and are slower to run. For mobile deployments we recommend YOLOv5s/m, for cloud deployments we recommend YOLOv5l/x. See our README table for a full comparison of all models.

YOLOv5 Models

Training Settings

Before modifying anything, first train with default settings to establish a performance baseline. A full list of train.py settings can be found in the train.py argparser.

Further Reading

If you'd like to know more a good place to start is Karpathy's 'Recipe for Training Neural Networks', which has great ideas for training that apply broadly across all ML domains: http://karpathy.github.io/2019/04/25/recipe/

karl-gardner commented 3 years ago

Hello @glenn-jocher

Sounds good I will respond with more detailed information on losses and metrics. But I don't have to do anything special with the --data .yaml file other than putting the following:

nc: 1 names: ['cell']

with only one label?

Thanks,

Karl

glenn-jocher commented 3 years ago

@kgardner330 yes your data yaml is all good.

github-actions[bot] commented 2 years ago

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv3 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv3 🚀 and Vision AI ⭐!