Skip to content

A-P-U-R-B-O/EchoLens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

26 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฆ  EchoLens - AI Pandemic Predictor

EchoLens Banner Python Streamlit License

Predict Future Pandemics Using Historical Epidemic Patterns

Trained on Black Death โ€ข Spanish Flu โ€ข SARS โ€ข COVID-19

Live Demo โ€ข Documentation โ€ข Quick Start โ€ข Deploy


๐Ÿ“– Overview

EchoLens is an AI-powered pandemic prediction system that analyzes historical epidemic data to forecast future outbreak hotspots and global spread patterns. By learning from humanity's deadliest pandemics, EchoLens helps governments and health organizations prepare infrastructure and save lives.

๐Ÿ’ก Core Insight: Disease patterns repeat when surveillance fails. History teaches us where the next pandemic will strike.

๐ŸŽฏ Key Capabilities

  • ๐Ÿ”ฎ Outbreak Prediction - Forecast pandemic risk 30-180 days ahead
  • ๐Ÿ“Š Risk Assessment - Real-time risk scores for any geographic region
  • ๐Ÿ—บ๏ธ Hotspot Identification - Pinpoint high-risk locations before outbreaks occur
  • ๐Ÿ“ˆ Spread Forecasting - Model transmission rates and growth patterns
  • ๐Ÿ” Historical Comparison - Match current situations to past pandemics
  • ๐Ÿ’ก Actionable Recommendations - Immediate, short-term, and long-term strategies

โœจ Features

๐Ÿค– AI-Powered Intelligence

  • Groq API Integration - Lightning-fast predictions using OpenAI GPT-OSS 120B model
  • No Training Required - Uses pre-trained AI knowledge on historical pandemics
  • Real-time Analysis - Get predictions in seconds, not hours

๐ŸŽจ Beautiful Dashboard

  • Modern UI - Sleek gradients, smooth animations, professional design
  • Interactive Charts - Plotly-powered gauges, trend lines, and comparisons
  • Responsive Layout - Works perfectly on desktop, tablet, and mobile

๐Ÿ“Š Visual Analytics

  • Risk Score Gauge - 0-100 risk indicator with color-coded zones
  • Probability Trends - 30/60/90-day outbreak likelihood charts
  • Historical Database - Interactive tabs for Black Death, Spanish Flu, SARS, COVID-19
  • Comparison Graphs - Side-by-side pandemic mortality rate analysis

๐Ÿ“ฅ Export & Share

  • Download Reports - Export predictions as text files
  • Shareable Links - Send predictions to stakeholders
  • Timestamped Results - Track prediction accuracy over time

๐Ÿš€ Quick Start

Prerequisites

Installation

# Clone the repository
git clone https://github.com/A-P-U-R-B-O/echolens.git
cd echolens

# Install dependencies
pip install -r requirements.txt

# Set up environment variables
cp .env.example .env
# Edit .env and add your GROQ_API_KEY

Configuration

Create a .env file:

GROQ_API_KEY=your_groq_api_key_here

Run Locally

streamlit run app.py

Visit: http://localhost:8501

๐Ÿ› ๏ธ Technology Stack

Component Technology Purpose
Frontend Streamlit 1.28+ Interactive web dashboard
AI Model Groq API (OpenAI/GPT-OSS 120B) Fast LLM inference for predictions
Visualization Plotly 5.17+ Interactive charts and gauges
Backend Python 3.11 Core application logic
Deployment Render / Streamlit Cloud Cloud hosting

๐Ÿ’ก How It Works

1๏ธโƒฃ Historical Learning

EchoLens analyzes patterns from 4 major pandemics:

  • Black Death (1347-1353) - 75-200M deaths, 50% mortality
  • Spanish Flu (1918-1920) - 50-100M deaths, 10% mortality
  • SARS (2002-2004) - 774 deaths, 10% mortality
  • COVID-19 (2019-2023) - 6.9M+ deaths, 2% mortality

2๏ธโƒฃ Pattern Recognition

AI identifies similarities between current outbreaks and historical patterns:

  • Transmission rates (R0 values)
  • Geographic spread patterns
  • Population density impacts
  • Healthcare infrastructure readiness
  • Seasonal and climate factors

3๏ธโƒฃ Risk Calculation

Combines multiple factors to generate risk scores:

Risk Score = f(
    current_cases,
    population_density,
    healthcare_capacity,
    historical_patterns,
    geographic_factors,
    seasonal_conditions
)

4๏ธโƒฃ Prediction Generation

Outputs actionable forecasts:

  • 30/60/90-day probabilities - Outbreak likelihood percentages
  • Hotspot locations - High-risk cities and regions
  • Spread patterns - Expected transmission routes
  • Recommendations - Preventive actions with timelines

๐ŸŽฏ Use Cases

๐Ÿ›๏ธ Government & Public Health

  • Infrastructure Planning - Allocate hospital beds and medical supplies
  • Early Warning Systems - Detect outbreaks before they spread
  • Resource Distribution - Optimize vaccine and treatment placement
  • Policy Decisions - Data-driven lockdown and travel restrictions

๐Ÿฅ Healthcare Organizations

  • Capacity Planning - Prepare ICU beds and ventilators
  • Staff Allocation - Deploy medical personnel efficiently
  • Supply Chain - Stock PPE and medications proactively

โœˆ๏ธ Travel & Tourism

  • Risk Advisories - Issue travel warnings based on predictions
  • Route Planning - Avoid high-risk regions
  • Insurance Pricing - Adjust premiums based on outbreak risk

๐ŸŽ“ Academic Research

  • Epidemiological Studies - Analyze pandemic spread patterns
  • Model Validation - Compare AI predictions to real outcomes
  • Historical Analysis - Study lessons from past pandemics

๐Ÿ“Š Sample Output

๐ŸŽฏ PREDICTION FOR SOUTHEAST ASIA
Generated: 2025-11-08 15:01:49 UTC

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐Ÿ“ˆ OVERALL RISK SCORE: 72/100 (HIGH RISK)

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐Ÿ“Š OUTBREAK PROBABILITIES:
  โ€ข 30 days: 45% (Moderate Risk)
  โ€ข 60 days: 67% (Elevated Risk)
  โ€ข 90 days: 78% (High Risk)

๐ŸŒ SPREAD PATTERN:
  โ€ข Expected R0: 2.8-3.2
  โ€ข Primary vector: International air travel
  โ€ข Secondary vector: Urban mass transit
  โ€ข Geographic direction: West to East coastal cities

๐Ÿšจ TOP 5 RISK FACTORS:
  1. High population density (15M+ in metro areas)
  2. Limited healthcare infrastructure (2 beds/1000 people)
  3. Major international travel hub (50M+ passengers/year)
  4. Monsoon season increasing transmission
  5. Historical outbreak region (SARS, H1N1 precedents)

๐Ÿ“ TOP 3 HOTSPOT CITIES:
  1. Bangkok, Thailand (Risk: 85/100)
  2. Manila, Philippines (Risk: 78/100)
  3. Ho Chi Minh City, Vietnam (Risk: 72/100)

๐Ÿ’ก RECOMMENDATIONS:

Immediate Actions (0-7 days):
  โ€ข Increase disease surveillance at airports
  โ€ข Activate emergency response teams
  โ€ข Stockpile PPE and medical supplies

Short-term Strategies (1-4 weeks):
  โ€ข Expand testing capacity by 300%
  โ€ข Prepare field hospitals in hotspot cities
  โ€ข Launch public awareness campaigns

Long-term Preparation (1-3 months):
  โ€ข Improve healthcare infrastructure
  โ€ข Establish cross-border coordination protocols
  โ€ข Build vaccine distribution networks

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐Ÿ“š HISTORICAL COMPARISON:
Most similar to: SARS (2002-2004)
Key similarity: Southeast Asia origin, similar R0 value
Critical difference: Higher population density now
Likely outcome: Containable with aggressive early intervention

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐ŸŒ Deployment

Deploy to Render.com (Free - Recommended)

  1. Push to GitHub:

    git add .
    git commit -m "Deploy EchoLens"
    git push origin main
  2. Deploy on Render:

    • Go to render.com
    • Click "New +" โ†’ "Web Service"
    • Connect repository: A-P-U-R-B-O/echolens
    • Render auto-detects render.yaml
    • Add environment variable: GROQ_API_KEY=your_key
    • Click "Create Web Service"
  3. Live in 2 minutes! โœ…

    • URL: https://echolens.onrender.com
    • Auto-deploys on every push

Deploy to Streamlit Cloud (Easiest)

  1. Go to share.streamlit.io
  2. Click "New app" โ†’ Select A-P-U-R-B-O/echolens
  3. Main file: app.py
  4. Add secret: GROQ_API_KEY = "your_key"
  5. Click "Deploy"

Docker Deployment

# Build image
docker build -t echolens .

# Run container
docker run -p 8501:8501 -e GROQ_API_KEY=your_key echolens

# Access at http://localhost:8501

๐Ÿ”‘ Getting Your Groq API Key

  1. Visit console.groq.com
  2. Sign up / Log in (free account)
  3. Navigate to "API Keys"
  4. Click "Create API Key"
  5. Copy key and add to .env file

Free Tier Includes:

  • 30 requests/minute
  • 14,400 requests/day
  • Llama 3.1 70B model access

๐Ÿ“ˆ Roadmap

v1.0 (Current) โœ…

  • Historical pandemic database
  • Groq API integration
  • Risk prediction system
  • Beautiful Streamlit dashboard
  • Export reports

v1.1 (Coming Soon) ๐Ÿšง

  • Real-time WHO/CDC data integration
  • Interactive world map with hotspots
  • Email alerts for high-risk regions
  • Multi-language support (ES, FR, ZH)
  • Mobile app (iOS/Android)

v2.0 (Future) ๐Ÿ”ฎ

  • Custom ML model training
  • Social media sentiment analysis
  • Climate change impact modeling
  • API endpoints for external integrations
  • Enterprise dashboard with role-based access

๐Ÿค Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/AmazingFeature
  3. Commit changes: git commit -m 'Add AmazingFeature'
  4. Push to branch: git push origin feature/AmazingFeature
  5. Open Pull Request

Development Guidelines

  • Follow PEP 8 style guide
  • Add docstrings to all functions
  • Test locally before submitting PR
  • Update README if adding features

๐Ÿ› Known Issues

  • Slow first load on Render free tier - Cold starts take 30-60 seconds
  • API rate limits - Groq free tier limited to 30 requests/minute
  • Historical data - Currently limited to 4 major pandemics

Workarounds:

  • Upgrade to Render paid plan for faster loading
  • Implement request caching to reduce API calls
  • Contribute additional pandemic data via PR

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2025 A-P-U-R-B-O

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

โš ๏ธ Disclaimer

Important: EchoLens is a research and educational tool designed to demonstrate AI applications in epidemiology. It should NOT be used as the sole basis for public health decisions.

  • โœ… Use for: Research, education, preliminary risk assessment
  • โŒ Do NOT use for: Medical diagnosis, emergency response, policy decisions

Always consult with:

  • Epidemiologists and infectious disease experts
  • Public health authorities (WHO, CDC)
  • Local government health departments

Predictions are based on historical patterns and current AI models, which may not account for novel pathogens, mutations, or unprecedented scenarios.


๐Ÿ™ Acknowledgments

Data Sources

  • World Health Organization (WHO) - Global health data
  • Centers for Disease Control (CDC) - Epidemic statistics
  • Historical Archives - Black Death, Spanish Flu records
  • Academic Research - Peer-reviewed epidemiological studies

Technology

  • Groq - Lightning-fast LLM inference
  • Streamlit - Beautiful web app framework
  • Plotly - Interactive visualizations
  • Python Community - Open-source libraries

Inspiration

"Those who cannot remember the past are condemned to repeat it."
โ€” George Santayana

This project was inspired by the lessons learned from COVID-19 and the need for better pandemic preparedness systems.


๐Ÿ“ž Contact & Support

Creator

A-P-U-R-B-O

Support

Community

  • โญ Star this repo if it helps your research
  • ๐Ÿ”„ Share with public health professionals
  • ๐Ÿค Contribute to make it better

๐Ÿ“Š Project Stats

GitHub stars GitHub forks GitHub watchers

GitHub issues GitHub pull requests GitHub last commit


๐ŸŒŸ Star History

If EchoLens helps you or your organization, please โญ star this repository!


๐Ÿฆ  EchoLens - Predicting Tomorrow's Pandemics Today

Built by @A-P-U-R-B-O
Powered by Groq API (OpenAI/GPT-OSS 120B)
Last Updated: 2025-11-08


Helping humanity prepare for future pandemics through AI-powered predictions

โฌ† Back to Top

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages