mohak2312 / Glasses-detection

glass detection
9 stars 10 forks source link

how to train the glass_cascade #1

Open alfredtorres opened 6 years ago

alfredtorres commented 6 years ago

hello, im studying the face recongiton. I want to detect the glassed in the face images. but using the glass_cascade.xml cannt achieve i dont konw how to improve and train a better glasses_detector. can you share more,thank you.

mohak2312 commented 6 years ago

First of all, use the thick frame for glass detection. The main problem is background lighting. So try to train and detect in the same environment. Use more images for training. I used 800 images but it is not enough. Use HD camera if possible. And don't overtrain it. I got better accuracy with 15-18 stages instead of 20 stages. Just observe your training model first. I used more negative images that include faces. And try to train images of glass with the different angle. Use bottom and corner edge of the glass for training. So take images that focus more on that edges. It is hard to recognize top edge because of eyebrows. Use plane background in a glass image for training maybe same like skin color. I tried with white background and it gave me the worse result but you can try it because i did some filtering on that image so maybe it is possible that it is because of that filtering. detectMultiScale(roi_gray,1.04,5) in this, try with different scaling factor(1.00-5.00) and min neighbour(3-7) according to brightness of face and how far your face from the camera.

useful link: https://www.youtube.com/watch?v=jG3bu0tjFbk this channel is very useful. I mostly followed the tutorial. And try to read a comment on that videos, you will find the useful solution from that.

alfredtorres commented 6 years ago

thank you for your help, i have watched the tutorial. i will create a cascade again. thank you all the way. if i have any problem, i will ask for your help, sorry for my disturb.

mohak2312 commented 6 years ago

you are welcome. No problem and if you get better accuracy then let me know the changes you made.

alfredtorres commented 6 years ago

hello, I have tried some methods this days. finally, I choose deep learning. I use CNN to extract features and a Binary SVM to predict whether eyeglass or not. deep learning method can approach the 99% acc.