CLOFAI: A Dataset of Real And Fake Image Classification Tasks for Continual Learning

William Doherty, Anton Lee, Heitor Murilo Gomes · 2025

Read CLOFAI: A Dataset of Real And Fake Image Classification Tasks for Continual Learning by William Doherty, Anton Lee, Heitor Murilo Gomes (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-2501-11140.txt.

Introduction

William Doherty, Anton Lee, and Heitor Murilo Gomes present CLOFAI in 2025, a dataset for teaching image classifiers to tell real photos from fake ones over time. New image generators keep appearing, and classifiers trained on old fakes often fail on new ones.

Retraining from scratch can be blocked by storage, cost, or privacy limits. Continual learning updates a model without keeping all old data. The dataset frames the task as a step-by-step shift in image type. Tests with three known methods show that two of them beat a naive baseline by a clear margin, while one does poorly.

Catalog record

CREATORWilliam Doherty, Anton Lee, Heitor Murilo Gomes
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE28 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2501-11140

Browse the full library · About the Tower of Babel

Full text

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

CLOFAI: A Dataset of Real And Fake Image Classification Tasks for Continual Learning William Doherty, Anton Lee, Heitor Murilo Gomes Abstract The rapid advancement of generative AI models capable of creating realistic media has led to a need for classifiers that can accurately distinguish between genuine and artificially-generated images. A significant challenge for these classifiers emerges when they encounter images from generative models that are not represented in their training data, usually resulting in diminished performance. A typical approach is to periodically update the classifier’s training data with images from the new generative models then retrain the classifier on the updated dataset. However, in some real-life scenarios, storage, computational, or privacy constraints render this approach impractical. Additionally, models used in security applications may be required to rapidly adapt. In these circumstances, continual learning provides a promising alternative, as the classifier can be updated without retraining on the entire dataset. In this paper, we introduce a new dataset called CLOFAI (Continual Learning On Fake and Authentic Images), which takes the form of a domain-incremental image classification problem. Moreover, we showcase the applicability of this dataset as a benchmark for evaluating continual learning methodologies. In doing this, we set a baseline on our novel dataset using three foundational continual learning methods – EWC, GEM, and Experience Replay – and find that EWC performs poorly, while GEM and Experience Replay show promise, performing significantly better than a Naive baseline. The dataset and code to run the experiments can be accessed from the following GitHub repository: https://github.com/Will-Doherty/CLOFAI . 1 Introduction Continual learning aims to solve the problem of catastrophic forgetting [ 1 ] , enabling neural networks to learn new information while preserving existing knowledge. The primary challenge in continual learning is achieving an optimal balance between the ability to learn new information (plasticity) and the ability to maintain previously learned information (stability), known as the stability-plasticity dilemma [ 2 ] . Continual learning involves training a model on a sequence of distinct tasks, one after another. Formally, we define the data for task t as D_{t}=(X_{t},Y_{t}) , where X_{t} is the set of input data and Y_{t} is the set of corresponding output labels for task t , with t\in T=\{1,\ldots,k\} for k tasks. To be a continual learning problem, each task D_{t} must be distinct from other tasks in either input X_{t} or output Y_{t} (or both). Continual learning aims to optimizes model performance across all tasks while only training on one task at a time. Various strategies for continual learning exist, such as regularization and replay. Regularization methods, like those proposed by [ 3 , 4 , 5 ] , add explicit terms to the learning process to balance performance between old and new tasks. Replay methods, as described by [ 6 ] , use samples from previous tasks to supplement the training data for the current task. In this paper, we present a novel contribution to the field of continual learning by introducing CLOFAI (Continual Learning on Fake and Authentic Images), a unique dataset designed to address the challenge of detecting fake versus real images. CLOFAI is structured as a domain-incremental image classification problem, offering a diverse array of images spanning various categories and complexities. We highlight the significance of CLOFAI as a benchmark for assessing the efficacy of continual learning methodologies in the context of image classification tasks. By leveraging this dataset, researchers and practitioners can evaluate the robustness and adaptability of their continual learning algorithms in a challenging domain-incremental setting. To establish a foundation for comparison, we employ three fundamental continual learning methods, setting a baseline performance on CLOFAI. Through this comparative analysis, we provide insights into the strengths and limitations of existing approaches, while discussing characteristics of the CLOFAI dataset. 2 Related Work In this section, we turn to the literature on continual learning, followed by a discussion of real versus fake image classification in non-continual-learning scenarios. 2.1 Continual Learning Regularization approaches are popular strategies to cope with forgetting, where network parameters are regularized selectively. Elastic Weight Consolidation (EWC) [ 3 ] leverages the Fisher Information Matrix (FIM), the diagonals of which provide a parameter importance measure, to protect critical parameters during the learning of new tasks. This is done via a regularization term in the loss function that penalizes changes to parameters in proportion to their importance: \mathcal{L}_{\text{EWC}}(\theta)=\mathcal{L}_{\text{batch}}(\theta)+\frac{\lambda}{2}\sum_{j}F_{jj}(\theta_{j}-\theta_{j,\text{old}})^{2} (1) Here, \theta_{j} represents the value of parameter j after the most recent training batch; \theta_{j,\text{old}} is previous value of parameter j ; F_{jj} is the entry at row and column j in the FIM; \mathcal{L}_{\text{batch}}(\theta) is the loss on the most recent training batch; \lambda is a hyperparameter controlling the strength of the regularization. The loss is higher when changes to important parameters (as measured by Fisher information) are greater. Like EWC, Synaptic Intelligence (SI) [ 4 ] uses an importance measure to constrain parameter updates, although the specific implementation is different; for Synaptic Intelligence, parameter importance is calculated based on its contribution to the change in the loss function during training. Memory Aware Synapses (MAS) [ 5 ] also calculates an importance measure, although it is based on the sensitivity of the predictions to parameter changes, rather than the sensitivity of the loss function. The most basic replay method is Experience Replay, where a selection of training samples are stored in a memory buffer, then interspersed amongst the training data for subsequent tasks. The primary challenge when applying Experience Replay is deciding which samples to store in the buffer; these samples should encode maximal information about the previous tasks. For example, Mean-of-Feature sampling selects the instances that are closest to the feature mean of each class [ 7 ] , while Maximally Interfered Retrieval [ 8 ] prioritizes the inclusion of the training samples for which the model’s predictions are most adversely impacted by parameter updates. Gradient Episodic Memory (GEM) [ 6 ] is another replay approach. For a new task t , GEM calculates the gradient \nabla\mathcal{L}_{t}(\theta) with respect to the current model parameters \theta , where \mathcal{L} represents the loss function. It then retrieves the stored samples from previous tasks to compute the gradients for each past task. GEM aims to find a parameter update direction that minimizes the new task’s loss without increasing the loss on any previous task, formalized as solving a constrained optimization problem in equation 2 . Note that \mathcal{L}_{1:t-1}(\theta_{\text{new}})\leq\mathcal{L}_{1:t-1}(\theta_{\text{old}}) means the loss on each task from 1 to t-1 when using the new model parameters must be lower than the loss on the same task using the old model parameters. \min_{\theta}\mathcal{L}_{t}(\theta)\quad\text{s.t.}\quad\mathcal{L}_{1:t-1}(\theta_{\text{new}})\leq\mathcal{L}_{1:t-1}(\theta_{\text{old}}) (2) 2.2 Real Versus Fake Image Classification Several papers investigate fake face classification [ 9 , 10 , 11 ] , showing that CNNs perform strongly in this domain. Other papers have examined real versus fake image classification more generally. In one example, a CNN is used to classify the GAN-generated images [ 12 ] in a dataset created by the authors. In another [ 13 ] , Latent Diffusion Models [ 14 ] are used to recreate the images from the CIFAR-10 dataset [ 15 ] and a CNN is subsequently used to classify them. It is also possible to not only classify images as real or

Read the complete text