Skip to content

ahmetsn702/ExifRiskAuditor

Repository files navigation

ExifRiskAuditor

A comprehensive image forensics and privacy risk assessment tool that combines EXIF metadata analysis, AI-powered visual intelligence, solar forensics, and deep learning-based location classification.

Overview

ExifRiskAuditor analyzes images to detect privacy risks, verify authenticity, and assess potential information leakage. It is designed for digital forensics, OSINT investigations, and privacy auditing workflows.

Key Capabilities

  • EXIF Metadata Extraction - GPS coordinates, camera model, software traces, timestamps
  • AI Visual Analysis - Google Gemini-powered location detection and forgery assessment
  • Solar Forensics - NOAA-based sun position validation to detect timestamp/location spoofing
  • Error Level Analysis (ELA) - Pixel-level forgery detection via JPEG compression artifacts
  • Street Classification - ONNX-based ResNet18 model for location identification from street-level imagery
  • Risk Scoring - Decorator pattern-based composite scoring (0-100) with weighted risk factors
  • PDF Reporting - Automated forensic report generation with QuestPDF

Architecture

ExifRiskAuditor/
├── Services/                    # Core analysis engine
│   ├── ExifRiskManager.cs       # Main orchestrator
│   ├── GeminiVisualAnalyzer.cs  # Google Gemini AI integration
│   ├── SolarCalculator.cs       # NOAA solar position algorithm
│   ├── SolarForensicsService.cs # Shadow/timestamp validation
│   ├── ForgeryAnalyzer.cs       # Error Level Analysis (ELA)
│   ├── StreetClassifierService.cs # ONNX model inference
│   ├── ReportGenerator.cs       # PDF report output
│   ├── RiskScoring/             # Decorator pattern scoring
│   └── Rules/                   # EXIF-based risk rules
├── Models/                      # Data models + ML artifacts
│   ├── ScanResult.cs
│   ├── RiskDetail.cs
│   ├── street_classifier.onnx   # Trained ResNet18 model
│   └── class_labels.json
├── Data/                        # Entity Framework + SQLite
├── ExifRiskAuditor.UI/          # WPF desktop application
│   ├── MainWindow.xaml          # Drag-and-drop UI
│   └── ViewModels/              # MVVM view models
├── StreetClassifierTraining/    # Python ML pipeline
│   ├── train_model.py           # ResNet18 transfer learning
│   ├── download_and_extract.py  # Dataset collection from YouTube
│   └── test_ui.py               # Gradio testing interface
└── Migrations/                  # EF Core database migrations

Tech Stack

Layer Technology
Backend .NET 9.0, C#
UI WPF + Material Design, MVVM (CommunityToolkit)
AI/ML Google Gemini API, ONNX Runtime, ResNet18
Image Processing SixLabors.ImageSharp, MetadataExtractor
Database SQLite + Entity Framework Core 9.0
PDF Generation QuestPDF
ML Training Python, PyTorch, torchvision
Dataset Tools yt-dlp, ffmpeg

Analysis Pipeline

Image Input
    ↓
┌─ EXIF Extraction (GPS, Camera, Software, Date)
├─ Solar Forensics (Sun position vs shadow validation)
├─ ELA Forgery Detection (Compression artifact analysis)
├─ Gemini AI Analysis (Location OSINT + forgery scoring)
└─ Street Classifier (ONNX inference + region validation)
    ↓
Risk Score Calculation (Decorator pattern, 0-100)
    ↓
Output: UI Display / PDF Report / SQLite Storage

Risk Scoring Breakdown

Risk Factor Points Trigger
GPS Location Data +40 EXIF contains coordinates
Face Detection +25 Identity exposure risk
Device Fingerprint +15 Camera model identified
Recent Content +10 Photo taken within 1 year
High Resolution +10 Enables biometric analysis
Software Traces +5 Editing software detected
Manipulation x1.5 AI forgery score > 50%

Prerequisites

  • .NET 9.0 SDK
  • Google Gemini API key (for AI analysis features)
  • Python 3.8+ (only for ML training pipeline)

Setup

  1. Clone the repository

    git clone https://github.com/yourusername/ExifRiskAuditor.git
    cd ExifRiskAuditor
  2. Set the Gemini API key

    # Windows (PowerShell)
    $env:GEMINI_API_KEY="your-api-key-here"
    
    # Linux/macOS
    export GEMINI_API_KEY="your-api-key-here"
  3. Build and run (Console)

    dotnet build
    dotnet run
  4. Build and run (WPF UI)

    dotnet build ExifRiskAuditor.UI/ExifRiskAuditor.UI.csproj
    dotnet run --project ExifRiskAuditor.UI

ML Training (Optional)

The street classifier model is pre-trained and included as Models/street_classifier.onnx. To retrain:

cd StreetClassifierTraining
pip install torch torchvision onnx pillow
python train_model.py

Dataset collection from YouTube walking tours:

pip install yt-dlp
python download_and_extract.py

Screenshots

Console interface and WPF UI screenshots coming soon.

Project Structure Details

  • Console App (Program.cs) - Interactive CLI with menu-driven analysis, history search, and record management
  • WPF App (ExifRiskAuditor.UI/) - Drag-and-drop interface with Material Design, real-time analysis display, and map integration
  • Street Classifier - Trained on Istanbul street-level imagery (Abdi Ipekci Caddesi, Harbiye, Gezi Parki) with 5km validation radius

License

This project is licensed under the MIT License. See LICENSE for details.

About

Image forensics and privacy risk assessment tool — EXIF metadata analysis, AI visual intelligence, solar forensics, and deep learning location classification

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors