Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VIRIBIOTECH — Bioréacteur Thermophile Intelligent

D4Gen Hackathon 2026 — Genopole Évry-Courcouronnes

Système de contrôle IA en boucle fermée pour bioréacteur anaérobie thermophile.
Produit du biogaz, hygiénise les effluents animaux et certifie le digestat CE 1069/2009 — en temps réel.


Problème

Chaque année, 200 millions de tonnes d'effluents animaux (fientes de volaille, lisier, boues) quittent les élevages sans certification pathogène validée. SARS, H5N1, résistance aux antibiotiques — même vecteur. La réglementation CE 1069/2009 impose une hygiénisation thermophile, mais personne ne sait en temps réel si elle est atteinte.

Solution

Un bioréacteur thermophile (53°C, HRT 17 jours) équipé d'une IA qui contrôle — pas seulement surveille :

  • Détection précoce de déséquilibre via H₂ (précurseur +2h avant VFA/Alk)
  • Boucle fermée : Sensors → Controller → ActuatorDriver → Sensors[t+1]
  • Certification pathogène temps réel : Salmonella, E. coli, helminthes, charge virale
  • Rapport biosécurité 5 couches généré par LLM (AWS Bedrock)

Architecture

┌─────────────────────────────────────────────────────────┐
│                    VIRIBIOTECH STACK                    │
├──────────────┬──────────────┬──────────────┬────────────┤
│  Layer 0     │  Layer 1     │  Layer 2     │  Layer 3   │
│  Hard rules  │  AI Control  │  Sanitary    │  Fleet     │
│  (safety)    │  LSTM + RF   │  CE 1069     │  KPIs      │
└──────────────┴──────────────┴──────────────┴────────────┘
        ↓               ↓               ↓
   ActuatorDriver   BioreactorPredictor   ReportGenerator
   (closed loop)    (SageMaker GPU)       (AWS Bedrock)

Modèles ML :

  • BioreactorLSTM — prédiction CH₄ horizon 1h/24h (R² = 0.9996, entraîné sur SageMaker GPU)
  • RiskClassifier (Random Forest) — probabilité acidification, risque SPA, niveau alerte
  • IsolationForest — détection d'anomalies capteurs

Variables surveillées : température, pH, VFA/Alcalinité, H₂, CH₄%, NH₃ libre, activité méthanogène, log-réductions pathogènes, 4 KPIs fleet (SRI, EYI, SCP, FRI)

Substrat de référence : fientes_volaille — substrat le plus exigeant (NH₃ libre ~700 mg/L, proche du seuil d'inhibition 400 mg/L)


Structure

viribiotech/
├── ai/
│   ├── controller.py          # Contrôleur 2 niveaux (hard rules + AI supervisory)
│   ���── actuator_driver.py     # Boucle fermée — applique les corrections aux capteurs
│   ��── predictor.py           # LSTM + Random Forest
│   ├── anomaly_detector.py    # Isolation Forest
│   ├── report_generator.py    # Rapport biosécurité via AWS Bedrock (Claude Haiku)
│   ├─��� batch_traceability.py  # Audit trail SQLite (CE 1069/2009)
│   └── maintenance_predictor.py
├── api/
│   ├── main.py                # FastAPI — 20+ routes REST + WebSocket
│   ├── state.py               # Singleton — buffer capteurs, modèles charg��s
│   └── websocket.py
├── dashboard/
│   └── app.py                 # Streamlit — 5 onglets, refresh 2s
├── data/
│   ├── sensor_simulator.py    # Simulateur physique bioréacteur
│   ├── schemas.py             # Pydantic schemas
│   └── training_data.csv
├���─ models/
│   ├── meta.json              # Métadonnées modèles RF
│   └─�� meta_lstm.json         # Métadonnées LSTM
├── notebooks/
│   ├── 02_lstm_training.py    # Entraînement LSTM local
│   └── train_sagemaker.py     # Job SageMaker GPU
├── demo.py                    # CLI démo — 4 scénarios
├── start_demo.sh              # Lancement API + dashboard
└── requirements.txt

Installation

git clone https://github.com/<compte>/viribiotech.git
cd viribiotech

pip install -r requirements.txt

Créer un fichier .env (non versionné) :

export AWS_DEFAULT_REGION="us-west-2"
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_SESSION_TOKEN="..."        # si session temporaire
export SUBSTRATE="fientes_volaille"   # ou lisier_porcin, boues_step

Les modèles ML (.pkl, .pt) ne sont pas inclus dans le repo (binaires lourds).
Regénérer via python notebooks/02_lstm_training.py ou placer les fichiers dans models/.


Lancement

# API + Dashboard (production)
bash start_demo.sh

# API seule
SUBSTRATE=fientes_volaille python -m uvicorn api.main:app --host 0.0.0.0 --port 8000

# Dashboard seul
streamlit run dashboard/app.py --server.port 8501

API disponible sur http://localhost:8000 — documentation interactive : http://localhost:8000/docs
Dashboard : http://localhost:8501


Démo CLI

# Scénario acidification — sans contrôle (H₂=199ppm, VFA/Alk=0.966, quarantaine h10:30)
python demo.py --scenario acidification

# Même scénario avec boucle fermée IA (VFA/Alk ↓90% → 0.092, 38 actions exécut��es)
python demo.py --scenario acidification --autonomous --live

# Panne thermique — process intact, alerte sanitaire CE 1069/2009
python demo.py --scenario temp_drift

# Pic NH₃ — inhibition méthanogènes
python demo.py --scenario nh3_spike

Routes API principales

Route Description
GET /status État temps réel du bioréacteur
GET /prediction Prédictions LSTM + RF
GET /actions Dernière action du contrôleur IA
GET /compliance Conformité CE 1069/2009 temps réel
GET /fleet KPIs normalisés SRI/EYI/SCP/FRI
POST /demo/jump?scenario= Sauter à un scénario (acidification, temp_drift…)
POST /report Déclencher la génération rapport Bedrock
GET /report/latest Récupérer le dernier rapport biosécurité

Références

  • Nordberg et al. — Anaerobic digestion of energy crops and industrial residues (2007)
  • INRAE — données bioréacteurs thermophiles France
  • CE 1069/2009 — Règlement sous-produits animaux (SPA)
  • WHO — Guidelines for the safe use of wastewater, excreta and greywater (2006)

VIRIBIOTECH — One Health : couper la chaîne de contamination zoonotique là où elle commence.

About

Closed-loop AI control system for thermophilic anaerobic bioreactor.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages