Detect whether art is AI-generated or human brush-made using deep learning.
Artificially generated artwork has become increasingly realistic due to advanced generative models like Stable Diffusion, Midjourney, and DALLΒ·E. This makes it difficult for viewers, artists, and digital platforms to distinguish between human-created artwork and AI-produced images.
ArtSentinel is a deep-learningβbased classifier built using a fine-tuned EfficientNet-B0 convolutional neural network. The model is trained on 180,000+ images from the AI-ArtBench dataset, containing a diverse mix of both AI-generated images and real brush-made artwork.
ArtSentinel serves as a practical tool to:
- β Verify content authenticity
- β Protect artistic integrity
- β Detect synthetic art in online platforms
- β Provide transparency in digital art marketplaces
- βοΈ Build a reliable classifier to distinguish between AI-generated and human-made artwork
- βοΈ Fine-tune a state-of-the-art deep learning model for high accuracy
- βοΈ Provide reproducible evaluation using ROC-AUC, PR-AUC, and confusion matrices
- βοΈ Develop a FastAPI backend to perform real-time image inference
- βοΈ Create a modern Next.js frontend for image upload and prediction visualization
- βοΈ Deploy as a full-stack system accessible to end-users
ArtSentinel follows a complete ML pipeline:
- AI-generated and brush-made classes from AI-ArtBench are converted into a balanced binary dataset
- 180,000+ labeled images split into training, validation, and test sets
Image pipeline includes:
- Resizing to 224Γ224
- Normalization (ImageNet statistics)
- Random crops, flips, and rotations
- Affine transforms and color jitter
- Implemented using Albumentations library
- Architecture: EfficientNet-B0 (pretrained on ImageNet)
- Optimizer: AdamW with weight decay
- Scheduler: OneCycleLR for optimal learning rate
- Mixed Precision: FP16 for faster training
- Early Stopping: ROC-AUCβbased to prevent overfitting
- Result: Achieved extremely high accuracy and generalization
- Loads the trained model
- Preprocesses incoming images
- Performs real-time inference
- Returns predictions with confidence scores
- CORS-enabled for frontend integration
- Elegant, responsive UI for uploading artwork
- Displays classification results with confidence bars
- Real-time visual feedback and animations
- Communicates seamlessly with backend API
Python 3.10
PyTorch
- Timm - EfficientNet-B0 implementation
- NumPy - Numerical computing
- Pillow - Image processing
- Albumentations - Advanced image augmentation
- scikit-learn - Metrics (ROC-AUC, PR-AUC, confusion matrix)
Next.js 14 (App Router)
TailwindCSS
React Hooks
- Image dropzone with drag-and-drop
- Smooth UI animations
- Vercel - Frontend hosting
- Railway/Render - FastAPI backend deployment (Not yet deployed)
The trained EfficientNet-B0 model achieves:
| Metric | Score |
|---|---|
| Accuracy | 95%+ |
| ROC-AUC | 0.98+ |
| PR-AUC | 0.97+ |
| F1-Score | 0.94+ |
The model demonstrates strong generalization with minimal overfitting through:
- Early stopping based on validation ROC-AUC
- Extensive data augmentation
- Transfer learning from ImageNet weights
- Python 3.10+
- Node.js 18+
- CUDA-enabled GPU (optional, for training)
# Clone the repository
git clone https://github.com/yourusername/artsentinel.git
cd artsentinel/backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the FastAPI server
uvicorn main:app --reload --host 0.0.0.0 --port 8000The API will be available at http://localhost:8000
# Navigate to frontend directory
cd ../frontend
# Install dependencies
npm install
# Run development server
npm run devThe application will be available at http://localhost:3000
ArtSentinel Homepage - Upload and analyze artwork authenticity
Vagabond manga panel correctly classified as Real Art (Human-made)
Gemini-generated artwork correctly classified as AI Art
Traditional artwork correctly classified as Real Art
Studio Ghibli artwork misclassified as AI Art (False Positive) - Demonstrates model limitations with highly stylized animation
Upload an image for classification
Request:
curl -X POST "http://localhost:8000/predict" \
-H "Content-Type: multipart/form-data" \
-F "file=@artwork.jpg"Response:
{
"prediction": "Real Art",
"confidence": 0.92,
"probabilities": {
"ai_generated": 0.08,
"human_made": 0.92
}
}To train the model from scratch:
cd training
# Prepare dataset
python prepare_dataset.py --data-path /path/to/ai-artbench
# Train model
python train.py \
--epochs 50 \
--batch-size 32 \
--learning-rate 0.001 \
--model efficientnet_b0
# Evaluate model
python evaluate.py --checkpoint best_model.pth- Add support for more art styles and mediums
- Implement attention visualization (Grad-CAM)
- Expand dataset with recent AI-generated art samples
- Add multi-class classification (Stable Diffusion, Midjourney, DALLΒ·E, etc.)
- Integrate explainability features for predictions
- Mobile application development
- Batch processing API endpoint
- False Positives: Highly stylized or digital artwork (like Studio Ghibli animation) may be misclassified as AI-generated
- Dataset Bias: Model performance depends on the diversity of training data
- Adversarial Attacks: Sophisticated post-processing may fool the classifier
- Evolving AI Art: New generative models may produce images the model hasn't seen during training
- AI-ArtBench Dataset - For providing the training data
- EfficientNet - For the efficient model architecture
- FastAPI - For the robust backend framework
- Next.js - For the modern frontend framework
- Open Source Community - For the amazing tools and libraries
For questions, feedback, or collaboration opportunities:
- GitHub: @yking-ly
- Email: yashnkotian3006@example.com
- LinkedIn: Yash Kotian
β If you find this project useful, please consider giving it a star! β




