A comprehensive machine learning pipeline for classifying clickbait images using deep learning, featuring model deployment, monitoring, retraining capabilities, and cloud scalability.
Vide Demo Link: Clickbait Image Classifier Demo
Complete walkthrough of the application, API endpoints, dashboard features, and deployment process
- FastAPI Documentation: https://clickbait-image-classifier-staging.up.railway.app/docs
- Live API Endpoint: https://clickbait-image-classifier-staging.up.railway.app
- Streamlit Dashboard: https://huggingface.co/spaces/dean-daryl/clickbait-classifier
⚠️ Note: The API may appear inactive initially. This is expected behavior as it's hosted on a free-tier Render instance that enters sleep mode when idle. Please allow a few seconds for the server to wake up upon first request.
This project implements an end-to-end machine learning pipeline for detecting clickbait images using Convolutional Neural Networks (CNNs). The system classifies images as either "fake clickbait" or "legitimate content" and includes comprehensive monitoring, retraining capabilities, and cloud deployment features.
- Image Classification: CNN-based model for clickbait detection with 94.2% accuracy
- RESTful API: FastAPI-based prediction service with comprehensive endpoints
- Interactive Dashboard: Streamlit UI for monitoring and management
- Model Retraining: Automated retraining with new data uploads
- Load Testing: Locust-based performance testing and flood simulation
- Cloud Deployment: Docker containerization for scalability
- Real-time Monitoring: System uptime and performance tracking
- Data Visualization: Feature analysis and model interpretation
- Machine Learning: TensorFlow/Keras, CNN Architecture
- Backend: FastAPI, Python 3.8+
- Frontend: Streamlit Dashboard
- Deployment: Docker, Cloud Services (AWS/GCP)
- Testing: Locust for load testing
- Data Processing: NumPy, OpenCV, PIL
git clone https://github.com/your-username/clickbait-image-classifier.git
cd clickbait-image-classifierpython -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activatepip install -r requirements.txtCreate the following directory structure and add your images:
data/
├── train/
│ ├── clickbait_fake/ # Add 500+ fake clickbait images
│ └── clickbait_real/ # Add 500+ legitimate images
└── test/
├── clickbait_fake/ # Add 100+ test fake images
└── clickbait_real/ # Add 100+ test real images
cd src
python model.pyuvicorn src.prediction:app --host 0.0.0.0 --port 8000 --reloadstreamlit run app_hf.py --server.port 8501- API Documentation: http://localhost:8000/docs
- API Info: http://localhost:8000/docs-info
- Dashboard: http://localhost:8501
- Health Check: http://localhost:8000/status
# Test single prediction
curl -X POST "http://localhost:8000/predict" -F "file=@sample.jpg"
# Check system status
curl -X GET "http://localhost:8000/system-check"
# Build image
docker build -t clickbait-classifier .
# Run container
docker run -p 8000:8000 -p 8501:8501 clickbait-classifier
# With volume mounting
docker run -p 8000:8000 -p 8501:8501 \
-v $(pwd)/data:/app/data \
-v $(pwd)/models:/app/models \
clickbait-classifierGET /- Root endpoint with API statusGET /docs- Interactive API documentation (Swagger UI)GET /docs-info- API information and usage examplesGET /redoc- Alternative documentation (ReDoc)GET /status- Model and system statusGET /system-check- Comprehensive system health check
POST /predict- Single image classificationPOST /predict-batch- Multiple image classificationGET /model-info- Model performance metrics
POST /retrain- Trigger model retrainingGET /debug- Debug information and request tracking