| title | emoji | colorFrom | colorTo | sdk | app_port | pinned | license | tags | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ImageScreenAI |
π |
blue |
purple |
docker |
7860 |
false |
mit |
|
A transparent, unsupervised first-pass screening system for identifying images requiring human review in production workflows
ImageScreenAI is not a "perfect AI detector." It is a pragmatic screening tool designed to reduce manual review workload by flagging potentially AI-generated images based on statistical and physical anomalies.
β
A workflow efficiency tool
β
A transparent, explainable detector
β
A model-agnostic screening system
β
A first-pass filter, not a verdict engine
β A definitive "real vs fake" classifier
β A black-box deep learning detector
β A system claiming near-perfect accuracy on 2025 AI models
- Multi-Metric Ensemble: 5 independent statistical detectors analyzing different AI generation failure modes
- Binary UX: Only two outcomes -
LIKELY_AUTHENTICorREVIEW_REQUIRED(no ambiguous "maybe") - Full Explainability: Per-metric scores, confidence levels, and human-readable explanations
- Batch Processing: Parallel analysis of up to 50 images with progress tracking
- Multiple Export Formats: CSV, JSON, and PDF reports for integration into existing workflows
- No External Dependencies: No ML models, no cloud APIs - fully self-contained
- Production Ready: FastAPI backend, comprehensive error handling, configurable thresholds
Instead of answering "Is this image AI or real?", we answer:
"Does this image require human review?"
This reframes the problem from classification to prioritization - far more valuable in real-world workflows.
Each metric targets a different failure mode of AI image generation models (diffusion models, GANs, etc.):
- Weight: 30%
- Target: Lighting inconsistencies in diffusion models
- Rationale: Real photos have gradients aligned with physical light sources. Diffusion models perform patch-based denoising, creating low-dimensional gradient structures inconsistent with physics.
- Method: Sobel gradients β PCA β eigenvalue ratio analysis
- Threshold: Eigenvalue ratio < 0.85 indicates suspicious structure
- Research Basis: Gragnaniello et al. 2021 - "Perceptual Quality Assessment of Synthetic Images"
- Weight: 25%
- Target: Unnatural spectral energy distributions
- Rationale: Camera optics and sensors produce characteristic frequency falloffs. AI models can create spectral peaks/gaps not found in nature.
- Method: 2D FFT β radial spectrum β high-frequency ratio + roughness + power-law deviation
- Thresholds: HF ratio outside [0.08, 0.35] indicates anomalies
- Research Basis: Dzanic et al. 2020 - "Fourier Spectrum Discrepancies in Deep Network Generated Images"
- Weight: 20%
- Target: Missing or artificial sensor noise
- Rationale: Real cameras produce Poisson shot noise + Gaussian read noise with characteristic variance. AI models often produce overly uniform images or synthetic noise.
- Method: Patch-based Laplacian filtering β MAD estimation β CV + IQR analysis
- Thresholds: CV < 0.15 (too uniform) or > 1.2 (too variable) flags images
- Research Basis: Kirchner & Johnson 2019 - "SPN-CNN: Boosting Sensor Pattern Noise for Image Manipulation Detection"
- Weight: 15%
- Target: Overly smooth or repetitive regions
- Rationale: Natural scenes have organic texture variation. GANs can produce suspiciously smooth regions or repetitive patterns.
- Method: Patch-based entropy, contrast, edge density β distribution analysis
- Thresholds: >40% smooth patches (smoothness > 0.5) indicates anomalies
- Research Basis: Nataraj et al. 2019 - "Detecting GAN Generated Fake Images using Co-occurrence Matrices"
- Weight: 10%
- Target: Impossible or highly unlikely color patterns
- Rationale: Physical light sources create constrained color relationships. AI can generate oversaturated or unnaturally clustered hues.
- Method: RGBβHSV conversion β saturation analysis + histogram roughness + hue concentration
- Thresholds: Mean saturation > 0.65 or top-3 hue bins > 60% flags images
- Research Basis: Marra et al. 2019 - "Do GANs Leave Specific Traces?"
final_score = (
0.30 Γ gradient_score +
0.25 Γ frequency_score +
0.20 Γ noise_score +
0.15 Γ texture_score +
0.10 Γ color_score
)- Robustness: No single metric failure breaks the system
- Diversity: Each metric captures orthogonal information
- Tunability: Weights can be adjusted based on use case
- Explainability: Per-metric scores preserved for transparency
- Fail-Safe: Neutral scores (0.5) for metric failures prevent cascading errors
- Hyperparameter Sensitivity: Weights are manually tuned, not learned
- Assumption of Independence: Metrics may correlate in practice (e.g., frequency β noise)
- Fixed Weights: No adaptive weighting based on image characteristics
- Threshold Brittleness: Single threshold (0.65) for binary decision may not fit all contexts
- No Adversarial Robustness: Trivial post-processing can fool statistical detectors
- Transparency: Statistical methods are auditable; neural networks are black boxes
- Generalization: ML models overfit to training generators; unsupervised methods generalize better
- Deployment: No GPU required, no model versioning issues
- Trust: Users understand "gradient inconsistency" better than "neuron activation patterns"
Image Upload β Validation β Parallel Metric Execution β Aggregation β Threshold Decision β Report Export
ImageScreenAI/
βββ app.py # FastAPI application entry point
βββ config/
β βββ settings.py # Environment variables, weights, thresholds
β βββ constants.py # Enums, metric parameters, explanations
β βββ schemas.py # Pydantic models for type safety
βββ metrics/
β βββ gradient_field_pca.py # Gradient structure analysis
β βββ frequency_analyzer.py # FFT-based spectral analysis
β βββ noise_analyzer.py # Sensor noise pattern detection
β βββ texture_analyzer.py # Statistical texture features
β βββ color_analyzer.py # Color distribution anomalies
β βββ aggregator.py # Ensemble combination logic
βββ features/
β βββ batch_processor.py # Parallel/sequential batch handling
β βββ threshold_manager.py # Runtime threshold configuration
β βββ detailed_result_maker.py # Explainability extraction
βββ reporter/
β βββ csv_reporter.py # CSV export for workflows
β βββ json_reporter.py # JSON API responses
β βββ pdf_reporter.py # Professional reports
βββ utils/
β βββ logger.py # Structured logging
β βββ image_processor.py # Image loading, resizing, conversion
β βββ validators.py # File validation
β βββ helpers.py # Utility functions
βββ ui/
βββ index.html # Single-page web interface
Detailed Architecture: See docs/Architecture.md
| Image Source | Expected Detection Rate |
|---|---|
| Consumer AI tools (2022-2023) | 80β90% |
| Stable Diffusion 1.x / 2.x | 70β80% |
| Midjourney v5 / v6 | 55β70% |
| DALLΒ·E 3 / Gemini Imagen 3 | 40β55% |
| Post-processed AI images | 30β45% |
| False positives on real photos | ~10β20% |
- Modern Models Are Good: 2024-2025 generators produce physically plausible images
- Post-Processing Erases Traces: JPEG compression, filters, and resizing remove statistical artifacts
- Real Photos Vary Widely: Macro, long-exposure, and HDR photos trigger false positives
- Adversarial Evasion: Adding noise or slight edits defeats statistical detectors
- Single image: 2β4 seconds
- Batch (10 images): 15β25 seconds (parallel)
- Memory: 50β150 MB per image
- Max concurrent workers: 4 (configurable)
- Python 3.11+
- pip
# Clone repository
git clone https://github.com/itobuztech/ImageScreenAI.git
cd ImageScreenAI
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Create required directories
mkdir -p data/{uploads,reports,cache} logs
# Run server
python app.pyServer will start at http://localhost:8005
- Open
http://localhost:8005in browser - Upload images (single or batch)
- View results with per-metric breakdowns
- Export reports (CSV/PDF)
# Single image analysis
curl -X POST http://localhost:8005/analyze/image \
-F "[email protected]"
# Batch analysis
curl -X POST http://localhost:8005/analyze/batch \
-F "[email protected]" \
-F "[email protected]" \
-F "[email protected]"
# Download CSV report
curl -X GET http://localhost:8005/report/csv/{batch_id} -o report.csvFull API Documentation: See docs/API.md
| Document | Description |
|---|---|
docs/Architecture.md |
System architecture, data flow diagrams, component details |
docs/API.md |
Complete API reference with examples |
-
Gragnaniello, D., Cozzolino, D., Marra, F., Poggi, G., & Verdoliva, L. (2021). "Are GAN Generated Images Easy to Detect? A Critical Analysis of the State-of-the-Art." IEEE International Conference on Multimedia and Expo. Paper
-
Dzanic, T., Shah, K., & Witherden, F. (2020). "Fourier Spectrum Discrepancies in Deep Network Generated Images." NeurIPS 2020. Paper
-
Kirchner, M., & Johnson, M. K. (2019). "SPN-CNN: Boosting Sensor Pattern Noise for Image Manipulation Detection." IEEE International Workshop on Information Forensics and Security. Paper
-
Nataraj, L., Mohammed, T. M., Manjunath, B. S., Chandrasekaran, S., Flenner, A., Bappy, J. H., & Roy-Chowdhury, A. K. (2019). "Detecting GAN Generated Fake Images using Co-occurrence Matrices." Electronic Imaging. Paper
-
Marra, F., Gragnaniello, D., Cozzolino, D., & Verdoliva, L. (2019). "Detection of GAN-Generated Fake Images over Social Networks." IEEE Conference on Multimedia Information Processing and Retrieval. Paper
-
Corvi, R., Cozzolino, D., Poggi, G., Nagano, K., & Verdoliva, L. (2023). "Intriguing Properties of Synthetic Images: from Generative Adversarial Networks to Diffusion Models." arXiv preprint. Paper
-
Sha, Z., Li, Z., Yu, N., & Zhang, Y. (2023). "DE-FAKE: Detection and Attribution of Fake Images Generated by Text-to-Image Diffusion Models." ACM CCS 2023. Paper
- Wang, S. Y., Wang, O., Zhang, R., Owens, A., & Efros, A. A. (2020). "CNN-Generated Images Are Surprisingly Easy to Spot... for Now." CVPR 2020. Paper
This system:
- β Never claims "real" or "fake" with certainty
- β Provides probabilistic screening only
- β Encourages human verification for all flagged images
- β Documents methodology transparently
- β Acknowledges false positive rates upfront
Suitable for:
- Content moderation pre-screening (reduces human workload)
- Journalism workflows (identifies images needing verification)
- Stock photo platforms (flags for manual review)
- Legal discovery (prioritizes suspicious documents)
Not suitable for:
- Law enforcement as sole evidence
- Automated content rejection without human review
- High-stakes decisions (e.g., criminal prosecution)
- False Positives: 10-20% of real photos flagged (especially HDR, macro, long-exposure)
- Evolving Generators: Detection rates decline as AI models improve
- Post-Processing Evasion: Simple filters can defeat statistical detectors
- No Adversarial Robustness: Not designed to resist intentional evasion
Create .env file:
# Server
HOST=localhost
PORT=8005
WORKERS=4
DEBUG=False
# Detection
REVIEW_THRESHOLD=0.65
# Metric Weights (must sum to 1.0)
GRADIENT_WEIGHT=0.30
FREQUENCY_WEIGHT=0.25
NOISE_WEIGHT=0.20
TEXTURE_WEIGHT=0.15
COLOR_WEIGHT=0.10
# Processing
MAX_FILE_SIZE_MB=10
MAX_BATCH_SIZE=50
PROCESSING_TIMEOUT=30
PARALLEL_PROCESSING=True
MAX_WORKERS=4Adjust REVIEW_THRESHOLD in config/settings.py:
- Conservative (0.75): Fewer false positives, may miss some AI images
- Balanced (0.65): Recommended default
- Aggressive (0.55): Catch more AI images, more false positives
This project is licensed under the MIT License - see LICENSE file for details.
- Research papers cited above for theoretical foundations
- FastAPI team for excellent web framework
- OpenCV and SciPy communities for image processing tools
- Users providing feedback on detection accuracy
Built with transparency and honesty in mind.
Screening, not certainty. Efficiency, not perfection.