Rather than build a target shape into the architecture, make the shape a differentiable objective and penalise the network whenever its output has the wrong topology.
A topological loss turns topological data analysis (TDA) into a training signal. From the network’s output one builds a filtration, a nested family of sublevel sets
The map from the function values
As an objective it is a task term plus a topological penalty,
a function of the persistence diagram
Where the penalty pays off
Typical applications enforce the correct count of features where pixel-wise losses cannot, such as segmentation masks that must have exactly one connected component or the right number of loops (vessels, membranes, neurons), and generative outputs constrained to a target genus. Used more weakly it is a topological regulariser, biasing representations or reconstructions toward simple, low-Betti-number shape without fixing it.
Attribution. Feeding persistence to a network as input originates with Hofer et al., Deep Learning with Topological Signatures. The differentiable optimisation side, persistence as an objective minimised by gradient descent, is developed in Gabrielsson et al., A Topology Layer for Machine Learning, and Carrière et al. (differentiating functions of persistence diagrams). Its use as a segmentation loss that fixes the Betti numbers is due to Clough et al. and Hu et al. (topology-preserving segmentation).