Project Story
Inspiration
AI-generated content is becoming increasingly realistic. Today, an AI-generated image can look almost identical to a real photograph, making it difficult for an average person to determine whether what they are seeing is authentic or synthetic.
The bigger problem is blind trust.
Some people can identify obvious AI-generated images, while others may unknowingly trust synthetic content simply because it looks real. At the same time, many existing AI detection tools behave like black boxes. They provide a probability such as "87% AI-generated" without clearly explaining the evidence behind that result.
We wanted to build something different.
We created AI Lens as a privacy-first and explainable digital authenticity platform. Instead of asking users to blindly trust a single AI prediction, AI Lens examines multiple forensic signals and presents the evidence behind its assessment.
Our goal is not to claim that AI detection can be perfect. Our goal is to reduce blind trust by giving users understandable evidence that helps them make a more informed decision.
This led us to three core principles:
- Explainability — show users why content may be suspicious.
- Privacy — analyze content without permanently storing user files.
- Evidence-based detection — combine multiple signals instead of depending on a single prediction.
What it does
AI Lens is a hybrid digital authenticity platform that analyzes images, documents, and raw text for potential signs of AI generation or manipulation.
Instead of returning only a probability, AI Lens produces a transparent Forensic Risk Score from 0–100, supported by an itemized signal log.
🖼️ Image Analysis
AI Lens performs local forensic inspection of image data, including:
- EXIF metadata such as camera
Make,Model, andFocalLength - PNG binary structure and chunk analysis
tEXt,zTXt, andiTXtchunks- AI-generation parameters and tool signatures
- Known generative tool configurations such as Stable Diffusion and ComfyUI parameters
These local signals are combined with Sightengine's GenAI detection model to provide an additional pixel-level AI detection signal.
📄 Document Analysis
For documents, AI Lens examines available metadata and structural information to identify potentially suspicious characteristics.
📝 Text Analysis
For raw text, AI Lens analyzes statistical linguistic characteristics such as:
- Type-Token Ratio (TTR) — vocabulary diversity
- Sentence burstiness variance (\sigma^2) — variation in sentence structure and pacing
These signals help identify unusually uniform linguistic patterns that may be associated with machine-generated text.
🔍 Explainable Results
Rather than simply displaying:
"87% AI-generated"
AI Lens explains the contributing signals and presents them as a forensic assessment.
This makes the result easier to understand and audit.
🔐 Privacy-First Processing
Files are processed transiently in memory using buffers such as Buffer.from().
No uploaded files are intentionally:
- Stored on disk
- Cached
- Saved in a database
- Persisted after processing
⚡ Graceful Degradation
AI Lens does not completely depend on an external AI detection service.
If the external detection service experiences a timeout or outage, the local forensic engine can still analyze the available evidence and return a result.
How we built it
We built AI Lens as an asynchronous hybrid analysis pipeline using Next.js App Router and serverless infrastructure.
Frontend
The interface was designed around an Apple-inspired macOS/iOS Human Interface aesthetic using:
- Next.js
- React
- Tailwind CSS
- Responsive layouts
- Dynamic risk gauges
- Signal classification chips
- Frosted-glass UI components
- Mobile and desktop responsive design
The goal was to make a technically complex forensic system feel simple enough for an everyday user.
Hybrid Image Pipeline
The image analysis pipeline combines two layers of evidence.
Layer 1 — Local Forensic Analysis
The application inspects the raw image buffer and extracts metadata and structural information.
For example, it checks:
Image
├── EXIF Metadata
│ ├── Make
│ ├── Model
│ └── FocalLength
│
├── PNG Structure
│ ├── tEXt
│ ├── zTXt
│ └── iTXt
│
└── Generative Tool Signatures
├── Stable Diffusion
└── ComfyUI parameters
Layer 2 — AI Detection
The same image is analyzed using Sightengine's GenAI model to provide an additional AI-generated-content signal.
The two sources of evidence are then combined by our scoring/orchestration layer.
Evidence Fusion
Instead of treating one signal as absolute proof, AI Lens combines multiple indicators.
Conceptually:
$$ RiskScore = f(LocalForensics,\ AI\ Detection,\ Metadata,\ Structure,\ LinguisticSignals) $$
The resulting score is presented as a Forensic Risk Score from 0–100 together with the individual signals that contributed to it.
This approach helps avoid situations where a single missing metadata field is incorrectly treated as proof of AI generation.
Document & Text Pipeline
Documents are inspected for metadata and structural information.
For text, we calculate statistical metrics including Type-Token Ratio and sentence-level variation.
For example:
$$ TTR = \frac{\text{Unique Tokens}}{\text{Total Tokens}} $$
We also examine sentence-length variation and burstiness:
$$ \sigma^2 = \frac{1}{n}\sum_{i=1}^{n}(x_i-\mu)^2 $$
These metrics are treated as signals, rather than definitive proof that text was generated by AI.
Deployment
The application is deployed using Vercel's serverless infrastructure.
The architecture was designed around transient processing rather than persistent file storage, allowing the system to operate without a traditional upload-storage pipeline.
Challenges we ran into
1. Avoiding False Positives
One of our biggest challenges was realizing that missing metadata does not necessarily mean AI generation.
For example, images shared through messaging applications or exported through image-editing software may lose EXIF metadata.
Initially, treating missing metadata as suspicious could incorrectly flag completely authentic images.
We therefore refined our heuristics so that:
Missing camera metadata
↓
Not automatically suspicious
↓
Risk contribution = 0
while stronger indicators such as actual AI-generation parameters can contribute significantly more to the risk assessment.
This was an important lesson: absence of evidence is not necessarily evidence of AI generation.
2. Combining Local and External Analysis
Another challenge was coordinating our local forensic engine with an external AI detection API.
Local analysis is fast, while an external AI model introduces network latency and potential failures.
We therefore designed an asynchronous orchestration layer that can:
- Run local analysis
- Request external AI detection
- Handle timeouts
- Handle API failures
- Combine available evidence
- Continue operating when the external service is unavailable
This made the system more resilient instead of creating a single point of failure.
3. Making Forensics Understandable
Forensic analysis can produce highly technical information that ordinary users may not understand.
We had to transform low-level information such as:
PNG chunk
EXIF marker
metadata field
statistical metric
AI detection response
into understandable signals that users can interpret.
The challenge was to maintain technical depth without overwhelming the user.
4. Responsive Interface Design
We wanted AI Lens to feel like a polished consumer product rather than a traditional developer tool.
Creating a dark, high-contrast interface with frosted-glass panels while maintaining responsive behavior across desktop and mobile required significant CSS restructuring.
We also focused on preventing layout shifts when analysis results appeared dynamically.
Accomplishments that we're proud of
🔐 Privacy-first architecture
We designed the analysis pipeline around transient in-memory processing rather than persistent file storage.
🔍 Explainable detection
Instead of providing only an opaque probability, AI Lens provides a Forensic Risk Score + individual evidence signals.
🤖 Hybrid AI + Forensics
We successfully combined:
- Local metadata analysis
- Binary structural inspection
- Statistical text analysis
- External AI detection
into a single analysis pipeline.
⚡ Resilient architecture
The application can continue providing local forensic analysis even when the external AI detection service experiences failures or timeouts.
🎨 Production-style interface
We built a polished responsive interface inspired by Apple's Human Interface design principles, supporting both desktop and mobile experiences.
Most importantly, we are proud that AI Lens is designed around a simple idea:
Don't blindly trust the content. Examine the evidence behind it.
What we learned
Building AI Lens taught us that AI detection is not simply a machine-learning classification problem.
We learned how different layers of evidence can complement each other.
🔬 Digital Forensics
We gained practical experience with:
- EXIF metadata
- PNG binary structures
- PNG chunks
- Metadata interpretation
- Generative tool signatures
- Raw byte-stream processing
📊 Statistical NLP
We learned how statistical properties of language can be used as supporting evidence.
Metrics such as:
$$ TTR = \frac{Unique\ Tokens}{Total\ Tokens} $$
and sentence-level variance can provide useful signals, although they should never be treated as absolute proof.
☁️ Serverless Architecture
We learned how to design non-blocking serverless workflows that combine fast local computation with slower external API calls.
🧠 Responsible AI Detection
Perhaps the biggest lesson was that no single signal should automatically be treated as truth.
A missing EXIF field does not prove an image is AI-generated.
A detector's probability does not guarantee that an image is AI-generated.
A statistical language pattern does not prove that a human did not write the text.
AI Lens therefore focuses on evidence aggregation and transparency rather than false certainty.
What's next for AI Lens
AI Lens is currently focused on images, documents, and text. Our next goal is to expand it into a broader digital authenticity platform.
🔐 C2PA & Provenance
We plan to add C2PA (Coalition for Content Provenance and Authenticity) verification to check cryptographically signed content provenance and authenticity information.
🎥 Video Deepfake Detection
We plan to support video analysis through frame-by-frame forensic inspection and deepfake detection.
This could allow AI Lens to identify suspicious visual patterns across an entire video rather than analyzing only a single frame.
🎙️ Audio Deepfake Detection
We also plan to introduce AI-generated and manipulated audio analysis, creating a more complete multimodal authenticity system.
🤖 MCP Integration
We plan to build an open-source Model Context Protocol (MCP) server that allows LLM agents to query AI Lens directly.
This would enable an AI agent to perform a workflow such as:
User Content
↓
AI Agent
↓
AI Lens MCP Server
↓
Forensic Analysis
↓
Evidence + Risk Score
↓
AI Agent
↓
Explainable Response
Our long-term vision is for AI Lens to become a digital authenticity layer for the AI era—helping people, applications, and AI agents distinguish between content that should be trusted, content that requires verification, and content that deserves closer forensic inspection.
Built With
- cloud
- cybersecurity
- forensics
- javascript
- natural-language-processing
- next.js
- node.js
- react
- rest-api
- serverless
- sightengine-api
- tailwind-css
- vercel
Log in or sign up for Devpost to join the conversation.