Submitted:
14 November 2026
Posted:
17 November 2026
You are already at the latest version
Abstract
Images produced by generative models now look convincing enough that visual inspection alone is oftenunreliable. This paper examines a practical way to distinguish real photographs from AI-generated imagesusing an EfficientNet-B2 classifier supplied with complementary image information. The input includesthree RGB channels, a Fourier-frequency map, and an artifact-residual map. The evaluation uses 40,000labeled examples drawn from CommunityForensics-Small, divided into 28,000 training, 6,000 validation,and 6,000 test images. On the held-out test set, the classifier reached 94.53% accuracy (95% stratifiedbootstrap confidence interval: 93.95%–95.10%), an F1-score of 94.50% for the synthetic class, and anAUROC of 98.57%. The operating threshold was selected from validation data rather than tuned on thetest set. These results demonstrate encouraging performance within the sampled data distribution. They donot establish reliability on image generators absent from training, nor do they establish robustness to everyform of social-media processing. The study presents a reproducible detection pipeline and identifies thetests needed before the method can be considered a dependable general-purpose forensic tool.
Keywords:
synthetic image detection
; EfficientNet-B2
; image forensics
; FFT
; classification
; CommunityForensics
1. Introduction
An image can be persuasive even when its origin is uncertain. Generative adversarial networks and diffusion systems have made convincing synthetic pictures widely accessible, creating new problems for news verification, digital investigations, and public trust. For ordinary viewers, errors may be subtle or invisible. Automated detection offers useful assistance, but it should be treated as evidence to examine rather than an unquestionable verdict.
Early detectors often concentrated on artifacts associated with one generation technique. As generative models changed, researchers observed that strong performance on familiar sources did not necessarily carry over to unfamiliar ones [2,3]. Recent work argues for broader generator diversity and more informative feature representations [4,5]. This paper studies a compact convolutional approach that retains ordinary color information while exposing two additional forensic views of the same image.
2. Background and Related Work
The detection problem is a binary classification task: given an image, estimate whether it is a camera-derived or otherwise authentic sample, or an image generated by an AI system. This definition is deliberately narrower than detecting every kind of manipulation. A genuine photograph that has been edited, for example, may fall outside the training labels. The distinction matters because the output of a classifier reflects its dataset and labeling policy.
2.1. Convolutional and Pretrained Detectors
Wang et al. showed that convolutional classifiers could learn cues shared across some generative models [1]. Ojha et al. later emphasized how difficult cross-generator generalization remains and explored pretrained features as a possible alternative [2]. Cozzolino et al. reported that a lightweight classifier built on CLIP representations can generalize across different synthesis systems, even with limited generator-specific training images [3]. Together, these studies suggest that feature selection and evaluation protocol matter as much as headline test accuracy.
2.2. Dataset Diversity
Park and Owens introduced Community Forensics, a collection of roughly 2.7 million generated images from 4,803 models, to make training and evaluation more representative of the fast-changing generator landscape [4]. Their findings suggest that training on a wider range of generators can improve transfer. The present study uses the smaller CommunityForensics-Small resource, making computation manageable while leaving the question of truly unseen generators open.
2.3. Frequency Cues and Image Artifacts
Frank et al. documented that frequency analysis can reveal traces of synthetic image production [5]. Frequency-domain evidence is attractive because two images that look similar in RGB space may have different underlying spectral patterns. However, it is not a universal signature: compression, resizing, reconstruction and new synthesis methods can all change the pattern. For that reason, this work uses frequency and residual maps alongside, rather than instead of, RGB channels.
EfficientNet is used as the visual backbone because its compound-scaling strategy offers an established tradeoff between accuracy and computational requirements [6]. The study does not claim that EfficientNet-B2 is inherently the best detector. Instead, it asks whether this implementation can deliver solid performance on a clearly described held-out evaluation.
3. Dataset and Experimental Protocol
The experiment uses 40,000 labeled image samples obtained from the OwensLab/CommunityForensics-Small dataset. Labels are binary: 0 denotes real and 1 denotes AI-generated. The data are balanced across classes and partitioned into 70% training, 15% validation, and 15% testing. The notebook fixes random seed 13 and saves the split manifest for reproducibility.
Table 1.
Balanced image distribution used in the experiment.
| Split | Real | AI-generated | Total |
| Training | 14,000 | 14,000 | 28,000 |
| Validation | 3,000 | 3,000 | 6,000 |
| Test | 3,000 | 3,000 | 6,000 |
| Total | 20,000 | 20,000 | 40,000 |
The splitting procedure attempts to match the prevalence of known fake generators and real-image sources across validation and testing. This reduces some of the variation that can arise when source composition differs sharply between subsets. It also changes what the final result can establish: because generator identities can appear in multiple splits, the test set is held out by sample, but it is not a generator-disjoint benchmark.
3.1. Preparation and Augmentation
Images are converted to RGB and resized to 260 × 260 pixels. The training pipeline introduces modest transformations, including horizontal reflection, random crops, small brightness and contrast changes, Gaussian blur, and simulated JPEG compression. The aim is not to hide all forensic evidence; it is to discourage the classifier from depending too heavily on one image presentation. Validation and test inputs use deterministic preprocessing.
3.2. Leakage Checks and Evaluation Boundaries
The underlying project also examines exact file hashes across splits. No identical hashes were reported in the 40,000-file check. Exact-hash screening, however, does not rule out cropped, recompressed or visually near-identical images. Perceptual similarity and source-level overlap deserve separate scrutiny. More importantly, a test set that shares generator families with training should not be described as evidence of unseen-generator generalization.
The experimental goal is therefore measured performance under the recorded sampling protocol, together with an honest account of what remains unresolved. This is preferable to presenting a single high accuracy as proof of field readiness.
4. Proposed Detection Method
The detector constructs a five-channel representation for each image. Channels one through three retain the color information, channel four describes its spatial-frequency structure, and channel five emphasizes residual detail. These channels are assembled into a single tensor and passed to EfficientNet-B2. A two-class prediction head returns scores for real and generated images.
4.1. RGB Information
Color and spatial structure remain important. An image may contain irregular object boundaries, inconsistent shading, or other cues that can be captured by a conventional convolutional backbone. RGB channels are normalized using standard ImageNet statistics before being supplied to the model. Those pretrained feature representations provide a practical starting point for a limited-compute project.
4.2. Fourier-Frequency Information
The image is converted to grayscale and transformed using a two-dimensional fast Fourier transform. The implementation shifts the zero-frequency component to the center and applies a logarithm to the spectral magnitude. This map helps the classifier inspect image structure from a different perspective. It is not interpreted as a simple “real/fake” mask: frequency patterns can vary with image content and processing history.
4.3. Artifact-Residual Information
A separate residual-style map captures fine-scale differences that are less prominent in the original image. This auxiliary channel is intended to complement the spectral view, particularly where subtle local patterns survive resizing. Both engineered maps are created from the same input image; they are features of that image, not independent evidence of its origin.
4.4. Model Adaptation
The notebook creates an EfficientNet-B2 model with five input channels rather than the usual three. It retains a two-class output and uses an ImageNet-pretrained starting point where available. The pipeline checks that an input batch has the expected shape (batch, 5, 260, 260) before starting training. The design keeps the inference path simple: one image produces one five-channel tensor and one prediction.
This choice adds preprocessing overhead while allowing the model to incorporate information beyond RGB. However, the individual contributions of the frequency and residual channels remain unquantified because a controlled ablation study was not performed for the reported experiment.
5. Training and Reproducibility
The model is trained in a GPU-backed PyTorch environment with a batch size of 24, an initial learning rate of 2 × 10−4, AdamW optimization, and weight decay of 2 × 10−4. A cosine annealing learning-rate schedule is used. Cross-entropy loss includes label smoothing, and mixed-precision training reduces GPU memory requirements. The notebook permits up to 18 epochs, with early stopping after five epochs without a sufficient improvement.
Table 2.
Training configuration used in the experiment.
| Setting | Recorded configuration |
| Random seed | 13 |
| Backbone | EfficientNet-B2 |
| Input tensor | 5 × 260 × 260 |
| Batch size | 24 |
| Optimizer | AdamW |
| Learning rate | 0.0002 |
| Maximum epochs | 18 |
| Patience | 5 |
| Loss | Cross-entropy with label smoothing 0.05 |
5.1. Model Selection
Training and validation scores are recorded after each epoch. The checkpoint selected for evaluation is chosen using validation results; it contains the model state and the decision threshold. This separation is important because choosing the threshold directly from test performance would inflate the apparent quality of the final evaluation. The selected threshold for the reported run is 0.505.
Figure 1.
EfficientNet-B2 training and validation performance.

5.2. Reproducibility
The notebook records split metadata and a hash of the saved split file. During checkpoint loading it checks the model version, seed, image size, and split hash against the current configuration. These checks help prevent the accidental comparison of predictions from an incompatible run. Reproducing the exact numbers still requires the same dataset snapshot, library versions, and computing environment.
5.3. Inference Workflow
For an uploaded image, the inference code corrects orientation where possible, converts the input to RGB, creates the forensic maps, and computes a fake-class probability. A probability above the selected validation threshold is labeled AI-generated; a probability below it is labeled real. The label is a screening outcome, not a determination of provenance. The implemented notebook demonstrates image upload and model inference; deployment-service performance was not evaluated in this study.
6. Experimental Results
Evaluation was performed after model selection using 6,000 held-out samples, evenly divided between real and generated images. The best-checkpoint threshold of 0.505 was applied without retuning on the test set.
Table 3.
Validation and held-out test performance.
| Metric | Validation | Test |
| Samples | 6,000 | 6,000 |
| Accuracy | 94.85% | 94.53% |
| Fake-class precision | 94.63% | 95.10% |
| Fake-class recall | 95.10% | 93.90% |
| Fake-class F1 | 94.86% | 94.50% |
| AUROC | 98.80% | 98.57% |
| Threshold | 0.505 | 0.505 |
Figure 2.
Confusion matrix on the held-out 6,000-image test split.

The final test accuracy was 94.53%. A stratified bootstrap procedure reported a 95% confidence interval from 93.95% to 95.10%. The fake-class recall of 93.90% means that some generated images were classified as real. In applications where missed synthetic images are costly, this error mode is as relevant as overall accuracy.
7. Discussion
The small gap between validation accuracy (94.85%) and test accuracy (94.53%) is encouraging under the matched evaluation protocol. It suggests the reported test score is not simply the result of applying an extremely favorable threshold to one subset. Likewise, an AUROC of 98.57% indicates strong ranking separation for the test samples. Neither observation guarantees performance when the source of an image changes.
7.1. Findings Under the Evaluated Protocol
The main practical finding is that the five-channel EfficientNet-B2 implementation can distinguish the sampled real and AI-generated examples with relatively high accuracy. The pipeline can also be evaluated and reproduced from saved manifests and checkpoints. This makes it a useful foundation for subsequent controlled experiments.
7.2. Limitations of the Experimental Evaluation
A central limitation is cross-generator generalization. Generator identities are represented across data splits, so the held-out result is not a valid estimate for wholly new synthesis systems. A second limitation concerns preprocessing: although mild JPEG distortion and blur appear as training augmentations, a systematic test matrix covering compression levels, resizing factors, and platform recompression has not been completed. Third, without an RGB-only and paired ablation study, the contribution of the FFT and residual channels cannot yet be quantified independently.
7.3. Dataset Bias and Related Work
Research on fake-image detection repeatedly finds that models can exploit source-specific shortcuts rather than a stable property of synthetic imagery [2,3,4,5]. The present result should be read with this risk in mind. Matching source distributions improves comparison between validation and test, but it may also make both subsets easier than new images collected in the wild. The most informative next experiment would hold entire generator families out of training, rather than only withholding individual images.
The detector is therefore best understood as a research prototype and an aid to further investigation. A real-world workflow should combine its score with context, image metadata, provenance information, and independent checks.
8. Practical Deployment and Limitations
A useful detection system must be more than a high-performing notebook. In practice, a user should be able to submit an image, receive an intelligible result, and understand that a confidence score is not forensic proof. The implemented notebook supports local image upload, preprocessing, and probability-based classification. A FastAPI interface is considered as a possible deployment option; however, this study does not report API latency, throughput, or production reliability measurements.
8.1. Suggested Deployment Safeguards
The inference service should reject unsupported or oversized files, strip unsafe metadata where appropriate, and apply exactly the same deterministic preprocessing used during validation. Versioning the model, preprocessing pipeline, and threshold together is important: changing one of them silently can alter predictions. Results should be labeled as estimates, and users should be encouraged to investigate ambiguous cases rather than treat them as definitive.
8.2. Future Evaluation
The first priority is a generator-disjoint test: train on one set of known generators and evaluate on generators excluded entirely from all model-selection decisions. Next, the model should be tested across a documented range of JPEG quality settings and resize operations. An ablation should then compare RGB-only, RGB+FFT, RGB+artifact, and all five channels under the same splits and training budget. Finally, perceptual near-duplicate checking can strengthen the evidence against train–test overlap that survives changes in file encoding.
9. Conclusion
This work presented an EfficientNet-B2 image classifier that combines RGB information with frequency and artifact representations. On a balanced 6,000-image held-out test split from CommunityForensics-Small, it achieved 94.53% accuracy, 94.50% fake-class F1, and 98.57% AUROC. The experiment demonstrates a functioning five-channel detection pipeline and a reproducible evaluation process. Its broader contribution is a clearly defined starting point for further testing. To make a stronger claim about trustworthiness, future work must evaluate genuinely unseen generators, common image transformations, and the separate value of each feature channel. Until then, the model predictions should support—rather than replace—human verification.
Data and Code Availability
The experiments used the CommunityForensics-Small dataset (OwensLab/CommunityForensics-Small). The model was developed and evaluated in Python using PyTorch. The source code and trained model checkpoint are not currently available in a public repository. The experimental configuration and evaluation protocol are described in this manuscript.
References
- S.-Y. Wang et al., “CNN-generated images are surprisingly easy to spot... for now,” CVPR, 2020. https://openaccess.thecvf.com/content_CVPR_2020/html/Wang_CNN-Generated_Images_Are_Surprisingly_Easy_to_Spot..._for_Now_CVPR_2020_paper.html.
- U. Ojha, Y. Li, and Y. J. Lee, “Towards universal fake image detectors that generalize across generative models,” CVPR, 2023. https://openaccess.thecvf.com/content/CVPR2023/html/Ojha_Towards_Universal_Fake_Image_Detectors_That_Generalize_Across_Generative_Models_CVPR_2023_paper.html.
- D. Cozzolino, G. Poggi, R. Corvi, M. Nießner, and L. Verdoliva, “Raising the bar of AI-generated image detection with CLIP,” CVPR Workshops, 2024. https://openaccess.thecvf.com/content/CVPR2024W/WMF/html/Cozzolino_Raising_the_Bar_of_AI-generated_Image_Detection_with_CLIP_CVPRW_2024_paper.html.
- J. Park and A. Owens, “Community Forensics: Using thousands of generators to train fake image detectors,” CVPR, 2025. https://openaccess.thecvf.com/content/CVPR2025/html/Park_Community_Forensics_Using_Thousands_of_Generators_to_Train_Fake_Image_CVPR_2025_paper.html.
- J. Frank et al., “Leveraging frequency analysis for deep fake image recognition,” ICML, 2020. https://proceedings.mlr.press/v119/frank20a.html.
- M. Tan and Q. Le, “EfficientNet: Rethinking model scaling for convolutional neural networks,” ICML, 2019. https://proceedings.mlr.press/v97/tan19a.html.
- D. Guillaro et al., “A Bias-Free Training Paradigm for More General AI-generated Image Detection,” CVPR, 2025. https://openaccess.thecvf.com/content/CVPR2025/html/Guillaro_A_Bias-Free_Training_Paradigm_for_More_General_AI-generated_Image_Detection_CVPR_2025_paper.html.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.