RAVID : R etrieval- A ugmented Vi sual D etection: A Knowledge-Driven Approach for AI-Generated Image Identification

Mamadou Keita, Wassim Hamidouche, Hessen Bougueffa Eutamene, Abdelmalik Taleb-Ahmed, Abdenour Hadid · 2025

Read RAVID : R etrieval- A ugmented Vi sual D etection: A Knowledge-Driven Approach for AI-Generated Image Identification by Mamadou Keita, Wassim Hamidouche, Hessen Bougueffa Eutamene, Abdelmalik Taleb-Ahmed, Abdenour Hadid (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2508-03967.txt.

Introduction

Mamadou Keita and co-authors present a method for spotting AI generated images in a 2025 paper. Older detectors often lean on low level artifacts tied to one generator, so they fail on new generators or damaged images. The team instead borrows retrieval, a trick that has improved text systems, and applies it to pictures.

Their framework, RAVID, encodes a query image with a tuned vision encoder and pulls the most relevant images from a database. A vision language model then judges the enriched input. On a benchmark covering nineteen generators, the method reached the best average accuracy. It also held up far better than rivals when images were blurred or compressed. The authors present retrieval as a new base for fake image detection.

Catalog record

CREATORMamadou Keita, Wassim Hamidouche, Hessen Bougueffa Eutamene, Abdelmalik Taleb-Ahmed, Abdenour Hadid
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE62 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2508-03967

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

RAVID : R etrieval- A ugmented Vi sual D etection: A Knowledge-Driven Approach for AI-Generated Image Identification Mamadou Keita, Wassim Hamidouche, Hessen Bougueffa Eutamene, Abdelmalik Taleb-Ahmed, Abdenour Hadid Abstract In this paper, we introduce RAVID, the first framework for AI-generated image detection that leverages visual rag ( rag ). While rag methods have shown promise in mitigating factual inaccuracies in foundation models, they have primarily focused on text, leaving visual knowledge underexplored. Meanwhile, existing detection methods, which struggle with generalization and robustness, often rely on low-level artifacts and model-specific features, limiting their adaptability. To address this, RAVID dynamically retrieves relevant images to enhance detection. Our approach utilizes a fine-tuned CLIP image encoder, RAVID_CLIP, enhanced with category-related prompts to improve representation learning. We further integrate a vlm ( vlm ) to fuse retrieved images with the query, enriching the input and improving accuracy. Given a query image, RAVID generates an embedding using RAVID_CLIP, retrieves the most relevant images from a database, and combines these with the query image to form an enriched input for a vlm (e.g., Qwen-VL or Openflamingo). Experiments on the UniversalFakeDetect benchmark, which covers 19 generative models, show that RAVID achieves state-of-the-art performance with an average accuracy of 93.85%. RAVID also outperforms traditional methods in terms of robustness, maintaining high accuracy even under image degradations such as Gaussian blur and JPEG compression. Specifically, RAVID achieves an average accuracy of 80.27% under degradation conditions, compared to 63.44% for the state-of-the-art model C2P-CLIP, demonstrating consistent improvements in both Gaussian blur and JPEG compression scenarios. The code will be publicly available upon acceptance. Figure 1 : Performance comparison of detectors on the UniversalFakeDetect dataset, including frequency-based (Freq-spec, Co-occurrence), convolutional (CNN-Spot, F3Net), transformer-based (FatFormer, RINE, C2P-CLIP), hybrid (Bi-LORA, LGrad), multimodal (AntifakePrompt, Bi-LORA) architectures and RAG (RAVID (ours)). 1 Introduction The rapid advancement of generative models, particularly in image synthesis, has introduced significant challenges in distinguishing AI-generated content from real data. For instance, gan [ 19 , 20 , 8 ] and diffusion-based models [ 31 , 11 , 40 , 37 ] have become increasingly proficient at producing photorealistic images that are nearly indistinguishable from genuine ones. However, the progress in detection methods has not kept pace with these advancements, creating an urgent need for robust and reliable detection systems. As generative models continue to evolve, so do the complexities associated with their detection, leading to a constant race between improving generative techniques and enhancing detection capabilities. Traditional AI-generated image detection approaches primarily rely on identifying low-level artifacts or model-specific fingerprints [ 44 ] present in synthetic images. These artifacts include pixel inconsistencies, noise patterns, and subtle distortions that reveal traces of the underlying generation process. While these methods have demonstrated effectiveness in controlled settings, they often fail in real-world scenarios. As generative models improve, they become more adept at minimizing artifacts and replicating the statistical properties of real images, making detection increasingly difficult. Furthermore, many existing detection methods suffer from a fundamental limitation: over-reliance on model-specific features and low-level artifacts. Since these methods are often tailored to exploit weaknesses in particular architectures, they struggle to generalize across different generative models. Consequently, there is a growing need for more adaptive detection approaches that leverage additional sources of information to enhance performance, robustness, and reliability. One promising direction is rag [ 24 ] , a paradigm initially developed to improve factual accuracy in large language models by retrieving and incorporating external knowledge relevant to a given query. While extensively explored in textual tasks, its potential for visual tasks, particularly AI-generated image detection, remains largely underexplored. Existing detection methods mainly rely on hand-crafted features, model fingerprints, and deep learning-based classifiers trained on limited datasets [ 51 , 9 ] . These approaches face significant challenges in generalization, struggling to detect images generated by unseen models, and robustness, as even minor perturbations, such as noise injection, compression artifacts, or adversarial attacks, can significantly degrade their performance. Overcoming these limitations requires a more adaptive, retrieval-based framework that dynamically integrates external visual knowledge to improve decision-making. To address this gap, we propose RAVID, a novel retrieval-augmented framework for AI-generated image detection. Unlike traditional methods that rely solely on model-dependent features, RAVID retrieves visually similar images relevant to the input query and integrates them into the detection process, thereby enhancing accuracy and robustness. At its core, RAVID leverages a CLIP-based image encoder, fine-tuned through category-level prompt integration to improve its ability to capture semantic and structural patterns crucial for distinguishing AI-generated images from real ones. Additionally, we incorporate vlm , such as Openflamingo [ 2 ] , to effectively fuse retrieved images with the query input, enabling richer contextual understanding. By combining retrieval-based augmentation with advanced vision-language decision-making ability, our approach significantly improves adaptability and effectiveness, making it well-suited for real-world applications where reliable AI-generated content detection is critical. To evaluate our approach, we conduct extensive experiments on UniversalFakeDetect, a large-scale benchmark comprising AI-generated images from 19 generative models. This diverse dataset allows for rigorous assessment of our framework’s generalization and robustness across in- and out-of-domain scenarios. Experimental results demonstrate that RAVID consistently outperforms existing detection techniques, achieving an average accuracy of 93.85% and exhibiting better generalization across multiple challenging settings. As depicted in Figure 1 , RAVID achieves the highest accuracy, outperforming all compared state-of-the-art detectors. In addition, RAVID also demonstrates strong resilience to image degradations, achieving 80.27% average accuracy under conditions such as Gaussian blur and JPEG compression significantly outperforming the state-of-the-art C2P-CLIP model, which achieves 63.44% under the same settings. Unlike traditional methods, it maintains high accuracy by leveraging retrieval-augmented generation to compensate for lost visual features, ensuring robust performance even under real-world distortions. This highlights the effectiveness of retrieval-augmented techniques in enhancing generalization and robustness across different image generators. Our key contributions are summarized as follows: • A novel retrieval-augmented framework for AI-generated image detection, dynamically retrieving and integrating external visual knowledge to enhance decision-making. • Fine-tuning of a CLIP-based image encoder with category-level prompt integration, improving representation learning for retrieval tasks. • Integration of vlm to combine retrieved images with queries, enhancing contextual understanding and detection robustness. • Comprehensive evaluation on UniversalFakeDetect, demonstrating significant improvements in generalization and robustness over existing methods. The rest of this paper is structured as follows. Section 2 reviews related work on AI-generated image detection, AI image generation, and visual rag . Section 3 introduces the proposed visual rag -based approach for AI-generated image identification. Section 4 evaluates and analyzes the performance of the proposed detection framework. Finally, Section 7 summarizes the findings and concludes the paper. Figure 2 : Our RAVID integrates RAVID_CLIP for embedding-based image retrieval and Openflamingo for decision-making: (1) 4-class ProGAN training set images are encoded into vector embeddings using RAVID_CLIP and stored in a Milvus vector database; (2) At testing time, the query image embedding is matched against stored embeddings to retrieve the most relevant images; (3) The retrieved images and labels serve as contextual information, combined with the query image, and processed by Openflamingo. 2 Related Works 2.1 Image Generation Recent advances in deep generative models have significantly enhanced the capabilities of synthetic image generation. Early breakthroughs included the introduction of gan by Goodfellow et al. [ 12 ] , enabling the

Read the complete text