## 💡 Inspiration Across the globe, agricultural communities face an invisible crisis. On commercial and family farms spanning 250 hectares, human eyes and standard farm inspections cannot detect localized subsoil defects before planting. A 25-hectare pocket of high soil salinity, subsoil compaction, or severe nitrogen depletion looks identical to fertile topsoil.
When crops inevitably fail to establish on those stunted patches, farmers suffer devastating financial losses—up to $65,000 in wasted seeds, fuel, and labor. Even worse is the environmental fallout: desperate to salvage yields, farmers blanket-spray synthetic fertilizers across the entire 250 hectares. Because the stunted, damaged root zones cannot absorb the excess nitrogen, over 40% of the fertilizer leaches directly into groundwater aquifers and local waterways, causing toxic algal blooms, aquatic dead zones, and massive carbon emissions.
Commercial solutions exist, but they are locked behind a steep economic paywall: specialized Near-Infrared (NIR) multispectral drone cameras cost upwards of $4,000 to $8,000, pricing out smallholder and family farmers. We built TerraPulse to demolish this hardware paywall and democratize precision farmland diligence for every farmer and agricultural lender on Earth.
## 🚀 What It Does TerraPulse is an autonomous geospatial farmland diligence and precision cultivation copilot that operates with zero paid API keys and runs on any device:
- Zero-NIR Visible Optical Sensing: Farmers or land appraisers drop a GPS pin on an interactive satellite map and upload an ordinary RGB photo taken from any consumer smartphone or drone.
- Instant Computer Vision Decomposition: Our OpenCV engine analyzes visible-spectrum optical physics to isolate chlorotic, stunted crop patches and calculate canopy coverage percentages.
- Real-Time Agrometeorological Telemetry: In under two seconds, the system streams live 3-depth volumetric soil moisture (0–7 cm surface, 7–28 cm rootzone, 28–100 cm deep subsoil), reference evapotranspiration ($ET_0$), and precipitation forecasts from open global satellite models.
- Geospatial Agro-Pedology Modeling: Continuously maps coordinates to global soil taxonomy orders (Mollisols, Inceptisols, Entisols) to establish soil pH, nitrogen, and organic carbon baselines.
- Autonomous Agronomic Diligence Dossier: Delivers an objective Farmland Viability Score (0–100), risk ratings, and an actionable precision zonal fertilizer schedule (e.g., Agricultural Gypsum for alkaline soils, Lime for acidic zones, Potash and Biochar for drought stress) to halt blanket chemical dumping.
- 1-Click Bank-Ready PDF Export: Formats comprehensive diligence dossiers for agricultural loans, crop insurance underwriting, and environmental grants.
## 🛠️ How We Built It TerraPulse is built on an asynchronous, serverless full-stack architecture:
- Computer Vision Engine (
OpenCV 5.0&NumPy): Because standard cameras lack near-infrared sensors, we implemented visible-spectrum vegetative index decomposition: $$\text{VARI} = \frac{\text{Green} - \text{Red}}{\text{Green} + \text{Red} - \text{Blue}}$$ $$\text{ExG} = 2 \cdot \text{Green} - \text{Red} - \text{Blue}$$ Using Otsu dynamic thresholding and morphological contour extraction, the pipeline isolates chlorotic anomalies, delineates canopy boundaries, and renders radiometric Viridis stress heatmaps. - Weather & Hydrology Telemetry Engine (
Open-Meteo REST): Streams hourly meteorological and hydrological data directly from ECMWF, NOAA GFS, and DWD models without requiring user API keys. Built with safe null-tolerant array parsing routines to handle forecast timesteps across international timezones. - Geospatial Pedology Model: Derives cation-exchange capacity, soil pH, and organic matter across macro-regions and custom pin-drops using continuous spatial coordinate interpolation.
- Autonomous Agronomy Engine: Synthesizes vision metrics, moisture deficit, and soil chemistry into stoichiometric remediation plans according to agronomic chemistry standards.
- Frontend Design System: Built with vanilla HTML5, modern CSS3, and ES6 JavaScript following Apple and Linear
design principles—featuring an ultra-clean
#F5F5F7light canvas, responsive Leaflet.js mapping with ArcGIS satellite layers, and dual-spectrum image comparison. - Cloud Production Deployment: Hosted serverless on Vercel (
@vercel/pythonengine) and synchronized with GitHub.
## 🧗 Challenges We Ran Into
- Extracting Vegetative Health Without Near-Infrared (NIR): Standard cameras capture only Red, Green, and Blue bands. Standard NDVI math fails without NIR. We solved this by implementing atmospherically resistant visible formulas ($\text{VARI}$ and $\text{ExG}$), which leverage blue-band scattering correction to isolate chlorophyll density from visible light alone.
- Zero-Key Telemetry Reliability: Public meteorological streams often return
Nonefor unpopulated hourly forecast timesteps. We engineered robust safe-aggregation parsers (_safe_first,_safe_mean,_safe_sum) that guarantee uninterrupted execution without server crashes. - Geospatial Soil Chemistry Continuity: When international soil databases experience high-latency timeouts, agricultural applications typically crash or revert to static placeholder values. We engineered a regional pedology classification model that maps coordinates to FAO soil orders with coordinate-hash micro-jitter, ensuring every parcel on Earth produces distinct, realistic soil chemistry.
## 🏆 Accomplishments That We're Proud Of
- Democratizing $4,000 Technology: Proving that advanced crop anomaly detection and soil moisture profiling can be achieved using an ordinary smartphone or drone camera combined with open satellite telemetry.
- Zero Paid API Keys & Zero Maintenance: The entire application runs out of the box with zero configuration, zero subscription fees, and zero API credentials required from the user.
- Sub-2-Second Pipeline: The complete multi-modal analysis—image decomposition, satellite fetching, pedology modeling, and agronomic reasoning—executes in under 2 seconds.
- A Pure, Purposeful Interface: Designed a clean, distraction-free light-mode user experience without artificial "AI slop" or glowing gimmicks, prioritizing clarity and data legibility for farmers and loan officers.
## 📚 What We Learned
- Deepened our knowledge of agrometeorological modeling, specifically the FAO-56 Penman-Monteith method for calculating reference evapotranspiration ($ET_0$) and vapor pressure deficits.
- Mastered visible-spectrum optical physics and matrix manipulation in OpenCV for agricultural remote sensing.
- Explored agricultural chemistry, specifically the stoichiometric displacement of sodium ions in saline-sodic soils using Agricultural Gypsum ($CaSO_4$) versus elemental sulfur for pH buffering.
## 🔮 What's Next for TerraPulse
- Multispectral Drone Video Stream Processing: Integrating real-time video feeds from autonomous drone flight paths to generate live, stitched field health maps on the fly.
- IoT Soil Sensor Telemetry Integration: Enabling LoRaWAN-connected in-ground moisture and NPK probe synchronization for continuous ground-truth calibration.
- Carbon Credit Verification Pipeline: Partnering with carbon registries to turn verified biochar and regenerative soil remediation practices into tradeable carbon offset credits for participating farmers.
Built With
- computer-vision
- css3
- environmental-science
- fastapi
- gis
- html5
- javascript
- leaflet.js
- numpy
- open-meteo
- opencv
- precision-agriculture
- python
- remote-sensing
- rest-api
- vercel
Log in or sign up for Devpost to join the conversation.