# AI-Contain-Checker A modular AI content detection system with support for **image classification**, **image edit detection**, **Nepali text classification**, and **general text classification**. Built for performance and extensibility, it is ideal for detecting AI-generated content in both visual and textual forms. ## 🌟 Features ### 🖼️ Image Classifier * **Purpose**: Classifies whether an image is AI-generated or a real-life photo. * **Model**: Fine-tuned **InceptionV3** CNN. * **Dataset**: Custom curated dataset with **\~79,950 images** for binary classification. * **Location**: [`features/image_classifier`](features/image_classifier) * **Docs**: [`docs/features/image_classifier.md`](docs/features/image_classifier.md) ### 🖌️ Image Edit Detector * **Purpose**: Detects image tampering or post-processing. * **Techniques Used**: * **Error Level Analysis (ELA)**: Visualizes compression artifacts. * **Fast Fourier Transform (FFT)**: Detects unnatural frequency patterns. * **Location**: [`features/image_edit_detector`](features/image_edit_detector) * **Docs**: * [ELA](docs/detector/ELA.md) * [FFT](docs/detector/fft.md ) * [Metadata Analysis](docs/detector/meta.md) * [Backend Notes](docs/detector/note-for-backend.md) ### 📝 Nepali Text Classifier * **Purpose**: Determines if Nepali text content is AI-generated or written by a human. * **Model**: Based on `XLMRClassifier` fine-tuned on Nepali language data. * **Dataset**: Scraped dataset of **\~18,000** Nepali texts. * **Location**: [`features/nepali_text_classifier`](features/nepali_text_classifier) * **Docs**: [`docs/features/nepali_text_classifier.md`](docs/features/nepali_text_classifier.md) ### 🌐 English Text Classifier * **Purpose**: Detects if English text is AI-generated or human-written. * **Pipeline**: * Uses **GPT2 tokenizer** for input preprocessing. * Custom binary classifier to differentiate between AI and human-written content. * **Location**: [`features/text_classifier`](features/text_classifier) * **Docs**: [`docs/features/text_classifier.md`](docs/features/text_classifier.md) --- ## 🗂️ Project Structure ```bash AI-Checker/ │ ├── app.py # Main FastAPI entry point ├── config.py # Configuration settings ├── Dockerfile # Docker build script ├── Procfile # Deployment file for Heroku or similar ├── requirements.txt # Python dependencies ├── README.md # You are here 📘 │ ├── features/ # Core detection modules │ ├── image_classifier/ │ ├── image_edit_detector/ │ ├── nepali_text_classifier/ │ └── text_classifier/ │ ├── docs/ # Internal and API documentation │ ├── api_endpoints.md │ ├── deployment.md │ ├── detector/ │ │ ├── ELA.md │ │ ├── fft.md │ │ ├── meta.md │ │ └── note-for-backend.md │ ├── functions.md │ ├── nestjs_integration.md │ ├── security.md │ ├── setup.md │ └── structure.md │ ├── IMG_Models/ # Saved image classifier model(s) │ └── latest-my_cnn_model.h5 │ ├── notebooks/ # Experimental and debug notebooks ├── static/ # Static assets if needed └── test.md # Test notes ```` --- ## 📚 Documentation Links * [API Endpoints](docs/api_endpoints.md) * [Deployment Guide](docs/deployment.md) * [Detector Documentation](docs/detector/) * [Error Level Analysis (ELA)](docs/detector/ELA.md) * [Fast Fourier Transform (FFT)](docs/detector/fft.md) * [Metadata Analysis](docs/detector/meta.md) * [Backend Notes](docs/detector/note-for-backend.md) * [Functions Overview](docs/functions.md) * [NestJS Integration Guide](docs/nestjs_integration.md) * [Security Details](docs/security.md) * [Setup Instructions](docs/setup.md) * [Project Structure](docs/structure.md) --- ## 🚀 Usage 1. **Install dependencies** ```bash pip install -r requirements.txt ``` 2. **Run the API** ```bash uvicorn app:app --reload ``` 3. **Build Docker (optional)** ```bash docker build -t ai-contain-checker . docker run -p 8000:8000 ai-contain-checker ``` --- ## 🔐 Security & Integration * **Token Authentication** and **IP Whitelisting** supported. * NestJS integration guide: [`docs/nestjs_integration.md`](docs/nestjs_integration.md) * Rate limiting handled using `slowapi`. --- ## 🛡️ Future Plans * Add **video classifier** module. * Expand dataset for **multilingual** AI content detection. * Add **fine-tuning UI** for models. --- ## 📄 License See full license terms here: [`LICENSE.md`](license.md)