matiasdelellis / facerecognition

Nextcloud app that implement a basic facial recognition system.
GNU Affero General Public License v3.0
525 stars 47 forks source link

Feature idea: age-aware recognition #620

Open amo13 opened 1 year ago

amo13 commented 1 year ago

After letting the facerecognition app do its thing on my huge amount of family photos starting from 1966 and going till today, I noticed that I had to correct a lot of wrongly classified persons. A lot of them, I think, the app could have avoided all by itself by knowing only the birth year of the persons that are being recognized. One kid (toddlers are a pain to recognize for the app apparently) was classified as someone that would only be born 40 years later.

So I thought I'd just leave this idea here.

Anyway, I sincerely appreciate your work on this app a lot. Keep it going! (And it works way better than the official recognize app)

Server configuration

rhatguy commented 1 year ago

I'm not sure how feasible face recognition knowing a person's birth year might be, but I wonder if there would be some way to "hint" the clustering algorithm, or skew the results based on time. I.E. weight matches less based on their distance from the time of the rest of the cluster.

amo13 commented 1 year ago

Hinting based on the time of the rest of the cluster might not be the correct approach since we might have pictures of a person over decades in a cluster.

My idea is rather to assume we already have initially named clusters and with the names of the recognized persons a birth year. Then we can compare the birth year of the potential cluster person with the year from the exif data (or even of the folder name

matiasdelellis commented 1 year ago

Hi both, It is under consideration. But in particular, adding an age control would not resolve the kids and babies clustering errors. 🤔

The model was trained with photographs of middle-aged people, Therefore, it just can't identify them correctly. That is, the model is blinded, and all the boys appear to be the same. Unfortunately, the same applies to any non-Caucasian persons, and these are simply all the same for the model.. 😞

(Please, don't kill me, I'm not an expert and I don't know how to say it better... 😞)

Likewise, I am interested in this proposal to solve another problem. Knowing the age allows me to distribute the faces in smaller groups and in a stable way. So, I can first group the faces from 0 to 5 years, then 6 to 10, and so on.

Doing it this way would allow me to be much faster and more efficient during clustering. 😄 In any case, this is an improvement for the future. 😉

Regarding ethnicity or age bias, I think nextcloud has a unique opportunity to make a move to make a much better model, but for that, we have to convince users to share our photos and our children's photos.. 🙈

tuxArg commented 1 year ago

Hi,

Just an idea as I had (sort of) done it manually myself. Is it possible to use picture's metadata to know the date and then make clusters by year ranges? occ config:app:set facerecognition cluster_years (n years)

or, alternatively and more usefull but manual per directory occ face:background_job -u [user_id] -p [path] ... And only scan that directory.

vwbusguy commented 11 months ago

I have four kids and have had my nextcloud server syncing all my photos for over a decade. As such, I have a ton of kid pictures over a wide age range and can confirm the models can't tell them apart. Is there anything I can do with my existing data to improve the models for myself and everyone else using this?