# A Survey of Full-Cycle Cross-Modal Retrieval: From a Representation Learning Perspective
## 4 Loss Function  
The loss function will assess the model's performance by comparing the anticipated and expected outputs of the model and then determining the directions of optimization. If the difference between the two is exceptionally high, the loss value will be significant. Oppositely, if the difference is tiny or about equal, the loss value will be meager. As a result, an adequate loss function is required that correctly punishes the model as it is trained on the dataset. This section defines the principal loss function and performance analysis methods. We summarize innovative samples of the loss function in cross-modal tasks, which can be seen in Figure 4.  
Conventional classification methodologies divide loss functions into regression, binary, and multi-class categories. In contrast, our survey synthesized the utilization and development of loss functions within the context of cross-modal retrieval, ultimately distilling the loss function into four fundamental components. Consequently, the loss functions were classified into regression-based loss, classification-based loss, ranking loss, and cross-modal application loss. For example, the L1 loss and L2 loss represent prevalent approaches for calculating loss in regression loss functions. The L1 loss function calculates the mean absolute difference between predicted and actual values, with a valid domain extending from zero to positive infinity. This loss function exhibits rapid convergence, and the gradient can be assigned an appropriate penalty weight rather than an equal one, thus providing a more accurate gradient for updating the optimization direction. However, the L1 loss is vulnerable to the influence of outliers, which can dominate the gradient update process and render it unreliable. In contrast, the L2 loss function computes the sum of squared differences between predicted and true values. Despite its merits, the L2 loss presents certain drawbacks, such as a discontinuous derivative at 0, which leads to reduced solution efficiency and sluggish convergence. Additionally, the gradient for small loss values is indistinguishable from that of other loss values, which is not conducive to effective network learning. In the context of classification-based loss functions, the cross-entropy loss function is predominantly utilized. Ranking loss, on the other hand, estimates the relative distance between the input samples and is often associated with metric learning. Triplet \begin{table}
\begin{tabular}{c c} \hline \hline Pros of Unified Generation Model & **Generation Ability**: A unified generation model can generate outputs in one modality based on inputs from another modality, which can be useful for cross-modal retrieval. \\ \hline Pros of Unified Generation Model & **Better Performance**: A unified generation model can provide better performance in cross-modal retrieval compared to separate models for different modalities. The unified model can capture the complex relationships between different modalities more effectively. \\ \hline Cons of Unified Generation Model & **Limited Flexibility**: A unified generation model is not as flexible as traditional models in handling different modalities. The model generates representations for all modalities, which may not be optimal for specific modalities. \\ \hline Cons of Unified Generation Model & **Increased Complexity of Training**: Although training a unified generation model may take less time, the complexity of training the model may be higher. The model generates representations for multiple modalities, which can be a more challenging task. \\ \hline Cons of Unified Generation Model & **Increased Risk of Overfitting**: A unified generation model is more prone to overfitting. The model generates representations for multiple modalities simultaneously, which may overfit if the training data are not sufficiently diverse. \\ \hline \hline \end{tabular}
\end{table}