Bug 432207

Summary: After rejection, assign face to next best match
Product: [Applications] digikam Reporter: Johannes Stallkamp <jstallkamp>
Component: Faces-RecognitionAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: caulier.gilles, chrisc.gigamail, iwannaberich, metzpinguin, michael_miller, thilo.grundmann
Priority: NOR    
Version First Reported In: 7.2.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In: 8.7.0
Sentry Crash Report:

Description Johannes Stallkamp 2021-01-27 16:42:58 UTC
SUMMARY
If I reject a face assignment as incorrect, rerunning face recognition shall assign the face to the next best match (not again to the same, incorrect person) 


STEPS TO REPRODUCE
1. Run face recognition 
2. Reject incorrect faces
3. Run face recognition 

OBSERVED RESULT
Faces are (incorrectly) assigned to the same person  (again) 

EXPECTED RESULT
Faces are assigned to next best matching person. 

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2021-01-27 17:44:05 UTC
It does not work like that. We don't have a next match. You have to assign more people first for the face engine to learn. This is not a fingerprint comparison.

Maik
Comment 2 Thilo 2021-10-30 06:34:29 UTC
(In reply to Maik Qualmann from comment #1)
> It does not work like that. We don't have a next match. You have to assign
> more people first for the face engine to learn. This is not a fingerprint
> comparison.
> 
> Maik

Hello, I think this is an interesting question. Labelling, that a face does not belong to a certain person is valuable information. I understand, that it is not possible to simply reject this classification result and to accept the next best match (which would work when there would be something like a "similarity" vector for a query face that gives a scalar value of similarity for every person in the database.  
However, wouldnt it be possible to use the end users rejection of a classification result as "negative labeling" information for a retraining, leading to an improved classification result?
Comment 3 Chris 2023-10-17 08:16:41 UTC
If possible to inject a "value" into the deep learning mechanism, a rejection could apply a large "negative" recogition value to a rejected face tag, so it would not become to top choice after a re-scan.

How to keep track of rejections and cancel errornous rejections?
- Similar to how face regions are related to face tags in the database, but with the meaning "rejected" instead of "matched".
- A UI feature could allow you to view rejections and cancel them, in case of mistakes
Comment 4 caulier.gilles 2024-10-08 16:56:49 UTC
I'm not sure to understand. It's a bug or a wish ?

Gilles
Comment 5 Michael Miller 2025-03-18 23:37:59 UTC
(In reply to caulier.gilles from comment #4)
> I'm not sure to understand. It's a bug or a wish ?
> 
> Gilles

Hi Gilles,
I think this is a wish.

Cheers,
Mike
Comment 6 Michael Miller 2025-04-18 10:55:38 UTC
Git commit 499d41cee5f7422e9951ed9c097d898568f7046d by Michael Miller.
Committed on 18/04/2025 at 10:55.
Pushed by michmill into branch 'master'.

Save rejected face data

Save rejected face tags and exclude the tags from being used during face classification (matching).

This MR does not include code to write the rejected face tags to the item metadata.  That will be a different MR in the next several days.

This MR does not include the ability to clear the reject face data. That will be a different MR in the next several days.
Related: bug 502219, bug 444394, bug 415783, bug 502924

M  +5    -0    core/libs/database/coredb/coredbconstants.cpp
M  +1    -0    core/libs/database/coredb/coredbconstants.h
M  +137  -13   core/libs/database/tags/facetagseditor.cpp
M  +15   -3    core/libs/database/tags/facetagseditor.h
M  +135  -28   core/libs/database/tags/facetagsiface.cpp
M  +52   -6    core/libs/database/tags/facetagsiface.h
M  +29   -28   core/libs/facesengine/recognition/faceclassifier.cpp
M  +17   -11   core/libs/facesengine/recognition/faceclassifier.h
M  +2    -0    core/libs/facesengine/recognition/faceclassifierbase.cpp
M  +2    -0    core/libs/facesengine/recognition/faceclassifierbase.h
M  +35   -36   core/libs/facesengine/recognition/identityprovider.cpp
M  +4    -1    core/libs/facesengine/widgets/facescansettings.cpp
M  +8    -6    core/libs/mlfoundation/mlclassifierfoundation.h
M  +4    -3    core/libs/tags/autoassignment/classifiers/minmax/autotagsclassifierminmax.cpp
M  +10   -8    core/libs/tags/autoassignment/classifiers/minmax/autotagsclassifierminmax.h
M  +9    -5    core/libs/tags/autoassignment/classifiers/multiclassyolo/autotagsclassifiermultiyolo.h
M  +5    -3    core/libs/tags/autoassignment/classifiers/softmax/autotagsclassifiersoftmax.cpp
M  +10   -8    core/libs/tags/autoassignment/classifiers/softmax/autotagsclassifiersoftmax.h
M  +25   -0    core/utilities/facemanagement/database/faceutils.cpp
M  +10   -1    core/utilities/facemanagement/database/faceutils.h
M  +44   -20   core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp
M  +73   -39   core/utilities/facemanagement/pipelines/edit/facepipelineedit.cpp
M  +7    -0    core/utilities/facemanagement/pipelines/edit/facepipelineedit.h
M  +15   -0    core/utilities/facemanagement/pipelines/facepipelinebase.cpp
M  +1    -0    core/utilities/facemanagement/pipelines/facepipelinepackagebase.h
M  +27   -29   core/utilities/facemanagement/pipelines/recognize/facepipelinerecognize.cpp
M  +1    -0    project/bundles/homebrew/02-build-extralibs.sh
M  +2    -0    project/bundles/homebrew/03-build-digikam.sh
M  +11   -8    project/bundles/homebrew/config.sh

https://invent.kde.org/graphics/digikam/-/commit/499d41cee5f7422e9951ed9c097d898568f7046d