## 3 Tire Marking Point Identification Network Structure
### YOLOv5s Model Improvements
#### 3.2.1 Adding an Attention Mechanism  
In the improved YOLOv5s model [19], the simAM (Similarity Attention Mechanism) attention mechanism was introduced. This mechanism is a 3D weighted attention module that derives attention weights for the feature map without requiring additional parameters. The schematic diagram of the simAM module is depicted in Figure 6. The inspiration behind this module comes from the attention mechanism observed in the human brain. In the figure, the 3D weight implementation is achieved using an energy function.  
The design of the simAM module draws inspiration from the field of neurology, where neurons carrying rich information are often distinguished from other neurons by exhibiting unique firing patterns. Additionally, neurons carrying rich information tend to suppress the activity of surrounding neurons, a phenomenon known as null-field suppression in neurology. Hence, it is crucial to assign higher weights to these neurons to value their contributions.  
The simAM module uses the measurement of linear differentiability of neurons to find significant neurons and devises an energy function to find significant neurons, Equation (4) [20]:  
\[e_{t}(w_{t},b_{t},y,x_{i})=\left(y_{t}-\hat{t}\right)^{2}+\frac{1}{M-1}\sum_{i =1}^{M-1}(y_{0}-x_{i})^{2} \tag{4}\]  
where \(t\) and \(x_{i}\) are the input features, \(X\in R^{C\times H\times W}\) are neurons in one of the channels that contain a lot of information, and other ordinary neurons that do not contain much information, \(\hat{t}\) and \(x_{i}\) These two parameters are derived from \(t\) and \(x_{i}\) and are transformed linearly by the following equation:  
\[\hat{t}=w_{i}t+b \tag{5}\]  
\[M=C\times H \tag{6}\]  
where the parameter \(i\) is the spatial dimension index, \(M=C\times H\) is the number of neurons in the current channel, \(w_{i}\) is the transform weight, and \(b_{i}\) represents the deviation. Solving for the minimum of Equation (4) by binarizing \(y_{t}\) and \(y_{0}\) and regularizing Equation (4), a new expression for the energy function can be obtained as (7):  
\[e_{t}(w_{t},b_{t},y,x_{i})=\frac{1}{M-1}\sum_{i=1}^{M-1}\left(-1-(w_{t}x_{i}+b _{t})\right)^{2}+(1-(w_{t}t+b_{t}))^{2}+\lambda w_{t}^{2} \tag{7}\]  
Figure 6: Structure of simAM attention module.  
An analysis of the above equation gives:  
\[w_{t}=-\frac{2(t-\mu_{t})}{\left(t-\mu_{t}\right)^{2}+2\sigma^{2}+2\lambda} \tag{8}\]  
\[b_{t}=-\frac{1}{2}(t+\mu_{i})w_{i} \tag{9}\]  
Assuming for the moment that all pixels in each channel follow the same distribution and that the mean of the target neuron \(\mu=\frac{1}{M}\sum\limits_{i=1}^{M-1}x_{i}\) and the variance of the target neuron \(\sigma^{2}=\frac{1}{M}\sum\limits_{i=1}^{M-1}(x_{i}-\mu)^{2}\) are removed, the energy function of the smallest neuron should be the following equation:  
\[e_{t}^{*}=\frac{4\left(\sigma^{2}+\lambda\right)}{\left(t-\mu\right)^{2}+2 \sigma^{2}+2\lambda} \tag{10}\]  
where \(\mu=\frac{1}{M}\sum\limits_{i=1}^{M-1}x_{i}\), \(\sigma^{2}=\frac{1}{M}\sum\limits_{i=1}^{M-1}(x_{i}-\mu)^{2}\), and \(e_{t}^{*}\) are smaller means that this neuron \(t\) is different from the surrounding neurons and that this neuron \(t\) is also quite important, so it should be given enough weight and given a higher weight value.  
Once a specific neuron has been found and then the derivative of the neuron energy expansion has been derived, the feature enhancement to be studied is performed by adding the Sigmoid function as in Equation (11).  
\[\overset{\sim}{x}=sigmoid\left(\frac{1}{E}\right)\odot X \tag{11}\]  
To determine the best location for the simAM module, it was connected to CBL, CSP_1, and CSP_3 of the original network to test the network performance, and it was finally decided to insert the simAM module behind CSP_3 and named CSPS.