## 3 PQD Classification Model Based on Lightweight DenseNet
### Attention Mechanism  
The convolution and pooling operations of CNNs assume equal importance for each channel in the feature map by default. However, since the significance of the information carried by each channel varies, treating all channels as equally important lacks rationality. The CBAM convolutional block attention mechanism is an attention module designed to enhance the CNN's feature capture capability, as proposed by [PERSON] et al. [19]. The primary objective of this module is to improve the model's ability to perceive crucial feature information by incorporating channel attention and spatial attention, thereby enhancing classification performance without increasing network complexity. Consequently, this paper introduces the CBAM attention mechanism to strengthen the network's focus on detailed features within various LT of PQDs, enabling it to achieve better classification results. The CBAM attention mechanism module is mainly composed of two sub-modules: the channel attention module (CAM) and the spatial attention module (SAM). Its specific structure is shown in Figure 4. The main basis for CAM to allocate the weight coefficients is the importance of the feature channels. Firstly, global average pooling and max pooling are applied to aggregate information across all channels, generating two distinct one-dimensional feature vectors. These vectors are then processed through fully connected layers, followed by element-wise addition and an activation function to compute the channel attention weight \(M_{\text{CAM}}\), which is calculated as follows:  
\[M_{\text{CAM}}(F)=\text{sigmoid}(\text{MLP}(\text{AvgPool}(F))+\text{MLP}( \text{MaxPool}(F))) \tag{3}\]  
where MLP represents the computation performed by fully connected layers. AvgPool and MaxPool represent average pooling and max pooling operations, respectively. \(F\) refers to the input feature map of the CAM module. After \(M_{\text{CAM}}\) is obtained, it is element-wise multiplied with \(F\) to produce the feature map \(F_{1}\), which is weighted by CAM. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Layer** & \begin{tabular}{c} **Module Composition** \\ **(Growth Rate \(k\) = 32)** \\ \end{tabular} & **Output Dimensions** \\ \hline Convolutional & \(7\times 7\) Conv, stride = 2 & 64 \(\times\) 64 \(\times\) 64 \\ \hline Pooling & \(3\times 3\) Max pooling, stride = 2 & 32 \(\times\) 32 \(\times\) 64 \\ \hline DB1 & \(\begin{bmatrix}1\times 1\text{ Conv}\\ 3\times 3\text{ Conv}\end{bmatrix}\times 3\) & 32 \(\times\) 32 \(\times\) 160 \\ \hline Transition & \begin{tabular}{c} \(1\times 1\text{ Conv}\\ 2\times 2\text{ Average pooling, stride = 2}\end{tabular}\) & 16 \(\times\) 16 \(\times\) 80 \\ \hline DB2 & \(\begin{bmatrix}1\times 1\text{ Conv}\\ 3\times 3\text{ Conv}\end{bmatrix}\times 8\) & 16 \(\times\) 16 \(\times\) 336 \\ \hline Transition & \begin{tabular}{c} \(1\times 1\text{ Conv}\\ 2\times 2\text{ Average pooling, stride = 2}\end{tabular}\) & 8 \(\times\) 8 \(\times\) 168 \\ \hline DB3 & \(\begin{bmatrix}1\times 1\text{ Conv}\\ 3\times 3\text{ Conv}\end{bmatrix}\times 12\) & 8 \(\times\) 8 \(\times\) 552 \\ \hline Classification & \
\begin{tabular}{c} Adaptive average pooling \\ Fully connected, Softmax \\ \end{tabular} &
\begin{tabular}{c} \(1\times 1\times 552\) \\ \(1\times 1\times 41\) \\ \end{tabular} \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Network structure of the lightweight L-DenseNet model. After the feature map, \(F_{1}\), which is processed by CAM weighting, is obtained, it is used as input for the SAM module to further capture important spatial regions. Max pooling and average pooling are spatially applied to \(F_{1}\), generating two two-dimensional feature maps, which are then concatenated and processed through a convolution operation and activation function to ultimately produce the spatial attention weight \(M_{\text{SAM}}\). This weight is then applied to obtain the feature map weighted by SAM.