360Β° Financial Crime Detection Engine!
Detect money muling fraud rings from bank transaction data using graph theory algorithms, machine learning, and interactive visualization.
- Overview
- Features
- Architecture
- Tech Stack
- Getting Started
- CSV Format
- API Reference
- Project Structure
- Detection Algorithms
- Machine Learning Pipeline
- JSON Output Format
- Contributing
- License
RingNet360 is a full-stack financial crime detection engine that analyzes bank transaction data to uncover hidden fraud rings, money muling patterns, and shell network structures. Upload a CSV of transactions and instantly get:
- Interactive graph visualizations of money flow
- Suspicion scores for every account
- Detected fraud rings with categorized pattern types
- Timeline animations of transaction activity
- ML-powered anomaly detection with model transparency
- Downloadable HTML investigation reports
| Feature | Description |
|---|---|
| π Cycle Detection | Finds circular fund routing (AβBβCβA) with leakage rate analysis |
| πΈ Smurfing Analysis | Detects fan-in/fan-out patterns within 72-hour sliding windows |
| π’ Shell Network Detection | Identifies pass-through accounts and layered shell chains |
| π§© Community Detection | Louvain algorithm for dense subgroup identification |
| π Suspicion Scoring | Weighted multi-signal scoring (0β100) with false positive filtering |
| πΈοΈ Interactive Graph | D3.js force-directed graph with zoom, pan, and ring highlighting |
| β±οΈ Timeline Animation | Chronological transaction replay with play/pause controls |
| π Analytics Dashboard | Recharts-powered charts: pattern distribution, score histogram, ring risk |
| π€ ML Analysis | Random Forest classifier with ROC curves, confusion matrix, and feature importance |
| 𧬠Behavioral Similarity | Cosine-similarity based behavioral clustering of accounts |
| π₯ JSON Export | Download or copy-to-clipboard full analysis results |
| π HTML Reports | Generate downloadable investigation reports |
| β CSV Validation | Lightweight pre-upload validation endpoint |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend β
β React 19 + Vite + D3.js + Recharts + Tailwind CSS v4 β
β β
β ββββββββββββ ββββββββββββ ββββββββββββ βββββββββββββββββββββ
β β Hero β β Graph β β Timeline β β Analytics ββ
β β Upload β β Viz β β Slider β β Charts ββ
β ββββββ¬ββββββ ββββββββββββ ββββββββββββ βββββββββββββββββββββ
β β β
β βΌ Axios (proxy β :8000) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Backend β
β FastAPI + Python 3.11+ β
β β
β ββββββββββββββββ βββββββββββββββββ βββββββββββββββββββββ β
β β Graph Engine β β ML Engine β β Report Generator β β
β β - Cycles β β - Features β β - HTML Template β β
β β - Smurfing β β - RandomForestβ β - PDF-ready β β
β β - Shells β β - Behavioral β β β β
β ββββββββ¬ββββββββ βββββββββ¬ββββββββ βββββββββββββββββββββ β
β β β β
β ββββββββΌββββββββ ββββββββΌββββββββ βββββββββββββββββββββ β
β β Community β β Scoring β β Filters β β
β β Detection β β Engine β β (False Positive) β β
β ββββββββββββββββ ββββββββββββββββ βββββββββββββββββββββ β
β β
β NetworkX + Pandas + scikit-learn + python-louvain β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Technology | Purpose |
|---|---|
| Python 3.11+ | Core runtime |
| FastAPI | REST API framework |
| Uvicorn | ASGI server |
| Pandas | Data manipulation & CSV parsing |
| NetworkX | Graph construction & traversal |
| python-louvain | Community detection (Louvain) |
| scikit-learn | Random Forest ML pipeline |
| Technology | Purpose |
|---|---|
| React 19 | UI framework |
| Vite 7 | Build tool & dev server |
| D3.js 7 | Force-directed graph visualization |
| Recharts | Analytics charts & histograms |
| Tailwind CSS 4 | Utility-first styling |
| Lucide React | Icon system |
| Axios | HTTP client |
- Python 3.11+
- Node.js 18+
- npm
git clone https://github.com/heckerr404/CICD.git
cd CICDcd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000The API server will start at http://localhost:8000.
cd frontend
npm install
npm run devThe development server will start at http://localhost:5173.
Navigate to http://localhost:5173 β the frontend proxies API calls to port 8000.
Upload a CSV file with these required columns:
| Column | Type | Description | Example |
|---|---|---|---|
transaction_id |
string | Unique transaction identifier | TXN001 |
sender_id |
string | Source account ID | ACC_101 |
receiver_id |
string | Destination account ID | ACC_202 |
amount |
number | Transaction amount | 4999.00 |
timestamp |
datetime | When the transaction occurred | 2024-01-15 10:30:00 |
A sample test file is provided at test-data/test_transactions.csv.
GET /api/health
Response:
{ "status": "healthy", "service": "RingNet360" }POST /api/analyze
Content-Type: multipart/form-data
Body: file=<CSV file>
Returns the full analysis JSON (see JSON Output Format).
POST /api/validate
Content-Type: multipart/form-data
Body: file=<CSV file>
Lightweight pre-upload validation. Returns { valid, errors, warnings }.
GET /api/report?analysis_id=<uuid>
Returns a downloadable HTML investigation report.
CICD/
βββ backend/
β βββ main.py # FastAPI server & API endpoints
β βββ graph_engine.py # Cycle, smurfing, shell detection
β βββ ml_engine.py # Random Forest ML + behavioral similarity
β βββ community_detection.py # Louvain community detection
β βββ scoring.py # Weighted suspicion scoring
β βββ filters.py # False positive filters
β βββ validation.py # CSV validation logic
β βββ report_generator.py # HTML report generation
β βββ models.py # Pydantic response models
β βββ requirements.txt # Python dependencies
β βββ tests/ # Test suite
β
βββ frontend/
β βββ index.html # Entry HTML
β βββ package.json # NPM dependencies
β βββ vite.config.js # Vite configuration
β βββ src/
β β βββ App.jsx # Root application component
β β βββ main.jsx # React entry point
β β βββ index.css # Global styles (Tailwind)
β β βββ components/
β β β βββ LandingPage.jsx # Landing / marketing page
β β β βββ HeroUpload.jsx # CSV upload with drag & drop
β β β βββ SummaryCards.jsx # Key metric cards
β β β βββ GraphVisualization.jsx # D3.js force-directed graph
β β β βββ TimelineSlider.jsx # Transaction timeline replay
β β β βββ FraudRingTable.jsx # Detected rings table
β β β βββ SuspiciousTable.jsx # Suspicious accounts table
β β β βββ AnalyticsCharts.jsx # Recharts analytics dashboard
β β β βββ MLAnalysis.jsx # ML model results viewer
β β β βββ DownloadSection.jsx # JSON/Report export
β β β βββ NetworkBackground.jsx # Animated background
β β β βββ Tooltip.jsx # Reusable tooltip
β β βββ hooks/
β β β βββ useAnalysis.js # API integration hook
β β βββ utils/
β β βββ formatters.js # Formatting utilities
β β
β βββ public/ # Static assets
β
βββ test-data/
β βββ test_transactions.csv # Sample transaction dataset
β
βββ docs/ # Project documentation
βββ .gitignore
βββ README.md
Identifies circular fund routing patterns (e.g., AβBβCβA) using DFS-based cycle enumeration on the directed transaction graph. Each cycle is analyzed for:
- Leakage rate: % of funds lost per loop iteration
- Cycle length: Number of participating accounts
- Temporal proximity: Whether transactions occurred within a tight window
Detects structuring patterns using a 72-hour sliding window:
- Fan-out: One account distributing to many recipients (splitting large amounts)
- Fan-in: Many accounts converging funds into one account
- Threshold proximity: Amounts consistently near reporting thresholds (e.g., $9,999)
Identifies intermediary/pass-through accounts:
- High pass-through ratio: Accounts where inflow β outflow
- Layered chains: Sequential transfers through 3+ intermediaries
- Velocity analysis: Rapid receipt-and-forward patterns
Groups densely interconnected accounts into communities using the Louvain modularity optimization algorithm. Accounts in communities with high concentrations of flagged members receive a score boost.
Weighted multi-signal scoring algorithm (0β100):
- Pattern-based signals (cycle, smurfing, shell membership)
- Temporal clustering signals
- Amount-based signals (threshold proximity)
- Community association boost
- False positive filtering (payroll patterns, recurring bills, etc.)
RingNet360 includes a Random Forest classifier (RingHunter ML) that provides:
| Component | Details |
|---|---|
| Model | Random Forest with cross-validation |
| Features | In/out degree, transaction volume, temporal spread, amount variance, flow ratio |
| Outputs | Per-account ML confidence scores, ROC curve, confusion matrix, feature importance |
| Behavioral Analysis | Cosine similarity clustering to find behaviorally similar accounts |
The ML layer runs alongside the graph-based detection to provide a second independent signal, improving detection confidence.
{
"suspicious_accounts": [
{
"account_id": "ACC_101",
"suspicion_score": 78.5,
"detected_patterns": ["cycle", "smurfing"],
"ring_id": "RING_001",
"ml_confidence": 0.92
}
],
"fraud_rings": [
{
"ring_id": "RING_001",
"pattern_type": "cycle",
"member_accounts": ["ACC_101", "ACC_102", "ACC_103"],
"risk_score": 85.0
}
],
"summary": {
"total_accounts_analyzed": 25,
"suspicious_accounts_flagged": 8,
"fraud_rings_detected": 3,
"processing_time_seconds": 0.45
},
"graph_data": {
"nodes": ["..."],
"edges": ["..."]
},
"timeline_data": ["..."],
"ml_analysis": {
"model_type": "RandomForest",
"cross_val_accuracy": 0.94,
"precision": 0.91,
"recall": 0.88,
"f1_score": 0.89,
"confusion_matrix": {},
"roc_curve": {},
"feature_importance": []
},
"analysis_id": "uuid"
}- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License β see the LICENSE file for details.
Built with β€οΈ for financial crime investigators