Skip to content

Sensitivity

matiasdelellis edited this page Apr 5, 2019 · 6 revisions

Sensitivity

The similarity of two faces is established by the Euclidean Distance between their descriptors and the sensitivity determines how different the faces can be to continue to be considered as the same person.

A small value groups only very similar descriptors, resulting in many groups of the same person, but of great quality. A higher value will be more flexible when differentiating the descriptors to group them, resulting in grouping the largest number of faces of the same person, but can make mistakes grouping similar people.

Examples:

On my home server, for this test, I have 3016 images where our application found 1620 faces. Now we will see how our application detects people, according to the grouping of the most similar faces according to the sensitivity parameter.

Sensitivity 0.5: (Default value)

[matias@nube nextcloud]$ sudo -u apache php occ face:background_job -u matias
[sudo] password for matias: 
1/9 - Executing task CheckRequirementsTask (Check all requirements)
2/9 - Executing task CheckCronTask (Check that service is started from either cron or from command)
3/9 - Executing task LockTask (Acquire lock so that only one background task can run)
4/9 - Executing task StaleImagesRemovalTask (Crawl for stale images (either missing in filesystem or under .nomedia) and remove them from DB)
5/9 - Executing task CreateClustersTask (Create new persons or update existing persons)
        1620 faces found for clustering
        271 persons found after clustering
6/9 - Executing task AddMissingImagesTask (Crawl for missing images for each user and insert them in DB)
7/9 - Executing task EnumerateImagesMissingFacesTask (Find all images which don't have faces generated for them)
8/9 - Executing task ImageProcessingTask (Process all images to extract faces)
        NOTE: Starting face recognition. If you experience random crashes after this point, please look FAQ at https://github.com/matiasdelellis/facerecognition/wiki/FAQ
9/9 - Executing task UnlockTask (Release obtained lock)

With this parameter, 271 groups of similar people were obtained, but let's concentrate only on how the application detects me, and the algorithm detected me in in 4 groups that have 620 faces. The primary group contains the majority of the faces grouping 398 faces with few mistakes, but the second big group is essentially trash since there is no real person who has a majority there and I only appear on 8 faces. If we differentiate, we have 7.77% error (19 of 398 faces) in the first group, which can be considered acceptable, but if we take into account all the errors we have a 36.61% error (227 of 620 faces).

Sensitivity 0.4:

Change the sensitivity parameter. (Remember that you can do it from the setting panel as well).

[matias@nube nextcloud]$ sudo -u apache php occ config:app:set facerecognition sensitivity --value 0.4
Config value sensitivity for app facerecognition set to 0.4

We run the command again with the new parameter:

[matias@nube nextcloud]$ sudo -u apache php occ face:background_job -u matias
1/9 - Executing task CheckRequirementsTask (Check all requirements)
2/9 - Executing task CheckCronTask (Check that service is started from either cron or from command)
3/9 - Executing task LockTask (Acquire lock so that only one background task can run)
4/9 - Executing task StaleImagesRemovalTask (Crawl for stale images (either missing in filesystem or under .nomedia) and remove them from DB)
5/9 - Executing task CreateClustersTask (Create new persons or update existing persons)
        Clusters already exist, but there was some change that requires recreating the clusters
        1620 faces found for clustering
        721 persons found after clustering
6/9 - Executing task AddMissingImagesTask (Crawl for missing images for each user and insert them in DB)
7/9 - Executing task EnumerateImagesMissingFacesTask (Find all images which don't have faces generated for them)
8/9 - Executing task ImageProcessingTask (Process all images to extract faces)
        NOTE: Starting face recognition. If you experience random crashes after this point, please look FAQ at https://github.com/matiasdelellis/facerecognition/wiki/FAQ
9/9 - Executing task UnlockTask (Release obtained lock)

With this parameter, 721 groups of similar people were obtained, but the algorithm detected me in in 42 groups that have 395 faces. This time only confused me twice (..and certainly the image with which he compares it is not very good either). This represents a 0.50% error. Note that the individual groups are those that could not be grouped together. Since using a sensitivity of 0.4, only groups so very similar descriptors. But the important thing is that it does not group it with erroneous people either.

Comparation

facerecognition-sensitivity-0_5

facerecognition-sensitivity-0_4