Open mehio opened 5 years ago
@AlexeyAB I am desperate for help honestly
Dear Mehio, What are your reasoning to ally Deep Learning for this inspection ? Defects that are random are not necessarily well suited for a DL based detection. Did you consider other and more classic methods ( feature extraction, and feature space pattern recognition, pre-proccess, FFT-transformations ( Duda&Harts are good starting point)
Best regards / med venlig hilsen /真诚 Preben Hjornet Special Advisor Moble +45 2460 9899 skype preben.hjornet LinkedIn.http://www.linkedin.com/pub/preben-hj%C3%B8rnet/5/b88/126 Profile [Mailsignatur2]
From: mehio notifications@github.com Sent: 21. august 2019 05:26 To: AlexeyAB/darknet darknet@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [AlexeyAB/darknet] Detecting defects on metal steel surfaces NOT CONVERGING (#3790)
I could really use your help with some issues I am having with YOLO following your tutorial.
First I want to ask you about the dataset. I have a dataset which is images of metal steel surfaces which have defects on them such as scratches or patches. Images size is 200x200. I have 2 classes(scratches and patches) and i have 300 images per class so a total of 600 images. I will attach a sample with this email. When I used your tutorial with the same cfg file that you have (i only changed the number of classes and max batches and filters and steps) i got very bad results and no detection after 12000 iterations.
What can I change in the cfg file or dataset to get better results? I played around with some values in the cfg file such as width and height and i changed the channels from 3 to 1 because my images are grayscale, then i got different results but still bad and sometimes no detection. I know i have to change somethings in the cfg and dataset but i dont know where to start!
Do i need to get a dataset with bigger resolution? Do i need to change the network height and width? etc...
Thank you again for reading this and I hope to hear back from you as soon as possible.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/AlexeyAB/darknet/issues/3790?email_source=notifications&email_token=ABY4RBJ2JEHOJWY5BSFUP7LQFSYUPA5CNFSM4IOATP52YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HGMXPKA, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABY4RBOOSAJM5BIBU6YUJUDQFSYUPANCNFSM4IOATP5Q.
Hello Thank you for getting back to me. I am using the NEU surface defect detection dataset where other deep learning approaches were used and got good results. Which is why i want to use YOLO to try to get the same results.
https://towardsdatascience.com/deep-learning-computer-vision-and-automated-optical-inspection-774e8ca529d3 This person used a simple CNN, inceptionV3 and mobilenetV1 and got good results.
https://software.intel.com/en-us/articles/use-machine-learning-to-detect-defects-on-the-steel-surface In this link they also used many machine learning methods to achieve good results on the same dataset.
Yes defects are random but if you have a dataset and the defect is repeated in many images then why is not possible to train yolo?
The repeatability ( similarities within a class ) is what is going to be the factor you should learn on. You may consider some pre processing to enhance exactly these features and surpress anything else. To improve your SNR.
Get Outlook for Androidhttps://aka.ms/ghei36
From: mehio notifications@github.com Sent: Wednesday, August 21, 2019 10:14:00 AM To: AlexeyAB/darknet darknet@noreply.github.com Cc: Preben Hjornet preben.hjornet@gmail.com; Comment comment@noreply.github.com Subject: Re: [AlexeyAB/darknet] Detecting defects on metal steel surfaces NOT CONVERGING (#3790)
Hello Thank you for getting back to me. I am using the NEU surface defect detection dataset where other deep learning approaches were used and got good results. Which is why i want to use YOLO to try to get the same results.
https://towardsdatascience.com/deep-learning-computer-vision-and-automated-optical-inspection-774e8ca529d3 This person used a simple CNN, inceptionV3 and mobilenetV1 and got good results.
https://software.intel.com/en-us/articles/use-machine-learning-to-detect-defects-on-the-steel-surface In this link they also used many machine learning methods to achieve good results on the same dataset.
Yes defects are random but if you have a dataset and the defect is repeated in many images then why is not possible to train yolo?
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/AlexeyAB/darknet/issues/3790?email_source=notifications&email_token=ABY4RBJMJVY6APSQWCTXS23QFT2MRA5CNFSM4IOATP52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4Y2XEY#issuecomment-523348883, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABY4RBOJPKMXUXX5XUMEV63QFT2MRANCNFSM4IOATP5Q.
@mehio base on your sample images that is very doable. I don't think traditional methods will help you much due to the variability. CNN shine on anything that is fuzzy. I am detecting holes on steel plates which seem to come in all sizes with sort of funny defects and junk in them, the NN won't care, at some point(~200K epochs for me), it generalizes. The key for me was the sample set and make sure the images are all properly labeled and don't leave unlabeled images. Your sample set is a little low at 600, but it should give you preliminary detentions, make sure your threshold is low initially and pick the right model as recommended here.
Also start small. Use a pre-trained model - see the guides here - on simple things or use a public image database and once you succeed with that which you should, it is proven then do your own.
Hi thank you for replying. 1.Did you change anything in the cfg file? (resolution, anchors, etc...) 2.How big are your images? How big is your network size(height and width)? 3.My threshold will detect objects at 25% confidence so I am getting a few detections which is nice but obviously i want to make it better. The best MAP i got was 18%. 4.What do you mean pick the right model? Im using the full yolov3. And im using a pretrained weights which is the darknet53.conv.74
The only things i changed in my cfg are the filters (classes+5)x3, classes, max batches and steps(80%90% of max batches).
I have attached a zip file which has my training log , cfg file , images yolo mehio.zip
@mehio I would suggest:
Hi I realised something weird. I changed the batch size to 24 and subdivisions to 8 and now its getting better results and detections! Why is that??
And then theres another issue. In AlexeyABs tutorial it says change the testing batch and subdivision. But when i look at other peoples cfg files, they changed the training batch and subdivision. Why is that ?
@mehio There are no training and testing batch and subdivisions. There are commented and un-commented.
In original repo you should use batch=64 for Training and batch=1 for detection. In this repo you should use batch=64 for Training and any batch for detection.
I could really use your help with some issues I am having with YOLO following your tutorial.
First I want to ask you about the dataset. I have a dataset which is images of metal steel surfaces which have defects on them such as scratches or patches. Images size is 200x200. I have 2 classes(scratches and patches) and i have 300 images per class so a total of 600 images. I will attach a sample with this email. When I used your tutorial with the same cfg file that you have (i only changed the number of classes and max batches and filters and steps) i got very bad results and no detection after 12000 iterations.
What can I change in the cfg file or dataset to get better results? I played around with some values in the cfg file such as width and height and i changed the channels from 3 to 1 because my images are grayscale, then i got different results but still bad and sometimes no detection. I know i have to change somethings in the cfg and dataset but i dont know where to start!
Do i need to get a dataset with bigger resolution? Do i need to change the network height and width? etc...
Thank you again for reading this and I hope to hear back from you as soon as possible.