# YOLO-PGC: A Tomato Maturity Detection Algorithm Based on Improved YOLOv11
## 3 Methods
### Convolutional--Inductive Feature Fusion Module  
The proposed CIF2M architecture tackles the fundamental limitations of traditional CNNs when it comes to feature representation in complex backgrounds and occlusion scenarios. As shown in Figure 3, this module boosts feature modeling capabilities by integrating a lightweight architectural design, hierarchical feature extraction mechanisms, and dynamic convolution structures. The core CIF2M component adopts advanced techniques, such as grouped convolution, lightweight linear mapping, nonlinear activation, and batch normalization. These techniques enable it to achieve optimal computational efficiency while retaining robust feature representation capabilities for detecting tomato ripeness in complex environmental scenarios. The foundational grouped convolution component, shown in Figure 3b, implements computational optimization through strategic convolution decomposition. The mathematical formulation is  
\[Y=\sum_{g=1}^{G}X_{g}*K_{g}, \tag{7}\]  
where \(X_{g}\) denotes the input feature map, \(K_{g}\) represents grouped convolutional kernels, \(G\) indicates the quantity of the channel, \(g\) specifies the group number, and \(Y\) represents the output feature map. This approach optimizes computational efficiency while ensuring robust extraction of critical tomato characteristics, including surface texture and color gradients, thereby enhancing the accuracy of ripeness classification.  
For feature dimensionality management, CIF2M implements lightweight linear mapping through \(1\times 1\) convolutions. This process encompasses feature compression followed by higher-dimensional expansion, allowing for enhanced multiscale information integration capabilities. The transformation is formulated as follows:  
\[X_{\text{expanded}}=W_{1\times 1}(X_{\text{compressed}}) \tag{8}\]  
where \(X\) represents input features, \(X_{\text{compressed}}\) denotes compressed features, and \(X_{\text{expanded}}\) indicates expanded output features. This lightweight architecture ensures efficient feature extraction and integration in complex environmental contexts, which helps to maintain robustness against background interference such as vegetation and soil variations.  
The incorporation of GELU nonlinear activation enhances the feature expression capabilities of the model, particularly for complex surface characteristics and subtle ripeness variations. The GELU function is defined as follows:  
\[\text{GELU}(x)=0.5x\Bigg{(}1+\tanh\Bigg{(}\sqrt{\frac{2}{\pi}}\Big{(}x+0.04471 5x^{3}\Big{)}\Bigg{)}\Bigg{)}. \tag{9}\]  
This smooth nonlinear mapping facilitates fine-grained feature pattern learning, demonstrating efficacy in scenarios involving occlusion or subtle color gradients on the tomato surface.  
Batch normalization is applied post-convolution to ensure training stability and convergence optimization across varying environmental conditions. The normalization process is expressed as follows:  
\[\hat{x}=\frac{x-\mu}{\sigma}\cdot\gamma+\beta \tag{10}\]  
where \(\mu\) and \(\sigma\) represent the feature's mean and standard deviation, respectively, \(\gamma\) and \(\beta\) denote learnable scale and shift parameters, respectively, and \(\hat{x}\) represents the normalized feature. This normalization strategy effectively mitigates internal covariate shifts during training, enhancing model adaptability across diverse environmental conditions.  
The hierarchical feature extraction mechanism of CIF2M implements comprehensive target feature capture through sophisticated multiscale information fusion. In the context of tomato ripeness detection, this architecture enables concurrent processing of macroscopic morphological characteristics and microscopic texture features, providing robust feature representation for precise ripeness stage classification.