## 5 Discussion  
The automatic segmentation of plant lesions helps agricultural experts in clinical diagnosis to accurately outline the lesions and assist farmers in immediate treatment of crops. This article designs a plant leaf lesion segmentation network based on an improved MA-Net. We introduced a Mix Vision Transformer and ECA into this method. To demonstrate the superiority of this method, this paper first used resnet101 as the encoder. Under the same encoder, U-Net, U-Net++, MA-Net, Link-Net, FPN, PSP-Net, PAN, DeepLabV3, and DeepLabV3+ were selected as the main structures. After experimental comparison, it was proven that the segmentation effect of MA-Net is superior, as the mIoU reached 0.97973. Afterwards, using MA-Net as the main structure, dpn98, _se_resnet101, resnext101_32x8d, timm-regnetx_006, timm-regnety_006, densenet169, timm-gernet_m, mit_b2, and mit_b3 were used as encoders, respectively. After experimental comparison, it was proven that the segmentation effect is superior when using mit_b2 as the encoder, as the mIoU reached 0.98123. After selecting mit_b2 as the encoder, we replaced the original attention module PAB of MA-Net with attention modules SE, ECA, and CBAM. After experimental comparison, it was proven that the segmentation effect is superior when using ECA, as the mIoU reached 0.98159. Compared to Res-block, MiT consumes less time during the training process, can better capture global and contextual information in images, and has better robustness and scalability. Compared to PAB, which has higher computational complexity and requires a large amount of computing resources, ECA reduces the number of model parameters and computation by learning the correlation between channels. ECA also has better denoising ability.  
ECA learns channel attention through a 1D convolutional layer, thereby reducing computational complexity. PAB usually contains two fully connected layers, so the computational complexity of PAB is relatively high. Due to the low computational complexity of ECA, the required time is also relatively small. ECA itself does not add additional parameters, and the number of parameters mainly depends on the number of channels in the input feature map. The number of parameters in ECA is relatively small, with only one convolutional layer parameter. PAB has a large number of parameters, including the parameters of two fully connected layers.  
Parameters are the variables that are learned and optimized by the model during the training process. They are specific to the model and are adjusted based on the available data. Parameters help the model to capture patterns and trends in the data, and they are typically initialized with random values. Parameters are typically optimized using algorithms like gradient descent, which update the values of the parameters to minimize the error on the training set. The number of parameters is related to the number of channels in the input feature map, assuming there are C channels in the input feature map. As shown in Table 6, ECA has certain advantages in computational complexity, computation time, and number of parameters.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Attention** & **Computational Complexity** & **Time Taken** & **Parameters** \\ \hline PAB & \(\text{O}(D^{2}+D^{2}+n^{2}\times h+n\times D\times h)\) & 0.01294 s & \(5C^{2}+C^{3}/8\) \\ SENet & \(\text{O}(H\times W\times C+C^{2})\) & 0.00032 s & \(2\times C/r\) \\ CBAM & \(\text{O}(C\times k1\times k1\times H\times W+H\times W\times k2\times k2\times C)\) & 0.00038 s & \(C\times(C+2)+k^{2}\times C\) \\ ECANet & \(\text{O}(C\times D+D^{2})\) & 0.00026 s & \(2\times C\) \\ \hline \hline \end{tabular}
\end{table}
Table 6: Comparison of attention modules. The size of the input feature map is \(H\times W\), \(C\) is the number of channels, \(D\) is dimension, \(r\) is the compression ratio (usually 16), the size of the convolution kernel is \(k\times k\), the number of attention heads is \(h\), and the sequence length is \(n\).