How shroudy-bit32/satellite-edge-cloud-detection works
This repository builds and demonstrates an onboard cloud-screening pipeline for Sentinel-2 imagery, intended to reduce downlink while respecting spacecraft compute and memory limits. Its central workflow prepares and normalizes satellite patches, trains a binary classifier and a segmentation model, exports compact ONNX/INT8 models, then applies an operational decision threshold to classify imagery; the optional U-Net supplies pixel masks. Supporting branches validate across SPARCS, analyze downlink and operating points, and generate reports. The README documents these capabilities; some subsystem links are omitted where sampled source does not establish their runtime wiring.
Main entry points: dataset.py Patch datasets · export.py ONNX and INT8 export · inference.py Inference and masks · prepare_data.py Prepare Sentinel-2
Components 23
Data preparation
- Pipeline configuration
src/config.py - Prepare Sentinel-2
src/prepare_data.py - Prepare SPARCS
src/prepare_sparcs.py - Reflectance normalization
src/preprocess.py - Patch index and files
src/prepare_data.py - Patch datasets
src/dataset.py
Model development
- Cloud classifier
src/model.py - U-Net segmenter
src/unet.py - Segmentation losses
src/losses.py - Classifier training
src/train.py - Segmentation training
src/train_seg.py - Model checkpoints
src/train.py
Inference and deployment
- ONNX and INT8 export
src/export.py - Versioned model release
releases - Inference and masks
src/inference.py - Image demo
app.py
Validation and analysis
- Operating-point tuning
src/tune_operating_point.py - Downlink analysis
src/partial_downlink.py - External validation
src/evaluate_external.py - Quantization analysis
src/quantize_analysis.py
Reporting
- Technical report
src/make_report.py
Other components
- Operator
- Satellite imagery
Connections 26
- Operator → Image demo: submits imagery
app.py - Satellite imagery → Prepare Sentinel-2: provides scenes
README.md - Prepare Sentinel-2 → Reflectance normalization: normalizes reflectance
src/prepare_data.py - Prepare Sentinel-2 → Patch index and files: writes patches and index
src/prepare_data.py - Prepare SPARCS → Reflectance normalization: normalizes reflectance
src/prepare_sparcs.py - Patch index and files → Patch datasets: loads indexed patches
src/dataset.py - Patch datasets → Classifier training: supplies training samples
src/train.py - Patch datasets → Segmentation training: supplies image-mask samples
src/train_seg.py - Classifier training → Cloud classifier: builds model
src/train.py - Segmentation training → U-Net segmenter: builds segmenter
src/train_seg.py - Segmentation training → Segmentation losses: uses segmentation loss
src/train_seg.py - Classifier training → Model checkpoints: saves weights
src/train.py - Model checkpoints → ONNX and INT8 export: exports checkpoint
src/export.py - Patch datasets → ONNX and INT8 export: provides calibration samples
src/export.py - ONNX and INT8 export → Versioned model release: produces deployable models
README.md - Versioned model release → Inference and masks: loads model weights
src/inference.py - Reflectance normalization → Inference and masks: shares normalization
src/preprocess.py - Image demo → Inference and masks: requests predictions
app.py - Image demo → Pipeline configuration: loads release threshold
app.py - Inference and masks → Operating-point tuning: evaluates decision policy
- Operating-point tuning → Downlink analysis: sets analysis point
- Prepare SPARCS → External validation: prepares validation data
src/prepare_sparcs.py - External validation → Versioned model release: evaluates released models
- ONNX and INT8 export → Quantization analysis: tests quantized models
src/quantize_analysis.py - Downlink analysis → Technical report: supplies analysis results
- External validation → Technical report: supplies validation results