urbansense

UrbanSense: Real-Time IoT Sensor Fusion with Graph Neural Networks

A comprehensive smart city platform that uses Graph Neural Networks to process real-time IoT sensor data, detect events, and provide intelligent recommendations for urban management.

🌟 Live Demo - Try the interactive demo!

πŸš€ Quick Start

Option 1: Online Demo

Visit the live demo to see UrbanSense in action immediately.

Option 2: Local Setup

# Clone the repository
git clone https://github.com/VrindaBansal/urbansense.git
cd urbansense

# Navigate to web demo
cd web_demo

# Start local server
python -m http.server 8080

# Open http://localhost:8080 in your browser

That’s it! No dependencies required for the basic demo.

πŸ™οΈ What is UrbanSense?

UrbanSense transforms how cities understand and respond to urban events by connecting thousands of IoT sensors through intelligent AI. Instead of treating sensors as isolated data points, our Graph Neural Network creates a β€œsocial network” for sensors, understanding relationships and patterns across the entire urban ecosystem.

🎯 Key Features

🌟 Event Detection Examples

UrbanSense can automatically detect and respond to:

πŸ› οΈ Installation & Setup

Local Development

  1. Clone the repository:
    git clone https://github.com/VrindaBansal/urbansense.git
    cd urbansense
    
  2. For basic web demo (no dependencies):
    cd web_demo
    python -m http.server 8080
    # Visit http://localhost:8080
    
  3. For full AI capabilities (optional): ```bash

    Install Python dependencies

    pip install -r requirements.txt

For advanced ML features

pip install -r requirements-full.txt


4. **Environment Setup** (if using backend features):
```bash
# Copy example environment file
cp .env.example .env

# Edit .env with your configurations

Docker Setup (Optional)

# Build and run with Docker
docker build -t urbansense .
docker run -p 8080:8080 urbansense

πŸ’» Usage

Web Interface Controls

Programmatic API

from src.applications.smart_city.sensor_fusion import SmartCitySensorFusion

# Initialize the system
fusion = SmartCitySensorFusion()

# Add sensors
fusion.add_sensor('temp_001', 'temperature', location=(40.7589, -73.9851))
fusion.add_sensor('traffic_001', 'traffic', location=(40.7580, -73.9855))

# Process real-time data
fusion.process_sensor_data('temp_001', 28.5)
fusion.process_sensor_data('traffic_001', 75.0)

# Get AI insights
anomalies = fusion.detect_anomalies()
events = fusion.detect_events()
recommendations = fusion.get_recommendations()

πŸ—οΈ Architecture

Graph Neural Network Components

Fusion Strategies

  1. Early Fusion: Combine raw sensor data before processing
  2. Joint Fusion: Process multiple sensor types together
  3. Late Fusion: Combine individual sensor decisions
  4. Adaptive Fusion: Dynamic strategy selection based on data quality

πŸ“ Project Structure

urbansense/
β”œβ”€β”€ web_demo/                 # Interactive web interface
β”‚   β”œβ”€β”€ index.html           # Main interface
β”‚   β”œβ”€β”€ simulation.js        # Core simulation engine
β”‚   β”œβ”€β”€ style.css           # UI styling
β”‚   └── quick_demo.py       # Standalone demo server
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ models/gnn/          # Graph Neural Network models
β”‚   β”œβ”€β”€ applications/        # Smart city applications
β”‚   β”œβ”€β”€ fusion/             # Sensor fusion algorithms
β”‚   └── utils/              # Utility functions
β”œβ”€β”€ docs/                   # Documentation
β”œβ”€β”€ tests/                  # Unit tests
β”œβ”€β”€ requirements.txt        # Core dependencies
β”œβ”€β”€ requirements-full.txt   # Full ML dependencies
β”œβ”€β”€ .env.example           # Environment template
└── README.md              # This file

πŸš€ Deployment

GitHub Pages (Automatic)

The project automatically deploys to GitHub Pages on every push to main branch:

Manual Deployment

# Build for production
npm run build

# Deploy to your hosting platform
npm run deploy

πŸ§ͺ Testing

# Run all tests
python -m pytest tests/

# Run specific test category
python -m pytest tests/test_gnn.py
python -m pytest tests/test_fusion.py

# Run with coverage
python -m pytest --cov=src tests/

πŸ“Š Performance

🀝 Contributing

We welcome contributions! Here’s how to get started:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and test
  4. Commit: git commit -m 'Add amazing feature'
  5. Push: git push origin feature/amazing-feature
  6. Open a Pull Request

Development Guidelines

πŸ“„ License

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

πŸ™‹β€β™€οΈ Support

🌟 Acknowledgments

Built with inspiration from multimodal AI research in medical applications, adapted for smart city use cases. This project demonstrates how AI can make urban environments more responsive, safe, and efficient.


Ready to transform your city with AI? Try the demo now!