AgriTwin-GH

AgriTwin-GH ๐ŸŒฑ

[![Documentation](https://img.shields.io/badge/docs-online-brightgreen.svg)](https://arjun-christopher.github.io/AgriTwin-GH/) [![Python](https://img.shields.io/badge/python-3.13-3776AB?logo=python&logoColor=white)](https://www.python.org/downloads/) [![FastAPI](https://img.shields.io/badge/FastAPI-0.135+-009688?logo=fastapi&logoColor=white)](https://fastapi.tiangolo.com/) [![React](https://img.shields.io/badge/React-19-61DAFB?logo=react&logoColor=black)](https://react.dev/) [![Unity](https://img.shields.io/badge/Unity-WebGL-000000?logo=unity&logoColor=white)](https://unity.com/) [![PostgreSQL](https://img.shields.io/badge/PostgreSQL-15+-336791?logo=postgresql&logoColor=white)](https://www.postgresql.org/) [![Git LFS](https://img.shields.io/badge/Git_LFS-enabled-F05032?logo=git&logoColor=white)](https://git-lfs.com/) [![License: Proprietary](https://img.shields.io/badge/license-Proprietary-red.svg)](LICENSE) **An Advanced Digital Twin System for Precision Greenhouse Agriculture** *Integrating real-time environmental data streams, physics-based simulation, multi-model ML inference, and model predictive control into a unified cyber-physical platform for intelligent tomato cultivation.* [๐Ÿ“– View Full Documentation โ†’](https://arjun-christopher.github.io/AgriTwin-GH/)

๐Ÿ“‹ Table of Contents


AgriTwin-GH is a comprehensive cyber-physical system combining real-time environmental monitoring, ML-based disease and growth stage detection, physics-based digital twin simulation, and model predictive control for intelligent greenhouse management.

๐ŸŒŸ Overview

Capability Description
๐Ÿฆ  Predictive Disease Management Risk indexing from environmental sensor data to prevent fungal outbreaks before they occur
๐ŸŒฑ Growth-Aware Control Adaptive MPC policies that respond to detected crop development stages
๐Ÿ”ฎ Stage Transition Forecasting Multi-task LSTM predicts next growth stage and hours to transition directly from sensor time-series, enabling proactive interventions
๐Ÿค– Digital Twin Simulation Physics-based virtual replica enabling what-if scenario analysis
๐Ÿ“ธ Image Intelligence EfficientNet classifiers for tomato leaf disease detection and growth stage classification
๐Ÿ—„๏ธ Data Infrastructure PostgreSQL + TimescaleDB for time-series, MinIO for image object storage
๐ŸงŠ 3D Visualization Unity WebGL greenhouse scene driven live from the FastAPI state endpoint
๐Ÿ‘๏ธ Operator Decision Support React dashboard, visual alerts, and non-verbal notification systems

๐Ÿงฉ Components

Component Description
Synthetic Data Generator Configurable greenhouse sensor data generation
Indoor Dataset Generator Passive greenhouse physics model from outdoor weather
Disease Classifier EfficientNetB0 โ€” 6-class tomato leaf disease classification
Growth Stage Classifier EfficientNetB3 โ€” 6-stage tomato plant growth classification
Growth Progression Model Multi-task LSTM predicting current stage, next stage, and hours to transition from sensor time-series
Disease Progression Model Baseline + LSTM/GRU progression pipeline predicting per-disease current presence, 24h infection severity, and 24h trend (absent/emerging/reducing/stable/worsening) from hourly sensor time-series
Greenhouse Weather Forecast Model Chronos + XGBoost + LSTM ensemble forecasting 24h/48h indoor climate conditions for digital twin and control
Digital Twin Simulator Physics-based greenhouse model for scenario simulation
MPC-Like Control Policy Model predictive control for actuator management
Real-Time Closed-Loop DBโ†’AIโ†’MPCโ†’DB autonomous control cycle with in-memory context buffers
What-If Analysis Comparative scenario evaluation and decision support
Non-Verbal Alerts Visual operator notifications for critical events
Dashboard Visualizations Interactive monitoring and performance comparison
Resource Tracking Energy and water usage optimization and reporting
Time-Series Database PostgreSQL + TimescaleDB hypertables for sensor data
Image Storage MinIO (S3-compatible) with PostgreSQL metadata indexing
Monthly Snapshots Per-month aggregated sensor, resource, MPC, and disease summary stored to SQLite/PostgreSQL
Frontend Dashboard React 19 + Tailwind v4 SPA โ€” HomeDashboard, Detailed Insights, Manual Override
3D Greenhouse Scene Unity WebGL greenhouse with 10 actuator controllers, 15 crop plants (6-stage visual progression), time-of-day environment, and a central JSON-driven state applier for Python/FastAPI integration

๐Ÿ“Š System Architecture

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                   PRESENTATION & VISUALISATION LAYER                     โ•‘
โ•‘                                                                          โ•‘
โ•‘   React 19 + Tailwind v4  (Vite ยท port 5173)                            โ•‘
โ•‘   HomeDashboard ยท Detailed Insights ยท Manual Override                    โ•‘
โ•‘                                                                          โ•‘
โ•‘   Unity WebGL 3D Scene  (src/agritwin_gh/build/ ยท Git LFS)              โ•‘
โ•‘   10 Actuator Controllers ยท 15 Crop Plants ยท TimeOfDay Environment       โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฆโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
                           โ•‘ HTTP + JSON  (CORS ยท port 8000)
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฉโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                         FASTAPI APPLICATION LAYER                        โ•‘
โ•‘                                                                          โ•‘
โ•‘   Route Handlers  (thin adapters โ€” no DB / no MPC logic)                โ•‘
โ•‘   dt ยท actuators ยท weather ยท intelligence ยท resources ยท media ยท system   โ•‘
โ•‘                        โ–ผ                                                 โ•‘
โ•‘   Service Layer  (business logic)                                        โ•‘
โ•‘   DashboardService ยท ControlService ยท LoopService ยท MediaService         โ•‘
โ•‘                        โ–ผ                                                 โ•‘
โ•‘   RuntimeStore  (in-process singleton โ€” last DT step result)            โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฆโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
                           โ•‘ import only (no HTTP)
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฉโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                     DIGITAL TWIN ยท MPC ENGINE LAYER                      โ•‘
โ•‘                                                                          โ•‘
โ•‘   Input Provider              DTLoop (Orchestrator)                      โ•‘
โ•‘   โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€               โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€                       โ•‘
โ•‘   CSVInputProvider  โ”€โ”€โ–บ every 5 min:  DTEngine  (ARX physics)     โ•‘
โ•‘   SyntheticInputProvider       every 15 min: MPCSolver (SLSQP/CVXPY)    โ•‘
โ•‘   (swap with no loop change)  every 30 min: Image refresh hook          โ•‘
โ•‘                                                                          โ•‘
โ•‘   ML Inference Pipelines  (called per DT step)                          โ•‘
โ•‘   โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€                         โ•‘
โ•‘   Disease Classifier      EfficientNetB0  โ€” 6-class leaf disease        โ•‘
โ•‘   Growth Stage Classifier EfficientNetB3  โ€” 6-stage plant growth        โ•‘
โ•‘   Disease Progression     LSTM / GRU      โ€” 24h severity + trend        โ•‘
โ•‘   Growth Progression      Multi-task LSTM โ€” stage + hours to transition โ•‘
โ•‘   Weather Forecast        Chronos + XGBoost + LSTM โ€” 24h / 48h climate  โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฆโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
                           โ•‘ read / write
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฉโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                           DATA LAYER                                     โ•‘
โ•‘                                                                          โ•‘
โ•‘   PostgreSQL + TimescaleDB     Hypertables: weather ยท indoor conditions  โ•‘
โ•‘   MinIO  (S3-compatible)       Image store: disease scans ยท growth imgs  โ•‘
โ•‘   SQLite  (dev / no-DB mode)   Monthly snapshots + fallback storage      โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Multi-rate DT cadence:

Rate Period What happens
DT physics step every 5 min ARX model advances greenhouse state by one timestep
MPC re-solve every 15 min SLSQP optimiser recomputes optimal actuator trajectory
Image refresh every 30 min Disease / growth image observation hook fires

AgriTwin-GH is a fully software-defined system โ€” no physical hardware required. The SyntheticInputProvider generates realistic greenhouse conditions from a diurnal weather model, while the DatabaseInputProvider swaps in live PostgreSQL data for production use. Swapping providers does not change the loop, the MPC solver, or any ML model.


๐Ÿ—„๏ธ Data Infrastructure

Database Schemas

File Description
database/schema/timeseries_data.sql Sensor hypertables โ€” weather and indoor greenhouse time-series
database/schema/image_metadata.sql Image object store metadata โ€” disease scans and growth stage images
database/schema/monthly_snapshots.sql Monthly aggregation tables โ€” monthly_snapshots and monthly_actuator_energy

Monthly Snapshot Quick Enable

# Windows PowerShell
$env:AGRITWIN_MONTHLY_DB = "1"
python main.py
# Linux / macOS
AGRITWIN_MONTHLY_DB=1 python main.py

Apply the schema first (SQLite auto-creates on first ingest; PostgreSQL requires explicit apply):

psql -d agritwin_db -f database/schema/monthly_snapshots.sql

Seed mock data and inspect:

python scripts/seed_monthly_mock.py       # inserts 3 rows across 2 crop cycles
python scripts/show_monthly_snapshots.py  # compact table view
python scripts/show_monthly_snapshots.py --detail  # full per-row breakdown

See Monthly Snapshot Reference for the full schema, field reference, and API integration.


๐Ÿค– ML Models

Model Architecture Task Guide
Disease Classifier EfficientNetB0 6-class leaf disease detection โ€” Early Blight, Late Blight, Leaf Mold, Powdery Mildew, Septoria Leaf Spot, Spider Mites + Healthy โ†’
Growth Stage Classifier EfficientNetB3 6-stage growth classification โ€” Seedling โ†’ Early Vegetative โ†’ Flowering Initiation โ†’ Flowering โ†’ Unripe โ†’ Ripe, with TTA support โ†’
Growth Progression Model Multi-task LSTM Simultaneously predicts current stage, next stage, hours until stage transition, and 24h/48h transition probability from hourly sensor time-series โ†’
Disease Progression Model Baseline + LSTM/GRU Per-disease current presence, 24h infection severity, and 24h trend labels (absent, emerging, reducing, stable, worsening) from hourly sensor time-series โ†’
Greenhouse Weather Forecast Chronos + XGBoost + LSTM Ensemble 24h/48h indoor climate forecasting feeding the digital twin and MPC control policies โ†’

๐ŸŽฎ Model Predictive Control (MPC)

โ†’ MPC Complete Guide


๐Ÿ”„ Digital Twin Closed-Loop

A production-grade real-time closed-loop layer (realtime_core.py) that connects the PostgreSQL database, all AI inference pipelines, and the MPC solver into a single autonomous control cycle:

โ†’ DT Closed-Loop Guide ยท Streaming Guide


๐Ÿ› ๏ธ Technology Stack

Layer Technologies
Language & Runtime Python 3.13 ยท UV (package manager & venv)
Backend FastAPI ยท Uvicorn (ASGI) ยท SQLAlchemy
ML / DL TensorFlow ยท Keras ยท PyTorch ยท Chronos ยท LightGBM ยท XGBoost ยท CatBoost ยท Scikit-learn
Data NumPy ยท Pandas ยท PyArrow ยท Statsmodels
Visualization Matplotlib ยท Seaborn
Database PostgreSQL 15 ยท TimescaleDB ยท SQLite
Object Storage MinIO (S3-compatible)
Frontend React 19 ยท Tailwind CSS v4 ยท Vite
3D Scene Unity (WebGL build) ยท C#
Infra / DevOps Git LFS ยท MkDocs Material ยท Docker (MinIO)
Notebooks Jupyter ยท Feature demo notebooks (01โ€“06)

๐Ÿš€ Quick Start

Prerequisites

Requirement Purpose Link
Python 3.13 Backend runtime python.org
Node.js LTS React frontend nodejs.org
Git LFS Unity WebGL binary tracking git-lfs.com
PostgreSQL 15+ (optional) Production time-series storage postgresql.org
MinIO (optional) Image object storage min.io

Installation

git lfs install
git clone https://github.com/arjun-christopher/AgriTwin-GH.git
cd AgriTwin-GH
python setup.py

setup.py automates 9 steps: installs uv, initialises the project, creates the virtual environment, syncs all Python dependencies, creates .env from .env.example, creates config/settings.local.yaml, ensures all required data and log directories exist, runs npm install for the React frontend, and optionally downloads the Kaggle dataset. A formatted manual-steps guide is printed at the end for everything that requires human action (PostgreSQL, MinIO, API keys, CUDA).

Manual alternative:

uv venv && uv sync
.venv\Scripts\activate          # Windows
# source .venv/bin/activate     # macOS / Linux

Running the Application

# Full stack โ€” FastAPI backend + Vite dev server (auto-launched)
python main.py

# Backend only
uvicorn main:app --reload --host 0.0.0.0 --port 8000

# Interactive notebook demos
jupyter notebook feature_demos/

๐Ÿ“š Documentation

Guide Description
Feature Demos Guide Walkthrough of all 6 interactive notebooks
Database Reference Schema, queries, and time-series data guide
PostgreSQL Quick Start Database setup and data loading
Image Storage Setup MinIO + PostgreSQL image pipeline
Monthly Snapshot Reference Per-month aggregated sensor, resource, MPC, and disease summary โ€” schema, API, scripts
Indoor Greenhouse Dataset Synthetic dataset generation methodology
Disease Classification EfficientNetB0 leaf disease model
Growth Stage Classification EfficientNetB3 growth stage model
Growth Progression Model Multi-task LSTM for stage transition forecasting from sensor time-series
Disease Progression Model Baseline + LSTM/GRU disease progression forecasting for per-disease presence, 24h severity, and 24h trend labels
Weather Forecast Model Chronos + XGBoost + LSTM ensemble for 24h/48h greenhouse climate forecasting
MPC Complete Guide Model predictive control module: solver tuning, constraint strategy, cost function design, and end-to-end evaluation
DT Closed-Loop Guide Real-time DBโ†’AIโ†’MPCโ†’DB closed-loop layer: architecture, data flow, cadence, and CLI runner reference
DT Loop Streaming Guide Per-step data flow, log format walkthrough, cadence reference, AI model refresh, and FAQ
FastAPI Backend & API Guide All 15 REST endpoints, layer-by-layer architecture, runtime state, override mechanism, 3D fields, and testing
Frontend UI Reference React dashboard โ€” pages, components, and live API data-binding contract
Greenhouse 3D Model Reference Unity scene architecture โ€” C# controllers, GameObject hierarchy, JSON state schema, and FastAPI integration guide
Disease Progression Synthetic Dataset Technical documentation for the synthetic disease progression dataset โ€” generation methodology, disease dynamics, and feature schema
Deployment Guide MkDocs documentation site setup

๐Ÿ“– View Full Documentation โ†’


๐ŸŒ FastAPI Backend

A FastAPI + Uvicorn server that powers the digital twin system, exposing REST endpoints for real-time environmental monitoring, ML inference, actuator control, and system diagnostics. Includes interactive API documentation and runtime state management.

โ†’ FastAPI Backend & API Guide โ€” Full endpoint reference, architecture, and usage

.venv\Scripts\Activate.ps1
python main.py   # โ†’ FastAPI on http://localhost:8000

๐ŸŒฟ 3D Greenhouse Model

A Unity-based 3D greenhouse scene that mirrors the live digital twin state in real time via a JSON-driven central controller. The compiled WebGL build lives in src/agritwin_gh/build/ and is tracked in this repository via Git LFS (the Brotli-compressed binary bundles).

Component Description
GreenhouseStateApplier Central C# orchestrator โ€” reads a JSON state file (or /api/dt/state FastAPI response), detects changes, and dispatches to all sub-controllers automatically
10 Actuator Controllers Fluorescent lights, heater, humidifier, window fan, vent, and water tank โ€” each with status indicators, particle effects, and audio
15 Crop Plants Each with a CropStageController (6-stage visual model swap: Seedling โ†’ Ripe) and a CropHealthIndicator (green / yellow / red RGB health lights with blinking)
Environment System TimeOfDayController drives skybox, directional light, fog, and night lights; disease risk scores are mapped to visual health states

The full Unity Editor source project โ€” all C# scripts, scene files, prefabs, FBX models, skyboxes, and audio โ€” lives in unity_module/ at the repository root. Open it in Unity 2022 LTS or Unity 6 to edit, extend, or re-export the WebGL scene. The WebGL build at unity_module/build/ mirrors the deployable artefact served by FastAPI at src/agritwin_gh/build/. See the Greenhouse 3D Model Reference for the complete source project layout and step-by-step opening instructions.

src/agritwin_gh/build/
โ”œโ”€โ”€ Build/
โ”‚   โ”œโ”€โ”€ build.data.br          # Scene + asset data      (~18 MB, Git LFS)
โ”‚   โ”œโ”€โ”€ build.wasm.br          # Unity runtime (WASM)    (~ 6 MB, Git LFS)
โ”‚   โ”œโ”€โ”€ build.framework.js.br  # JS framework loader     (Git LFS)
โ”‚   โ””โ”€โ”€ build.loader.js        # Bootstrap loader
โ”œโ”€โ”€ StreamingAssets/
โ”‚   โ””โ”€โ”€ greenhouse_state.json  # Default DT state payload consumed by the scene
โ”œโ”€โ”€ TemplateData/              # WebGL template assets (CSS, icons, logos)
โ””โ”€โ”€ index.html                 # Entry point โ€” open in browser or embed in FastAPI

โ†’ Greenhouse 3D Model Reference


๐Ÿ’ป Frontend Dashboard

A React 19 + Tailwind v4 single-page application providing a real-time operator interface for the greenhouse digital twin.

Page Description
HomeDashboard Live sensor metrics strip, crop stage progression track, actuator status grid, camera frames, resource usage and cost summary
Detailed Insights Full indoor sensor readings with optimal ranges, per-pathogen disease risk bars, outdoor weather + 24h forecast, rolling stage and leaf-scan image galleries, growth stage transition spotlight
Manual Override Live/override mode toggle, editable growth stage + day-in-stage + start time, per-actuator on/off toggles, apply and reset-all actions

All pages make real fetch() calls to http://localhost:8000/api/* via src/agritwin_gh/frontend/src/services/api.js.

cd src/agritwin_gh/frontend
npm install
npm run dev      # โ†’ http://localhost:5173

โ†’ Frontend UI Reference


๐Ÿ“‚ Repository Structure

AgriTwin-GH/
โ”œโ”€โ”€ setup.py                    # 9-step interactive setup โ€” uv, venv, deps, .env, npm, Kaggle
โ”œโ”€โ”€ main.py                     # FastAPI entry point (Uvicorn + DT loop + Vite dev server)
โ”œโ”€โ”€ config/                     # App configuration (settings.yaml, settings.local.yaml, MPC config)
โ”œโ”€โ”€ feature_demos/              # Interactive Jupyter notebook demonstrations (01โ€“06)
โ”œโ”€โ”€ notebooks/                  # ML training notebooks (disease & growth stage classifiers)
โ”œโ”€โ”€ scripts/                    # Utility and data pipeline scripts
โ”‚   โ”œโ”€โ”€ load_timeseries_to_postgres.py  # Load CSV sensor data into PostgreSQL / TimescaleDB
โ”‚   โ”œโ”€โ”€ upload_images_to_minio.py       # Bulk image upload to MinIO buckets
โ”‚   โ”œโ”€โ”€ seed_monthly_mock.py            # Seed 3 monthly snapshot rows for demo
โ”‚   โ”œโ”€โ”€ show_monthly_snapshots.py       # Display monthly snapshot table (--detail, --cycle)
โ”‚   โ”œโ”€โ”€ run_realtime_loop.py            # CLI runner for the DT closed-loop
โ”‚   โ””โ”€โ”€ classify_input_leaf.py          # Run leaf disease classifier on an input image
โ”œโ”€โ”€ database/
โ”‚   โ””โ”€โ”€ schema/
โ”‚       โ”œโ”€โ”€ timeseries_data.sql         # Sensor hypertables (weather + indoor conditions)
โ”‚       โ”œโ”€โ”€ image_metadata.sql          # MinIO image metadata index
โ”‚       โ””โ”€โ”€ monthly_snapshots.sql       # Monthly aggregation tables
โ”œโ”€โ”€ src/agritwin_gh/            # Core Python library โ€” API, models, services, utils
โ”‚   โ”œโ”€โ”€ api/                    # FastAPI routers and RuntimeStore
โ”‚   โ”œโ”€โ”€ core/                   # Digital twin physics, MPC solver, realtime loop
โ”‚   โ”œโ”€โ”€ models/                 # ML model wrappers and inference pipelines
โ”‚   โ”œโ”€โ”€ services/               # Database, MinIO, and sensor service layers
โ”‚   โ”œโ”€โ”€ frontend/               # React 19 + Tailwind v4 dashboard SPA
โ”‚   โ””โ”€โ”€ build/                  # Unity WebGL greenhouse scene (Git LFS for .br binaries)
โ”‚       โ”œโ”€โ”€ Build/              # Brotli-compressed WASM + data bundles (LFS-tracked)
โ”‚       โ”œโ”€โ”€ StreamingAssets/    # greenhouse_state.json โ€” default DT state for the 3D scene
โ”‚       โ””โ”€โ”€ TemplateData/       # WebGL template CSS, icons, and Unity branding
โ”œโ”€โ”€ tests/                      # Unit and smoke tests
โ”œโ”€โ”€ unity_module/               # Full Unity 3D source project โ€” open in Unity to edit the greenhouse scene
โ”‚   โ”œโ”€โ”€ Assets/                 # Scenes, C# scripts, prefabs, FBX models, skyboxes, audio, textures
โ”‚   โ”œโ”€โ”€ Packages/               # Unity package manifest (URP 17.x, Input System, GLTFUtility โ€ฆ)
โ”‚   โ”œโ”€โ”€ ProjectSettings/        # Unity project config โ€” graphics, physics, audio, URP pipeline
โ”‚   โ””โ”€โ”€ build/                  # WebGL export โ€” Build/*.br binaries tracked via Git LFS
โ”œโ”€โ”€ data/                       # Raw, processed, and external datasets
โ”‚   โ”œโ”€โ”€ raw/                    # Unprocessed source files
โ”‚   โ”œโ”€โ”€ processed/              # Cleaned and feature-engineered outputs
โ”‚   โ””โ”€โ”€ external/               # Kaggle dataset โ€” disease images, growth stages, weather CSV
โ””โ”€โ”€ docs/                       # MkDocs documentation source files

๐Ÿ“„ Publication

The AgriTwin-GH framework has been peer-reviewed and published in the International Journal of All Research Education and Scientific Methods (IJARESM).

Field Details
Title AgriTwin-GH: Agricultural Digital Twin for Smart Greenhouse Horticulture of Tomato Cultivation
Authors Amala Margret. A, Dr. V. Govindasamy, Arjun Christopher, Vantapati Raja Rajeswari, Bhuvanalakshmi. J. P
Journal International Journal of All Research Education and Scientific Methods (IJARESM)
ISSN 2455-6211
Volume / Issue Volume 14, Issue 4, April 2026
DOI 10.56025/IJARESM.140426327
Full Text Read the paper
PDF (this repo) AgriTwin-GH - Journal Paper - IJARESM.pdf

๐Ÿ”ฌ Research Areas


๐Ÿ“œ License

โš ๏ธ PROPRIETARY LICENSE

This project is released under a restrictive proprietary license. All rights are reserved.

You are NOT permitted to:

For licensing inquiries or permission to use this Software, contact the copyright holder.

See LICENSE file for the complete terms and conditions.


**[๐Ÿ“– View Live Documentation](https://arjun-christopher.github.io/AgriTwin-GH/)**