Inspiration

Over 56% of humanity lives in cities today, a figure projected to exceed 70% by 2050. Nowhere is the friction between rapid urbanization and environmental crisis more visceral than in Delhi (National Capital Territory). Every winter, the city awakens to toxic smog where (\text{PM}{2.5}) and (\text{PM}{10}) concentrations regularly exceed 15 to 25 times World Health Organization safety thresholds. In summer, the Urban Heat Island (UHI) effect turns concrete blocks into thermal ovens, pushing land surface temperatures past 45°C.

Scientific evidence proves that strategically placed urban greenspaces, tree corridors, and dense Miyawaki micro-forests reduce localized temperatures by 3°C to 5°C, filter toxic particulates, and restore civic health. However, municipal planners face a dilemma: Where should new green infrastructure be prioritized to maximize human health without colliding with critical civic infrastructure?

Macro satellite rasters (100m–1km) lack the ground-truth resolution to detect whether a parcel is an asphalt parking lot, active water canal, or vacant plantable ground. We built Paryavaran to solve this: an end-to-end spatial intelligence engine that combines multi-criteria GIS telemetry with an autonomous OpenCV 5 Agentic Computer Vision loop running on AWS.


What it does

Paryavaran discretizes Delhi into 42,300 spatial micro-zones (250m × 250m) and computes an environmental necessity score while actively evaluating aerial micro-zones with computer vision.

  1. Multi-Criteria Telemetry: Integrates ground-truth air quality from Central Pollution Control Board (CPCB) monitoring stations, WorldPop demographic density, NASA MODIS summer thermal bands, and Google Open Buildings footprints.
  2. OpenCV 5 Vision Analysis: When a micro-zone is inspected, the system analyzes high-resolution aerial imagery using OpenCV 5:
    • Smog Dehazing: Contrast-Limited Adaptive Histogram Equalization (cv2.createCLAHE) in LAB color space strips atmospheric aerosol haze.
    • Dual-Space Canopy Extraction: Combines HSV thresholding with the Normalized Excess Green Index ((\text{ExG} = 2G - R - B)) to segment tree crowns without asphalt shadow errors.
    • Soil Parcel Segmentation: Identifies unpaved bare ground and uses cv2.findContours and cv2.contourArea to extract continuous plantable areas in square meters.
    • Structural Density: Computes architectural congestion using cv2.Canny.
  3. Agentic Perception-Decision-Action Loop: OpenCV 5 visual evidence directly drives autonomous planning actions:
    • Miyawaki Micro-Forest Branch: Continuous bare soil (\ge 5,000\,\text{m}^2) triggers automated planting blueprints, sapling quotas, and native species reservation (Neem, Peepal, Amaltas).
    • Rooftop Corridor Branch: Zones with (\ge 80\%) impervious concrete dynamically pivot to rooftop garden subsidies and vertical living walls.
    • Canopy Protection Branch: Zones where computer vision verifies dense mature canopy trigger conservation audits.
    • Water Exclusion Branch: Surface water bodies are strictly zeroed out and protected under riverine buffer policies.

How we built it

  • Computer Vision: Built with OpenCV 5 (cv2), leveraging LAB-space CLAHE, HSV segmentation, ExG indices, Canny edge detection, and morphological contours.
  • Agentic Decision Loop: Developed a stateful Perception-Decision-Action cycle in Python that inspects visual findings and dynamically adjusts mathematical priorities.
  • Spatial Processing: Discretized Delhi NCT coordinates using the spherical Haversine distance formula: $$d = 2R \arcsin \left( \sqrt{\sin^2\left(\frac{\Delta \phi}{2}\right) + \cos(\phi_1)\cos(\phi_2)\sin^2\left(\frac{\Delta \lambda}{2}\right)} \right)$$
  • Spatial Interpolation: Implemented an Inverse Distance-Weighted K-Nearest Neighbors (KNN) model across official CPCB telemetry: $$\hat{Z}(p) = \frac{\sum_{i=1}^{k} w_i Z(s_i)}{\sum_{i=1}^{k} w_i}, \quad \text{where } w_i = \frac{1}{\text{dist}(p, s_i)^2}$$
  • Cloud Infrastructure on AWS:
    • Automated CloudFormation template (aws-deploy.yaml) provisioning an Amazon EC2 (t3.medium) instance running Amazon Linux 2023 resolved dynamically via AWS SSM Parameter Store.
    • Multi-worker Gunicorn WSGI web server managed by an auto-restarting Systemd daemon serving the interactive Plotly Dash frontend.

Challenges we ran into

  1. Atmospheric Smog Distorting Aerial Segmentation: Delhi's heavy particulate haze created false positives in color thresholds. We resolved this by applying CLAHE on the Luminance channel in LAB color space before any segmentation.
  2. Shadow Artifacts in Urban Canyons: Dark building shadows frequently mimicked vegetation or water bodies. By coupling HSV color thresholding with the Normalized Excess Green index ((\text{ExG})), our OpenCV 5 pipeline successfully rejected asphalt shadows.
  3. Haversine Distance Scaling Across 42,300 Zones: Brute-force nearest-neighbor searches took over 4 hours. We re-engineered the spatial queries using Scikit-Learn BallTree in radian Haversine space, reducing runtime from 4 hours to under 90 seconds.

Accomplishments that we're proud of

  • Built a production-grade, closed Perception-Decision-Action loop where OpenCV 5 computer vision directly dictates downstream municipal resource allocation.
  • Discretized an entire global megacity into 42,300 micro-zones and made it interactively explorable in real time on AWS.
  • Created zero-cost open data ingestion pipeline with 100% test coverage across all OpenCV 5 agentic decision branches.

What we learned

  • How to integrate low-level OpenCV 5 morphological and color-space operators into high-level agentic decision frameworks.
  • The power of combining macro satellite telemetry (raster grids) with micro optical inspection (aerial computer vision) to eliminate zoning errors.
  • Designing self-healing cloud deployments on Amazon Linux 2023 with Systemd and AWS SSM Parameter Store.

What's next for Paryavaran

  • Integrating live high-resolution Sentinel-2 and drone feeds via automated AWS S3 event triggers.
  • Extending OpenCV 5 edge models to onboard camera systems on municipal inspection drones for real-time tree health and canopy survival auditing.

Built With

Share this project:

Updates

Submission history