# Enhanced YOLO- and Wearable-Based Inspection System for Automotive Wire Harness Assembly
## 2 Materials and Methods
### Model Selection
#### 2.2.4 Global Context Network Enhances Feature Extraction Modules  
Traditional convolutional neural networks use local receptive fields for convolution operations in image processing. A limitation of this approach is that it can only model a limited region of an image, leading to a restricted receptive field. This is particularly problematic in scenarios involving targets with distant correlations, as the convolutional kernel can only observe a portion of the image within its convolution range, making it challenging to enhance the detection capability for long-range dependencies. To strengthen the model's understanding of global relationships and expand its perceptual range, thereby better adapting to changes in scale, this paper integrates the Global Context Network (GCNet) into the C3 module, forming a combined C3 GC module to replace the original C3 module. GCNet is a global context modeling framework inspired by the advantages of Non-Local Networks and Squeeze-and-Excitation Networks (SENet). It combines the global context modeling capabilities of Non-Local Networks with the computational efficiency of SENet. Non-local uses non-local operations to establish remote dependency relationships between pixels in an image, enabling global attention. This approach allows the model to  
Figure 6: ASHF Network structure (\(X^{i-sl}\) denotes the output of a location feature map. \(a^{1},\ \ \beta^{2}\), \(\gamma^{3}\) denotes learnable weights). transcend the limitations of local association points. Additionally, it leverages an attention mechanism to generate globally attentive features, thereby acquiring more comprehensive information. This structure aims to enhance the model's perceptual range of global relationships, making it more suitable for processing image features of varying scales. The output of a Non-Local block can be expressed as follows:  
\[Z_{i}=X_{i}+W_{z}{\sum_{j=1}^{N_{p}}}\frac{f\big{(}X_{i}X_{j}\big{)}}{C(x)} \left(W_{v}*X_{j}\right), \tag{2}\]  
where \(i\) is the index of the query location and \(j\) enumerates all possible locations. \(f\left(X_{i}X_{j}\right)\) represents the relationship between positions \(i\) and \(j\), and has a normalization factor \(C(x)\). \(W_{z}\) and \(W_{v}\) represent linear transformation matrices (e.g., \(1\times 1\) convolution). For simplicity, let us denote \(\frac{f\left(X_{i}X_{j}\right)}{C(x)}\) as the normalized pairwise relationship between locations \(i\) and \(j\). However, the Non-local structure calculates the attention distribution for each pixel, causing a huge waste of computing resources. Therefore, GCNet takes advantage of its advantages and simplifies its structure, which can be expressed as follows:  
\[Z_{i}=X_{i}+W_{z}{\sum_{j=1}^{N_{p}}}\frac{exp\left(W_{k}X_{j}\right)}{{\sum_{ m=1}^{N_{p}}}exp\left(W_{k}X_{m}\right)}X_{j}, \tag{3}\]  
The simplified Non-local block structure is shown in Figure 7a. The entire GCNet block can be simply expressed as follows:  
\[Z_{i}=F(X_{i},\delta({\sum_{j=1}^{N_{p}}}\,\mathrm{a}_{j}X_{j})), \tag{4}\]  
\({\sum_{j=1}^{N_{p}}}\,\mathrm{a}_{j}X_{j}\) represents the weight module, and \(F\) represents the aggregation of global features to the features of each position. GCNet also incorporates the advantages of the SENet structure, optimizing the computational load while maintaining the basic speed of the model, thereby enhancing its accuracy. The architecture of the SE block is illustrated in Figure 7b.