# Deep Learning-Based Imagery Style Evaluation for Cross-Category Industrial Product Forms
## 4 Imagery Style Evaluation (ISE) Method for Cross-Category Industrial Product Forms
### Constructing an Enhanced YOLOv5 Deep Learning Network for Imagery Style Evaluation  
The deep learning architecture of the YOLOv5s network was chosen to construct an evaluation network structure for the imagery style of industrial product forms. However, it was found that misjudgments often occur for the original YOLOv5s network model. This issue arose because the model mistakenly identified small local elements as features while overlooking key features in the images. To solve this problem, a Convolutional Block Attention Module (CBAM) [72] was integrated into the Backbone network of the original YOLOv5s to capture key morphological features. Figure 8 illustrates the architecture of the CBAM attention mechanism. First, the feature map P is input into the Channel Attention Module to obtain the channel weights, which are then multiplied with the input feature map P to generate the intermediate feature map P\({}^{\prime}\). Next, p\({}^{\prime}\) is fed into the Spatial Attention Module to obtain the spatial weights, which are subsequently multiplied with p\({}^{\prime}\) to produce the final weighted feature map p\({}^{\prime\prime}\). The process can be expressed mathematically as follows:  
\[P=M_{c}(P)\otimes P \tag{15}\]  
\[P^{\prime\prime}=M_{s}(P^{\prime})\otimes P^{\prime} \tag{16}\]  
\[M_{c}(P)=\sigma(MLP(AvgPool(P))+MLP(AvgPool(P)) \tag{17}\]  
\[M_{s}(P)=\sigma\big{(}f^{i\times i}(AvgPool(P));MaxPool(P)\big{)} \tag{18}\]  
where P is the feature map, and \(M_{c}\) and \(M_{s}\) denote the Channel Attention Module and Spatial Attention Module. \(\otimes\) denotes the multiplication of elements, \(\sigma\) is a sigmoid operation, \(f^{i\times i}\) denotes a convolution operation with a convolution kernel of size \(i\times i\), \(W_{0}\) and \(W_{1}\) denote two convolution operations, \(P_{avg}^{c}\) and \(P_{avg}^{s}\) denote average pooling, \(P_{max}^{c}\) and \(P_{max}^{s}\) denote maximum pooling, and Multilayer Perceptron (MLP) represents the process of channel downgrading and then recovering. Figure 8: Structure diagram of the CBAM attention mechanism. Furthermore, variations in local chamfering in product form design can influence different imagery styles. In the original YOLOv5 deep network, shallow feature layers have a smaller receptive field compared to deeper layers, which enables them to extract more detailed features and better detect small, critical regions in the image. To address this issue, the YOLOv5s model is modified by changing the input channel to layer 13 from layer 17 to the first Conv layer in the Head module. This adjustment allows lower-level semantic features from the Neck structure to be directly recognized as local morphology, thereby reducing information loss of shallow features during convolution. The Head section uses the Complete Intersection over Union (CIoU) loss function, which integrates the center point distance, aspect ratio, and overlapping area for more precise bounding box regression. This loss function enhances the accuracy of localization and evaluation of key feature areas in industrial product forms, thereby improving the overall performance of the model. The calculation formula is as follows:  
\[ \begin{split} C IoU_{Loss}=1-\left(IoU-\frac{Distance\_2^{2}}{Distance\_C^{2}}-\frac{V^{2}}{(1-IoU)+V}\right)\\ V=\frac{4}{\pi^{2}}\left(arctan\frac{\underline{w}^{gt}}{\underline{ h}^{gt}}-arctan\frac{\underline{w}^{gt}}{\underline{h}^{gt}}\right)^{2}\\ IoU=\frac{DetectionResult\cap Ground Truth}{DetectionResult \cup Ground Truth}\end{split}  \tag{19}\]  
where \(C\) is the minimum outer rectangle, \(Distance\_C^{2}\) is the diagonal distance, \(Distance\_2^{2}\) is the Euclidean distance between the centers, and \(w\) and \(h\) are the width and height scales of the bounding box, respectively. The Intersection over Union (IoU) measures the overlap between the predicted bounding box and the ground truth box, defined as the ratio of their overlapping area to their union area. Higher IoU values indicate more accurate evaluation results.