website URL:-- https://deepdefenders.netlify.app/ Deep Defender is a Flask-based prototype for detecting potentially fake or synthetic media. It combines a lightweight web UI, PostgreSQL-backed detection history, URL-based media analysis, and optional model code for image and audio deepfake detection. for api testing only https://deep-defender-an6z.onrender.com/
This repository has been built as a hackathon/demo project, and the current implementation mixes production-like pieces with heuristic fallbacks. The README below reflects the code as it exists today.
/api/url/analyze /api/image/detect /api/voice/detectdetections.dbThere are two different detection paths in the codebase:
Upload Media flow in the UI
The frontend uploads the actual selected image or audio file. The backend saves it temporarily, analyzes the media bytes through the optional trained model path when weights are available, and otherwise uses deterministic image/audio heuristics.
Analyze URL flow in the UI
The backend fetches a remote image or audio file, tries to use optional local TensorFlow weights if present, and otherwise falls back to heuristic analysis based on media characteristics and URL metadata.
deep-defender/
├── app.py # Main Flask app, routes, DB setup, URL analysis
├── .app.py # Small launcher that calls main()
├── index.html # Frontend UI
├── config.js # Frontend backend API URL config
├── script.js # Frontend interactions and API calls
├── style.css # Frontend styling
├── render.yaml # Render backend deploy config
├── requirements.txt # Backend/runtime dependencies
├── requirements-ml.txt # Optional TensorFlow/Hugging Face dependencies
├── .python-version # Render Python runtime line
├── detections.db # SQLite database used by the app
├── image_preprocess.py # Image preprocessing for TensorFlow model path
├── image_xception.py # Xception-based image classifier definition
├── audio_preprocess.py # Audio preprocessing for TensorFlow model path
├── audio_transformer.py # Audio transformer model definition
├── auto_transformer.py # Duplicate audio transformer model file
├── backend/pipelines/
│ ├── image_pipeline.py # HF image pipeline wrapper
│ └── audio_pipeline.py # HF audio pipeline wrapper
└── src/
├── models/
│ ├── hf_image_model.py # Hugging Face image model loader
│ └── hf_audio_model.py # Hugging Face audio model loader
└── utils/
└── postprocess.py # Label mapping helper
The frontend chooses one of these endpoints based on file extension:
POST /api/image/detectPOST /api/voice/detectThese routes:
fileUploaded filenames are not used as suspicious keyword evidence, which helps avoid false positives for authentic files with confusing names.
POST /api/url/analyze is the most substantial path in the app.
Flow:
models/image_xception.weights.h5 or image_xception.weights.h5models/audio_transformer.weights.h5 or audio_transformer.weights.h5url_detectionsWhen trained weights are not available, the app uses heuristics:
Image heuristics:
Audio heuristics:
POST /api/image/detectGET /api/image/historyPOST /api/voice/detectGET /api/voice/historyPOST /api/url/analyzeGET /api/url/historyGET /api/analyticsReturns:
The app creates three tables on startup:
image_detectionsvoice_detectionsurl_detectionsThe database is initialized in init_db() and seeded with demo image/voice history in seed_demo_data() if the history tables are empty.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
The Render deploy uses the lighter backend dependency set in requirements.txt. If you later want the TensorFlow and Hugging Face helper code locally, install:
pip install -r requirements-ml.txt
TensorFlow wheels are not available for every Python release, so use Python 3.12 for the optional ML environment.
python app.py
Or:
python .app.py
The server starts on:
http://localhost:9000
This repo includes render.yaml, so the easiest path is Render Blueprints:
render.yaml.deep-defender-an6z.https://deep-defender-an6z.onrender.com/health
If Render gives your service a different URL, update config.js with that URL and push again so Netlify calls the correct backend.
Manual Render settings are:
Language: Python 3
Build Command: pip install -r requirements.txt
Start Command: gunicorn app:app --timeout 120
Health Check Path: /health
Environment variables:
CORS_ORIGINS=https://deepdefenders.netlify.app
FLASK_DEBUG=false
SEED_DEMO_DATA=true
The app uses SQLite by default. For persistent production history, create a Render PostgreSQL database and set DATABASE_URL to its internal database URL.
The frontend reads window.DEEP_DEFENDER_API_BASE_URL from config.js. For the default Render service name it already points Netlify traffic to:
https://deep-defender-an6z.onrender.com
For local Flask testing, the value stays blank and calls the same origin.
Open the app in a browser and use one of the tabs:
Upload Media
Analyze URL
http:// or https:// URLThe repository contains model code that is only partially wired into the live app:
Important note:
app.pyindex.html, script.js, style.css, and config.js.weights.h5 files that are not included hereauto_transformer.py appears to duplicate audio_transformer.pydetections.db is committed into the repo and may contain mutable local demo dataDeep Defender is a strong prototype for a deepfake-detection dashboard. The upload and URL flows now inspect actual media bytes, with deterministic heuristic fallbacks when trained weights are not available. To reach dependable 70-80% accuracy, the next major step is validating against a labeled image/audio dataset and wiring in a trained model that matches that data.
website URL:-- https://deepdefenders.netlify.app/ Deep Defender is a Flask-based prototype for detecting potentially fake or synthetic media. It combines a lightweight web UI, PostgreSQL-backed detection history, URL-based media analysis, and optional model code for image and audio deepfake detection. for api testing only https://deep-defender-an6z.onrender.com/
This repository has been built as a hackathon/demo project, and the current implementation mixes production-like pieces with heuristic fallbacks. The README below reflects the code as it exists today.
/api/url/analyze /api/image/detect /api/voice/detectdetections.dbThere are two different detection paths in the codebase:
Upload Media flow in the UI
The frontend uploads the actual selected image or audio file. The backend saves it temporarily, analyzes the media bytes through the optional trained model path when weights are available, and otherwise uses deterministic image/audio heuristics.
Analyze URL flow in the UI
The backend fetches a remote image or audio file, tries to use optional local TensorFlow weights if present, and otherwise falls back to heuristic analysis based on media characteristics and URL metadata.
deep-defender/
├── app.py # Main Flask app, routes, DB setup, URL analysis
├── .app.py # Small launcher that calls main()
├── index.html # Frontend UI
├── config.js # Frontend backend API URL config
├── script.js # Frontend interactions and API calls
├── style.css # Frontend styling
├── render.yaml # Render backend deploy config
├── requirements.txt # Backend/runtime dependencies
├── requirements-ml.txt # Optional TensorFlow/Hugging Face dependencies
├── .python-version # Render Python runtime line
├── detections.db # SQLite database used by the app
├── image_preprocess.py # Image preprocessing for TensorFlow model path
├── image_xception.py # Xception-based image classifier definition
├── audio_preprocess.py # Audio preprocessing for TensorFlow model path
├── audio_transformer.py # Audio transformer model definition
├── auto_transformer.py # Duplicate audio transformer model file
├── backend/pipelines/
│ ├── image_pipeline.py # HF image pipeline wrapper
│ └── audio_pipeline.py # HF audio pipeline wrapper
└── src/
├── models/
│ ├── hf_image_model.py # Hugging Face image model loader
│ └── hf_audio_model.py # Hugging Face audio model loader
└── utils/
└── postprocess.py # Label mapping helper
The frontend chooses one of these endpoints based on file extension:
POST /api/image/detectPOST /api/voice/detectThese routes:
fileUploaded filenames are not used as suspicious keyword evidence, which helps avoid false positives for authentic files with confusing names.
POST /api/url/analyze is the most substantial path in the app.
Flow:
models/image_xception.weights.h5 or image_xception.weights.h5models/audio_transformer.weights.h5 or audio_transformer.weights.h5url_detectionsWhen trained weights are not available, the app uses heuristics:
Image heuristics:
Audio heuristics:
POST /api/image/detectGET /api/image/historyPOST /api/voice/detectGET /api/voice/historyPOST /api/url/analyzeGET /api/url/historyGET /api/analyticsReturns:
The app creates three tables on startup:
image_detectionsvoice_detectionsurl_detectionsThe database is initialized in init_db() and seeded with demo image/voice history in seed_demo_data() if the history tables are empty.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
The Render deploy uses the lighter backend dependency set in requirements.txt. If you later want the TensorFlow and Hugging Face helper code locally, install:
pip install -r requirements-ml.txt
TensorFlow wheels are not available for every Python release, so use Python 3.12 for the optional ML environment.
python app.py
Or:
python .app.py
The server starts on:
http://localhost:9000
This repo includes render.yaml, so the easiest path is Render Blueprints:
render.yaml.deep-defender-an6z.https://deep-defender-an6z.onrender.com/health
If Render gives your service a different URL, update config.js with that URL and push again so Netlify calls the correct backend.
Manual Render settings are:
Language: Python 3
Build Command: pip install -r requirements.txt
Start Command: gunicorn app:app --timeout 120
Health Check Path: /health
Environment variables:
CORS_ORIGINS=https://deepdefenders.netlify.app
FLASK_DEBUG=false
SEED_DEMO_DATA=true
The app uses SQLite by default. For persistent production history, create a Render PostgreSQL database and set DATABASE_URL to its internal database URL.
The frontend reads window.DEEP_DEFENDER_API_BASE_URL from config.js. For the default Render service name it already points Netlify traffic to:
https://deep-defender-an6z.onrender.com
For local Flask testing, the value stays blank and calls the same origin.
Open the app in a browser and use one of the tabs:
Upload Media
Analyze URL
http:// or https:// URLThe repository contains model code that is only partially wired into the live app:
Important note:
app.pyindex.html, script.js, style.css, and config.js.weights.h5 files that are not included hereauto_transformer.py appears to duplicate audio_transformer.pydetections.db is committed into the repo and may contain mutable local demo dataDeep Defender is a strong prototype for a deepfake-detection dashboard. The upload and URL flows now inspect actual media bytes, with deterministic heuristic fallbacks when trained weights are not available. To reach dependable 70-80% accuracy, the next major step is validating against a labeled image/audio dataset and wiring in a trained model that matches that data.