## 2 Materials and Methods
### YOLOv10 Network Improvement
#### 2.2.3 Histogram Transformer Optimization  
In the YOLOv10 network, the extraction of image features mainly relies on convolutional kernels with fixed receptive fields, which makes it difficult for the model to simultaneously focus on local details and global information. This causes the model, under complex backgrounds, to tend to overlook the subtle features of tea tree diseases, resulting in missed or false detections of small-area diseases.  
Figure 5: Wavelet Transform Conv.  
To address this issue, this study introduces the Histogram Transformer to optimize the YOLOv10 network, aiming to enhance the feature extraction capability of the original network, reduce background interference, and improve the detection accuracy of disease regions [22]. The core idea is to group the spatial features of the image using histograms, and to assign pixels to different groups based on pixel intensity or other features. As shown in Figure 6, the Histogram Transformer is mainly composed of two parts: DHSA (Dynamic-range Histogram Self-Attention) and DQFF (Dual-scale Gated Feed-Forward).  
DHSA primarily captures the histogram information within the image by dynamically adjusting the weights of the self-attention mechanism, thereby enhancing the model's understanding of the overall distribution of the image. DQFF introduces a multi-scale perspective by capturing key information from the image at different scales during feature processing. Through a gating mechanism, the DQFF module can effectively control the transmission and fusion of features from different scales, thus helping the model to better handle both local and global features in the image. As shown in Equations (12) and (13), Equation (12) indicates that at layer l, the input feature \(F_{l-1}\) is processed by Layer Normalization and then input to DHSA. The output from DHSA is added to the previous layer output \(F_{l-1}\) to produce the current layer output \(F_{l}\). Equation (13) shows that after processing \(F_{l}\) with Layer Normalization, it is input to DQFF, and the output of DQFF is added to the input to form the new \(F_{l}\).  
\[F_{l}=F_{l-1}+\text{DHSA}(\text{LN}(F_{l-1})) \tag{12}\]  
\[F_{l}=F_{l}+\text{DQFF}(\text{LN}(F_{l})) \tag{13}\]  
To more effectively capture and integrate features from different scales during image processing, the Histogram Transformer incorporates two types of reshaping within DHSA: BHR (Bin-wise Histogram Reshaping) and FHR (Frequency-wise Histogram Reshaping). In BHR, features are grouped into different bins based on intensity, with each bin including a specific range of pixel values. This method enables the model to integrate and process features on a global level, thus achieving a more comprehensive understanding of the overall distribution and structure of the image. In contrast, FHR reshapes the features according to frequency, grouping the features into specific frequency dimensions, with each bin concentrating on a narrower range of intensity values and containing fewer pixels. This  
Figure 6: Histogram Transformer.  
allows the model to capture the local details in the image more precisely, thereby enhancing its ability to perceive and process fine details.