Researchers from the University of Modena and Reggio Emilia (Unimore) have developed CoDE, an AI system designed to identify visual deepfakes with unparalleled precision. This system, which uses advanced contrastive learning techniques, has set a new benchmark by achieving over 97% accuracy in detecting manipulated images. CoDE was showcased at the European Conference on Computer Vision (ECCV) 2024 in Milan, as part of the European Lighthouse on Secure and Safe AI (ELSA) initiative.
The Deepfake Problem
Deepfakes—AI-generated or manipulated media—are becoming increasingly common and harder to spot. These altered images and videos have legitimate uses in fields like entertainment and education but also pose significant threats. With the rise of accessible AI technologies like StableDiffusion and Dall-E, creating deepfakes has become easier, fueling concerns about misinformation and manipulation. This makes it more urgent than ever to have reliable tools for identifying them.
CoDE: A Game-Changer in Deepfake Detection
Unimore’s CoDE, which stands for Contrasting Deepfakes Diffusion via Contrastive Learning, is a breakthrough in the ongoing fight against deepfakes. Developed by researchers Lorenzo Baraldi and Federico Cocchi, under the guidance of Professors Rita Cucchiara and Marcella Cornia, CoDE sets itself apart as the most precise system available. Trained on an immense dataset—over 2 million real images and 9 million AI-generated ones—CoDE has been equipped to handle a variety of deepfake scenarios. The computational power behind this system equals about 10 years of processing time on standard workstations.
What makes CoDE particularly effective is its ability to detect even the smallest manipulations in images, a crucial feature as AI-generated content grows more convincing. It is resilient against image compression and transmission distortions, areas where many detection systems typically fall short.

How CoDE Works
At the heart of CoDE is its contrastive learning approach. This allows the AI to pinpoint not only whether an entire image is fake but also to identify specific manipulated sections or even individual pixels. The system’s accuracy—97% compared to the roughly 60% human success rate—shows just how far the technology has advanced.
CoDE goes beyond simple detection, providing a confidence score and a visual breakdown of which parts of an image appear altered. This transparency helps users understand the nature of the manipulation, adding a valuable layer of insight to the detection process.
Despite its strengths, CoDE isn’t flawless. It can struggle with images that have been heavily edited or compressed, and regular updates are required to keep it up to date with the latest AI techniques. However, its precision and robustness make it the most advanced system available for deepfake detection.
The Broader Impact and ELSA’s Role
The rise of deepfakes has broad implications, from spreading false information to invading personal privacy. Unimore’s development of CoDE is part of the larger ELSA project, an EU-backed initiative focused on creating safe AI technologies. In collaboration with Leonardo S.p.A., Unimore has hosted international competitions aimed at improving deepfake detection methods, fostering a global effort to tackle this issue.
CoDE’s role extends beyond merely spotting fakes. In a world where even authentic images can be digitally altered, the system helps define what is “real” and what is not. This capability is becoming increasingly essential as AI-generated content proliferates, influencing everything from media transparency to personal security.
A New Light On Digital Landscape
The ongoing evolution of deepfake technology demands equally sophisticated tools for detecting and understanding it. Unimore’s CoDE system offers the most accurate solution to date, providing much-needed clarity in a digital landscape where distinguishing between real and manipulated media is becoming increasingly difficult. As part of the ELSA initiative, CoDE is a critical tool in the fight to preserve the integrity of visual media and maintain trust in the images and videos we consume every day.
With its remarkable accuracy and the ongoing improvements driven by international collaboration, CoDE represents a major leap forward in AI’s ability to counteract the growing threat of deepfakes.