{"id":27058529,"url":"https://github.com/arshtiwari2004/signal-x","last_synced_at":"2025-04-10T22:48:42.374Z","repository":{"id":286128933,"uuid":"960451833","full_name":"ArshTiwari2004/Signal-X","owner":"ArshTiwari2004","description":"Signal-X is an AI-powered traffic management system using advanced computer vision, edge computing, and geospatial intelligence. With real-time sensor fusion, machine learning algorithms, and adaptive signal control, it enables dynamic congestion management and emergency vehicle prioritization.","archived":false,"fork":false,"pushed_at":"2025-04-06T00:16:20.000Z","size":51112,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T22:48:33.823Z","etag":null,"topics":["arduino","deepsort","expo","flask","opencv","pygame","python","react-native","tensorflow","yolov8"],"latest_commit_sha":null,"homepage":"https://signal-x-zkh5.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArshTiwari2004.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-04T13:08:32.000Z","updated_at":"2025-04-06T00:16:24.000Z","dependencies_parsed_at":"2025-04-09T19:36:19.789Z","dependency_job_id":null,"html_url":"https://github.com/ArshTiwari2004/Signal-X","commit_stats":null,"previous_names":["arshtiwari2004/signal-x"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArshTiwari2004%2FSignal-X","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArshTiwari2004%2FSignal-X/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArshTiwari2004%2FSignal-X/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArshTiwari2004%2FSignal-X/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArshTiwari2004","download_url":"https://codeload.github.com/ArshTiwari2004/Signal-X/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312197,"owners_count":21082637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","deepsort","expo","flask","opencv","pygame","python","react-native","tensorflow","yolov8"],"created_at":"2025-04-05T12:15:31.191Z","updated_at":"2025-04-10T22:48:42.346Z","avatar_url":"https://github.com/ArshTiwari2004.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://readme-typing-svg.demolab.com/?lines=This+is+Signal-X+,+an+AI+Powered+Smart+Traffic+Management+System;\u0026center=true\u0026color:FF0000\u0026width=900\u0026height=50\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eBreaking the Red Tape of Congestion and Inefficiency\u003c/em\u003e\n\u003c/p\u003e|\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://signal-x-zkh5.vercel.app/\"target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Live%20Now-0066FF?style=for-the-badge\u0026logo=vercel\u0026logoColor=white\" alt=\"Live Now\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003cp style=\"font-size: 16px; color: #666;\"\u003eClick the button above to visit the live version of the Signal-X project hosted on Vercel.\u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdiv align =\"center\"\u003e\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![React](https://img.shields.io/badge/React-18.x-blue.svg)](https://reactjs.org/)\n[![Flask](https://img.shields.io/badge/Flask-2.x-green.svg)](https://flask.palletsprojects.com/)\n\n\u003c/div\u003e\n\n## 🌟 Overview\n\nSignal-X is an AI-driven smart traffic management system that uses YOLO-based vehicle detection, Arduino-controlled signals, and MapMyIndia’s geospatial analytics to optimize traffic flow in real-time. It prioritizes emergency vehicles, prevents congestion, and enhances road safety through dynamic signal adjustments using live video feeds. Scalable and future-ready, Signal-X is adaptable for cities of all sizes, making urban commuting smarter and more efficient.\n\n\n## 🚧 Problem Statement\n\n### ❗ The Urban Gridlock Crisis\n\nWith rapid urbanization and an ever-increasing number of vehicles, cities are choking under **intense traffic congestion**. What should be smooth commutes turn into daily nightmares, leading to:\n\n- ⏱️ **Wasted Time** stuck in endless queues  \n- ⛽ **Higher Fuel Consumption** and rising transportation costs  \n- 🌫️ **Increased Pollution** and carbon emissions  \n- 🚨 **Delayed Emergency Responses** for ambulances, fire trucks, and police  \n- 😠 **Driver Frustration** and rising road rage incidents  \n\n---\n\n### 🚦 The Flaws of Conventional Traffic Lights\n\nTraditional traffic systems follow **fixed-timer logic**, blindly rotating signals **without considering real-time traffic flow**. This outdated mechanism leads to:\n\n- 🟢 **Green lights on empty roads**, wasting valuable intersection time  \n- 🔴 **Vehicle pile-ups in busy lanes**, creating bottlenecks  \n- 🚑 **Emergency vehicles stuck**, unable to move swiftly through intersections  \n- 🧍‍♂️ **Manual control dependency**, requiring more manpower  \n- 🧠 **No AI, No Adaptability**, making systems unresponsive and inefficient  \n\n---\n\n### 🧠 The Need for a Smarter Solution\n\nTo truly **revolutionize urban mobility**, we need a system that is:\n\n- ✅ **AI-powered** and capable of dynamic decision-making  \n- 🌐 **IoT-integrated** for real-time traffic sensing  \n- 🗺️ **Geospatially aware** for adaptive routing  \n- ⚙️ **Automated \u0026 Scalable**, reducing human dependency  \n\n\u003e It’s time to move beyond timers and take the **smart route** to traffic management.\n\n---\n\n\n## 💡 Our Solution – Signal-X\n\n**Signal-X** is an AI-driven Smart Traffic Management System that transforms urban mobility using the power of **computer vision**, **IoT**, and **geospatial intelligence**. Designed to be **scalable**, **real-time**, and **intelligent**, Signal-X optimizes traffic flow, reduces congestion, and ensures faster emergency response through dynamic signal control.\n\n---\n\n### 🚀 Key Features\n\n- 🧠 **AI-Powered Traffic Analysis**  \n  YOLOv8-based object detection continuously monitors vehicle flow across all junction lanes.\n\n- ⏱️ **Dynamic Signal Adjustment**  \n  Adaptive signal control based on real-time congestion and traffic density patterns.\n\n- 🌐 **IoT Integration**  \n  Raspberry Pi/Arduino-based controllers ensure seamless traffic light control and emergency detection.\n\n- 🗺️ **Geospatial Intelligence**  \n  Integration with MapMyIndia's API offers live congestion updates and smart rerouting.\n\n- 🚑 **Emergency Vehicle Prioritization**  \n  Automatically detects emergency vehicles (ambulance, fire brigade, police) and gives them green-light priority.\n\n- 🔮 **Congestion Prediction**  \n  AI models analyze historical + real-time data to predict and prevent traffic bottlenecks.\n\n---\n\n## 🧩 How Signal-X Works – Workflow\n\nSignal-X operates through a seamless, AI-driven pipeline that integrates video processing, intelligent decision-making, and hardware-level execution.\n\n---\n\n### ⚙️ Step-by-Step Workflow\n\n1. 🎥 **Live Data Collection**  \n   - RTSP streams from **CCTV cameras and drones** provide real-time traffic video feeds.\n\n2. 🗺️ **Traffic API Integration**  \n   - Feeds are passed to **MapMyIndia Traffic API** for real-time congestion data enrichment.\n\n3. 🧠 **Vehicle Detection using YOLOv8**  \n   - Vehicles are identified and classified into 5 categories:  \n     🚑 Ambulance, 🧬 Organ Transport, 🚒 Fire Brigade, 🚓 Police, 🆘 Disaster Units\n\n4. 🔄 **Real-Time Multiprocessing**  \n   - Uses Python’s **multiprocessing** to analyze **all four lanes** at a junction simultaneously for accurate density analysis.\n\n5. 🧮 **Smart Signal Optimization**  \n   - A custom AI model determines the optimal green-light timing using:  \n     - 📊 **Vehicle Density**  \n     - 🕓 **Historical Traffic Patterns** (via Reinforcement Learning)  \n     - 📡 **Live API Congestion Data**\n\n6. 🔌 **IoT-Based Hardware Integration**  \n   - Arduino module integrated into the junction system.  \n   - If an emergency vehicle is detected, **immediate green signal** is activated and maintained until it passes.\n\n7. 🖥️ **Real-Time Dashboard (React)**  \n   - Officers monitor and visualize traffic flow and system decisions via a **React-based dashboard** in real-time.\n\n---\n\n### 🎯 Why Signal-X?\n\n\u003e Unlike traditional fixed-timer systems, Signal-X uses **real-time intelligence and automation** to enhance traffic efficiency, reduce delays, and save lives.\n\n✅ Smart  \n✅ Scalable  \n✅ Emergency-Ready  \n✅ Real-Time  \n✅ AI-Optimized  \n\n## 🔧 Technical Architecture\n\n### Components Overview\n\n1. **Data Collection Layer**\n   - CCTV cameras \u0026 drones capture live video feeds\n   - Microphone sensors detect emergency vehicle sirens\n   - IoT devices (Raspberry Pi \u0026 Arduino) process sensor inputs\n\n2. **AI Processing Layer**\n   - YOLOv8 for vehicle detection and classification\n   - DeepSORT for vehicle tracking\n   - OpenCV for image processing\n   - Flask for API management\n\n3. **Backend Processing**\n   - MongoDB for data storage\n   - WebSocket for real-time communication\n   - Traffic analysis algorithms\n\n4. **Frontend Dashboard**\n   - React-based responsive interface\n   - Real-time traffic analytics visualization\n   - MapMyIndia integration for geospatial display\n\n5. **Signal Control System**\n   - Priority-based signal switching for emergency vehicles\n   - Adaptive traffic light control based on congestion analysis\n\n## 💻 Technology Stack\n\n## 🧰 Tech Stack – What Powers Signal-X 🚦\n\nSignal-X is built using a powerful blend of **AI, hardware, geospatial analytics, real-time systems, and scalable web technologies**. Here's everything under the hood:\n\n---\n\n### 🌐 Frontend – **React Dashboard**\n\n| Tech | Purpose |\n|------|---------|\n| ⚛️ React.js | Dynamic, component-based UI |\n| 🗺️ MapMyIndia SDK | Interactive maps \u0026 live traffic visualization |\n| 🌈 Tailwind CSS | Modern utility-first styling |\n| 📡 WebSocket | Real-time UI updates \u0026 traffic stats |\n| 🔗 Axios | API requests and data fetching |\n| 📱 React Native (Expo) | Mobile traffic monitor app (optional extension) |\n\n---\n\n### 🧠 AI \u0026 Computer Vision – **Smart Traffic Brain**\n\n| Tech | Purpose |\n|------|---------|\n| 🧠 YOLOv8 | High-speed vehicle detection \u0026 classification |\n| 🎥 OpenCV (cv2) | Image \u0026 video stream processing |\n| 📊 NumPy, SciPy | Traffic data analytics |\n| 📈 Matplotlib | Data visualization and graphs |\n| 🔬 Ultralytics | YOLOv8 training and inference |\n| 🧠 Reinforcement Learning | Intelligent signal timing optimization |\n\n---\n\n### 🧪 Backend – **Core Logic \u0026 APIs**\n\n| Tech | Purpose |\n|------|---------|\n| 🐍 Flask | RESTful API backend (Python) |\n| 🌐 WebSocket (Flask-SocketIO) | Real-time data sync with frontend |\n| 🍃 MongoDB | NoSQL database for storing traffic history \u0026 logs |\n| ⚙️ Express.js + Node.js | API support for mobile \u0026 hardware integrations |\n\n---\n\n### 🔌 Hardware – **IoT-Powered Signal Controller**\n\n| Component | Role |\n|-----------|------|\n| 💡 Arduino UNO | Signal \u0026 sensor control unit |\n| 🔊 CZN15E Sound Sensor | Detects approaching emergency sirens |\n| 🎥 OV7670 Camera Module | Captures live video for CV analysis |\n| 📏 HC-SR04 Ultrasonic Sensor | Measures distance \u0026 lane occupancy |\n| 💡 LEDs, 🧲 Buzzer, 🔌 Jumper Wires, 🔳 Breadboard | Circuit components for signal light system |\n| 🧠 Arduino IDE + Embedded C/C++ | Logic programming and testing |\n| 🖥️ Serial Monitor | Debugging and communication with PC |\n\n---\n\n### 🎮 Bonus Tools \u0026 Utilities\n\n| Tool | Use |\n|------|-----|\n| 🧩 Pygame | Simulating traffic flow for testing |\n| 📈 Scikit-learn | Optional ML utilities |\n| 🧪 Matplotlib | Data analysis visualization |\n| 🧠 Gemini API | Optional AI assistance (integration idea) |\n\n---\n\n\u003e 🚀 Signal-X combines **real-world sensors**, **cutting-edge AI**, and **cloud-based data pipelines** to create a future-ready traffic management solution.\n\n---\n\n## 🚀 Getting Started\n\n### Prerequisites\n- Python 3.8+\n- Node.js and npm\n- MongoDB\n- MapmyIndia API key\n- Gemini API key \n- Arduino IDE \n\n\n### Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/ArshTiwari2004/Signal-X.git\n   cd Signal-X\n   ```\n2. **Setup Frontend**\n    ```bash\n    cd traffic-monitoring/frontend/web/signalx-web\n    npm install\n    ```\n3. **Create a .env file in the root of the frontend directory with:**\n    ```bash\n    VITE_MAPPLS_SDK_KEY=your_mapmy_india_sdk_key\n    ```\n4. **Start the development server:**\n    ```\n    npm run dev\n    ```\n5.  **Setup Backend - Create and activate a virtual environment:**\n    ```\n    python -m venv venv\n    venv\\Scripts\\activate  # Windows\n    source venv/bin/activate  # Linux/Mac\n    ```\n6. **Install the required packages:**\n    ```\n    pip install -r requirements.txt\n    ```\n7. **Start the Flask server:**\n    ```\n    python backend/flask_api.py\n    ```\n8. **For running the Expo project on mobile**\n   ```\n   cd mobile-app/signalx-mobile\n   npm i\n   ```\n9. **Set up your GEMINI_API_KEY in .env**\n   ```\n   VITE_GEMINI_API_KEY=your_gemini_api_key\n   ```\n10. **Run the app**\n   ```\n   npx expo start\n   ```\n11. **Setting up the expo backend**\n   ```\n   cd mobile-app/mobile-backend\n   npm i \n   ```\n12. **Set up env variables for expo backend**\n    ```\n     TWILIO_ACCOUNT_SID=your_twilio_account_sid_here\n     TWILIO_AUTH_TOKEN=your_twilio_auth_token_here \n     TWILIO_PHONE_NUMBER=your_twilio_phone_number_here \n     MONGO_URI=your_mongodb_connection_string_here\n    ```\n\n13. **Run the Mobile Backend Server**\n    ```\n    npm run dev \n    ``` \n14. **Setup the Arduino IDE**\n    \n```bash \n# ⚙️ How to Upload \n1. Open the `.ino` files using the Arduino IDE. \n2. Select the correct board and port: - Tools \u003e Board \u003e (e.g., Arduino UNO) - Tools \u003e Port \u003e (Select the connected COM port) \n3. Connect your Arduino (e.g., UNO, Nano, etc.) via USB. \n4. Click the \"Upload\" button in the Arduino IDE (➡️ icon). \n5. Ensure all required components (Servo motors, LEDs, Buzzer, etc.) are connected as per the logic in the code. \n```\n\n\n\n# Project Structure\n\n```bash\nsignal-x/\n├── Arduino_code/\n│   ├── sketch_Camera/\n│   │   └── sketch_Camera.ino           # Controls CCTV pan/tilt\n│   └── sketch_LED_Buzzer/\n│       └── sketch_LED_Buzzer.ino       # Controls signal lights \u0026 alarms\n│\n├── mobile-app/\n│   ├── mobile-backend/\n│   │   ├── config/\n│   │   │   ├── db.js                   # MongoDB connection\n│   │   │   └── dotenv.js               # API keys config\n│   │   ├── models/\n│   │   │   ├── Incident.js             # Report schema\n│   │   │   └── User.js                 # Auth schema\n│   │   └── routes/\n│   │       ├── authRoutes.js           # Login/register endpoints\n│   │       └── incidentRoutes.js       # Report submission\n│   │\n│   └── signalx-mobile/\n│       ├── components/\n│       │   ├── EmergencyAlert.js       # Siren detection UI\n│       │   └── LiveTrafficLight.js     # Real-time signal status\n│       └── screens/\n│           ├── HomeScreen.js           # Main dashboard\n│           └── ReportScreen.js         # Incident form\n│\n├── traffic-monitoring/\n│   ├── backend/\n│   │   ├── templates/                  # Admin panel HTML\n│   │   ├── ambulance_detection.py      # Priority vehicle logic\n│   │   └── traffic_control.py          # Signal timing algorithms\n│   │\n│   ├── frontend/\n│   │   └── web/\n│   │       └── signalx-web/\n│   │           └── src/\n│   │               ├── components/     # Reusable UI elements\n│   │               ├── pages/          # Route-specific pages\n│   │               └── routes/         # Navigation config\n│   │\n│   ├── models/                         # AI models\n│   │   ├── yolov8n.pt                 # Vehicle detection weights\n│   │   └── siren_detection.h5         # Audio classification\n│   │\n│   ├── simulations/                    # Traffic simulations\n│   │   ├── rippling_effect.py         # Congestion spread model\n│   │   └── traffic_simulator.py       # Junction flow simulator\n│   │\n│   ├── utils/                          # Utility scripts\n│   │  \n│   │                  \n│   │\n│   ├── alert.wav                      # Emergency sound\n│   ├── dashboard.png                  # Admin UI mockup\n│   └── README.md                      # Setup instructions\n\n```\n\n\n\n\n## 🖼️ Snippets \n*Landing page of Signal-X*\n![Landingpage](Landingpage.png)\n\n*Dashboard of Signal-X*\n![Dashboard](dashboard.png)\n\n*Auth workflow*\n![userflow](userflow.png)\n\n*Snapshots of the Citizen App*\n![Snapshots](Mobile.png)\n\n\n\n\n\n## 🔮 Future Enhancements\n\n## 1. **AI-Powered Red-Light Violation Detection** : \n- Use AI-based license plate recognition to detect vehicles running red lights. Integrated with government databases, the system can auto-generate challans, improving law enforcement efficiency.\n\n## 2. **Smart Signal Optimization with Reinforcement Learning**: \n- Leverage reinforcement learning to optimize signal timings based on real-time and historical traffic data, ensuring faster clearance for emergency vehicles and smoother traffic flow.\n\n## 3. **AI-Based Incident Detection \u0026 Rerouting**:\n- Utilize AI to detect accidents or breakdowns via CCTV analysis. The system can instantly alert authorities and reroute traffic to prevent congestion.\n\n\n## 🤝 Contributing\n#### Contributions are welcome! Please feel free to submit a Pull Request.\n\n- Fork the repository\n- Create your feature branch (git checkout -b feature/amazing-feature)\n- Commit your changes (git commit -m 'Add some amazing feature')\n- Push to the branch (git push origin feature/amazing-feature)\n- Open a Pull Request\n\n\n\n**❤️ Made with love by Team Synapse — Arsh Tiwari, Priyanshi Bothra, and Nibedan Pati**\n\n\n📩 Have a suggestion or want to connect? Drop a mail at: arshtiwari12345@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farshtiwari2004%2Fsignal-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farshtiwari2004%2Fsignal-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farshtiwari2004%2Fsignal-x/lists"}