matiasdelellis / facerecognition

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

Big Cluster / Face Group appeared with different People #730

Closed Cebrain closed 4 months ago

Cebrain commented 6 months ago

Problem

I updated in the last months to Nextcloud 28 and in the last days i found an big cluster /face group with all kind of people and images. Example, the biggest cluster in my library is myself with 1300 photos and this appeared cluster are now 900 faces which includes pictures of myself and many other people i already identified as persons.

Steps to reproduce

Sorry, i have no idea.

Question

My question is now, is there a way to delete this Cluster/ Face group and rescan this pictures? As i see i can add this group to another person, but this does not help because it is completely mixed.

matiasdelellis commented 5 months ago

Hi @Cebrain First of all, it would be important to know if you are using the "native" application in the user preferences or Memories.

The native tool is only preserved because there is an option to see the clusters that make up the person. Maybe there is a group of faces that you accidentally incorporated into the main person.

Cebrain commented 5 months ago

Hi, i am not exactly sure what you mean with native application, but i think i am using the correct one in settings.

Example i the person to "Everyone?" I went into Personal Settings -> Face Recognition -> Click on Face Group -> Review Facegroup I can only see one single face group.

In this group are now many faces with different people, most people i have already setup some persons. image

matiasdelellis commented 5 months ago

ok.. You have two options.. If you have faces with strange positions (Not frontal) and you are using model 1, I recommend using model 4 and you will have much better results.

If they are childrens, or non-Caucasian/Asian people, the model we use has problems identifying these people. This model simply cannot differentiate them well.. 🤦🏻 It is a big problem but there is still no better model. 😞

In both cases you can try to reduce the grouping threshold and the minimum confidence and recluster again.

Then, just assuming that this is a random cluster, but not the one that includes all the photos. You can click on the icon of the person with the cross, and the cluster will be hidden. You can then name all the faces individually in the file or photo side panel. This is complicated if it is a very large cluster, because then you must add one by one.

matiasdelellis commented 4 months ago

There is a new model in the latest version, which theoretically should have better results since it was trained with more Asian people, however I don't know if this is your problem. 🤔

Cebrain commented 4 months ago

ok.. You have two options.. If you have faces with strange positions (Not frontal) and you are using model 1, I recommend using model 4 and you will have much better results.

If they are childrens, or non-Caucasian/Asian people, the model we use has problems identifying these people. This model simply cannot differentiate them well.. 🤦🏻 It is a big problem but there is still no better model. 😞

In both cases you can try to reduce the grouping threshold and the minimum confidence and recluster again.

Then, just assuming that this is a random cluster, but not the one that includes all the photos. You can click on the icon of the person with the cross, and the cluster will be hidden. You can then name all the faces individually in the file or photo side panel. This is complicated if it is a very large cluster, because then you must add one by one.

thanks for response and sorry for the late reply.

Sadly nothing happened in my case. The pictures are mostly from european people and not many children. There are many different pictures with frontal images and far away.

The strange thing was that as i remember, all these pictures was already grouped with other people faces. Suddenly this single People Group appeared (1000 pictures of my 8000).

Is it possible to destroy this group completely and face-recognition rescan the pictures?

matiasdelellis commented 4 months ago

It's strange that you have only one group that big. The reason for maintaining the current clustering algorithm is to avoid accumulating errors by making simple errors-

What values do you have in Clustering threshold and Minimum confidence?? By default it is 0.4 and 0.99. Test with 0.3 and 0.9

Cebrain commented 4 months ago

This is my current setup, it is possible that i messed something up with these settings a longer time ago.

image

So person stats are about: Myself 1200 pictures Person 2 1100 pictures Person 3 1000 pictures Then the broken picture group with 850 pictures Person 4 200 pictures and go on.

matiasdelellis commented 4 months ago

With clustering threshold 0.4 you should already see a big difference.

Cebrain commented 4 months ago

Can i rescan only this group after setting to another value or do i need to reset everything?

matiasdelellis commented 4 months ago

No...It is not necessary.. it only affects grouping. There will be smaller clusters but of greater quality.

Maybe you should reset the clustering (occ face:reset --clustering) to start renaming from scratch.

Cebrain commented 4 months ago

Ok, i let it scan and give feedback :) Thanks for help

Cebrain commented 4 months ago

Ok, feedback is already here 😄

Nothing really changed, but the Group now jumped from 850 pictures to 1250 pictures 😓 But i recognize one thing, the group has mostly pictures from faces/people from the side.

matiasdelellis commented 4 months ago

Nothing really changed, but the Group now jumped from 850 pictures to 1250 pictures 😓

D'Oh!. It doesn't make sense, but I believe you... 🙈

But i recognize one thing, the group has mostly pictures from faces/people from the side.

Maybe by analyzing from scratch with the last update and same model you can have an improvement, since I added a small undocumented change to improve these issues.

But I honestly don't think it's worth it. Personally I would try to hide this cluster and eventually use the side panel to name each face little by little.

Cebrain commented 4 months ago

Still thanks for help :) Maybe when i have some time i will reset the faces. For the moment i live with it