IKXAI-anonymity: Iterative XAI-based probabilistic k-anonymity for face image anonymization
Rami Haffar, David Sánchez · Pattern Recognition · 2026
Facial images are of great interest for research, but they might compromise individuals’ privacy. Existing approaches to image anonymization often rely on either uniform image perturbation (such as pixelation or blurring) or generative AI models, but both lack privacy guarantees and may severely compromise images’ analytical utility. In this work, we present IKXAI-anonymity, a novel framework that enforces probabilistic k -anonymity on face images through an iterative process guided by explainable artificial intelligence techniques. Unlike global transformations or latent-space manipulations, our method applies small and incremental modifications to only the most identity-revealing pixels iteratively. The added noise remains lightweight at every step, which allows the anonymization process to gradually reduce identity traces with minimal harm the overall utility of the image in secondary analyses ( e.g. , age, gender, and race classification). The identity-revealing image regions to perturb are detected using a gradient-based counterfactual explainer. The process iterates until the image identity prediction rank falls below a threshold k , which corresponds to a probability of re-identification of at most 1 / k . We evaluate IKXAI-anonymity on a curated dataset of face images and compare it with pixel perturbation techniques, direct image-space k -anonymity and state-of-the-art generative approaches. Our results show that IKXAI-anonymity reliably achieves the targeted level of privacy while retaining much better image utility than the other methods in secondary tasks. The code to reproduce all the reported experiments is available at https://github.com/RamiHaf/IKXAI-anonymity .