ScaledYOLOv4 icon indicating copy to clipboard operation
ScaledYOLOv4 copied to clipboard

Using YOLO as a multi-label classifier: how?

Open andyrey opened this issue 3 years ago • 5 comments

I plan to use YOLO tiny as classifier, not detector. Case: human face already detected. Need to be classified with multiple tags: with glasses or not, with mask or not and some other features. Classifiers currently used are very slow. I plan to set the only one cell instead of, say, 416x416 in cfg file (will it work, I am not sure), get all classes from output, satisfying the thresholds, ignore BB coordinates- they are not important in the case. Of course, I plan to put down multiple labels in dataset -same coordinate,different classes, it is not a question. The question is: will it work without changing in framework code? Has anybody tried this? Any advice?

andyrey avatar Jun 15 '21 11:06 andyrey

maybe you should just use a classifier network, pytorch has a few built in, my goto is efficientnet-B2

LukeAI avatar Jun 15 '21 11:06 LukeAI

Yes, it works. We have done this in 2021-01-14, but not yet have the plan to release the function. (hint: GAP and BCE) And if your mask and glasses has keypoints annotation, you could combine this with our code. (hint: Wing loss)

WongKinYiu avatar Jun 15 '21 12:06 WongKinYiu

Thank you for your answers. @LukeAI: afraid, efficientnet-B2 much slower, it was good for Kaggle competition where processing time is not important.

@WongKinYiu: what is GAP and BCE stand for (Before Common Era?). We use YOLO-4 for detection of person and face successfully, and these detectors work fast enough. Having got the face, we classify (not detect) articles on the face: gorges, mask, respirator and so on. We don't use keypoints, current classifiers (not YOLO) define presence or absence of glasses& mask rather good, but just too much slow... So, only YOLO demonstrate outperforming speed.

andyrey avatar Jun 16 '21 05:06 andyrey

Global Average Precision, Binary Cross Entropy...

andyrey avatar Dec 06 '21 07:12 andyrey

Global Average Pooling, Binary Cross Entropy

WongKinYiu avatar Dec 06 '21 09:12 WongKinYiu