Disharmony: Forensics using Reverse Lighting Harmonization

Philip Wootaek Shin, Jack Sampson, Vijaykrishnan Narayanan, Andres Marquez, Mahantesh Halappanavar · DOI

Abstract

Image harmonization—the process of adjusting a foreground object to match the lighting, color, and shading of a background—poses a significant challenge to digital forensics. Traditional forensic tools, which often rely on noise patterns or compression artifacts, frequently fail to detect these seamless edits. We present the Disharmony Network, a segmentation-based forensic tool specifically designed to identify harmonized manipulations. By employing an aggregated training strategy across neural, manual, and physics-based harmonization techniques, the Disharmony Network learns a generalized representation of lighting inconsistencies. Our results demonstrate that this approach significantly outperforms existing state-of-the-art forensic models in both detection accuracy and localization precision.

Introduction

In the era of Generative AI, the ability to "splice" an object into a photograph has become trivial. However, a simple paste operation usually results in a visual mismatch where the lighting of the inserted object does not align with the environment. To rectify this, researchers and artists use image harmonization to adjust the foreground object's visual properties. While beneficial for creative applications, this process creates a "blind spot" for digital forensics. Existing models are typically not tuned to the subtle artifacts left behind by harmonization tools, which are specifically designed to make images look natural to the human eye.

This paper addresses this gap by introducing the Disharmony Network, a system that treats forensic detection as a segmentation task focused on lighting discrepancies rather than low-level pixel noise.

Methodology

The core innovation of the Disharmony Network is its training philosophy. Rather than specializing in a single type of edit, the model utilizes an aggregated training strategy to learn a robust "grammar" of lighting inconsistencies. The training data encompasses three distinct categories of harmonization:

  1. Neural Network-based: Edits generated by deep learning encoder-decoder models (e.g., the Harmonizer model).
  2. Manual/Handcrafted: Professional-grade edits where human artists adjust color, saturation, and brightness using tools like Adobe Photoshop.
  3. Physics-based: Edits grounded in traditional light-transport principles, including shading, occlusion, and global illumination.

The researchers utilized MaskFormer as the underlying architecture. MaskFormer’s ability to treat segmentation as a mask classification task proved highly effective for aggregating these diverse visual signals into a unified forensic tool.

Datasets and Evaluation

To ensure the model was sufficiently "light-aware," it was trained and tested on a diverse set of data:

  • DISK25k: A large-scale dataset of nearly 25,000 image pairs used for initial pretraining on neural-based harmonization artifacts.
  • RealHM: A high-quality dataset consisting of 216 manual, human-centric edits used for fine-tuning the model on realistic, professional manipulations.
  • IH Dataset (Careaga): A physics-based dataset containing 60 composite images to ground the model in light-transport principles.
  • iHarmony4 Benchmark: A 100-image test set featuring five different deep-learning harmonization methods (including DoveNet and PCT-Net) to evaluate the model's ability to generalize to unseen architectures.

Key Insights

The "Reverse" Harmonization Approach

Instead of attempting to create a perfect blend, the Disharmony Network is trained to recognize the "seams" created by the blending process itself. By performing what the authors term "reverse lighting harmonization," the model identifies the signatures left behind when an AI or an artist attempts to smooth over an edit.

Generalization through Diversity

The study found that training on a single type of harmonization makes forensic models brittle. By combining neural, manual, and physics-based data, the Disharmony Network avoids overfitting to specific algorithmic artifacts and instead learns to identify broader lighting inconsistencies.

Challenges with Diffusion Models

The authors noted that modern diffusion-based editing (e.g., InstructPix2Pix) presents a unique challenge. These models often alter the entire background to match a prompt rather than just modifying the target object. This global change makes localizing the specific "edit" difficult, as the entire image technically contains generative artifacts.

Results

The Disharmony Network demonstrated superior performance compared to established forensic models such as MantraNet, CAT-Net, HIFI-Net, and IML-ViT.

  • Detection Accuracy: In terms of ROC AUC, the Disharmony Network consistently scored approximately 0.70, while competing models hovered between 0.52 and 0.63.
  • Localization Precision: The model achieved mean Intersection over Union (mIoU) scores between 0.55 and 0.60. In contrast, existing forensic models struggled to reach 0.10 on harmonized data, often producing noisy or entirely empty masks.

Limitations and Future Work

Despite its success, the Disharmony Network faces limitations in detecting very small modifications that occupy a negligible fraction of the image. Additionally, in tasks like virtual try-ons (e.g., StableVINTON), the model occasionally flags unedited areas, such as a person's face, due to global lighting shifts applied by the generative pipeline.

Future research will focus on improving detection for these holistic changes and fine-tuning the model on edge cases where the edited area is extremely small or the lighting changes are exceptionally subtle.

Summary updated

BibTeX
@inproceedings{shin2025disharmony,
  author = {Philip Wootaek Shin and Jack Sampson and Vijaykrishnan Narayanan and Andres Marquez and Mahantesh Halappanavar},
  title = {{Disharmony: Forensics using Reverse Lighting Harmonization}},
  booktitle = {Workshops @ WACV},
  year = {2025},
  doi = {10.1109/wacvw65960.2025.00085},
}
Figure