# Developing a Dead Fish Recognition Model Based on an Improved YOLOv5s Model
## 3 YOLO-DWM Model Algorithm  
### DWMConv Convolution Module  
The YOLOv5s network has significant downsampling, which causes many feature details of the targets to be gradually lost during the downsampling process. Dead fish on the water surface are greatly affected by lighting, and the targets often exist at a certain distance from the detection source. However, the original Conv module has a weak ability to extract features for targets of different scales. Therefore, the goal is to improve the detection performance of the targets while minimizing the increase in the model's parameter count. A multi-scale convolution module based on depthwise separable convolution (DWMConv) is proposed, with the DWMConv structure shown in Figure 2. First, the input features undergo initial feature extraction through a 3 \(\times\) 3 convolutional kernel (Conv) to capture the information of the input features. Then, they are further processed through three parallel convolutional operations: a 3 \(\times\) 3 depthwise convolution (DWConv), a 3 \(\times\) 3 convolution (Conv), and a 5 \(\times\) 5 depthwise convolution (DWConv) for additional feature extraction. The use of DWConv allows for retaining the spatial feature extraction capability of conventional convolutions while reducing redundant computations. At the same time, DWMConv utilizes a residual structure. Finally, these features are fused. After passing through the BN layer and SiLU activation function, a standard convolution with a kernel size of 1 is applied for pointwise convolution to adjust the number of output channels.  
The specific calculation process for DWMConv is as follows:  
\[Y^{\prime}=Y_{in}f_{3\times 3} \tag{4}\]  
\[Y^{\prime\prime}=Y^{\prime}+Y^{\prime}f_{3\times 3}+Y^{\prime}f_{3\times 3}+Y^{ \prime}f_{5\times 5}^{\prime} \tag{5}\]  
\[Y_{out}=SiLU(\gamma Y^{\prime\prime}+\beta)f_{1\times 1} \tag{6}\]  
where \(Y_{in}\) is the input feature map, \(Y^{\prime}\) is the original feature map, \(Y^{\prime\prime}\) is the feature map after the second processing, \(Y_{out}\) is the final output feature map, \(f\) is the kernel of the standard convolution, \(f^{\prime}\) is the kernel of the depthwise convolution, and \(\gamma\) and \(\beta\) are the learnable parameters in the BN layer.  
Figure 1: The network structure of YOLO-DWM.  
DWMonv is a multi-scale depthwise separable convolution, where the \(3\times 3\) convolutional kernel is suitable for capturing fine details, while the \(5\times 5\) convolutional kernel is better at capturing broader contextual information. This multi-scale convolution can capture various patterns of the input features, enhancing the model's feature representation capability. Additionally, the residual structure helps to address the vanishing gradient problem in deep networks and allows information to flow more easily through the network.  
Depthwise separable convolution is a commonly used convolution operation in neural networks that primarily consists of two parts: depthwise convolution (DWConv) and pointwise convolution. The structure is shown in Figure 3. Depthwise convolution consists of processes 1 and 2, where each channel is convolved with a separate convolutional kernel. This means that each input channel generates a corresponding output channel to capture feature information of the target. Processes 3 and 4 represent pointwise convolution, which convolves all channels at each position, allowing for a linear combination of the feature maps generated by the depthwise convolution.