Skip to content

Anu13lol/VerifAI

Repository files navigation

VerifAI 🛡️

High-throughput media fingerprinting and piracy detection engine — Google Solution Challenge 2026

Live API: https://verifai-672474041041.us-central1.run.app/docs


What is VerifAI?

VerifAI is a content piracy detection engine. A media owner registers their asset — image or video — and VerifAI generates a perceptual fingerprint using a custom C++ hashing engine. When a potentially stolen copy appears, VerifAI scans it against the registry and detects matches even after compression, cropping, or color shifting. Matched assets trigger an AI-generated threat report powered by Google Gemini.

Think of it as Shazam for stolen media.


Architecture

Upload -> C++ Hash Engine(pHash + dHash) -> PostgreSQL + pgvector -> Scan -> Hamming Distance Search -> Match Results + Gemini Threat Report


Benchmark

Engine Speed
C++ (pybind11) 289 FPS
Pure Python (imagehash) ~4.4 FPS
Speedup 65×

Tested on a single CPU core. The C++ hot path mirrors the boundary targeted by CUDA kernel offload in production GPU pipelines.


API Endpoints

Method Endpoint Description
GET /health Service status
POST /assets/register Register and fingerprint a media asset
POST /scan Scan a file against the registry
GET /alerts List all registered fingerprints
GET /report/{asset_id} Gemini AI threat intelligence report

Tech Stack

  • C++17 — perceptual hash engine (pHash, dHash)
  • pybind11 — zero-copy Python bindings
  • FastAPI — REST API
  • PostgreSQL 16 + pgvector — fingerprint storage and vector search
  • Google Gemini 2.0 Flash — AI threat analysis
  • Docker + Google Cloud Run — containerized cloud deployment
  • SQLAlchemy — ORM

Local Setup

Prerequisites

  • Python 3.12
  • CMake 4.x
  • MSVC 2019 or g++
  • Docker
  • PostgreSQL 16

1. Clone the repo

git clone https://github.com/Anu13lol/VerifAI.git cd VerifAI

2. Build the C++ engine

mkdir build && cd build cmake .. make cp verifai_engine*.pyd../python/

3. Install Python dependencies

pip install fastapi uvicorn python-multipart sqlalchemy psycopg2-binary pgvector opencv-python google-generativeai python-dotenv

4. Set up environment variables

Create a .env file in the root: DATABASE_URL=postgresql://admin:root@localhost:5433/mediaguard GEMINI_API_KEY=your_key_here

5. Start the server

uvicorn api.main:app --reload Visit http://localhost:8000/docs


Docker

docker build -t verifai . docker run -p 8000:8000 --env-file .env verifai


Live Deployment

Deployed on Google Cloud Run with Cloud SQL PostgreSQL 16 + pgvector. https://verifai-672474041041.us-central1.run.app


Competition

  • Competition: Google Solution Challenge 2026
  • Track: Digital Asset Protection
  • Team: @Anu13lol

About

Sports Broadcasting Threat Tracker with Gemini AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors