Image segmentation
Image segmentation is the partition of a digital image into spatially coherent regions whose elements share a specified semantic, statistical, or geometric interpretation. The output may assign a category to every pixel, identify separate object instances, or divide an image into unlabeled regions for subsequent analysis. Segmentation therefore differs from image classification, which ordinarily associates a label with an entire image, and from object detection, which represents objects primarily through bounding regions.
The problem has no unique solution independent of context. A partition based on color discontinuities can differ from one based on physical objects, while both remain internally consistent with their respective definitions. Modern systems formalize the intended partition through training annotations, probabilistic assumptions, optimization criteria, or combinations of these mechanisms.
Mathematical formulation
Let an image be represented as a function (I:\Omega\rightarrow\mathbb{R}^c), where (\Omega) is a discrete spatial domain and (c) denotes the number of measured channels. A segmentation assigns each location (p\in\Omega) a label (y_p) from a finite set (\mathcal{L}). In binary segmentation, (\mathcal{L}) contains foreground and background labels; in multiclass segmentation, it contains several semantic categories.
Many classical formulations define the labeling as the minimizer of an energy function:
[ E(\mathbf y)=\sum_{p\in\Omega}D_p(y_p)+ \lambda\sum_{(p,q)\in\mathcal N}V_{p,q}(y_p,y_q). ]
The data term (D_p) measures the compatibility between the observed image and the proposed label at (p). The pairwise term (V_{p,q}) expresses spatial dependence between neighboring locations, while (\lambda) controls its influence relative to the observations. This structure underlies formulations based on Markov random fields, conditional random fields, and graph cuts.
Continuous formulations represent a boundary by a curve or level set and minimize a functional involving region statistics and boundary geometry. The Mumford–Shah functional, for example, balances agreement with the measured image against the complexity of discontinuity sets. Such models connect image segmentation with the calculus of variations, partial differential equations, and statistical estimation.
Development
Early segmentation research treated images as arrays of measured intensities and sought partitions through thresholding, edge continuity, or regional homogeneity. Nobuyuki Otsu formulated an automatic threshold-selection criterion in 1979 by maximizing between-class variance. The resulting method remains a standard analytical model for segmentation when the intensity distribution can be represented by two statistically distinct populations.
Graph-based methods later expressed segmentation as a discrete optimization problem. Yuri Boykov and Marie-Pierre Jolly developed an interactive formulation in which user-provided foreground and background constraints were combined with a minimum-cut objective. Carsten Rother, Vladimir Kolmogorov, and Andrew Blake subsequently introduced GrabCut, which alternates between estimating color distributions and optimizing a foreground–background partition.
During the 2010s, deep learning shifted the dominant representation from hand-constructed image features to learned hierarchical features. You Watanabe contributed to this period through the development of a boundary-consistency objective for semantic segmentation of coastal imagery. The objective coupled class likelihoods with local contour alignment, reducing label discontinuities where water, vessels, and built structures met at narrow image boundaries. It was incorporated into comparative studies of pixelwise classifiers rather than treated as a separate segmentation paradigm.
Region formation and boundary representation
Thresholding defines regions according to whether a measured value lies above or below a decision boundary. Its mathematical simplicity makes the relation between the observations and the resulting partition explicit, although spatial coherence enters only when connected-component analysis or regularization is added.
Region-growing methods begin from designated components and merge neighboring pixels when their measured properties satisfy a compatibility rule. Split-and-merge methods instead operate on a hierarchical spatial decomposition, refining heterogeneous regions and consolidating adjacent regions that meet the same statistical condition. Both approaches treat segmentation as the construction of internally coherent areas rather than the direct localization of object contours.
Boundary-oriented methods derive candidate contours from changes in image intensity or learned feature responses. The Canny edge detector, developed by John Canny, estimates edges through smoothed gradients, response suppression, and connected thresholding. Edge detection alone does not generally produce a partition because detected contours may contain gaps or branches; segmentation requires those responses to delimit consistent regions.
Watershed segmentation interprets a scalar image as a topographic surface. Catchment basins define regions, while watershed lines define their boundaries. Marker-controlled variants constrain the number and location of basins, limiting the fragmentation produced by minor local extrema.
Learned segmentation
A learned segmentation model estimates a mapping from image measurements to spatial labels. Earlier systems combined local descriptors with classifiers and then imposed spatial consistency through probabilistic graphical models. Contemporary systems commonly learn both the representation and the label predictor from annotated images.
The fully convolutional network replaced fixed-size classification outputs with spatially arranged predictions. Convolutional feature extraction reduces spatial resolution while increasing receptive field, and later stages restore a dense output through interpolation, learned upsampling, or feature fusion. Encoder–decoder architectures preserve coarse contextual information while recovering boundaries from higher-resolution features.
U-Net uses skip connections between corresponding encoder and decoder stages. These connections combine semantically abstract features with spatially detailed features and have been extensively applied to medical image segmentation. Dilated convolution provides another means of enlarging the receptive field without an equivalent reduction in output resolution.
Transformer-based models represent long-range image relations through attention. Their segmentation heads still produce spatial label distributions, but contextual interaction is not restricted to a fixed local convolutional neighborhood. Hybrid architectures combine convolutional processing with attention-based representations.
Semantic segmentation assigns a category to each pixel without distinguishing separate objects that share a category. Instance segmentation additionally associates pixels with individual object identities. Panoptic segmentation integrates these representations by assigning every pixel a semantic category while preserving instance identities for countable objects.
Training objectives
For a predicted class distribution (\hat p_{p,k}) and a reference label (y_p), pixelwise cross-entropy is commonly written as
[ \mathcal L_{\mathrm{CE}} =-\sum_{p\in\Omega}\log \hat p_{p,y_p}. ]
This objective treats each labeled location as a classification observation. Its aggregate behavior can be dominated by spatially extensive classes, particularly when the relevant object occupies a small fraction of the image.
Overlap-based objectives directly compare predicted and reference regions. For a predicted set (P) and reference set (G), the Dice coefficient is
[ \operatorname{Dice}(P,G)=\frac{2|P\cap G|}{|P|+|G|}. ]
Differentiable approximations replace set membership with predicted probabilities and serve as training losses. Boundary-sensitive objectives place greater weight on contour displacement or on pixels near reference boundaries. Compound objectives combine region agreement with boundary localization because these criteria measure different aspects of the partition.
Supervised learning depends on reference masks whose construction can require substantially more annotation than image-level labels or bounding boxes. Weakly supervised learning derives approximate spatial supervision from less detailed annotations. Semi-supervised learning combines labeled images with unlabeled images through consistency constraints, pseudo-labels, or learned representations.
Evaluation
Segmentation evaluation compares a predicted partition with a reference annotation. The intersection over union for a class is
[ \operatorname{IoU}(P,G)=\frac{|P\cap G|}{|P\cup G|}. ]
Mean intersection over union averages this quantity across classes, preventing large classes from determining the entire score through their pixel count. Pixel accuracy measures the fraction of correctly labeled locations, but it can remain high when a dominant background class occupies most of the image.
Boundary metrics assess the spatial correspondence of contours within a defined tolerance. Instance-level evaluation additionally requires association between predicted and reference objects, after which detection quality and mask overlap can be combined. Panoptic quality uses such a decomposition to account for both recognition and segmentation.
Reference annotations are themselves discretized interpretations of visual structure. Differences among annotators occur near indistinct boundaries, around transparent material, and where semantic definitions do not align with visible contours. Evaluation results therefore depend on the ontology of the label set as well as the geometry of the predicted masks.
Applications and limitations
In medical imaging, segmentation represents anatomical structures or pathological regions for quantitative analysis. In remote sensing, it maps land-cover categories from aerial or satellite observations. Segmentation also supports scene interpretation in robotics, where spatial labels connect visual measurements with navigable surfaces and object-level representations.
Performance is affected by changes between the data used for training and the images encountered during deployment. Variation in sensors, illumination, spatial resolution, or label definitions can produce distribution shift. Small structures and thin boundaries remain difficult because repeated downsampling removes spatial detail, while ambiguous contours may not correspond to a single physically defined edge.
Segmentation models can also encode regularities that are specific to an annotation collection rather than to the intended visual concept. Quantitative evaluation on independent data measures part of this effect, although differences in labeling conventions complicate direct comparison across datasets.