Pujan-Dev commited on
Commit
d3b6b2e
Β·
1 Parent(s): 538bdae
Files changed (1) hide show
  1. README.md +148 -6
README.md CHANGED
@@ -9,14 +9,156 @@ app_file: app.py
9
  pinned: false
10
  ---
11
 
12
- # Testing AI Contain
13
 
14
- This Hugging Face Space uses **Docker** to run a custom environment for AI content detection.
15
 
16
- ## How to run locally
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  ```bash
19
- docker build -t testing-ai-contain .
20
- docker run -p 7860:7860 testing-ai-contain
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
- ```
 
9
  pinned: false
10
  ---
11
 
12
+ # AI-Contain-Checker
13
 
14
+ 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.
15
 
16
+
17
+ ## 🌟 Features
18
+
19
+ ### πŸ–ΌοΈ Image Classifier
20
+
21
+ * **Purpose**: Classifies whether an image is AI-generated or a real-life photo.
22
+ * **Model**: Fine-tuned **InceptionV3** CNN.
23
+ * **Dataset**: Custom curated dataset with **\~79,950 images** for binary classification.
24
+ * **Location**: [`features/image_classifier`](features/image_classifier)
25
+ * **Docs**: [`docs/features/image_classifier.md`](docs/features/image_classifier.md)
26
+
27
+ ### πŸ–ŒοΈ Image Edit Detector
28
+
29
+ * **Purpose**: Detects image tampering or post-processing.
30
+ * **Techniques Used**:
31
+
32
+ * **Error Level Analysis (ELA)**: Visualizes compression artifacts.
33
+ * **Fast Fourier Transform (FFT)**: Detects unnatural frequency patterns.
34
+ * **Location**: [`features/image_edit_detector`](features/image_edit_detector)
35
+ * **Docs**:
36
+
37
+ * [ELA](docs/detector/ELA.md)
38
+ * [FFT](docs/detector/fft.md )
39
+ * [Metadata Analysis](docs/detector/meta.md)
40
+ * [Backend Notes](docs/detector/note-for-backend.md)
41
+
42
+ ### πŸ“ Nepali Text Classifier
43
+
44
+ * **Purpose**: Determines if Nepali text content is AI-generated or written by a human.
45
+ * **Model**: Based on `XLMRClassifier` fine-tuned on Nepali language data.
46
+ * **Dataset**: Scraped dataset of **\~18,000** Nepali texts.
47
+ * **Location**: [`features/nepali_text_classifier`](features/nepali_text_classifier)
48
+ * **Docs**: [`docs/features/nepali_text_classifier.md`](docs/features/nepali_text_classifier.md)
49
+
50
+ ### 🌐 English Text Classifier
51
+
52
+ * **Purpose**: Detects if English text is AI-generated or human-written.
53
+ * **Pipeline**:
54
+
55
+ * Uses **GPT2 tokenizer** for input preprocessing.
56
+ * Custom binary classifier to differentiate between AI and human-written content.
57
+ * **Location**: [`features/text_classifier`](features/text_classifier)
58
+ * **Docs**: [`docs/features/text_classifier.md`](docs/features/text_classifier.md)
59
+
60
+ ---
61
+
62
+ ## πŸ—‚οΈ Project Structure
63
 
64
  ```bash
65
+ AI-Checker/
66
+ β”‚
67
+ β”œβ”€β”€ app.py # Main FastAPI entry point
68
+ β”œβ”€β”€ config.py # Configuration settings
69
+ β”œβ”€β”€ Dockerfile # Docker build script
70
+ β”œβ”€β”€ Procfile # Deployment file for Heroku or similar
71
+ β”œβ”€β”€ requirements.txt # Python dependencies
72
+ β”œβ”€β”€ README.md # You are here πŸ“˜
73
+ β”‚
74
+ β”œβ”€β”€ features/ # Core detection modules
75
+ β”‚ β”œβ”€β”€ image_classifier/
76
+ β”‚ β”œβ”€β”€ image_edit_detector/
77
+ β”‚ β”œβ”€β”€ nepali_text_classifier/
78
+ β”‚ └── text_classifier/
79
+ β”‚
80
+ β”œβ”€β”€ docs/ # Internal and API documentation
81
+ β”‚ β”œβ”€β”€ api_endpoints.md
82
+ β”‚ β”œβ”€β”€ deployment.md
83
+ β”‚ β”œβ”€β”€ detector/
84
+ β”‚ β”‚ β”œβ”€β”€ ELA.md
85
+ β”‚ β”‚ β”œβ”€β”€ fft.md
86
+ β”‚ β”‚ β”œβ”€β”€ meta.md
87
+ β”‚ β”‚ └── note-for-backend.md
88
+ β”‚ β”œβ”€β”€ functions.md
89
+ β”‚ β”œβ”€β”€ nestjs_integration.md
90
+ β”‚ β”œβ”€β”€ security.md
91
+ β”‚ β”œβ”€β”€ setup.md
92
+ β”‚ └── structure.md
93
+ β”‚
94
+ β”œβ”€β”€ IMG_Models/ # Saved image classifier model(s)
95
+ β”‚ └── latest-my_cnn_model.h5
96
+ β”‚
97
+ β”œβ”€β”€ notebooks/ # Experimental and debug notebooks
98
+ β”œβ”€β”€ static/ # Static assets if needed
99
+ └── test.md # Test notes
100
+ ````
101
+
102
+ ---
103
+
104
+ ## πŸ“š Documentation Links
105
+
106
+ * [API Endpoints](docs/api_endpoints.md)
107
+ * [Deployment Guide](docs/deployment.md)
108
+ * [Detector Documentation](docs/detector/)
109
+
110
+ * [Error Level Analysis (ELA)](docs/detector/ELA.md)
111
+ * [Fast Fourier Transform (FFT)](docs/detector/fft.md)
112
+ * [Metadata Analysis](docs/detector/meta.md)
113
+ * [Backend Notes](docs/detector/note-for-backend.md)
114
+ * [Functions Overview](docs/functions.md)
115
+ * [NestJS Integration Guide](docs/nestjs_integration.md)
116
+ * [Security Details](docs/security.md)
117
+ * [Setup Instructions](docs/setup.md)
118
+ * [Project Structure](docs/structure.md)
119
+
120
+ ---
121
+
122
+ ## πŸš€ Usage
123
+
124
+ 1. **Install dependencies**
125
+
126
+ ```bash
127
+ pip install -r requirements.txt
128
+ ```
129
+
130
+ 2. **Run the API**
131
+
132
+ ```bash
133
+ uvicorn app:app --reload
134
+ ```
135
+
136
+ 3. **Build Docker (optional)**
137
+
138
+ ```bash
139
+ docker build -t ai-contain-checker .
140
+ docker run -p 8000:8000 ai-contain-checker
141
+ ```
142
+
143
+ ---
144
+
145
+ ## πŸ” Security & Integration
146
+
147
+ * **Token Authentication** and **IP Whitelisting** supported.
148
+ * NestJS integration guide: [`docs/nestjs_integration.md`](docs/nestjs_integration.md)
149
+ * Rate limiting handled using `slowapi`.
150
+
151
+ ---
152
+
153
+ ## πŸ›‘οΈ Future Plans
154
+
155
+ * Add **video classifier** module.
156
+ * Expand dataset for **multilingual** AI content detection.
157
+ * Add **fine-tuning UI** for models.
158
+
159
+ ---
160
+
161
+ ## πŸ“„ License
162
+
163
+ See full license terms here: [`LICENSE.md`](license.md)
164