# Image-Text Matching Model Based on CLIP Bimodal Encoding
## 4 Experimental Analysis
### Learning Rate Scheduling  
While the Adam optimizer has been widely recognized for its adaptive learning rate and has gained popularity in multimodal learning, our preliminary experiments indicated that stochastic gradient descent (SGD) was more suitable for our application. Specifically, we observed that SGD achieved better generalization performance across both the Flickr30k and WuKong datasets, while minimizing the risk of overfitting. Moreover, training stability was enhanced with SGD, resulting in smoother convergence for our dual-encoder architecture. Based on these results, we chose to utilize SGD to ensure consistent and reliable performance throughout our experiments. In the model training process, this paper introduced a learning rate scheduling strategy to find the minimum value more efficiently and facilitate faster convergence. As the model sought to extract deeper information during training, it typically consisted of a larger number of layers. This complexity could lead to challenges, such as gradient disappearance or explosion, complicating the convergence process. Gradient descent operated through iterative updates in the feature space, where features of varying scales may have contributed to gradient instability. To address the issue of inconsistent scales, normalization techniques were employed to ensure uniformity across feature data. This effectively alleviated problems related to gradient explosion and disappearance. Additionally, learning rate scheduling served as another effective solution by modifying the learning rate to adjust the magnitude of parameter updates. Among the various popular scheduling schemes, the learning rate decay strategy was particularly prevalent. This strategy began by setting a relatively large learning rate as a target value, then employed a warm-up phase to gradually increase the learning rate to this target. Subsequently, the learning rate was reduced during training. In this paper, we utilized the cosine decay strategy, which decreased the learning rate according to a cosine function. The rationale for selecting cosine decay lay in its smooth reduction of the learning rate, which enhanced convergence stability and helped prevent abrupt changes that could destabilize training. Exponential decay represented the numerical value of the learning rate change according to an exponential function, with the formula:  
\[\alpha_{t}=\alpha_{0}\cdot\beta^{n} \tag{10}\]  
where \(\alpha_{0}\) represented the initial learning rate, \(n\) represented the current training round, and \(\beta\) represented the learning rate decay coefficient. Exponential decay meant that the learning rate would decay once every training round. Step decay meant that the learning rate would decay by a fixed multiple after a certain number of rounds. The formula was:  
\[current\_lr\_rate=lr\_rate\cdot decay\_rate^{(global\_epoch/decay\_epoch)} \tag{11}\]  
where \(lr\_rate\) was the initial learning rate, \(decay\_rate\) was the learning rate decay coefficient, \(global\_epoch\) was the number of rounds of current training, and \(decay\_epoch\) was the learning rate decay cycle, which determined how many rounds the learning rate decayed at once. As it was a step decay, its function image was a discrete image. When the remainder of the training round and the learning rate decay cycle was 0, the above formula was calculated to obtain the new learning rate value. This paper used the cosine decay strategy, indicating that the change trend of the learning rate during the model training process followed the cosine function law. The cosine decay formula was:  
\[ \begin{array}{l}global\_step=min(global\_step,decay\_steps)\\ cosine\_decay=0.5\cdot(1+cos(\pi\cdot\frac{global\_step}{decay\_steps}))\\ decayed=(1-\alpha)\cdot cosine\_decay+\alpha\\ decayed\_learning\_rate=learning\_rate\cdot decayed\end{array}