Skip to content

PuneetKumar1790/SpectraLens

Repository files navigation

SpectraLens

See what the image is hiding.

SpectraLens is a product-style AI image forensics demo built for hackathons, judge presentations, and fast local deployment. It combines a polished landing page with a live detector experience that helps classify uploaded images as real, AI-generated, or AI-edited while surfacing supporting forensic signals.

What It Includes

  • A dedicated landing page at / for storytelling, product framing, and investor/judge demos
  • A separate detector workspace at /scan for live model interaction
  • FastAPI + mounted Gradio architecture
  • EfficientNet-based image classifier with room for frequency-analysis features
  • Metadata and forensic signal summaries for explainability
  • A trained checkpoint in checkpoints/best.pt so the demo can run locally right away
  • Docker support for later deployment

Product Flow

  1. Open the landing page and pitch the problem, value, and need for trustworthy media verification.
  2. Redirect into the detector page for a live upload-and-scan demo.
  3. Review class confidence, forensic signals, and visual evidence overlays.

Project Structure

  • main.py - FastAPI entrypoint and landing page
  • app.py - SpectraLens detector interface mounted at /scan
  • detector/ - model, feature extraction, and dataset helpers
  • train.py - training script
  • generate_manifest.py - dataset manifest generator
  • download_cifake.py - helper for pulling CIFAKE samples
  • checkpoints/best.pt - trained demo checkpoint
  • data/ - local sample images and CSV manifests
  • Dockerfile - deployment container definition

Run Locally

py -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python main.py

Then open:

  • http://127.0.0.1:7860/
  • http://127.0.0.1:7860/scan

Train the Model Again

python generate_manifest.py
python train.py --manifest data/train_manifest.csv --epochs 5 --freeze-backbone

Deployment

This repo is prepared for Docker-friendly platforms such as:

  • Hugging Face Docker Spaces
  • Render
  • Railway

The app listens on port 7860.

If you deploy to Hugging Face Spaces, add the required Spaces metadata block back to the top of the README inside the Space repo, or maintain a separate deployment-specific README for that target.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors