🎓 Institution: Al-Farabi University
👥 Team: Abdulrahman Ahmed Turki, Mohammed Natiq Hilo, Mustafa Ahmed Najah
📊 Performance: Validation Loss 0.0007 (Trained on 7,500 real-terrain image pairs over 8 epochs)
An AI-powered municipal oversight platform designed to automatically detect unauthorized construction using satellite imagery. Built specifically for the First Annual Student Forum for AI Projects at the University of Baghdad, College of Artificial Intelligence.
Deployed on Streamlit Community Cloud — click the link above to try the AI model in your browser!
This project was developed addressing the core evaluation criteria of the forum:
- Distinction: Unlike traditional manual city surveying which is slow and labor-intensive, this project utilizes automated temporal image analysis.
- New Idea: We implement a true Siamese Convolutional Neural Network (CNN) using PyTorch. By feeding two satellite images (T0 and T1) into the network simultaneously, the system computes the deep feature distance to isolate newly constructed buildings while ignoring seasonal changes.
- Modern Programming & UI: The application is built using Python and Streamlit, featuring a highly customized, premium CSS frontend designed to look like a professional municipal dashboard.
- AI Algorithms: The core logic relies on a custom PyTorch Siamese CNN (Encoder-Decoder) trained from scratch. The system includes a full training pipeline (
train.py,dataset.py,model.py) demonstrating true Deep Learning implementation.
- Solving a Problem: Erbil city is expanding rapidly. Unauthorized construction leads to poor urban planning and lost municipal revenue. This system allows the municipality to scan entire sectors instantly.
- Realism & Sustainability: The solution requires only satellite imagery (which is readily available via APIs like Google Earth Engine or Planet) and standard computing resources, making it highly sustainable for government use.
- Clarity & Prototype: The Streamlit dashboard is designed for an interactive, smooth presentation. It clearly displays the "Baseline" and "Recent" images, with a dynamic "Run Analysis" button that yields clear, actionable metrics (Number of violations, total area changed, and confidence scores).
- Privacy: The system strictly analyzes structural data from macroscopic satellite views. It does not process facial recognition, personal identification, or any private citizen data.
- Integrity: The algorithmic approach is objective. It flags all structural changes regardless of neighborhood, ensuring fair and unbiased municipal oversight.
-
Clone the repository:
git clone https://github.com/YUNCOX/illegal-building-detection.git cd illegal-building-detection -
Install dependencies:
pip install -r requirements.txt
-
Generate the Semi-Synthetic Erbil Dataset and Train the Model: Because downloading massive, high-res historical datasets of Erbil costs thousands of dollars, this project includes an intelligent automated pipeline. It directly connects to public ArcGIS servers, downloads thousands of real Erbil satellite tiles, mathematically injects new building constructions to create a semi-synthetic dataset, and then trains the PyTorch model.
python fetch_erbil.py python generate_dataset.py python train.py
This will generate the dataset and output
erbil_siamese_model.pth. -
Run the Streamlit app:
streamlit run app.py
app.py: The main Streamlit application containing the UI and inference logic.model.py: PyTorch implementation of the Siamese CNN.dataset.py: PyTorch DataLoader for the image pairs.train.py: The training loop for the neural network.fetch_erbil.py: Connects to ArcGIS servers to download real Erbil satellite tiles.generate_dataset.py: Injects "new" buildings onto real Erbil terrain to create a semi-synthetic training dataset.requirements.txt: Python dependencies.README.md: Project documentation.sample_data/: Contains example 'Before' and 'After' satellite images for testing the demo.
Al-Farabi University
- Abdulrahman Ahmed Turki
- Mohammed Natiq Hilo
- Mustafa Ahmed Najah
