Inspiration
Satellite imagery can reveal changes in forests, waterways, farms, and cities, but reviewing thousands of images manually takes significant time and specialized knowledge. We created TerraLens to help small environmental teams quickly identify important land-cover patterns and decide which locations need expert attention.
What it does
TerraLens is an AI-powered environmental screening web app. Users can upload satellite or aerial imagery and receive:
- The three most likely land-cover categories
- Calibrated confidence and uncertainty
- A visual overlay showing influential image regions
- Visually similar reference scenes
- A clear recommendation when human review is needed
TerraLens also includes Compare Mode. Users can upload aligned before-and-after images to receive a change score, predicted land-cover transition, and visual difference map.
The model recognizes ten categories: Annual Crop, Forest, Herbaceous Vegetation, Highway, Industrial, Pasture, Permanent Crop, Residential, River, and Sea or Lake.
TerraLens is a screening and prioritization tool, not an official land-use determination. Important findings should always be verified using source imagery, local context, and qualified human review.
How we built it
We trained the model using the EuroSAT RGB dataset, which contains 27,000 Sentinel-2 image patches. Each image is resized to 64 by 64 pixels and converted into a 252-value feature vector describing color distributions, spatial layout, edges, and texture.
A scikit-learn pipeline standardizes these features and processes them with a histogram-based gradient boosting classifier. Temperature scaling calibrates the resulting probabilities. The included model achieved 91.6% accuracy on 5,400 held-out test images.
To make predictions understandable, TerraLens temporarily hides small image regions and measures how the prediction changes. The most influential regions are highlighted in the review overlay. Similar scenes are retrieved using cosine similarity between image feature vectors.
The backend is built with Python and Flask. The frontend uses React and Vite. NumPy handles numerical processing, Pillow manages uploaded images and overlays, and joblib packages the trained model. Automated tests verify feature extraction, analysis, comparison, example images, model readiness, and invalid-upload handling.
Challenges we faced
One major challenge was producing accurate satellite-image classifications without requiring expensive GPU infrastructure. We addressed this by designing an efficient feature-extraction pipeline and combining it with gradient boosting.
Another challenge was communicating uncertainty responsibly. A single confident-looking label could mislead users, so we added probability calibration, top-three predictions, normalized uncertainty, review states, and clear limitations.
We also needed to make the model understandable. The occlusion-based overlay and similar-scene retrieval provide useful context without adding another large AI model.
Compare Mode was challenging because images may differ due to alignment, lighting, season, or image quality instead of meaningful environmental change. We therefore describe its output as a screening signal and warn users that images must show the same aligned location.
Finally, we had to connect model inference, image validation, API responses, visual explanations, example imagery, and a production frontend into one stable application during the hackathon.
What we learned
We learned that building responsible AI requires more than maximizing accuracy. Users also need uncertainty, explanations, limitations, and a clear understanding of when human judgment is required.
We also learned how to train and calibrate a machine-learning classifier, design image features, create explainability tools, connect a React interface to a Flask API, and package a complete application that judges can run without retraining the model.
What's next
Future versions could add image alignment, geographic metadata, time-series monitoring, segmentation masks, cloud detection, and evaluation using imagery from more regions. We would also like to test TerraLens with environmental specialists and measure how much review time it can save.
Built With
- eurosat
- flask
- framer
- joblib
- lucide
- machine-learning
- motion
- numpy
- pillow
- pytest
- python
- react
- scikit-learn
- scipy
- sentinel-2
- vite
Log in or sign up for Devpost to join the conversation.