Real-time AI β’ Real information β’ Real confidence
Built with genuinity by the 4real? team at HackHarvard 2025
Youwei Zhen β’ Brandon Sun β’ Yuxin Zeng β’ Krishna Mansinghka
| ποΈ Product Authentication | π€ Deepfake Detection | π° Fact Checking | π€ Person Research |
|---|---|---|---|
| Verify luxury goods | Detect AI-generated images | Verify news claims | Background checks |
| Multi-criterion analysis | Custom ResNet50 model | Source credibility | Red flag detection |
| Image similarity scoring | Real-time detection | Web search verification | Fakeness scoring |
π Quick Start β’ π‘ API Reference β’ ποΈ Architecture β’ π― Use Cases
π Try it now: 4reall.netlify.app
- Overview
- Key Features
- Architecture
- Workflows
- Tech Stack
- Setup & Installation
- API Documentation
- Use Cases
- Project Structure
- Contributing
4real? is a comprehensive, AI-powered authentication system designed to combat counterfeits, deepfakes, and misinformation. The platform leverages multiple cutting-edge AI technologies to verify:
- ποΈ Physical Products - Authenticate luxury goods, sneakers, collectibles, electronics
- π€ AI-Generated Content - Detect deepfakes and synthetic media
- π° News & Information - Fact-check claims and verify sources
- π€ People - Research backgrounds and detect red flags
In an era where:
- $4.2 trillion in counterfeit goods circulate annually
- 96% of deepfakes are malicious
- Misinformation spreads 6x faster than truth
We provide instant, AI-driven verification to help users make informed decisions.
- Dynamic Criteria Generation - AI searches the web for brand-specific authentication markers
- Guided Photo Capture - Step-by-step instructions for capturing specific angles
- Multi-Criterion Analysis - Parallel scoring of stitching, logos, materials, hardware
- Image Similarity Scoring - SIFT, color histograms, SSIM, edge detection
- Trust-Scored References - Prioritizes official brand sites over resale platforms
- Real-Time Price Verification - Validates market value using web search
- Custom ResNet50 Model - Trained on extensive Real/Fake dataset
- Instant Pre-Check - Analyzes images before any other processing
- Configurable Threshold - Adjustable confidence levels (default: 60%)
- Multi-Model Support - Extensible architecture for additional models
- Claim Extraction - Automatically identifies factual statements
- Web Search Verification - Cross-references with reliable sources
- Source Credibility Rating - Evaluates trustworthiness of sources
- Evidence-Based Verdicts - TRUE/FALSE/PARTIALLY TRUE with explanations
- Background Investigation - Searches for controversies, crimes, records
- Fakeness Score (0-100) - Quantifies trustworthiness
- Red Flag Detection - Highlights serious concerns
- Source Citations - Verifies information reliability
graph TB
subgraph "Frontend (Nuxt 3 + Vue 3)"
UI[User Interface]
Camera[Camera System]
Upload[File Upload]
end
subgraph "Backend (Flask API)"
API[API Gateway]
ItemDetect[Item Detection]
DeepfakeCheck[Deepfake Detection]
Criteria[Criteria Generation]
Analysis[Counterfeit Analysis]
FactCheck[Fact Checking]
PersonResearch[Person Research]
end
subgraph "AI Services"
Gemini[Google Gemini 2.5 Pro]
GeminiFlash[Gemini Flash]
PyTorch[PyTorch ResNet50]
Groq[Groq LLaMA]
end
subgraph "External APIs"
SerpAPI[SerpAPI / Google Lens]
GoogleSearch[Google Search]
Supabase[Supabase Storage]
end
UI --> Camera
UI --> Upload
Camera --> API
Upload --> API
API --> ItemDetect
ItemDetect --> DeepfakeCheck
DeepfakeCheck --> Criteria
Criteria --> Analysis
API --> FactCheck
API --> PersonResearch
ItemDetect --> Gemini
DeepfakeCheck --> PyTorch
Criteria --> Gemini
Criteria --> GoogleSearch
Analysis --> GeminiFlash
FactCheck --> Gemini
FactCheck --> GoogleSearch
PersonResearch --> GeminiFlash
PersonResearch --> GoogleSearch
ItemDetect --> Groq
ItemDetect --> SerpAPI
API --> Supabase
style UI fill:#00DC82
style API fill:#3178C6
style Gemini fill:#4285F4
style PyTorch fill:#EE4C2C
graph LR
subgraph "API Layer"
Flask[Flask Server]
end
subgraph "Detection Modules"
Item[item_detection.py]
AIDetect[ai_detection/]
Counterfeit[counterfeit.py]
FactC[fact_check.py]
Person[person.py]
end
subgraph "Support Modules"
Criteria[criteria.py]
ReverseSearch[generate_real_images/]
Similarity[image_similarity_scores/]
Prompts[prompts/]
Parser[llm_parser.py]
end
subgraph "Data Layer"
Cache[(SQLite Cache)]
Uploads[(/uploads)]
end
Flask --> Item
Flask --> AIDetect
Flask --> Counterfeit
Flask --> FactC
Flask --> Person
Item --> Criteria
Item --> ReverseSearch
Counterfeit --> Criteria
Counterfeit --> Similarity
Item --> Prompts
Counterfeit --> Prompts
FactC --> Prompts
Person --> Prompts
Item --> Parser
Counterfeit --> Parser
Criteria --> Cache
Flask --> Uploads
sequenceDiagram
participant U as User
participant FE as Frontend
participant API as Flask API
participant DF as Deepfake Detector
participant ID as Item Detection
participant RS as Reverse Search
participant CG as Criteria Generator
participant CA as Counterfeit Analyzer
participant SS as Similarity Scorer
U->>FE: Upload/Capture Image
FE->>API: POST /detect
API->>DF: Check if AI-generated
alt Is Deepfake (β₯60%)
DF-->>API: Deepfake Detected
API-->>FE: Return Deepfake Warning
FE-->>U: Show AI Detection Alert
else Not Deepfake
DF-->>API: Authentic Image
API->>ID: Analyze Image
ID->>RS: Reverse Image Search
RS-->>ID: Reference Images + Trust Scores
ID->>ID: Extract Product Name
ID-->>API: Product Detected + References
API-->>FE: Detection Result + Product Info
FE-->>U: Show Product Modal
U->>FE: Confirm & Specify Brand (optional)
FE->>API: POST /criteria/:id
API->>CG: Generate Criteria
CG->>CG: Search Web for Auth Markers
CG-->>API: Criteria + Locations
API-->>FE: Guided Photo Instructions
FE-->>U: Show Step-by-Step Guide
loop For Each Criterion
U->>FE: Capture Angle Photo
FE->>FE: Store Image
end
FE->>API: POST /analyze/:id (all images)
API->>SS: Calculate Similarity Scores
SS-->>API: Similarity Results
par Parallel Analysis
API->>CA: Analyze Criterion 1
API->>CA: Analyze Criterion 2
API->>CA: Analyze Criterion N
end
CA-->>API: Aggregated Results
API->>API: Calculate Overall Score
API-->>FE: Authentication Report
FE-->>U: Show Results (Authentic/Counterfeit)
end
flowchart TD
Start([User Uploads Image]) --> Upload[Save Image to /uploads]
Upload --> DeepfakeCheck{Run Deepfake<br/>Detection Model}
DeepfakeCheck -->|Probability β₯ 0.6| Flagged[Flag as AI-Generated]
DeepfakeCheck -->|Probability < 0.6| Continue[Continue to<br/>Item Detection]
Flagged --> CalcConfidence[Calculate Confidence Level]
CalcConfidence --> ShowWarning[Return Deepfake Warning]
ShowWarning --> End1([End: Show Alert to User])
Continue --> ItemDetect[Detect Item Type]
ItemDetect --> TypeCheck{Item Type?}
TypeCheck -->|Product| ProductFlow[Product Authentication Flow]
TypeCheck -->|Person| PersonFlow[Person Research Flow]
TypeCheck -->|Text| FactCheckFlow[Fact-Check Flow]
TypeCheck -->|Other| GeminiAnalysis[General AI Analysis]
ProductFlow --> End2([Continue Product Auth])
PersonFlow --> End3([Research Person])
FactCheckFlow --> End4([Verify Claims])
GeminiAnalysis --> End5([Return Analysis])
style Flagged fill:#ff6b6b
style ShowWarning fill:#ff6b6b
style Continue fill:#51cf66
style DeepfakeCheck fill:#ffd43b
flowchart LR
A[Image with Text] --> B[Extract Claims via OCR + AI]
B --> C{Contains<br/>Factual Claims?}
C -->|No| D[Return: No Claims Found]
C -->|Yes| E[For Each Claim]
E --> F[Search Web for Evidence]
F --> G[Evaluate Sources]
G --> H[Cross-Reference Multiple Sources]
H --> I{Verdict}
I -->|Supported| J[TRUE]
I -->|Contradicted| K[FALSE]
I -->|Mixed| L[PARTIALLY TRUE]
I -->|Insufficient| M[UNVERIFIABLE]
J --> N[Compile Report]
K --> N
L --> N
M --> N
N --> O[Calculate Confidence Score]
O --> P[Return Results]
style J fill:#51cf66
style K fill:#ff6b6b
style L fill:#ffd43b
style M fill:#868e96
graph TD
URL[URL/Domain] --> Extract[Extract Domain]
Extract --> Known{Known Brand?}
Known -->|Yes| Official[Official Brand Site]
Known -->|No| Dynamic[Dynamic Scoring]
Official --> Score10[Trust Score: 1.0]
Dynamic --> HTTPS{HTTPS?}
HTTPS -->|Yes| Base1[Base: 0.4]
HTTPS -->|No| Base2[Base: 0.3]
Base1 --> Indicators
Base2 --> Indicators
Indicators[Check Indicators] --> Official2{Has 'official'<br/>'authorized'<br/>'certified'?}
Official2 -->|Yes| Plus1[+0.15]
Official2 -->|No| Plus2[+0.0]
Plus1 --> Platform
Plus2 --> Platform
Platform{E-commerce<br/>Platform?} -->|Yes| MinTrust[Min Trust: 0.5]
Platform -->|No| RedFlags
MinTrust --> RedFlags
RedFlags{Red Flags?<br/>'replica'<br/>'fake'<br/>'cheap'} -->|Yes| Penalty[-0.3]
RedFlags -->|No| Boost
Penalty --> Final
Boost[Frequency Boost] --> Final[Final Trust Score]
Final --> Clamp[Clamp to 0.0-1.0]
style Score10 fill:#51cf66
style Official fill:#51cf66
style Penalty fill:#ff6b6b
style RedFlags fill:#ffd43b
- Framework: Nuxt 3 (Vue 3)
- Styling: Tailwind CSS 4.x
- State Management: Vue Composition API
- Camera: Native MediaDevices API
- Deployment: Vercel/Netlify ready
- Framework: Flask 3.x
- AI/ML:
- Google Gemini 2.5 Pro (reasoning + search)
- Google Gemini Flash (vision analysis)
- Google Gemini 2.0 Flash Lite (item detection)
- PyTorch 2.0+ (deepfake detection)
- Groq (LLaMA 3.1) (text processing)
- Computer Vision: OpenCV, scikit-image
- Deep Learning: ResNet50, EfficientNet
- Embeddings: sentence-transformers (MiniLM)
- APIs:
- SerpAPI (Google Lens reverse image search)
- Supabase (image storage)
- Cache: SQLite (criteria caching)
- Embeddings: Semantic similarity search
- Version Control: Git
- Package Management: pip, npm
- Environment: python-dotenv
- Python 3.11+
- Node.js 18+
- API Keys (see below)
Create a .env file in the backend/ directory:
# AI Services
GEMINI_API_KEY=your_gemini_api_key
GROQ_API_KEY=your_groq_api_key
# Search & Storage
SERPAPI_API_KEY=your_serpapi_key
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key# Navigate to backend
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run Flask server
python main.pyThe backend will start on http://0.0.0.0:5555
# Navigate to frontend
cd frontend
# Install dependencies
npm install
# Run development server
npm run devThe frontend will start on http://localhost:3000
Backend Configuration (backend/main.py):
# Adjust deepfake detection threshold
DEEPFAKE_CONFIDENCE_THRESHOLD = 0.6 # Range: 0.0-1.0Frontend Configuration (frontend/nuxt.config.ts):
export default defineNuxtConfig({
runtimeConfig: {
public: {
apiUrl: 'http://localhost:5555' // Backend URL
}
}
})http://localhost:5555
GET /healthResponse:
{
"status": "ok",
"message": "Backend is running"
}POST /detectRequest Body:
{
"image": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
}Response (Product):
{
"success": true,
"detection_id": "uuid-here",
"item": "Nike Air Jordan 1",
"item_type": "product",
"confidence": "High",
"description": "Detected a Nike Air Jordan 1 sneaker",
"product_url": "https://nike.com/...",
"product_image": "https://...",
"price_range": [150.0, 200.0],
"filename": "upload_20231015.jpg"
}Response (Deepfake Detected):
{
"success": true,
"is_deepfake": true,
"deepfake_detection": {
"is_deepfake": true,
"probability": 0.87,
"confidence_level": "high",
"message": "This image appears to be AI-generated or manipulated."
}
}Response (Person):
{
"success": true,
"detection_id": "uuid-here",
"item_type": "person",
"awaiting_person_input": true,
"message": "Person detected. Please provide their name."
}Response (Text/Document):
{
"success": true,
"detection_id": "uuid-here",
"item_type": "text",
"fact_check": {
"overall_verdict": "FALSE",
"confidence_score": 0.92,
"claims": [...]
}
}POST /criteria/:detection_idRequest Body (Optional):
{
"brand": "Louis Vuitton"
}Response:
{
"success": true,
"detection_id": "uuid-here",
"item": "Card Holder",
"location_angle": [
"Front - Logo Monogram - Capture straight-on view",
"Back - Stitching Pattern - 45-degree angle",
"Interior - Date Code - Close-up with good lighting"
],
"detailed_criteria": [
{
"primary_feature": "Logo Monogram",
"primary_location": "Front center",
"why_important": "Authentic LV monograms have precise spacing",
"how_to_photograph": "Capture straight-on with even lighting",
"backup_feature": "Heat Stamp",
"backup_location": "Interior",
"backup_how_to_photograph": "Close-up macro shot"
}
]
}POST /analyze/:detection_idRequest Body:
{
"images": [
"data:image/jpeg;base64,...",
"data:image/jpeg;base64,...",
"data:image/jpeg;base64,..."
]
}Response:
{
"success": true,
"detection_id": "uuid-here",
"item": "LV Card Holder",
"is_authentic": true,
"overall_confidence": 0.89,
"criteria_results": [
{
"criterion": "Logo Monogram",
"score": 5,
"passed": true,
"confidence": 0.95,
"notes": "Monogram spacing is correct...",
"visual_markers": ["Correct font", "Proper spacing"]
}
],
"summary": "β
Item appears AUTHENTIC. Total score: 44/50 (88.0%). 9/10 criteria passed.",
"initial_scan": {
"similarity_score": 0.931,
"match_status": "MATCH",
"confidence": "High",
"counterfeit_risk": "Low"
}
}POST /research_personRequest Body:
{
"detection_id": "uuid-here",
"person_name": "John Doe",
"additional_info": "CEO of TechCorp"
}Response:
{
"success": true,
"person_name": "John Doe",
"person_research": {
"fakeness_score": 25,
"overall_assessment": "low_risk",
"summary": "Some controversies found but overall trustworthy",
"findings": [
{
"title": "Labor dispute settled",
"category": "legal",
"severity": "low",
"verified": true
}
],
"red_flags": [],
"positive_notes": ["Long-standing industry reputation"]
}
}- Verify luxury goods before purchase (Poshmark, eBay, Grailed)
- Authenticate sneakers (StockX, GOAT validation)
- Check collectibles (trading cards, limited editions)
- Detect AI-generated profile pictures
- Fact-check viral claims and screenshots
- Verify news sources
- Research people before meetings (dating, business)
- Verify online identities
- Check backgrounds for hiring
- Monitor counterfeit products
- Protect intellectual property
- Maintain brand reputation
HackHarvard2025/
βββ backend/
β βββ ai_detection/ # Deepfake detection module
β β βββ model.py # ResNet50 model architecture
β β βββ inference.py # Inference wrapper
β β βββ deepfake_model.pth # Trained model weights
β β βββ Dataset/ # Training data (Real/Fake)
β βββ generate_real_images/ # Reverse image search
β β βββ image_searcher.py # Google Lens integration
β β βββ trust_scorer.py # Domain trust scoring
β β βββ brand_detector.py # Brand identification
β β βββ utils.py # Helper functions
β βββ image_similarity_scores/ # Image comparison
β β βββ similarity_calculator.py # Multi-metric scoring
β β βββ feature_extractors.py # SIFT, color, edge
β β βββ comparison_analyzer.py # High-level API
β βββ prompts/ # AI prompt templates
β β βββ criteria.py
β β βββ counterfeit.py
β β βββ fact_check.py
β β βββ person.py
β βββ main.py # Flask API server
β βββ criteria.py # Criteria generation
β βββ counterfeit.py # Counterfeit analysis
β βββ fact_check.py # Fact checking
β βββ person.py # Person research
β βββ item_detection.py # Item classification
β βββ llm_parser.py # JSON parsing
β βββ upload_image.py # Supabase integration
β βββ requirements.txt # Python dependencies
β βββ criteria_cache.db # SQLite cache
β
βββ frontend/
β βββ pages/
β β βββ index.vue # Landing page
β β βββ detect.vue # Detection interface
β βββ components/
β β βββ CameraView.vue
β β βββ CriteriaCapture.vue
β β βββ DetectionResults.vue
β β βββ AnalysisResults.vue
β β βββ DeepfakeResults.vue
β β βββ PersonInput.vue
β β βββ PersonResults.vue
β β βββ FactCheckResults.vue
β βββ assets/
β β βββ css/
β β βββ images/
β βββ nuxt.config.ts # Nuxt configuration
β βββ package.json # Node dependencies
β βββ tsconfig.json # TypeScript config
β
βββ README.md # This file
Beautiful, modern UI showcasing all features with animated elements and feature marquee.
- Capture - Take photo or upload image
- Detection - AI identifies the item
- Criteria - Shows authentication checklist
- Guided Capture - Step-by-step photo instructions
- Analysis - Comprehensive authenticity report
- Authentic: Green checkmarks, high confidence scores
- Counterfeit: Red X marks, detailed failure explanations
- Deepfake: Warning alerts with probability scores
- Fact-Check: Claim-by-claim verdicts with sources
1. Image Upload β Deepfake Pre-Check
ββ IF deepfake probability β₯ 60% β STOP, show warning
ββ ELSE β Continue
2. Item Detection (Gemini Vision)
ββ Classify: product/person/text/other
ββ Extract: product name, brand, description
3. Reverse Image Search (Google Lens)
ββ Find similar images
ββ Extract reference images from trusted sources
ββ Calculate trust scores (official brand = 1.0)
ββ Detect brand from search results
4. Criteria Generation (Gemini + Web Search)
ββ Search web for authentication guides
ββ Extract key features: logo, stitching, materials
ββ Generate photo instructions
ββ Cache with semantic similarity
5. Guided Photo Capture (Frontend)
ββ Show criterion 1 β Capture
ββ Show criterion 2 β Capture
ββ ... β Submit all images
6. Parallel Analysis (ThreadPoolExecutor)
ββ Criterion 1 β Gemini Flash β Score 1-5
ββ Criterion 2 β Gemini Flash β Score 1-5
ββ Criterion N β Gemini Flash β Score 1-5
7. Image Similarity (OpenCV)
ββ SIFT feature matching (25%)
ββ Color histogram (35%)
ββ SSIM structural (20%)
ββ Edge detection (15%)
ββ Shape analysis (5%)
8. Final Verdict
ββ Aggregate scores β Overall confidence
ββ Calculate risk level
ββ Generate recommendations
ββ Return report to user
base_score = 0.3 # Unknown domains
# Factors:
+ 1.0 if official brand domain (hardcoded)
+ 0.1 if HTTPS
+ 0.15 if 'official', 'authorized', 'certified' in domain
+ 0.5 if e-commerce platform (Amazon, eBay, etc.)
- 0.3 if 'replica', 'fake', 'cheap' in domain/path
+ 0.15 if domain appears 3+ times in results
+ 0.08 if domain appears 2 times
final_score = clamp(base_score + adjustments, 0.0, 1.0)cd backend
# Test reverse image search
python test_materials/test_reverse_search.py
# Test similarity scoring
python test_materials/example_similarity_usage.py
# Test item detection
python item_detection.py
# Test fact checking
python fact_check.py test_materials/fact_check.png# Test deepfake detection
cd backend/ai_detection
python inference.py path/to/image.jpg deepfake_model.pth- Deepfake Model - Trained on specific dataset, may need retraining for new generation methods
- Criteria Quality - Depends on web search results availability
- API Rate Limits - SerpAPI, Gemini have usage quotas
- Image Quality - Poor lighting/focus affects accuracy
- Brand Coverage - Limited to ~40 major brands (expandable)
This project was created for HackHarvard 2025. All rights reserved.
Don't Get Fooled. Know What's 4real.
Made with π at HackHarvard 2025