🎓 Part of Graduation Thesis – University of Information Technology – VNU HCM\
This backend module powers the real-time AI-based flood monitoring system for over 600 traffic cameras in Ho Chi Minh City. It is designed using microservices architecture and runs inside Docker containers for scalability and maintainability.
- 🌐 FastAPI-based RESTful API server
- 🧠 Integrates trained AI model for flood detection
- 📦 Containerized using Docker
- ⚙️ Microservices-ready architecture
- 🌍 Receives image data from mobile/web frontend
- 🧾 Returns flood detection prediction (Flood / No Flood)
- FastAPI – High-performance API framework
- Python 3.10+ – Backend language
- TensorFlow/Keras – For loading and running the CNN model
- OpenCV – Image preprocessing
- Uvicorn – ASGI server
- Docker – For containerization
backend/
├── app/
│ ├── main.py # Entry point
│ ├── model_loader.py # Load .keras model
│ ├── predictor.py # Inference logic
│ ├── schemas.py # Request/response schemas
│ └── utils.py # Image preprocessing
├── Dockerfile # Docker instructions
├── requirements.txt # Python dependencies
└── README.md # You are here
git clone https://github.com/ManhHoDinh/safe-move-ai.git
cd safe-move-ai/backendpython3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtuvicorn app.main:app --reloadNavigate to http://localhost:8000/docs to try the API via Swagger UI.
docker build -t safe-move-backend .docker run -d -p 8000:8000 safe-move-backendTest API at: http://localhost:8000/docs
| Method | Endpoint | Description |
|---|---|---|
| POST | /predict |
Upload image and get prediction |
| GET | /health |
Health check |
curl -X POST "http://localhost:8000/predict" \
-H "accept: application/json" \
-H "Content-Type: multipart/form-data" \
-F "file=@example.jpg"- Place your trained
.kerasfile inapp/model/and updatemodel_loader.pypath accordingly.
- Connects with Flutter Mobile App via REST
- Supports integration with frontend dashboards and admin systems
- 🎓 Paper: IEEE Xplore
- 🗃️ Dataset: UIT-VisDrone-Flood on Roboflow
- 🧪 Model Demo: Hugging Face Space
Developed by Hồ Đình Mạnh & Lê Thị Bích Hằng – UIT – VNU HCM