How basvapriyanka/ai-assisted-climate-change-mitigation-tool works
Project type and purpose
• This is a full-stack, data-driven web application with an embedded ML model.
• Purpose: provide an AI-Assisted Climate Change Mitigation Tool that analyzes time-series climate data (CSV) using a pre-trained LSTM model, and exposes results via a web UI.
File structure
• Data & model artifacts:
• Beutenberg_2023_7-12.csv, Beutenberg_2024_1-11.csv (raw time-series inputs)
• model.h5 (pre-trained LSTM)
• scaler.pkl (data preprocessor)
• Notebook: LSTM_Climate.ipynb (exploration, training, experimentation)
• Backend: app.py (Flask/FastAPI server exposing model inference endpoints)
• Frontend:
• index.html, index (1).html
• index.js (AJAX calls to backend)
• reset.css, style.css (styling)
• README.md describes purpose; no service orchestration files (Docker, k8s).
Architecture components
a. Frontend (Browser)
• index.html + CSS for layout
• index.js implements HTTP requests to the backend for predictions and history charts.
b. Backend (Python App)
• app.py loads scaler.pkl and model.h5 on startup
• Exposes REST endpoints (e.g., /predict, /history)
• Reads raw CSV or incoming data, applies scaler, runs LSTM inference, returns JSON.
c. Data Store
• CSV files on disk act as data sources for historical inputs.
• Optionally swap in a database in future.
d. Machine Learning
• LSTM model (.h5) and scaler (.pkl) encapsulate the core ML logic.
e. User’s Browser & External Services
• Browser consumes REST API, renders results (charts, tables).
• No external cloud services currently.
Relationships & interactions
• User → Frontend: loads index.html, interacts with UI controls.
• Frontend → Backend: AJAX calls to app.py REST endpoints.
• Backend → ML Model: app.py loads and queries model and scaler for predictions.
• Backend → Data Files: reads CSV for historical data, writes logs as needed.
• Backend → Frontend: returns JSON payloads.
Architectural patterns & design principles
• MVC-lite:
• View: HTML/CSS/JS
• Controller: index.js triggering HTTP
• Model: Python LSTM and scaler
• Separation of concerns: data processing and business logic in backend; presentation in frontend.