  In this article, we propose a method to design loss functions based on
component trees which can be optimized by gradient descent algorithms and which
are therefore usable in conjunction with recent machine learning approaches
such as neural networks. We show how the altitudes associated to the nodes of
such hierarchical image representations can be differentiated with respect to
the image pixel values. This feature is used to design a generic loss function
that can select or discard image maxima based on various attributes such as
extinction values. The possibilities of the proposed method are demonstrated on
simulated and real image filtering.
