As mentioned above, our solution is an architectural extension that can be adapted to a generic neural network.
In this paper, we used a standard Convolutional Neural Network, the ResNet18, as a base model to which we added our solution to solve a hierarchical images classification problem.
As graphically represented in Figure REF , what we do is to extend the output layer with some fully connected layers equal to the number of layers available in the classes hierarchy tree of the problem to be solved, and to associate a loss function to each of these new layers added.
In practice, we construct a mapping between the layers of a class hierarchy and the new layers of the neural network (\(linear_1,\dots ,linear_N\)  in Figure REF ) so that the network can learn to discriminate between all class labels belonging to a given layer of the hierarchy.
To minimize the intra-class variance and at the same time to keep the features among different classes separated we compute the Center Loss [1]} on each training mini-batch and update all class centers after each training epoch.
More formally we compute the center loss \(\mathcal {L}_{C}\)  as follow:
\(\mathcal {L}_{C} = \sum _{i=1}^{m}{\Vert x_{i} - c_{y_{i}} \Vert }_{2}^{2} \) 
