ml

Partial Cross-Entropy Segmentation

Research notebook on point-supervised segmentation with a U-Net

Partial Cross-Entropy Segmentation

Tech Stack

PythonPyTorchU-Netscikit-learn

About This Project

Overview

A research-style notebook studying semantic segmentation when only sparse point labels are available instead of full masks. A custom Partial Focal Cross-Entropy loss trains on labeled pixels only, and four controlled experiments sweep point-label density, focal-loss gamma, U-Net depth, and semi-supervised pseudo-labeling — all evaluated against full ground-truth masks with a fixed, reproducible seed.

Motivation

Full pixel-level annotation for segmentation datasets is expensive and slow to produce, so I wanted to measure exactly how much accuracy you sacrifice — and how you can partially claw it back — when you only have sparse point labels.

Lessons Learned

The focal loss gamma parameter had a much bigger effect on point-label performance than model depth did — tuning the loss function mattered more than making the network bigger, which ran counter to my initial assumption.