Implemented a comprehensive pytest suite and resolved bugs in the training metrics to prepare the data and modeling pipeline. We also removed physically-invalid augmentations from the data pipeline and fixed environment build errors.
- Missing unit tests for critical data pipeline and mathematical functions (loss, metrics, stitching).
- Bug in Keras metrics
DiceCoefficientandMeanIoUwhereadd_weightreceived an invalidshapeargument. - Use of
A.RandomBrightnessContrastand similar augmentations indataset.pythat destroyed the physical reflectance signatures of clouds and water bodies. - Python
GDALpackage installation failure due to a mismatch with the system library version.
- Removed
A.RandomBrightnessContrast,A.GaussNoise, andA.GaussianBlurfrom_build_albumentations_pipelineindataset.py. - Fixed
DiceCoefficientandMeanIoUinmodel.pyby properly using thenamekwargs inadd_weight. - Downgraded
GDALinrequirements.txtto3.8.4to align with the system-providedlibgdal-devversion. - Added a full pytest suite under
tests/coveringdataset.py,geospatial_utils.py, andmodel.py.
- Added
test_dataset.pyto ensureCloudPatchDatasetcorrectly reads.npyarrays, maintains batch shapes, and properly instantiates train/val splits. - Added
test_model.pyto mathematically validateMultiClassDiceLoss,CombinedDiceCELoss,DiceCoefficient, andMeanIoUagainst expected tensor operations. - Added
test_geospatial.pyto validategenerate_tile_coords,cosine_bell_mask, and the sliding windowstitch_predictionslogic. - All tests pass (
pytest tests/).
- Accuracy: Ensures physics-based integrity by removing spectral-altering augmentations.
- Stability: Prevents runtime crashes from invalid metrics initialization and provides automated verification for future changes.