FlowID: Enhancing Forensic Identification with Latent Flow-Matching Models

Jules Ripoll1, David Bertoin1, Alasdair Newson2, Charles Dossal1, Jose Pablo Baraybar3
1INSA Toulouse  2Sorbonne Université  3International Committee of the Red Cross
IJCAI 2026
Content warning: This paper contains images of facial injuries that readers may find unpleasant.
Injured inputFlowID reconstruction
Injured inputFlowID reconstruction
Injured inputFlowID reconstruction
Injured inputFlowID reconstruction

Samples from InjuredFaces, our facial reconstruction benchmark, edited with FlowID. Top: original images. Bottom: edited results.

Abstract

Every day, many people die under violent circumstances, whether from crimes, war, migration, or climate disasters. Medico-legal and law enforcement institutions document many portraits of the deceased for evidence, but cannot immediately carry out identification on them. While traditional image editing tools can process these photos for public release, the workflow is lengthy and produces suboptimal results.

In this work, we leverage advances in image generation models, which can now produce photorealistic human portraits, to introduce FlowID, an identity-preserving facial reconstruction method. Our approach combines single-image fine-tuning, which adapts the generative model to out-of-distribution injured faces, with attention-based masking that localizes edits to damaged regions while preserving identity-critical features. Together, these components enable the removal of artifacts from violent death while retaining sufficient identity information to support identification.

To evaluate our method, we introduce InjuredFaces, a novel benchmark for identity-preserving facial reconstruction under severe facial damage. Beyond serving as an evaluation tool for this work, InjuredFaces provides a standardized resource for the community to study and compare methods addressing facial reconstruction in extreme conditions. Experimental results show that FlowID outperforms state-of-the-art open-source methods while maintaining low memory requirements, making it suitable for local deployment without compromising data privacy.

Method

FlowID is an inversion-based editing method built on the Stable Diffusion 3 latent flow-matching model. Given an injured portrait and a textual description, it removes the artifacts of violent death while preserving identity-critical features, through two components: single-image fine-tuning, which adapts the model to the out-of-distribution input so that inversion retains identity, and localized editing with attention-inferred masks, which confines edits to the damaged regions.

Single-Image Fine-Tuning

Inversion-based editing integrates the probability-flow ODE up to a strength \(t_s\); when the inversion is imperfect, crucial identity information is lost and cannot be recovered during reconstruction. Part of this error stems from the fact that the input image is not a sample produced by the model. FlowID therefore begins by fine-tuning the pretrained SD3 model on the single image–prompt pair, making the image a more likely sample under its source prompt \(P^{src}\). As the number of fine-tuning steps \(N\) increases, reconstruction error decreases steadily and identity-related attributes emerge early in the process.

Input
Input
N=0
\(N=0\)
N=20
20
N=40
40
N=60
60
N=80
80
N=100
100
Single-image fine-tuning improves inversion performance.

Localized Editing with Inferred Masks

Recognizing a person relies on morphological cues (the shape of the nose, mouth, or jaw) but also on secondary cues such as tattoos or jewelry, which the generation process may inadvertently alter. To prevent this, FlowID derives a binary mask \(M\) from the model's own cross-attention maps between the image tokens and the concept tokens to be edited. The maps are averaged over all attention heads and transformer blocks, binarized with a k-means step, and enlarged with a max-pooling operation so the mask slightly overshoots the edit region. At every solver step, reference content is pasted back outside the mask, so only the targeted region is modified while the rest of the face is preserved exactly.

Input
Input
Without masking
w/o Masking
With masking
w/ Masking
Impact of our masking component for details preservation. Without masking, the person's tattoo is altered (middle) When using our masking component, we manage to infer the location of the tattoo and explicitly preserve it (right).

Results

We compare FlowID against UltraEdit, SDEdit, ICEdit, Kontext, and RF-Solver on our InjuredFaces benchmark and on FFHQ. To ensure a fair evaluation, image-quality and distortion metrics are computed only over images where the edit was successfully applied, since methods that fail to modify the target attribute would otherwise trivially score high on preservation.

Input
FlowID
Kontext
RF-Solver
ICEdit
UltraEdit
SDEdit
Qualitative comparison of image editing methods on InjuredFaces.
MethodIP ↑CLIP ↓FID ↓CMMD ↓LPIPS ↓VLM ↓
UltraEdit0.300.23116.442.360.200.19
SDEdit0.230.24104.482.290.240.15
ICEdit0.220.25190.432.610.240.88
Kontext0.480.24128.783.470.100.28
RF-Solver0.480.24117.883.120.140.36
FlowID0.500.23123.073.090.120.14
(a) InjuredFaces
MethodIP ↑CLIP ↑FID ↓CMMD ↓LPIPS ↓VLM ↑
UltraEdit0.460.2635.280.830.240.84
SDEdit0.130.2869.101.800.490.61
ICEdit0.750.2736.370.580.190.65
Kontext0.720.2731.300.850.200.96
RF-Solver0.260.2851.591.380.310.87
FlowID0.770.2729.040.450.110.94
(b) FFHQ

Quantitative comparison on (a) InjuredFaces and (b) FFHQ.

Supplementary Material

A. Implementation Details

Both InjuredFaces and FFHQ benchmarks were run on an A100 GPU cluster. For methods that use source and target prompts like ours, we use the prompt describing the injured photo from InjuredFaces as the source, and “a person's face” as the target. For instruction-based methods, we infer the edit instructions based on the source and target prompt with simple rules. For implementations that allow negative guidance, we extract the injury description from the source prompt by removing “a person's face” from the prompt. Our method uses the Adam8Bit optimizer in order to lower the memory requirements for compatibility with consumer hardware. We run all fine-tunings with a batch size of 1, gradient accumulation of 10, 80 optimizer steps, and a learning rate of 5e-5. These details allow us to run FlowID on an NVIDIA RTX 4090 GPU.

For instruction-based methods we check for the presence of a given type of injury and turn it into an instruction, e.g. if “wound” is in the description, the instruction becomes “remove the wound”. Checked attributes are: “wound”, “blood”, “mouth open”, “bump”, “bruise”, “cut”, “injury”, “swollen”. For ICEdit, we used the following prompt: “A diptych with two side-by-side images of the same scene. On the right, the scene is exactly the same as on the left but {instruction}” where the instruction follows the above rule. For RF-Solver, we use default parameters except for the number of feature injection steps, which we set to 10, as it yielded the best balance between identity preservation and edit insertion. Similarly we used a strength \(t_s\) of 0.65 for SDEdit.

Table 1. Successful edit rates per method and benchmark.
Method FFHQ InjuredFaces
Step 1Step 2Step 3Step 4Step 5Step 1
UltraEdit0.850.840.830.800.780.84
SDEdit0.580.580.570.560.560.86
ICEdit0.640.580.540.460.430.10
Kontext0.970.960.960.930.920.52
RF-Solver0.880.860.860.850.850.67
FlowID0.970.960.950.940.930.95

Success rates for both sequential edits on FFHQ and one-step edits on InjuredFaces can be seen in Table 1. We notice that our method tends to edit more strongly than others, thus motivating the need for the filtering applied on the InjuredFaces benchmark.

B. Additional Details on InjuredFaces

Injured portrait \(I_{inj}\)
Reference portrait Reference portrait
\(I_{ref}\)
“a person's face, injured” \(P\)
🧮 \(a\)
Figure 1. An InjuredFaces sample.

Figure 1 shows a sample from our InjuredFaces dataset. Each injured face represents a row in our dataset. It comes with healthy portraits of the same person, a textual description of the injured portraits, and an embedding vector \(a\), computed as the average of identity embeddings.

Figure 2 provides additional insight into the identity preservation metric. The cosine similarity matrix illustrates pairwise identity similarities across multiple identities, with higher values along same-identity pairs and substantially lower values for mismatched identities. Together, these visualizations confirm that the identity embedding produces consistent representations for the same individual, supporting its use as a reference for identity preservation evaluation.

Cosine similarity matrix between identity embeddings
Figure 2. Cosine similarity matrix between identity embeddings.

C. Additional Results on FFHQ

We further evaluate performance on sequences of five consecutive edits, always applying attribute modifications in the same fixed order for each identity. To ensure consistency, if an edit fails the sequence is terminated and we move on to the next identity. Results for the editing sequences are shown in Figure 3. We observe trends consistent with the single-shot setting: our method achieves the best scores across all metrics, while maintaining a success rate nearly on par with the strongest competitors. Figure 4 provides a qualitative comparison. Our approach better preserves the appearance of the original identity throughout the sequence, whereas Kontext, although faithful in applying edits, tends to generate unrealistic textures as edits accumulate, an effect also reflected in its higher FID values.

Editing success
(a) Editing success
Identity preservation
(b) Identity preservation
FID
(c) FID
CMMD
(d) CMMD
LPIPS
(e) LPIPS
Figure 3. Quantitative results on consecutive edits on FFHQ.
Input+ “light hair”− “earrings”+ “glasses”+ “hat”− “smile”
FlowIDKontextICEditRF-SolverUltraEditSDEdit
Qualitative comparison of sequential editing
Figure 4. Qualitative comparison of sequential editing with different editing methods.

BibTeX

@article{ripoll2026flowid,
  title={FlowID: Enhancing Forensic Identification with Latent Flow-Matching Models},
  author={Ripoll, Jules and Bertoin, David and Newson, Alasdair and Dossal, Charles and Baraybar, Jose Pablo},
  journal={arXiv preprint arXiv:2603.29591},
  year={2026},
  url={https://arxiv.org/abs/2603.29591}
}