harthur / kittydar

Face detection for cats in JavaScript - demo for TXJS 2012 talk
http://harthur.github.com/kittydar
MIT License
1.42k stars 172 forks source link

uploaded an owl and it detected 1 cat :( #1

Closed aurelian closed 7 years ago

aurelian commented 12 years ago

This is k-mart quality

This is not a cat

Original image: http://cl.ly/HP4G

Nevertheless, nice work

arielp commented 12 years ago

This one is close, but no cigar.

http://imgur.com/a/7UeNn

harthur commented 12 years ago

@aurelian "This is k-mart quality"

What does that mean?

Regarding the owl and cat feet, there are definitely a lot of false positives. Hopefully this will turn into the "kittydar said something else was a cat" issue.

In any case, any one is welcome to fork and make it better so there are less false positives in general.

aurelian commented 12 years ago

@harthur it was a joke, obviously the context was missing - one sent me a link to your demo, uploaded said owl. You can imagine the rest. Sorry about that. Promise, I won't open github issues after having 1 beer :|

How do I train the classifier or where should I look to have less false positives?

FractalBobz commented 12 years ago

I think i see what's happened here, that wavy branch in the capture area could be mistaken for ears. i think it's pretty funny.

I'm wondering how kittydar can find those tilted heads, (see arielp's image) Should we try splitting up the image into various rotated rectangle areas? or train the classifier to recognise more tilted heads?

harthur commented 12 years ago

How do I train the classifier or where should I look to have less false positives?

There are three ways to make this better:

  1. Better training data, it's already pretty good though.
  2. Better input. Right now that's a HOG descriptor (cell size 6px, block size 2 cells, block stride 1 block, 6 bins, L2 norm), extracted from a 48x48 resize of the test image, but something like a Haar of Oriented Gradients looks promising.
  3. Better classifier. Right now it's using a neural network, a support vector machine or something else could be better, but right now it looks like a neural network is the only one implemented in JS.

I just increased the classification threshold though, so that will get rid of a bunch of false positives and the expense of just a couple more false negatives probably. I think your owl image now detects 0 cats overall.

I'm wondering how kittydar can find those tilted heads, (see arielp's image) Should we try splitting up the image into various rotated rectangle areas? or train the classifier to recognise more tilted heads?

Yeah, it's not testing any different orientations right now. The best way is the first way you mention, testing at different angles instead of training at different angles.

jnorthrup commented 12 years ago

train with random rotations and aspect ratios applied artificially. add a few more nn layers.