Skip to content

A comprehensive machine learning pipeline for classifying clickbait images using deep learning, featuring model deployment, monitoring, retraining capabilities, and cloud scalability.

Notifications You must be signed in to change notification settings

dean-daryl/clickbait-image-classifier

Repository files navigation

🖼️ Clickbait Image Classifier - ML Pipeline & Cloud Deployment

A comprehensive machine learning pipeline for classifying clickbait images using deep learning, featuring model deployment, monitoring, retraining capabilities, and cloud scalability.

📺 Video Demo

Vide Demo Link: Clickbait Image Classifier Demo

Complete walkthrough of the application, API endpoints, dashboard features, and deployment process

🌐 Live Application URLs

📋 Project Description

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.

Key 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

Technologies Used:

  • 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

🚀 Setup Instructions

Step 1: Clone Repository

git clone https://github.com/your-username/clickbait-image-classifier.git
cd clickbait-image-classifier

Step 2: Create Virtual Environment

python -m venv venv

# On Windows
venv\Scripts\activate

# On macOS/Linux
source venv/bin/activate

Step 3: Install Dependencies

pip install -r requirements.txt

Step 4: Prepare Training Data

Create 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

Step 5: Train Model (Optional - Pre-trained model included)

cd src
python model.py

Step 6: Start the API Server

uvicorn src.prediction:app --host 0.0.0.0 --port 8000 --reload

Step 7: Launch Dashboard (New Terminal)

streamlit run app_hf.py --server.port 8501

Step 8: Access Applications

Step 9: Test the System

# 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"

📓 Notebook Details

Jupyter Notebook: notebook/clickbait_classifier.ipynb

Performance Test Results

Screenshot 2025-08-03 at 11 03 59

🐳 Docker Deployment

Quick Docker Setup

# 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-classifier

🧪 API Endpoints

Core Endpoints

  • GET / - Root endpoint with API status
  • GET /docs - Interactive API documentation (Swagger UI)
  • GET /docs-info - API information and usage examples
  • GET /redoc - Alternative documentation (ReDoc)
  • GET /status - Model and system status
  • GET /system-check - Comprehensive system health check

Prediction Endpoints

  • POST /predict - Single image classification
  • POST /predict-batch - Multiple image classification
  • GET /model-info - Model performance metrics

Management Endpoints

  • POST /retrain - Trigger model retraining
  • GET /debug - Debug information and request tracking

About

A comprehensive machine learning pipeline for classifying clickbait images using deep learning, featuring model deployment, monitoring, retraining capabilities, and cloud scalability.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published