Unsafe2Safe: Controllable Image Anonymization for Downstream Utility
Organizations: Dartmouth College
Abstract
Large-scale image datasets frequently contain identifiable or sensitive content, raising privacy risks when training models that may memorize and leak such information. We present Unsafe2Safe, a fully automated pipeline that detects privacy-prone images and rewrites only their sensitive regions using multimodally guided diffusion editing. Unsafe2Safe operates in two stages. Stage 1 uses a vision-language model to (i) inspect images for privacy risks, (ii) generate paired private and public captions that respectively include and omit sensitive attributes, and (iii) prompt a large language model to produce structured, identity-neutral edit instructions conditioned on the public caption. Stage 2 employs instruction-driven diffusion editors to apply these dual textual prompts, producing privacy-safe images that preserve global structure and task-relevant semantics while neutralizing private content. To measure anonymization quality, we introduce a unified evaluation suite covering Quality, Cheating, Privacy, and Utility dimensions. Across MS-COCO, Caltech101, and MIT Indoor67, Unsafe2Safe reduces face similarity, text similarity, and demographic predictability by large margins, while maintaining downstream model accuracy comparable to training on raw data. Fine-tuning diffusion editors on our automatically generated triplets (private caption, public caption, edit instruction) further improves both privacy protection and semantic fidelity. Unsafe2Safe provides a scalable, principled solution for constructing large, privacy-safe datasets without sacrificing visual consistency or downstream utility.
Figures & tables
| Privacy Criterion | Recall | Precision | F1 |
| All attributes | 0.975 | 0.793 | 0.874 |
| Face | 0.850 | 0.927 | 0.887 |
| Health indicators | 0.892 | 0.678 | 0.770 |
| Vehicles | 0.829 | 0.435 | 0.570 |
| Personal opinion | 0.778 | 0.665 | 0.717 |
| Model | Prior | Quality Score | Cheating Scores | ||||
| CLIP (↑) | SSIM (↓) | LPIPS (↑) | |||||
| C101 | I67 | C101 | I67 | C101 | I67 | ||
| U2S (FE) | 0.3054 | 0.3411 | 0.8551 | 0.6497 | 0.1118 | 0.2815 | |
| class | 0.2634 | 0.3149 | 0.8559 | 0.6708 | 0.1139 | 0.2600 | |
| 0.3094 | 0.3448 | 0.8556 | 0.6497 | 0.1118 | 0.2803 | ||
| 0.2685 | 0.2946 | 0.8550 | 0.6580 | 0.1168 | 0.2846 | ||
| Model | Text Prior | Utility Score | Privacy Score | ||||||||
| Accuracy ( ) | VLMScore ( ) | FaceSim ( ) | TextSim ( ) | Race Entropy ( ) | |||||||
| Cal101 | Indoor | Cal101 | Indoor | Cal101 | Indoor | Cal101 | Indoor | Cal101 | Indoor | ||
| Raw Images | – | 94.277 | 83.881 | 7.700 | 0.763 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 0.4384 | 0.7443 |
| Unsafe2Safe (FE) | 94.334 | 79.925 | 9.646 | 8.009 | 0.4378 | 0.2666 | 0.6611 | 0.4210 | 0.5552 | 0.7399 | |
| class | 93.857 | 80.448 | 12.555 | 7.512 | 0.4965 | 0.3743 | 0.4856 | 0.2077 | 0.4051 | 0.6508 | |
| 94.487 | 80.746 | 9.873 | 7.440 | 0.4881 | 0.2883 | 0.5395 | 0.2896 | 0.6409 | 0.7208 | ||
| Model | Text Prior | Utility | Privacy | ||||
| BLEU-4 | CIDEr | VLMScore | FaceSim | TextSim | RaceEnt | ||
| Raw | – | 0.436 | 1.413 | 0.646 | 1.0000 | 1.0000 | 0.6170 |
| U2S (FP) | 0.433 | 1.390 | 32.002 | 0.2013 | 0.1442 | 0.7364 | |
| U2S (FE) | 0.423 | 1.363 | 36.641 | 0.1975 | 0.1276 | 0.7282 | |
| FaceAnon | – | 0.444 | 1.429 | 1.622 | 0.4436 | 0.8123 | 0.6458 |
| Model | Text Prior | Utility | Privacy | |||
| ( ) | VLMScore ( ) | FaceSim ( ) | TextSim ( ) | RaceEnt ( ) | ||
| Raw | – | 0.6064 | 0.600 | 1.0000 | 1.0000 | 0.6288 |
| U2S (FP) | 0.6573 | 33.192 | 0.2041 | 0.1514 | 0.7499 | |
| U2S (FE) | 0.7093 | 37.059 | 0.1951 | 0.1196 | 0.7397 | |
| FaceAnon | – | 0.6632 | 1.705 | 0.4483 | 0.8158 | 0.6568 |
| Model | %White | %Black | %Asian | %Hispanic | %Other |
| Raw Images | 80.28 | 2.82 | 5.63 | 4.23 | 7.04 |
| U2S (FE, ) | 45.93 | 29.63 | 13.33 | 0.00 | 11.11 |
| U2S (FE, ) | 37.90 | 25.81 | 17.74 | 2.42 | 16.13 |
| DP2 [ 21 ] | 56.70 | 3.09 | 19.59 | 4.12 | 16.49 |
| FaceAnon [ 25 ] | 70.67 | 4.00 | 10.67 | 4.00 | 10.67 |
| Finetuned | Text Prior | Utility Score | Privacy Score | ||||||||
| Accuracy ( ) | VLMScore ( ) | FaceSim ( ) | TextSim ( ) | Race Entropy ( ) | |||||||
| Cal101 | Indoor | Cal101 | Indoor | Cal101 | Indoor | Cal101 | Indoor | Cal101 | Indoor | ||
| 94.773 | 80.746 | 11.651 | 6.559 | 0.5571 | 0.3382 | 0.6553 | 0.3112 | 0.5642 | 0.7414 | ||
| class | 94.887 | 79.776 | 10.674 | 5.943 | 0.6888 | 0.3500 | 0.6176 | 0.2898 | 0.5528 | 0.7678 | |
| 94.582 | 81.791 | 10.814 | 5.646 | 0.5401 | 0.3389 | 0.6589 | 0.3044 | 0.6497 | 0.7599 | ||
| 94.315 | 81.418 | 16.878 | 16.926 | 0.5164 | 0.2909 | 0.6126 | 0.3399 | 0.6826 | 0.7493 | ||
| #Samples | Utility | Privacy Instances | ||||
| Split | Train | Val | Acc@1 | Text | Faces | Races |
| Caltech101 [ 13 ] | ||||||
| Original | 2000 | 980 | 94.27 | 251 | 82 | 71 |
| Safe subset | 1552 | 756 | 83.49 | 111 | 24 | 0 |
| MIT Indoor67 [ 37 ] | ||||||
| Original | 3991 | 1317 | 83.88 | 551 | 2184 | 1332 |
| Text Prior | |||
| FLEUR ( ) | 80.45 | 78.93 | 58.27 |
| Model | Text Prior | Utility Score | Privacy Score | ||||||
| Accuracy ( ) | FaceSim ( ) | TextSim ( ) | Race Entropy ( ) | ||||||
| Cal101 | Indoor | Cal101 | Indoor | Cal101 | Indoor | Cal101 | Indoor | ||
| Raw Images | – | 94.277 | 83.881 | 1.0000 | 1.0000 | 1.0000 | 1.0000 | 0.4384 | 0.7443 |
| Unsafe2Safe (FlowEdit [ 24 ] ) | 94.334 | 79.925 | 0.4378 | 0.2666 | 0.6611 | 0.4210 | 0.5552 | 0.7399 | |
| class | 93.857 | 80.448 | 0.4965 | 0.3743 | 0.4856 | 0.2077 | 0.4051 | 0.6508 | |
| 94.487 | 80.746 | 0.4881 | 0.2883 | 0.5395 | 0.2896 | 0.6409 | 0.7208 | ||
Privacy-Preserving ML
Privacy-preserving machine learning develops methods to learn, share, and run models while limiting exposure of sensitive data.
See all 432 papers