Spaces:
Running
Running
File size: 3,886 Bytes
8ee42ef 5f1d750 39e8740 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c f6d2d17 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c 5f1d750 7104b2c f6d2d17 5f1d750 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | ---
title: TrueLens Forensics
emoji: ποΈ
colorFrom: gray
colorTo: gray
sdk: docker
app_file: app.py
pinned: false
---
# TrueLens Forensic Suite v1.0
## Advanced Multimedia Authenticity Verification System
[](https://opensource.org/licenses/MIT)
[](https://www.python.org/)
[](https://flask.palletsprojects.com/)
**TrueLens** is a professional-grade forensic suite designed to detect AI-generated synthetic media and deepfakes with high precision. By combining state-of-the-art Neural Networks (SigLIP2) with classical digital forensic signals (ELA, FFT, DCT), TrueLens provides a multi-layered defense against generative misinformation.
---
## ποΈ System Architecture
TrueLens employs a **Hybrid Forensic-Neural Ensemble** (HFNE) architecture:
### 1. Neural Analysis Layer
* **Primary Classifier:** SigLIP2 (Vision Transformer) fine-tuned for synthetic artifact detection.
* **Strategy:** Multi-crop Test-Time Augmentation (TTA) focusing on facial biometrics, central composition, and global structure.
### 2. Forensic Signal Layer (Classical)
* **DCT Block Analysis:** Detects inconsistent JPEG grid alignments and compression quantization typical of authentic camera hardware.
* **ELA (Error Level Analysis):** Identifies non-uniform compression levels across different regions of an image.
* **FFT (Fast Fourier Transform):** Scans the frequency spectrum for high-frequency checkerboard artifacts unique to GANs and Diffusion models.
* **Noise Consistency:** Analyzes pixel-level sensor noise variance to detect synthetic patches.
* **Edge Sharpness:** Monitors gradient uniformity to catch unnaturally sharp or blurred synthetic edges.
### 3. Consensus Fusion Logic
A weighted Bayesian logic gate synthesizes the output of all layers. It includes an **Uncertainty Quantification** engine that flags ambiguous samples rather than providing false positives, ensuring the system's "Forensic Integrity."
---
## π Performance Benchmarks
Evaluated against a controlled dataset of 66 high-resolution samples (Pexels realistic photos vs. SDXL/Midjourney synthetic generations):
| Metric | Local Engine (CPU) |
|:---|:---:|
| **Accuracy** | **92.4%** |
| **Precision** | **0.94** |
| **Recall** | **0.91** |
| **F1-Score** | **0.92** |
| **Avg. Latency** | **~2.2s** |
---
## π οΈ Installation & Setup
### Prerequisites
* Python 3.10 or higher
* pip (Python package manager)
### Quick Start
1. **Clone the repository:**
```bash
git clone https://github.com/abhiisonu/TrueLens.git
cd TrueLens
```
2. **Install dependencies:**
```bash
pip install -r requirements.txt
```
3. **Initialize the engine:**
```bash
python app.py
```
*Note: On first run, it will download approximately 800MB of neural weights.*
4. **Access the Workbench:**
Open `http://localhost:5006` in your browser.
---
## π Forensic Evaluation
You can run the batch evaluator to verify the engine's performance on your own datasets:
```bash
python evaluate.py --fake-dir "path/to/fakes" --real-dir "path/to/reals"
```
---
## βοΈ Privacy & Disclosure
* **Privacy first:** TrueLens processes all inference on-device.
* **Zero-Persistence:** Uploaded samples are purged from memory and disk immediately after inference completion.
* **Disclosure:** This tool is an academic project designed for forensic research. While highly accurate, forensic signals can be bypassed by advanced adversarial techniques (anti-forensics).
---
## π Credits & License
Developed as a Minor Project for Forensic Research.
Licensed under the [MIT License](LICENSE).
---
*Β© 2026 TrueLens Forensic Lab. All rights reserved.*
|