AI / MACHINE LEARNING / AGRITECH•INTERNSHIP PROJECT · 2025

Roots.

AI-powered crop recommendation system.

A full-stack agricultural recommendation application that combines environmental conditions, live weather data, and machine learning to suggest optimal crops for any selected geographical location.

View source codeLive applicationPython · Scikit-learn · Flask · React · TypeScript · Open-Meteo
AI/ML Internship · ICT Academy of Kerala · Technopark, Thiruvananthapuram (1 Month)

# 01 // FULL-STACK SYSTEM ARCHITECTURE

01 FRONTEND

React & TypeScript

Geolocation · Weather UI · Results

02 API LAYER

Flask REST API

Validation · Weather cache · Routes

03 ML MODEL

Scikit-Learn Model

Random Forest · 7 Soil/Climate inputs

04 EXTERNAL DATA

Open-Meteo APIs

Live metrics + 1991–2020 rainfall

The frontend captures location coordinates and soil properties, the Flask service aggregates real-time temperature, humidity, and historical rainfall via Open-Meteo APIs, and feeds the standardized 7-feature vector into a serialized Random Forest classifier to return ranked agricultural recommendations.

# 02 // FOUR-STEP RECOMMENDATION PIPELINE

01 — Location Selection

Users search by city/region or activate device geolocation. The application resolves coordinates and manages past location history for rapid re-evaluation.

Browser GeolocationLocation History
02 — Weather Data Extraction

The Flask service fetches real-time temperature and relative humidity alongside historical precipitation archives (1991–2020) to synthesize an annualized rainfall index.

Open-Meteo IntegrationIn-Memory Cache
03 — Soil Parameter Inputs

Accepts essential chemical soil properties: Nitrogen (N), Phosphorus (P), Potassium (K), and soil pH levels, using regional baseline estimates with support for manual input override.

NPK RatiospH ChemistryPrototype Defaults
04 — Crop Prediction & Fallback

Evaluates the trained model to predict the top 3 recommended crops with probabilistic confidence scores, falling back to a deterministic agricultural heuristic if the ML inference fails.

Top-3 ProbabilityCrop MetadataRule-Based Fallback

# 03 // ML MODEL & FEATURE SPECIFICATION

The core predictive engine is a Random Forest Classifier trained in Google Colab on multi-class crop records (cropsdata.csv) and serialized to a .pkl artifact for low-latency serving in Flask. The model evaluates seven environmental vectors:

SOIL NUTRIENT

Nitrogen (N)

Vegetative leaf growth ratio

SOIL NUTRIENT

Phosphorus (P)

Root & seed development

SOIL NUTRIENT

Potassium (K)

Disease & drought resistance

SOIL CHEMISTRY

Soil pH

Nutrient availability index

CLIMATE

Temperature

Live ambient reading (°C)

CLIMATE

Humidity

Relative moisture (%)

PRECIPITATION

Annual Rainfall

Derived historical precipitation estimate (mm)

# 04 // CHALLENGES & PRACTICAL LEARNINGS

Bridging ML to Full-Stack Web

Transitioned a standalone Colab notebook into an interactive web app. Engineered input verification in Flask, handled serialized model deserialization, and formatted multi-class probabilities into clean, ranked JSON responses for React.

Harmonizing Environmental Data

Live APIs don't supply annual rainfall on demand. Solved by querying Open-Meteo's historical archives (1991–2020) and deriving annualized precipitation norms, coupled with in-memory caching to curb rate limits.

Transparent Data Boundaries

A key internship insight was avoiding false accuracy claims. Soil values use state-level baseline defaults rather than physical field sensors; the UI clearly displays when default assumptions or rule-based fallbacks are active.

Internship Experience & Scope

ICT Academy of Kerala

Roots was developed as part of a focused 1-month AI/ML internship at Technopark, Thiruvananthapuram. The project emphasized connecting machine learning models to live web services, handling data provenance, and turning raw predictions into accessible, actionable tools for everyday users.