AI / MLIn Progress3 min read

Sentinel-AI

Financial Risk Research & Simulation

Sentinel-AI

Overview

Sentinel-AI is a modular, enterprise-grade financial risk research and simulation platform built as a 5-phase academic research project (631-page thesis, ESTIN Bejaia). Phase 1 ingests OHLCV market data, engineers features (log returns, volatility, momentum, RSI), applies PCA dimensionality reduction, and trains a LightGBM regressor for risk/volatility scoring tracked via MLflow. Phase 2 fuses tabular signals with FinBERT news-sentiment embeddings (NLP engine) and CNN candlestick chart-pattern recognition (vision engine) into a unified multimodal risk representation via a late-fusion PyTorch head. Phase 3 retrieves relevant SEC filings and financial news from a pgvector-backed vector store via LangChain and generates grounded natural-language risk explanations using an LLM. Phase 4 introduces a simulated market environment (Gymnasium) with Q-Learning and PPO agents for simulation-only portfolio management. Phase 5 covers SHAP/LIME explainability, adversarial robustness, differential privacy, subgroup bias auditing, and drift detection (PSI). Phases 1–2 are fully implemented with trained models; phases 3–5 are designed with service scaffolding.

Problem & Solution

The Problem

Financial risk analysis requires integrating heterogeneous data sources — market OHLCV data, news sentiment, chart patterns, and regulatory filings — into a unified, explainable risk scoring system.

The Solution

Five-phase research platform: LightGBM risk scoring → FinBERT + CNN multimodal fusion → RAG-grounded LLM explanations → RL simulation → Trust & explainability auditing.

Architecture & Dataflow

Pipeline Architecture
OHLCV Data → Feature Engineering (log returns, volatility, RSI) → PCA → LightGBM (Phase 1) → Multimodal Fusion: FinBERT Sentiment + CNN Vision + Tabular (Phase 2) → pgvector + LangChain RAG → LLM Explanation (Phase 3) → Gymnasium RL Simulation (Phase 4) → SHAP/LIME Audit (Phase 5)

Technical Stack & Implementation

AI / ML & Models

  • LightGBM
  • Scikit-learn (PCA, StandardScaler)
  • FinBERT (ProsusAI/finbert)
  • PyTorch CNN
  • LangChain
  • SHAP
  • LIME

Backend & APIs

  • FastAPI
  • Python
  • Uvicorn
  • Pydantic

Data & Storage

  • NumPy
  • Pandas
  • PyArrow
  • pgvector
  • PostgreSQL

DevOps & Infra

  • Docker
  • Kubernetes
  • Redis
  • Prometheus
  • MLflow

Technical Challenges & Solutions

01

Fusing heterogeneous data modalities (tabular + text + image) into a coherent risk representation

02

Ensuring the LLM explains risk scores without making financial predictions

03

Balancing model complexity with inference latency for real-time risk scoring

Key Highlights & Results

Phases 1–2 fully implemented with trained models (MLflow runs, .pt and .safetensors artifacts)

631-page academic thesis documenting full system design and evaluation

Modular service architecture — each engine independently deployable via Docker

5-phase architecture: Core Engine → Multimodal → RAG+LLM → RL → Trust
LightGBM risk scoring with PCA dimensionality reduction and MLflow tracking
FinBERT sentiment embeddings + CNN chart-pattern recognition (late-fusion multimodal)
pgvector + LangChain RAG for grounded LLM risk explanations
Simulated market environment with Q-Learning and PPO (Gymnasium + Stable-Baselines3)
SHAP/LIME explainability with adversarial robustness and drift detection
6 independent microservices (data_engine, risk-engine, nlp_engine, vision-engine, multimodal-engine, rag-engine)