CIFAKE
A computer vision and deep learning study investigating how accurately artificial intelligence can distinguish authentic photographs from AI-generated images.
Project overview
CIFAKE explores the growing challenge of distinguishing authentic photographs from images produced by generative artificial intelligence.
The project combines exploratory data analysis, visual feature investigation, deep learning, model comparison, robustness testing, and a human-versus-AI experiment.
Instead of considering accuracy alone, the study investigates what visual characteristics the models rely on and how common image transformations affect their reliability.
Detect AI-generated images
Compare multiple deep learning models
Analyze visual characteristics using EDA
Test model robustness under image transformations
Compare AI classification with human judgment
The CIFAKE dataset
The dataset contains 120,000 labeled images divided equally between authentic and AI-generated samples.
The 60,000 real images originate from the ten CIFAR-10 categories, while the 60,000 synthetic samples were generated using Stable Diffusion.
The balanced dataset includes different animals, vehicles, objects, backgrounds, textures, and lighting conditions.
Data preparation
Images were organized into training, validation, and testing subsets while preserving an equal distribution of real and synthetic examples.
The preprocessing pipeline resized and normalized the images according to the input requirements of each model.
Additional transformed datasets were created to test whether the models learned meaningful image characteristics or relied too heavily on orientation and low-level patterns.
Balanced training, validation, and testing subsets.
Images adapted to the selected architecture.
Pixel values standardized before training.
Flipped, blurred, rotated, and brightness-adjusted tests.
Exploratory data analysis
Exploratory analysis examined pixel intensity, contrast, edge density, and relationships between visual characteristics in real and AI-generated images.
Although both classes shared broadly similar distributions, closer examination revealed subtle differences in smoothness, edge structure, and contrast behavior.
Compared RGB intensity behavior across authentic and generated samples.
Examined whether overall contrast could independently distinguish the classes.
Measured the relationship between image contrast and edge density.
Visual feature analysis
Real images generally contain naturally irregular edges and greater texture variation.
Some generated images exhibit smoother surfaces or unnaturally sharp transitions, but contrast alone could not reliably separate the two classes.
Edge density and contrast displayed a moderate correlation, suggesting that combinations of features are more informative than a single isolated measurement.
Model development
Three deep learning approaches were evaluated to compare transfer learning with custom convolutional architectures.
Vision Transformer
A pre-trained transformer model using transfer learning to capture global visual relationships.
Lightweight CNN
A compact convolutional architecture designed to classify images efficiently.
Deeper CNN
A deeper custom network developed to learn more complex spatial and texture patterns.
Classification performance
The pre-trained Vision Transformer achieved the strongest performance, reaching approximately 98.4% classification accuracy.
Training and validation curves showed stable learning, while the CNN architectures also achieved competitive results.
The results demonstrate that both local texture patterns and broader image relationships contribute to authenticity classification.
Robustness evaluation
High accuracy on unchanged test images did not guarantee stable performance under altered conditions.
Horizontal flipping caused a major performance decline, suggesting that the model learned orientation-sensitive patterns.
Blurring also reduced accuracy by removing the fine texture and edge information used by the classifier.
These experiments demonstrate why robustness testing is essential before using image-authenticity models in real-world environments.
Human versus AI
A human classification experiment compared participant judgments with the trained models.
Participants performed only moderately above random guessing, while the strongest model exceeded 98% accuracy on the original test set.
Key findings
The experiments revealed several important lessons about model accuracy, image features, and real-world reliability.
Fine details matter
Edges and texture provided more useful information than color distribution alone.
Contrast is not enough
Real and generated images showed significant overlap in their overall contrast values.
Blur reduces reliability
Removing fine texture and edge information caused model performance to decline.
Orientation affects predictions
Horizontal flipping exposed strong sensitivity to image orientation.
AI outperformed humans
Participants found it considerably harder to distinguish synthetic imagery.
Accuracy needs context
High test accuracy did not guarantee robustness under real-world transformations.
Technology stack
The complete experimentation workflow was developed using Python, computer vision libraries, deep learning frameworks, and statistical evaluation tools.
Technical challenges
The project required processing a large balanced dataset and comparing architectures with different image-input requirements.
A major challenge was distinguishing high test accuracy from genuine generalization, which required transformed and degraded image experiments.
Interpreting model behavior also required connecting quantitative results with visual characteristics such as contrast, edges, and texture.
Explore the full project
View the complete notebook, exploratory analysis, model experiments, evaluation results, and implementation on GitHub.
View CIFAKE on GitHubProject outcome
CIFAKE demonstrates that deep learning can distinguish authentic and AI-generated imagery with high accuracy under controlled conditions.
It also shows that headline accuracy should not be treated as the only measure of success, because image transformations and real-world variations can significantly affect reliability.
The result is a complete computer vision case study combining data analysis, model development, evaluation, robustness testing, and human comparison.




