Open MarcPoulin1 opened 4 years ago
What mAP do you get on Training dataset?
For the last weights I get this:
Thanks for your help!
Your model is trained very well.
https://github.com/AlexeyAB/darknet#how-to-improve-object-detection
for each object which you want to detect - there must be at least 1 similar object in the Training dataset with about the same: shape, side of object, relative size, angle of rotation, tilt, illumination. So desirable that your training dataset include images with objects at diffrent: scales, rotations, lightings, from different sides, on different backgrounds - you should preferably have 2000 different images for each class or more, and you should train 2000*classes iterations or more
Yes I understand this. The problem is that the object that I am trying to identify has too many variations. Damage is not a well defined object by clear features like cars, animals and others. My question is what do you suggest in order to have a better object detector? Should I only increase the number of images or can I optimize some parameters in the config file?
You use bad images in your training dataset.
Did you get Training and Validation datasets by evenly randomly dividing a Single dataset in a Training 80% and Validation 20% of images? You should do this.
Yes the training and validation sets come from a random split 80%/20% of the same dataset.
I have used the same code for another project that worked perfectly. Here is the python code for the spit (I masked some parts of the code):
import os import random import numpy as np
image_folder = MASKED!!!
image_list = [f for f in os.listdir(image_folder) if f.split('.')[-1] in ["jpg","jpeg"]]
random.seed(5) np.random.shuffle(image_list)
split_index = int(0.8*len(image_list))
while image_list[split_index-1][:9]==image_list[split_index][:9]: split_index+=1
training,validation = image_list[:split_index],image_list[split_index:]
def write_file(data,name):
data_folder = MASKED!!!!
data = ['data/obj2/' + f for f in data]
f = open(os.path.join(data_folder,name),'w+')
f.write('\n'.join(data))
f.close()
write_file(training,'train2.txt') write_file(validation,'valid2.txt')
So I think that your dataset is too small.
Also what mAP@0.05 can you get by using ./darknet detector map ... -iou_thresh 0.05
command?
At 0.05 I get a better mAP! What does it mean? Thank you very much for your help!
Accuracy on the validation dataset is very low even at low iou_thresholds. While the accuracy on the training dataset is very high. This means that your training set is not representative - there are very few objects in it that you want to detect. Just collect 4-8x more images and follow these rules: https://github.com/AlexeyAB/darknet/issues/4359#issuecomment-557659270
Thank you! I will increase the number of images and post if I need some help later.
I'm training yolov3 with COCO dataset (only 5 categories):
Problem: In training the error decreases but mAP is always 0.0%
COCO dataset has already been used for this type of training, so I don't use bad images in my dataset training, right? Any ideas? please help
@maria-mh07
Yes I understand this. The problem is that the object that I am trying to identify has too many variations. Damage is not a well defined object by clear features like cars, animals and others. My question is what do you suggest in order to have a better object detector? Should I only increase the number of images or can I optimize some parameters in the config file?
I do not think that damage is object. In COCO terms it is "stuff", I think it can be better use semantic segmentation networks like BiSeNet and others (but its much harder to annotate images). https://paperswithcode.com/sota/real-time-semantic-segmentation-on-cityscapes But I'm not really sure, you should try and compare. If you have only 1% test result you definitely should increase your dataset.
@maria-mh07
Show bad.list and bad_labels.list files
@maria-mh07
@maria-mh07
class_id [0-4], but some txt-annotations are empty. I also think that in train.txt there are some repeated routes. I don't know if this affects.
This is normal.
set GPU=1 CUDNN=1 in the Makefile and do
make clean
make
Ok thank you very much @AlexeyAB Sorry for this silly question but how do I do it on windows?
Thanks!! =)
I did a training with 128 images, I used yolo_mark for the annotations and it seems to be going well. So I think there is somthing wrong with my .txt annotations or train.txt and valid.txt files.
Does it affect if I have different numbers of decimals?
No, it's normal
0 0.197656 0.700234 0.0 0.0
How can be object with zero size? It's bad.
I have repeated paths to the same imagen in valid.txt/train.txt files.
Its normal.
Check your dataet by using Yolo_mark and run training with flag -show_imgs
Would you look at my conversion scrip of the bounding boxes, please? I would really appreciate it because I don't know what I'm doing wrong filter_train.zip Thank you very much for all the help
@maria-mh07
I can see the bounding box but the image is shifted
It's normal. This is due data augmentation. Your dataset is correct.
Train more using much more images. https://github.com/AlexeyAB/darknet#when-should-i-stop-training
ok thank you very much for the help! =)
When I train a YOLOv3 to detect damage on images of cars I get a low average loss but also a really low MAP. The model is overfitting a lot (see below). I have trained the model on 500 images of damaged car.
Any suggestion on how to reduice overfitting for this type of detection? I can increase the number of photos and change the config file. Also since the damage doesn't have any aspect ratio, what are the optimal anchors for this problem? If I increase the number of anchors will it help on the validation set?