How ap1510/ai_based_disaster_relief_and_management_system works
Project type and purpose
• This is a full-stack, AI-powered decision-support web application (DRAMS) built on Django.
• Purpose: end-to-end disaster management—real-time detection (fire, flood, social distancing), predictive analytics (evacuation zones), alerting/rescue coordination, and post-disaster relief planning.
File structure
• Top-level “DRAMS” directory contains a standard Django MVC:
• DRAMS/DRAMS (settings, URLs, ASGI/WGI) – project config
• DRAMS/uno (models, views, migrations) – application logic
• static/ & templates/ – UI assets and HTML
• Additional ML modules live alongside (firedetector, flooddetector, Social-Distance-Detector), each with config, model weights, and prediction scripts.
• Data folder “Mongo DB” contains CSVs for city, location, user data (ingested into the database).
• Training scripts (train.py), prediction scripts (predict_fire.py, predict_flood.py), and webstreaming.py support video ingestion.
README for architectural hints
• Describes three phases: Pre-Disaster (CNN detection + clustering), During Disaster (real-time alerts via external services & routing algorithms), Post-Disaster (connectivity restoration & relief-vehicle routing)
• Mentions Kubernetes & Django for scalable deployment.
Main components & their interactions
a. Frontend Layer
– Static assets (CSS/JS/HTML templates) served by Django’s view/template engine
– User interface for uploading CCTV streams, viewing alerts, feedback forms
b. Backend Layer (Django MVC)
– Request router (urls.py → uno/views/*.py)
– Controllers invoke:
• Detection services (fire/flood CNNs, social-distance YOLO)
• Clustering module (DBSCAN on geolocations)
• Routing engines (GRASP, VND algorithms)
– Data access via Django ORM (PostgreSQL or MongoDB) for: users, alerts, relief centers, road graphs
c. AI & Analytics Services (could be modeled as microservices)
– fire/flood detectors (firedetector, flooddetector packages)
– social-distance-detector module
– cluster & routing algorithm library
d. Data Storage
– Primary database (relational or MongoDB for geospatial queries)
– Flat-file CSV repository for initial ingestion
– Model artifacts folder (output/natural_disaster.model)
e. External Integrations
– Notification APIs (Aadhaar, PAN, Aarogya Setu)
– Kubernetes (deployment, scaling)
– Map/Routing APIs (if external road-network data is used)
Architectural patterns & design principles
• MVC pattern in Django
• Separation of concerns:
• Web tier (request handling & UI)
• AI/compute tier (disaster detection & route planning)
• Data tier (persistent storage & model artifacts)
• Modular ML microservices for each detection type
• Asynchronous task execution (could leverage Celery for long-running video analysis)
• Scalable orchestration via Kubernetes
Elements
• Clear labels for each component (e.g., “Django URL Router”, “Fire Detector Service”).
• Green for Django backend components
• Purple for ML/AI services
• Orange for databases & storage
• Red for external APIs