## 2 Materials and Methods
### Network Model Construction
#### Multiscale feature fusion
\[O=\sum_{i}\frac{w_{i}}{\varepsilon+\sum_{j}w_{j}}\cdot I_{i} \tag{2}\]  
\[O=\sum_{i}\frac{e^{w_{i}}}{\sum_{j}e^{w_{j}}}\cdot I_{i} \tag{3}\]  
The original Concat module is restructured, using BiFPN to replace the traditional FPN and PAN for a novel feature fusion approach, thereby assigning higher weights to small object features, enhancing the focus on small targets. * **Deformable convolution** In laser weeding operations, targeting the critical tissue parts of weeds with laser beams is essential for effective weed eradication; imprecise targeting can increase the accidental injury rate to crop seedlings. The original YOLOv8-seg network relies on the detection accuracy of bounding boxes within the Backbone, but square bounding boxes are not sensitive to the local information of irregular targets. Therefore, to enhance the network's perception of the irregular edges of weeds, deformable convolutions (DCNs) [29] are considered for integration into the Backbone, allowing some \(3\times 3\) convolutional kernels to adjust their shapes to fit the irregular structures of weeds, while maintaining the stability of the convolutional structure and reducing deviation. Given that Dynamic Snake Convolution (DSConv) [30] performs well in segmenting tubular structures, adapting to slender and twisted local structural features to enhance geometric structure perception, this paper introduces DSConv, constructing convolutional kernels with strong perception of irregular curves. This section elucidates the application of DSConv in extracting irregular local features of weed stems and leaf edges, assuming standard 2D convolutional coordinates \(K\), with the center coordinate as \(K_{i}=(x_{i},y_{i})\). The original \(3\times 3\) convolutional kernel is \(K\), represented by  
\[K=\{(x-1,y-1),(x-1,y),\cdots,(x+1,y+1)\} \tag{4}\]  
By introducing deformation offsets \(\Delta\), the convolutional kernel becomes more flexible, focusing on the irregular edges of tubular weed stems and leaves. Figure 5 linearizes the standard kernel in both axial directions, expanding it into a kernel of size 9. Taking the \(X\) axial direction as an example, each grid position in \(K\) is denoted as \(K_{i\pm c}=(x_{i\pm c},y_{i\pm c})\), where \(c=0,1,2,3,4\) represents the horizontal distance from the center grid. The selection of each grid position \(K_{i\pm c}\) in kernel \(K\) is a cumulative process. Starting from the central position \(K_{i}\), the position away from the center grid depends on the position of the previous grid: \(K_{i\pm 1}\) increases by an offset \(\Delta=\{\delta|\delta\in[-1,1]\}\) relative to \(K_{i}\)[30]. Therefore, the offsets need to be accumulated to ensure that the kernel conforms to a linear structural form. The change in the X-axis direction is  
\[K_{i\pm c}= \begin{cases}(x_{i\pm c},y_{i\pm c})=\left(x_{i}+c,y_{i}+\sum_{i}^{i +c}\Delta y\right)\\ (x_{i\pm c},y_{i\pm c})=\left(x_{i}-c,y_{i}+\sum_{i-c}^{i}\Delta y\right)\end{cases}  \tag{5}\]  
The change in the Y-axis direction is  
\[K_{j\pm c}= \begin{cases}\left(x_{j\pm c},y_{j\pm c}\right)=\left(x_{j}+\sum_{ j}^{j+c}\Delta x,y_{j}+c\right)\\ \left(x_{j\pm c},y_{j\pm c}\right)=\left(x_{j}+\sum_{j-c}^{j}\Delta x,y_{i}-c \right)\end{cases}  \tag{6}\]  
Since the offset \(\Delta\) is typically a decimal, while coordinates are usually in integer form, bilinear interpolation is employed, expressed as  
\[K=\sum_{k^{\prime}}B\left(K^{\prime},K\right)\cdot K^{\prime} \tag{7}\]  
Here, \(K\) represents the decimal positions in Equations (5) and (6). \(K^{\prime}\) enumerates all integer spatial positions.