TruthLens Enhanced is a production-ready AI-powered system that detects whether images, videos, or audio files are AI-generated or authentic. The enhanced version features improved accuracy, performance optimizations, comprehensive validation, and advanced analysis capabilities.
python start_truthlens.py
This script automatically checks dependencies, optimizes settings, and starts the application.
# Install dependencies
pip install -r requirements.txt
# Start the application
streamlit run app.py
# Run comprehensive system validation
python run_complete_validation.py
# Or run individual components
python validate_with_samples.py # Accuracy testing with sample data
python demo_enhanced_truthlens.py # Interactive feature demonstration
python test_enhanced_system.py # System component testing
TruthLens/
├── 🚀 start_truthlens.py # Easy startup script (NEW)
├── 📱 app.py # Enhanced Streamlit web application
├── ⚙️ config.py # Enhanced configuration system
├── 📋 requirements.txt # Python dependencies
│
├── 🧠 models/ # Enhanced AI model wrappers
│ ├── visual.py # Visual detection with ensemble & caching
│ └── audio.py # Audio detection with caching
│
├── 🔬 forensic/ # Enhanced forensic analysis
│ ├── reasoning.py # Advanced reasoning engine
│ ├── cross_modal.py # Enhanced cross-modal analysis
│ └── highlighting.py # Media highlighting system
│
├── 🛠️ utils/ # Utility functions
│ ├── preprocess.py # Media preprocessing
│ └── cache.py # Intelligent caching system (NEW)
│
├── 📊 Real/ # Real images for validation (YOUR DATA)
├── 🤖 AI Gen/ # AI-generated images for validation (YOUR DATA)
│
├── 🧪 validate_with_samples.py # Sample-based accuracy validation (NEW)
├── 🎮 demo_enhanced_truthlens.py # Interactive demonstration (NEW)
├── 🔍 test_enhanced_system.py # Enhanced system testing (NEW)
├── 📋 run_complete_validation.py # Complete validation runner (NEW)
│
└── 📚 Documentation
├── README.md # This enhanced guide
├── QUICKSTART.md # Quick start guide
└── ENHANCEMENTS.md # Detailed enhancement documentation
# Test accuracy on your Real and AI Gen samples
python validate_with_samples.py
Expected Output:
# Showcase enhanced features
python demo_enhanced_truthlens.py
Features Demonstrated:
# Comprehensive system validation
python test_enhanced_system.py
Tests Performed:
# Threshold sensitivity
export TRUTHLENS_THRESHOLD_MODE=balanced # conservative|balanced|permissive
# Performance settings
export TRUTHLENS_USE_ENSEMBLE=true # Enable ensemble detection
export TRUTHLENS_ENABLE_CACHE=true # Enable result caching
export TRUTHLENS_USE_GPU=true # Use GPU acceleration
# Processing limits
export TRUTHLENS_MAX_FRAMES=100 # Max video frames to analyze
export TRUTHLENS_MAX_FILE_SIZE_MB=500 # Max upload size
# If models fail to load
python start_truthlens.py # Automatic dependency check
# If cache issues occur
python -c "from utils.cache import get_cache; get_cache().clear_cache()"
# If validation fails
python test_enhanced_system.py # Comprehensive system check
Your Real and AI Gen folders are automatically integrated:
# Process multiple files programmatically
from models.visual import get_visual_detector
detector = get_visual_detector()
for image_path in image_list:
result = detector.detect_image(image_path)
print(f"{image_path}: {result['prediction']}")
# Programmatic configuration
from config import set_threshold_mode, get_config
set_threshold_mode('conservative')
config = get_config()
# Cache operations
from utils.cache import get_cache
cache = get_cache()
stats = cache.get_cache_stats()
cache.clear_cache('visual') # Clear specific category
The enhanced system is designed for extensibility:
TruthLens Enhanced offers:
🔍 TruthLens Enhanced - Unveiling the Truth in Media with Advanced AI Detection
Ready to detect deepfakes with enhanced accuracy and performance!
TruthLens Enhanced is a production-ready AI-powered system that detects whether images, videos, or audio files are AI-generated or authentic. The enhanced version features improved accuracy, performance optimizations, comprehensive validation, and advanced analysis capabilities.
python start_truthlens.py
This script automatically checks dependencies, optimizes settings, and starts the application.
# Install dependencies
pip install -r requirements.txt
# Start the application
streamlit run app.py
# Run comprehensive system validation
python run_complete_validation.py
# Or run individual components
python validate_with_samples.py # Accuracy testing with sample data
python demo_enhanced_truthlens.py # Interactive feature demonstration
python test_enhanced_system.py # System component testing
TruthLens/
├── 🚀 start_truthlens.py # Easy startup script (NEW)
├── 📱 app.py # Enhanced Streamlit web application
├── ⚙️ config.py # Enhanced configuration system
├── 📋 requirements.txt # Python dependencies
│
├── 🧠 models/ # Enhanced AI model wrappers
│ ├── visual.py # Visual detection with ensemble & caching
│ └── audio.py # Audio detection with caching
│
├── 🔬 forensic/ # Enhanced forensic analysis
│ ├── reasoning.py # Advanced reasoning engine
│ ├── cross_modal.py # Enhanced cross-modal analysis
│ └── highlighting.py # Media highlighting system
│
├── 🛠️ utils/ # Utility functions
│ ├── preprocess.py # Media preprocessing
│ └── cache.py # Intelligent caching system (NEW)
│
├── 📊 Real/ # Real images for validation (YOUR DATA)
├── 🤖 AI Gen/ # AI-generated images for validation (YOUR DATA)
│
├── 🧪 validate_with_samples.py # Sample-based accuracy validation (NEW)
├── 🎮 demo_enhanced_truthlens.py # Interactive demonstration (NEW)
├── 🔍 test_enhanced_system.py # Enhanced system testing (NEW)
├── 📋 run_complete_validation.py # Complete validation runner (NEW)
│
└── 📚 Documentation
├── README.md # This enhanced guide
├── QUICKSTART.md # Quick start guide
└── ENHANCEMENTS.md # Detailed enhancement documentation
# Test accuracy on your Real and AI Gen samples
python validate_with_samples.py
Expected Output:
# Showcase enhanced features
python demo_enhanced_truthlens.py
Features Demonstrated:
# Comprehensive system validation
python test_enhanced_system.py
Tests Performed:
# Threshold sensitivity
export TRUTHLENS_THRESHOLD_MODE=balanced # conservative|balanced|permissive
# Performance settings
export TRUTHLENS_USE_ENSEMBLE=true # Enable ensemble detection
export TRUTHLENS_ENABLE_CACHE=true # Enable result caching
export TRUTHLENS_USE_GPU=true # Use GPU acceleration
# Processing limits
export TRUTHLENS_MAX_FRAMES=100 # Max video frames to analyze
export TRUTHLENS_MAX_FILE_SIZE_MB=500 # Max upload size
# If models fail to load
python start_truthlens.py # Automatic dependency check
# If cache issues occur
python -c "from utils.cache import get_cache; get_cache().clear_cache()"
# If validation fails
python test_enhanced_system.py # Comprehensive system check
Your Real and AI Gen folders are automatically integrated:
# Process multiple files programmatically
from models.visual import get_visual_detector
detector = get_visual_detector()
for image_path in image_list:
result = detector.detect_image(image_path)
print(f"{image_path}: {result['prediction']}")
# Programmatic configuration
from config import set_threshold_mode, get_config
set_threshold_mode('conservative')
config = get_config()
# Cache operations
from utils.cache import get_cache
cache = get_cache()
stats = cache.get_cache_stats()
cache.clear_cache('visual') # Clear specific category
The enhanced system is designed for extensibility:
TruthLens Enhanced offers:
🔍 TruthLens Enhanced - Unveiling the Truth in Media with Advanced AI Detection
Ready to detect deepfakes with enhanced accuracy and performance!