Production-grade real-time forensic analysis system with MSc-level capabilities
Features โข Installation โข Usage โข Documentation โข Contributing
- About
- Features
- Forensic Analysis Modules
- Evidence Management
- Installation
- Usage
- Output Structure
- Forensic Standards
- Architecture
- Roadmap
- Contributing
- License
- Contact
ForensicSight v2.0 is an advanced real-time forensic analysis system designed for crime scene investigation and evidence processing. Built with production-grade Python code, it combines state-of-the-art computer vision (YOLOv8) with specialized forensic analysis algorithms to provide lab-quality results in the field.
- Real-time object detection with 30+ FPS performance
- Automated evidence categorization following forensic protocols
- Advanced forensic analysis including bloodstain patterns, GSR detection, and fingerprint enhancement
- ISO 17025 compliant evidence management system
- Chain of custody tracking with SHA-256 integrity verification
| Feature | Description |
|---|---|
| YOLOv8s/m Integration | State-of-the-art object detection for real-time analysis |
| Multi-threaded Design | Capture โ Inference โ Main threads for optimal performance |
| Thread-safe Queues | Real-time evidence logging without frame drops |
| Webcam Support | 1280x720 @ 30fps with automatic resolution detection |
| Demo Mode | No camera required for testing and training |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ EVIDENCE CLASSIFICATION โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ PRIMARY โ SEARCH ZONES โ ANOMALIES โ
โ (Red, thick=3) โ (Blue, thick=1)โ (Yellow, thick=2) โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข sports ball โ โข bed โ โข handbag โ
โ โข bottle โ โข couch โ โข backpack โ
โ โข cell phone โ โข chair โ โข suitcase โ
โ โข knife โ โข dining table โ โข box โ
โ โข scissors โ โข refrigerator โ โข book โ
โ โข clock โ โข oven โ โข laptop โ
โ โข vase โ โข microwave โ โ
โ โข suitcase โ โข suitcase โ โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Header Bar - Case ID and system status
- Bounding Boxes - Color-coded by evidence type
- ABFO #2 Ruler - ASTM E2917 compliant scale marker
- Status Bar - Live evidence counts
- Zone Prompts - Contextual forensic instructions
- FPS Counter - Real-time performance monitoring
HSV Dual-Range Detection:
โข Primary range: H:0-10, S:100-255, V:50-255
โข Secondary range: H:160-180, S:100-255, V:50-255
Pattern Classification:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Type โ Criteria โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Drip Stain โ Circularity > 0.7, Area > 100px โ
โ Spatter (High Velocity) โ Area < 50px, irregular shape โ
โ Spatter (Medium Velocity)โ Area 50-100px, moderate circularityโ
โ Pooling โ Area > 500px โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Morphological Processing:
โข 5x5 kernel opening/closing for noise reduction
โข Automatic logging when blood_ratio > 10%
Stippling Pattern Analysis:
โข Circular contour detection (area: 10-100px)
โข Circularity threshold: > 0.7
Distance Estimation:
โโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โ Particles โ Distance โ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโค
โ > 100 โ Contact - 6" โ
โ 50-100 โ 6" - 12" โ
โ 20-50 โ 12" - 24" โ
โ < 20 โ > 24" or no GSR โ
โโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโ
Visual Markers: Magenta circles on detected particles
Image Processing Pipeline:
1. CLAHE Enhancement (clipLimit=3.0, tileGridSize=8x8)
2. Gabor Filter Bank (4 orientations: 0ยฐ, 45ยฐ, 90ยฐ, 135ยฐ)
3. Ridge Detection with skeletonization
4. Minutiae Extraction (endings & bifurcations)
Quality Assessment:
โข Based on intensity standard deviation
โข Automatic trigger when minutiae_count > 10
โข Suitable for AFIS comparison
Striation Pattern Detection:
1. Sobel edge detection
2. Hough Line Transform for parallel lines
3. Angle variance calculation
Classification:
โโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโ
โ Angle Variance โ Tool Type โ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโค
โ < 50ยฐ โ Screwdriver โ
โ 50ยฐ - 200ยฐ โ Pliers/Wrench โ
โ > 200ยฐ โ Irregular/Impact โ
โโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโ
Alternative Light Source Profiles:
โข UV (365nm): Semen/Saliva detection
- HSV: H:130-170, S:50-255, V:0-100
โข Blue (450nm): Blood enhancement
- HSV: H:100-140, S:50-255, V:0-255
Metrics:
โข Particle density per 1000px
โข Confidence scoring
forensic_case_files/[CASE_ID]/
โโโ 01_Biology_DNA/
โ โโโ *[CASE_ID]-BIO-###.png/.jpg
โโโ 02_Trace_Evidence/
โ โโโ *[CASE_ID]-TRC-###.png/.jpg
โโโ 03_Impressions/
โ โโโ *[CASE_ID]-IMP-###.png/.jpg
โโโ 04_Ballistics/
โ โโโ *[CASE_ID]-BAL-###.png/.jpg
โโโ 05_Crime_Scene_Photography/
โ โโโ *[evidence_id]_macro_[hash].png (close-up)
โ โโโ *[evidence_id]_context_[hash].jpg (full frame)
โโโ 06_Chain_of_Custody/
โ โโโ custody_*.json
โโโ master_evidence_registry.csv
Format: [CASE_ID]-[TYPE]-[###]
Examples:
CASE-2026-001-BIO-001 โ Biological evidence #1
CASE-2026-001-TRC-003 โ Trace evidence #3
CASE-2026-001-IMP-012 โ Impression #12
CASE-2026-001-BAL-001 โ Ballistics #1
| Column | Description |
|---|---|
| Evidence_ID | Unique identifier |
| Case_Number | Case identifier |
| Date_Time_Collected | UTC timestamp |
| Type | Evidence category |
| Description | Specific findings |
| Location_Found | Bounding box coordinates |
| Collected_By | Custodian ID |
| Photography_Reference | Image file paths |
| Packaging | Evidence packaging |
| Storage_Location | Storage details |
| Chain_of_Custody | Custody events |
| Contamination_Risks | Cross-contamination flags |
SHA-256 Hash Computation:
โ Every evidence image is hashed
โ Hash stored in metadata JSON
โ Verification during audit
{
"evidence_id": "CASE-2026-001-BIO-001",
"image_hash_sha256": "a1b2c3d4...",
"collection_timestamp": "2026-01-31T07:00:00Z",
"iso17025_compliant": true
}- Python 3.8 or higher
- 4GB RAM (8GB recommended)
- Webcam (optional, demo mode available)
- CUDA-compatible GPU (optional, for faster inference)
# Clone the repository
git clone https://github.com/leonkaushikdeka/leosa.git
cd leosa
# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
.\venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Download YOLOv8 model (automatic on first run)
python ForensicSight_v2.pyopencv-python>=4.8.0
ultralytics>=8.0.0
numpy>=1.24.0
scipy>=1.10.0
scikit-image>=0.21.0
# Run with live camera
python ForensicSight_v2.py
# Run in demo mode (no camera required)
python ForensicSight_v2.py --demo
# Run with specific YOLO model size
python ForensicSight_v2.py --model m # medium model| Key | Action |
|---|---|
q |
Quit application |
s |
Manual screenshot |
d |
Toggle demo mode |
from ForensicSight_v2 import ForensicSightSystem
# Initialize with custom case ID
system = ForensicSightSystem(
case_id="CASE-2026-001",
model_size="s" # 'n', 's', 'm', 'l', 'x'
)
# Start analysis
system.start()-
Macro Images (
*_macro_[hash].png)- High-resolution close-up of detected evidence
- Clean background for analysis
-
Context Images (
*_context_[hash].jpg)- Full frame with annotation
- ABFO #2 scale ruler included
- Evidence ID overlay
-
Metadata Files (
*_metadata.json)- SHA-256 image hash
- Bounding box coordinates
- Forensic analysis results
- Chain of custody timestamps
-
Master Registry (
master_evidence_registry.csv)- Complete evidence log
- Importable to database systems
ForensicSight v2.0 is designed to comply with international forensic standards:
| Standard | Compliance |
|---|---|
| ISO 17025 | General requirements for testing laboratories |
| ASTM E2917 | Forensic photography - scale in documentation |
| SWGDAM | DNA analysis guidelines |
| NIJ standards | Physical evidence handling |
- Timestamp logging (UTC)
- Custodian identification
- SHA-256 digital signatures
- Contamination risk detection
- Complete audit trail
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FORENSICSIGHT v2.0 ARCHITECTURE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโโ โ
โ โ WEBCAM/ โ โ
โ โ VIDEO โ โ
โ โโโโโโโโโฌโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
โ โ CAPTURE โ โ INFERENCE โ โ
โ โ THREAD โโโโโถโ THREAD โ โ
โ โ (Queue) โ โ (YOLOv8) โ โ
โ โโโโโโโโโโโโโโโโโ โโโโโโโโโฌโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ MAIN THREAD โโ
โ โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโ
โ โ โ Evidence โ โ Overlay โ โ Evidence Queue โ โโ
โ โ โ Processing โ โ Rendering โ โ (Thread-safe) โ โโ
โ โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โโ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ FORENSIC EVIDENCE MANAGER โโ
โ โ โโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ โโ
โ โ โ Directory โ โ CSV Log โ โ Image Storage โ โโ
โ โ โ Structure โ โ Registry โ โ (SHA-256) โ โโ
โ โ โโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ โโ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- GPU acceleration with CUDA
- Video recording (session capture)
- PDF report generation
- REST API for integration
- Web dashboard
- Mobile companion app
- 3D scene reconstruction
- Ballistic trajectory analysis
- AFIS integration
- Blockchain chain-of-custody
Contributions are welcome! Please read our Contributing Guide for details.
- ๐ Report bugs
- ๐ก Suggest features
- ๐ Improve documentation
- ๐ง Submit pull requests
This project is licensed under the MIT License - see the LICENSE file for details.
Leon Kaushik Deka
- GitHub: @leonkaushikdeka
- Email: leonkaushikdeka@gmail.com
Project Link: https://github.com/leonkaushikdeka/leosa
Made with ๐ฌ for Forensic Science
