# SPL-YOLOv8: A Lightweight Method for Rape Flower Cluster Detection and Counting Based on YOLOv8n
## 2 Data and Methods
### Methods
#### 2.2.3 StarNet Backbone Network  
The backbone network is a crucial component of the model, significantly impacting parameter count and performance. YOLO models are renowned for their efficiency and accuracy in object detection tasks, thanks to their backbone networks that combine linear projections, non-linear activation functions, and self-attention mechanisms. However, these networks often suffer from high computational complexity and reduced efficiency. To address this, we selected the novel StarNet [25] backbone network. StarNet innovatively uses star-shaped operations to efficiently fuse and interact feature maps, enhancing feature attention and extraction without significantly increasing computations. This makes it superior to traditional self-attention mechanisms that involve complex matrix operations. Star-shaped operations in StarNet fuse features through element-wise multiplication of two linearly transformed features, as shown in the formula below:  
\[\left\{\begin{aligned} & O_{\text{star}}=\left(W_{1}^{T}X\right)* \left(W_{2}^{T}X\right)\\ & W=\left[\begin{aligned} W\\ B\end{aligned}\right]\\ & X=\left[\begin{aligned} X\\ I\end{aligned}\right]\end{aligned}\right. \tag{1}\]  
In the equations: \(O_{\text{star}}\) is the result after the star operation, \(W\) is the weight matrix of the linear layer, \(B\) is the bias of the linear layer, \(X\) is the input, \(*\) denotes the star operation. Based on Equation (1), we define \(\omega_{1},\omega_{2},x\in\mathbb{R}^{(c+1)\times 1}\), where \(c\) is the number of input channels. The star operation can then be further expressed as:  
Figure 3: Structure of the SPL-YOLOv8 model.  
\[w_{1}^{T}x*w_{2}^{T}x \tag{2}\]  
\[=\left(\sum_{i=1}^{d+1}w_{1}^{i}x^{i}\right)*\left(\sum_{j=1}^{d+1}w_{2}^{j}x^{j}\right) \tag{3}\]  
\[=\sum_{i=1}^{d+1}\sum_{j=1}^{d+1}w_{1}^{i}w_{2}^{j}x^{i}x^{j} \tag{4}\]  
\[=\alpha_{(1,1)}x^{1}x^{1}+\cdots+\alpha_{(4,5)}x^{4}x^{5}+\cdots+\alpha_{(d+1,d+1)}x^{d+1}x^{d+1} \tag{5}\]  
where \(i\) and \(j\) are channel subscripts, and \(\alpha_{(i,j)}\) is the coefficient corresponding to the \(i\)-th and \(j\)-th channels, defined as follows:  
\[\alpha_{(m,n)}=\begin{cases}\omega_{1}^{i}\,\omega_{2}^{j},&i=j\\ \omega_{1}^{i}\,\omega_{2}^{j}+\omega_{1}^{j}\,\omega_{2}^{i},&i\
eq j\end{cases} \tag{6}\]  
StarNet [25] adopts a four-level hierarchical structure, where each level uses convolutional layers for downsampling and Star Blocks for feature extraction. The overall structure is shown in Figure 4. Star Blocks first employ depthwise convolution (DWConv) for initial feature extraction, followed by batch normalization, resulting in two feature maps with doubled width and a channel expansion factor of 4. After applying the ReLU activation function, the feature maps are fed into the second DWConv for further feature extraction, producing the output feature maps. Compared to traditional convolution, DWConv divides the convolution operation into two steps: performing convolution on each channel of the input data and then element-wise summing the results of these channels to obtain the output. This approach effectively reduces the number of parameters and computational cost, further enhancing the training and inference processes of the model.