Skip to content

amn2905/stegoai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ StegoAI – Advanced PDF Steganalysis Platform

AI-Powered Detection of Covert Data in Documents


πŸ“Œ Overview

StegoAI is a full-stack, production-grade machine learning platform designed to detect hidden (steganographic) data embedded within PDF files.

Unlike traditional security tools, StegoAI performs deep structural and statistical analysis to uncover covert communication channels that remain invisible to standard detection systems.

The platform integrates:

  • 🧠 Machine Learning Engine (XGBoost, LightGBM, RandomForest)
  • πŸš€ FastAPI Backend (real-time inference API)
  • 🎨 Streamlit Cyber UI (interactive detection dashboard)

🚨 Problem Statement

Modern cyber threats increasingly use steganography to conceal data inside documents such as PDFs.

This enables attackers to:

  • Exfiltrate sensitive information
  • Deliver hidden malware payloads
  • Maintain covert communication channels

πŸ”΄ Traditional security systems fail because they:

  • Rely on signature-based detection
  • Ignore document structure anomalies
  • Cannot detect hidden semantic patterns

πŸ’‘ Solution

StegoAI introduces a forensic AI pipeline that:

  • Extracts multi-dimensional features from PDFs

  • Detects anomalies in:

    • Metadata entropy
    • Invisible / encoded text
    • Structural inconsistencies
    • Binary padding patterns
  • Classifies files into:

    • βœ… Clean (Safe)
    • ⚠️ Stego (Hidden Data Detected)

βš™οΈ Key Capabilities

  • 🧠 Ensemble Learning Models

    • Random Forest (baseline)
    • XGBoost (production model)
    • LightGBM (optimized alternative)
  • πŸ” Advanced Feature Engineering

    • Entropy-based detection
    • XREF and object structure analysis
    • Hidden text and Unicode anomaly detection
  • πŸ“Š Robust Evaluation Framework

    • Cross-validation
    • Confusion matrix & ROC analysis
  • πŸš€ Real-Time API

    • Upload PDFs
    • Get instant threat classification
  • 🎨 Cybersecurity Dashboard (UI)

    • Interactive threat visualization
    • Risk-level indicators

🧠 System Architecture

PDF Input
   ↓
Feature Engineering (Forensic Analysis)
   ↓
ML Model (XGBoost / RF / LGBM)
   ↓
FastAPI Backend
   ↓
Streamlit UI Dashboard

πŸ“Š Model Performance

Evaluation performed using Stratified 5-Fold Cross-Validation

Model Accuracy Precision Recall F1 Score CV Mean F1
Random Forest 0.7989 0.7995 0.7989 0.7988 0.7963
XGBoost 0.8061 0.8067 0.8061 0.8060 0.8107
LightGBM 0.8137 0.8147 0.8137 0.8135 0.8075

πŸ“Œ XGBoost selected for deployment due to superior generalization and stability.


πŸ§ͺ Visual Results

πŸ“Š Confusion Matrix

Confusion Matrix

πŸ“ˆ ROC Curve

ROC Curve


πŸš€ How to Run (Backend + UI)

1️⃣ Clone Repository

git clone https://github.com/amn2905/stegoai.git
cd stegoai

2️⃣ Install Dependencies

pip install -r requirements.txt

3️⃣ Setup Environment

MODEL_PATH=models/best_model.pkl
PORT=8000
MAX_FILE_SIZE_MB=10

4️⃣ Download Model

https://drive.google.com/file/d/1sLig5TaZXeAZyS_E7N3tpdcOxLiToyCE

models/best_model.pkl

▢️ Run Backend

uvicorn api.main:app --reload

🎨 Run UI

streamlit run ui/app.py

🌐 Access


πŸ“‘ API Capabilities

  • /upload-pdf β†’ Upload & analyze PDF
  • /predict β†’ Feature-based prediction
  • /model-info β†’ Model metadata

πŸ“¦ Sample Output

{
"prediction":"Stego"
"confidence":0.6217
"risk_level":"High"
"decision":"Confident Stego"
"model_used":"XGBoost"
"probabilities":{
"clean":0.3783
"stego":0.6217
}
}

🌍 Real-World Applications

StegoAI has strong applicability across multiple high-impact domains:

πŸ” Cybersecurity

  • Detect hidden malware payloads in documents
  • Prevent covert data exfiltration

πŸ•΅οΈ Digital Forensics

  • Investigate cybercrime evidence
  • Identify hidden communication channels

🏒 Enterprise Security

  • Scan documents in secure pipelines
  • Integrate with SIEM systems

🏦 Banking & Finance

  • Detect fraud via hidden document manipulation
  • Secure confidential document exchange

πŸ›‘οΈ Government & Defense

  • Intelligence analysis
  • Covert communication detection

πŸ“ Cloud Storage Security

  • Scan uploaded files for hidden threats

πŸ“ˆ Impact

  • πŸš€ Enables detection of non-obvious cyber threats
  • πŸ” Provides forensic-level document analysis
  • ⚑ Supports real-time threat detection pipelines
  • 🧠 Bridges gap between ML and cybersecurity

πŸ“ Project Structure

api/        β†’ Backend API
src/        β†’ ML pipeline
ui/         β†’ Streamlit frontend
models/     β†’ trained models
results/    β†’ evaluation outputs
docs/       β†’ documentation

πŸ› οΈ Tech Stack

  • Python
  • Scikit-learn
  • XGBoost / LightGBM
  • FastAPI
  • Streamlit
  • Optuna

πŸ” Security Perspective

StegoAI focuses on behavioral + structural detection, not just signatures, making it resilient against:

  • Unknown attack patterns
  • Obfuscated payloads
  • Adaptive steganography techniques

πŸ“ˆ Future Scope

  • Multi-modal steganalysis (image/audio/video)
  • Deep learning-based detection
  • Real-time streaming analysis
  • SIEM integration

🀝 Collaboration

For research, funding, or deployment:

πŸ“© hamidamaan3@gmail.com


πŸ“œ License

All Rights Reserved


🧠 Final Note

StegoAI is not just a modelβ€”it is a cybersecurity-grade intelligent detection system built to uncover hidden threats in modern digital environments.

About

End-to-end steganalysis platform combining digital forensics, feature engineering, and ensemble ML models to detect covert data in PDF documents.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors