AIGC image detector
Inspiration
AI-generated images are becoming increasingly realistic, making it difficult to distinguish them from real photographs. We wanted to create a practical tool that could help users assess whether an image was likely generated by AI. Instead of producing only a binary label, our project also provides a confidence score to communicate how certain the model is.
What it does
Our project classifies images as either real or AI-generated. For each image, the model produces a prediction and a confidence score representing the likelihood that the image was generated by AI.
The system also includes calibration and robustness evaluation. This allows us to examine whether the confidence scores are meaningful and how well the model performs when images are transformed or modified.
How we built it
Model used
A dual-branch architecture CNN model
- Spatial branch: an ImageNet-initialised ConvNeXt-Small backbone learns semantic and texture cues.
- Forensic branch: a differentiable multi-domain feature extractor operates on image luminance. It combines a high-pass residual and two-scale Haar-wavelet detail maps, three bands of 8x8 block-DCT energy, and a windowed global FFT magnitude spectrum.
Training process
- Using Google Colab, with the dataset downloaded through Kaggle and dataset stored in Google Drive.
Our pipeline includes:
- Preparing the dataset and generating a training manifest
- Training the ConvNeXt Small model with PyTorch
- Calibrating predictions using temperature scaling
- Evaluating the model on validation data
- Measuring performance on clean and transformed images
- Exporting prediction results and evaluation outputs for analysis
We also used libraries and tools such as PyTorch, torchvision, NumPy, scikit-learn, pandas
Challenges we ran into
One major challenge is limited resources on hardware and dataset.
Another challenge was organizing the dataset and ensuring that the real and AI-generated images were correctly identified and split for training, validation, and calibration.
Moreover, making the model’s confidence scores reliable is also a challenge. A model can be correct while still being overconfident, so we added temperature scaling to improve calibration.
We also had to consider robustness. Real-world images may be resized, compressed, cropped, or otherwise transformed, and these changes can affect model performance. Finally, training on one dataset creates a risk that the model learns dataset-specific artifacts rather than general indicators of AI generation.
Accomplishments that we're proud of
We built a complete training and evaluation pipeline for AI-generated image detection. The pipeline supports model training, confidence calibration, and robustness evaluation rather than focusing only on classification accuracy.
We are also proud that the project is designed to produce interpretable prediction outputs, making it easier to understand both the model’s decision and its confidence.
What we learned
The main lesson from this project is to develop a model from nothing but a dataset. Developing an image detector involves more than selecting a model and measuring accuracy. Dataset quality, data splitting, calibration, and robustness testing all have a significant effect on whether the system is useful in practice. We also learned to complete project under limited resources, time and hardware.
Future plan
We plan to expand the dataset with images from more AI generators and real-world sources, evaluate performance across different image transformations, analyze representative false positives and false negatives, and improve the user interface for viewing predictions and confidence scores.
Log in or sign up for Devpost to join the conversation.