Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

802 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Aiscern β€” AI Content Detection Platform

License: MIT CI TypeScript Next.js

Aiscern is an AI-generated content detection SaaS that identifies AI-produced text, images, audio, and video using a multi-model ensemble β€” combining HuggingFace transformers, Gemini 2.0 Flash, NVIDIA NIM, and a retrieval-augmented generation (RAG) pipeline for high-accuracy, explainable results.

🌐 Live: aiscern.com


Features

Modality Models Used Avg. Accuracy
Text RoBERTa-base-openai-detector, Binoculars perplexity, Gemini ~95%
Image ViT-based classifier, CLIP embeddings, pixel-integrity signals ~91%
Audio wav2vec2 fine-tuned, spectral analysis, SynthID local ~88%
Video NVIDIA NIM deepfake detection, frame-level ensemble ~85%
  • RAG-augmented ensemble β€” retrieves similar patterns from pgvector for context-aware confidence
  • Web scanner β€” full-page crawl with JavaScript rendering via Playwright
  • Ephemeral scan mode β€” zero-history option for sensitive documents
  • Batch detection β€” upload and process multiple files
  • API access (Pro/Enterprise) β€” REST API with per-key rate limiting
  • Admin dashboard β€” real-time pipeline stats, D1 queue monitoring, user management

Tech Stack

Layer Technology
Frontend Next.js 15 (App Router), TypeScript, Tailwind CSS
Auth Clerk (JWT, OAuth)
Database Supabase (PostgreSQL + pgvector)
Storage Cloudflare R2
Edge DB Cloudflare D1
Inference HuggingFace Inference API, Gemini 2.0 Flash, NVIDIA NIM
Background jobs Inngest
Rate limiting Upstash Redis
Payments XPay (PKR + international)
Logging Pino (structured JSON)
CI/CD GitHub Actions β†’ Vercel

Quick Start

Prerequisites

  • Node.js 20+
  • npm 10+
  • A Supabase project
  • A Clerk application
  • A Cloudflare account (R2 bucket + D1 database)

Installation

git clone https://github.com/anasali89ji/AI-SCERN.git
cd AI-SCERN/frontend
npm install --legacy-peer-deps

Environment Variables

Copy .env.example to .env.local and fill in all values:

cp .env.example .env.local

See Environment Variables section for full reference.

Database Setup

Apply Supabase migrations in order:

# In Supabase SQL Editor, run each file in /supabase/migrations/ in order:
# 1. v6_pipeline_schema.sql
# 2. hardening.sql
# 3. calibration_tables.sql
# 4. calibration_stats.sql
# 5. performance_indexes.sql
# 6. r2_storage_column.sql
# 7. feature_flags.sql
# 8. v8_api_key_sha256_migration.sql
# 9. v9_scraper_sessions.sql
# 10. forensic_pipeline.sql

Development

cd frontend
npm run dev

Open http://localhost:3000.

Production Build

cd frontend
npm run build
npm start

Environment Variables

Variable Required Description
NEXT_PUBLIC_SUPABASE_URL βœ… Supabase project URL
NEXT_PUBLIC_SUPABASE_ANON_KEY βœ… Supabase anon/public key
SUPABASE_SERVICE_ROLE_KEY βœ… Supabase service role β€” server only, never expose
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY βœ… Clerk publishable key
CLERK_SECRET_KEY βœ… Clerk secret key β€” server only
GEMINI_API_KEY βœ… Google Gemini API key
GROK_API_KEY optional xAI Grok Vision (image detection primary)
OPENROUTER_API_KEY optional OpenRouter fallback
HUGGINGFACE_API_TOKEN optional HuggingFace Inference API
NVIDIA_API_KEY optional NVIDIA NIM (video deepfake)
R2_ACCOUNT_ID βœ… Cloudflare account ID
R2_ACCESS_KEY_ID βœ… R2 API key
R2_SECRET_ACCESS_KEY βœ… R2 API secret
R2_BUCKET_NAME βœ… R2 bucket name
CLOUDFLARE_D1_DATABASE_ID βœ… D1 database ID
UPSTASH_REDIS_REST_URL βœ… (prod) Upstash Redis URL
UPSTASH_REDIS_REST_TOKEN βœ… (prod) Upstash Redis token
INNGEST_EVENT_KEY βœ… Inngest event key
INNGEST_SIGNING_KEY βœ… (prod) Inngest signing key
SENTRY_DSN optional Error tracking
INTERNAL_API_SECRET βœ… Server-to-server auth secret

Full reference: .env.example


Project Structure

AI-SCERN/
β”œβ”€β”€ frontend/                  # Next.js 15 application
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ (auth)/            # Login, signup pages
β”‚   β”‚   β”œβ”€β”€ (dashboard)/       # Detect, history, settings
β”‚   β”‚   β”œβ”€β”€ (marketing)/       # Landing, pricing, blog
β”‚   β”‚   β”œβ”€β”€ (legal)/           # Privacy, terms, contact
β”‚   β”‚   └── api/               # API routes
β”‚   β”œβ”€β”€ components/            # Shared UI components
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ auth/              # Auth utilities
β”‚   β”‚   β”œβ”€β”€ inference/         # HF, Gemini, NVIDIA inference
β”‚   β”‚   β”œβ”€β”€ rag/               # RAG pipeline (pgvector)
β”‚   β”‚   β”œβ”€β”€ security/          # File validation, CSRF
β”‚   β”‚   β”œβ”€β”€ storage/           # Cloudflare R2
β”‚   β”‚   └── supabase/          # DB client
β”‚   └── next.config.ts
β”œβ”€β”€ admin/                     # Separate admin Next.js app
β”œβ”€β”€ signal-worker/             # Python image analysis worker
β”œβ”€β”€ supabase/migrations/       # Database migrations
β”œβ”€β”€ .github/workflows/         # CI/CD pipelines
└── cf-pipeline/               # Cloudflare Worker pipeline

Benchmarks

Accuracy metrics are published on the Methodology page with per-modality AUC-ROC, precision, recall, and false-positive rates.

Key datasets used for evaluation:

  • Text: PAN25, PERSUADE Corpus 2.0, M4 Benchmark
  • Image: FakeFace, CIFAKE, GenImage
  • Audio: ASVspoof 2019/2021, ADD 2023
  • Video: FaceForensics++, DFDC Preview

API Reference

Full API documentation: aiscern.com/docs/api

# Example: Detect text via API
curl -X POST https://aiscern.com/api/v1/detect/text \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Your content here"}'

# Example: Detect an image via API
curl -X POST https://aiscern.com/api/v1/detect/image \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "file=@photo.jpg"

# Example: Detect an audio clip via API
curl -X POST https://aiscern.com/api/v1/detect/audio \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "file=@clip.mp3"

Video detection is currently dashboard-only (/dashboard/detect/video) β€” a /api/v1/detect/video endpoint is planned but not yet implemented (requires browser-side frame extraction).


Contributing

See CONTRIBUTING.md for guidelines.


Security

To report vulnerabilities, see SECURITY.md or email security@aiscern.com.


License

MIT β€” see LICENSE.


Citation

If you use Aiscern in research, please cite:

@software{aiscern2024,
  title   = {Aiscern: Multi-Modal AI Content Detection},
  author  = {Aiscern Team},
  year    = {2024},
  url     = {https://github.com/anasali89ji/AI-SCERN}
}

About

AI detection and deepfake detection

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages