Skip to main content
GIS-Schools GIS-Schools
Detection ยท GeoAI

Synthetic Object Detector - Learning Demo

Find separated bright objects in a synthetic grid and return their pixel bounding boxes.

Detection task illustration
Family: Classical image analysisArchitecture: Trained threshold and connected componentsVersion: 1.0License: CC0 1.0 - original code, model, synthetic data and illustrations
Synthetic Object Detector - Learning Demo

What this model does

Find separated bright objects in a synthetic grid and return their pixel bounding boxes. This is an original synthetic educational baseline, not a pretrained satellite model.

Model family and method

Trained threshold and connected components. Training selects a threshold between observed training values that minimizes binary label errors; values above the threshold are foreground or changed. Detection then groups four-connected foreground pixels into boxes.

Inputs and outputs

training.csv uses x as pixel intensity and y as a foreground (1) or background (0) label. sample.json contains a two-dimensional grid.

Requirements

Python 3.9 or later. Standard library only; no GPU or extra packages.

How to train

Download and extract the ZIP, then open a terminal inside the extracted folder. The package includes a model already trained on 100 synthetic rows.

python train.py

How to run and check

python predict.py
python verify.py

Read prediction.json for the output. The supplied fixture test passed locally; it is not an independent real-world accuracy benchmark.

Use your own data

Replace training.csv and sample.json using the same columns, units and shapes. Retrain and assess a separate held-out test set. The included verify.py and expected.json apply only to the original synthetic fixture. These scripts do not read GeoTIFFs or preserve a CRS.

Limitations

Bounding boxes use zero-based, inclusive pixel coordinates. This is a classical baseline, not YOLO. Touching objects merge and shadows or background variation can cause errors. All sample data is synthetic; no real satellite or field validation is provided. Do not use the supplied parameters for operational mapping.

Included download

Training and prediction scripts, verification script, training CSV, sample inputs, expected outputs, trained model.json, prediction.json and README instructions. Original materials are released under CC0 1.0.

Examples and images

Downloads and resources

Hosted on GISSchoolsRunnable demo: trained model, Python code and synthetic data (ZIP)
Download Model
Discussion

Comments

0

No comments yet. Start the discussion.

Join the discussion

Leave a reply

Your email address will not be published. Required fields are marked.