EcoPulse : Urban Intelligence and Public Preparedness API

EcoPulse is an automated urban intelligence API and public safety pipeline designed to ingest unstructured citizen incident reports, classify environmental hazards using zero-shot natural language processing, and generate location-specific emergency advisories in real time.


1. Main Challenge and Track Alignment

Main Challenge

Metropolitan areas face severe environmental and infrastructural challenges, including toxic seasonal smog, municipal waste accumulation, water contamination, and traffic noise. Citizen reports regarding these hazards are typically received as unstructured text via various public channels. Municipal bodies often lack automated pipelines to rapidly categorize these reports, evaluate threat severity, and broadcast actionable public safety guidance to affected communities.

main

Track Alignment

This project aligns directly with the AI-Supported Assessment and Resilience Informatics track. By leveraging machine learning models for real-time text classification and natural language generation, the system automates the processing of public reports and accelerates municipal hazard response.


2. Project Description

Problem Statement

Unstructured complaints submitted by citizens require manual review, causing delays in identifying localized environmental risks. Without immediate severity scoring and rapid public communication, citizens remain exposed to environmental hazards such as severe air quality drops or contaminated water lines before official municipal interventions occur.

Solution Overview

EcoPulse implements an asynchronous RESTful API built with FastAPI that processes raw text input from citizen submissions. The backend routes incoming text through a two-stage artificial intelligence model pipeline:

metric

  1. Zero-Shot Classification: Categorizes the text into one of five predefined urban hazard classes and calculates a severity score based on label confidence.
  2. Generative Advisory Pipeline: Consumes the classification data and severity score to construct a 3-sentence public safety advisory for local residents.

Target Users

  • Municipal Operations Centers: Environmental protection departments and emergency management personnel who require structured data to prioritize field responses.
  • Urban Planners and Analysts: Municipal teams tracking localized incident frequency across urban sectors.
  • Local Residents: Citizens receiving automated, immediate public preparedness guidance based on confirmed neighborhood reports.

Impact and Scalability

By automating the report triage process, the system reduces the time required to generate public advisories from hours to seconds. The modular architecture permits straightforward deployment across other metropolitan regions by updating localized geographical parameters and target category definitions without requiring model retraining.


tech

3. Technology and Innovation Component

Architecture and AI Integration

The solution uses two distinct cloud-hosted language models to separate risk assessment from public communication generation:

  1. Classification Engine (Hugging Face Inference API):
  2. Model: facebook/bart-large-mnli
  3. Method: Zero-shot sequence classification.
  4. Candidate Labels: Air Pollution / Smog, Waste Management, Water Quality, Infrastructure Damage, Traffic / Noise.
  5. Rationale: Zero-shot classification eliminates the need for expensive domain-specific training data while maintaining high precision across diverse phrasing styles in citizen complaints.

  6. Public Preparedness Engine (OpenAI API):

  7. Model: gpt-3.5-turbo

  8. Method: Parameterized system prompting based on classification output and severity metrics.

  9. Rationale: Formulates clear, professional, context-aware 3-sentence public broadcast advisories formatted for immediate distribution.

  10. Asynchronous Execution:

  11. Built on FastAPI and httpx.AsyncClient with automated transport retries to handle external API rate limits and network latency gracefully.


4. Key Results and Proof of Concept

The functional prototype delivers an end-to-end processing pipeline verified through integration testing:

  • Endpoint /api/v1/analyze-report: Accepts raw text complaints and returns structured JSON responses containing top-label predictions, confidence scores, computed severity percentages, and generated advisory text.
  • Static Dashboard Interface: A responsive browser dashboard served directly from the FastAPI application allows users to submit reports, inspect raw API JSON outputs, and view live system status.
  • Health Check Endpoint /health: Reports active service status and verifies the presence of configured API authentication tokens.

terminal

5. Tech Stack

  • Backend Framework: Python 3.12, FastAPI, Uvicorn
  • HTTP Client: HTTPX (Async HTTP transport)
  • Configuration & Validation: Pydantic, Pydantic-Settings, Python-Dotenv
  • External APIs: Hugging Face Inference API, OpenAI Chat Completions API
  • Frontend: HTML5, CSS3, Vanilla JavaScript (served via FastAPI StaticFiles)

6. Prerequisites

  • Python 3.10 or higher
  • Active OpenAI API Key (OPENAI_API_KEY)
  • Active Hugging Face User Access Token (HUGGINGFACE_API_KEY)

Built With

Share this project:

Updates

Submission history