##If you want dataset for this please download
TrueSight_AI is a three-branch deepfake detection system that analyzes:
- RGB domain
- Noise (PRNU) domain
- Frequency (FFT) domain
This multi-modal design catches deepfakes far more reliably than RGB alone.
`flowchart.png`
Deepfake detection is hard using only RGB pixels.
Different domains reveal different hidden clues:
| Domain | What It Detects | Why It Works |
|---|---|---|
| RGB | Visual noise, textures, shadows | GANs hallucinate micro-details |
| Noise | Missing PRNU camera fingerprints | AI images lack real sensor noise |
| Frequency | Checkerboard patterns, FFT spikes | GANs leave periodic artifacts |
TrueSight_AI extracts all three and merges them into a unified classifier.
A CNN extracts:
- Texture details
- Color patterns
- Edge behavior
- Micro-structure inconsistencies
GANs often miss tiny high-frequency structures.
Noise is extracted using: Noise = Image - GaussianBlur(Image)
This branch detects:
- Missing camera sensor noise
- Over-smoothness
- Denoising artifacts
- Fake PRNU patterns
Real images always contain PRNU → AI images don’t.
FFT reveals:
- High-frequency spikes
- Checkerboard artifacts
- Moiré patterns
- Periodic GAN noise
These are invisible in RGB, but obvious in frequency space.
🏗 3. Project Structure go Copy code TrueSight_AI/ │── model.py │── train.py │── test_model.py │── predict_single.py │── verify_setup.py │── dataset.py │── feature_extractor.py │── saved/ │ ├── best_model.pth │ ├── training_curves.png │ ├── confusion_matrix.png │── dataset/ ├── train/ │ ├── real/ │ └── fake/ └── test/ ├── real/ └── fake/
pip install torch torchvision opencv-python pillow numpy matplotlib tqdm seaborn scikit-learnRun:
python verify_setup.pyThis script verifies that your environment is ready by checking:
📁 Dataset paths 🔧 Model imports ⚡ GPU / MPS / CPU availability 🖼️ Image loader integrity
python train.py best_model.pth training_curves.png confusion_matrix.png metrics.json
bash Copy code python test_model.py Outputs:
Accuracy Precision Recall F1-Score Confusion matrix Wrong predictions
Training curve Confusion matrix Real vs Fake confidence Per-image prediction logs
Add Vision Transformer (ViT) branch Add Wavelet Transform (DWT) Integrate CLIP features Deploy using FastAPI or Streamlit