Skip to content

ishasinghrathore37/ai_generated_content_detector

Repository files navigation

🧠 AI Content Detector (Image + Text)

An End-to-End Deep Learning based system that detects whether content is AI-generated or Human-created.

This project combines Computer Vision and Natural Language Processing into a unified AI detection platform with a simple web interface.


🚀 Features

  • AI Generated Image Detection (ResNet18)
  • AI Generated Text Detection (BERT)
  • Confidence Score Display
  • Combined Final Verdict (Image + Text)
  • Streamlit Web Interface
  • Deep Learning based approach (PyTorch + Transformers)

🏗 Models Used

📷 Image Model

  • Architecture: ResNet18
  • Framework: PyTorch
  • Input Size: 224x224
  • Classes:
    • AI Generated Image
    • Real Image

📝 Text Model

  • Architecture: BERT (bert-base-uncased)
  • Framework: HuggingFace Transformers
  • Max Token Length: 128
  • Classes:
    • AI Generated Text
    • Human Written Text

📂 Project Structure

AI-Content-Detector/
│
├── models/
│     ├── image_model.pth
│     └── text_model/
│           └── bert_text_detector.pth
│
├── training/
│     ├── train_image_model.py
│     ├── train_text_model.py
│     └── evaluate_image_model.py
│
├── data/
│     └── images/
│           ├── ai/
│           └── real/
│
├── app.py
└── README.md

⚙️ Installation

1️⃣ Clone the repository

git clone https://github.com/your-username/AI-Content-Detector.git
cd AI-Content-Detector

2️⃣ Install dependencies

pip install torch torchvision transformers streamlit scikit-learn pillow

▶️ Run the Application

streamlit run app.py

The application will open in your browser.


🎯 How It Works

Image Pipeline

  1. Upload image
  2. Resize and convert to tensor
  3. ResNet18 inference
  4. Softmax probability calculation
  5. Class prediction with confidence score

Text Pipeline

  1. Enter text
  2. Tokenize using BERT tokenizer
  3. Extract embeddings
  4. Classification layer
  5. Confidence score output

Final Verdict

If either image or text is predicted as AI-generated → Final result shows AI Generated Content.


📊 Evaluation Metrics

  • Accuracy
  • Precision
  • Recall
  • F1 Score
  • Confusion Matrix

🧠 Technologies Used

  • Python
  • PyTorch
  • Torchvision
  • HuggingFace Transformers
  • Streamlit
  • Scikit-learn
  • Pillow

💼 Resume Description

Developed an end-to-end AI Content Detection System using ResNet18 and BERT to classify AI-generated vs human-generated images and text. Integrated both models into a Streamlit web application with confidence scoring and combined verdict logic.


👩‍💻 Author

Isha singh Rathore
AI & Machine Learning/deep learning Enthusiast

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages