Abstract:Gossypol, a toxic compound unique to the Gossypium species, holds significant research value in agriculture and pharmaceuticals. Pigment glands, the primary carriers of gossypol, exhibit phenotypic traits that strongly correlate with gossypol content, making them effective indicators for its evaluation. However, the detection of pigment glands primarily relies on manual analysis, which is both time-consuming and inefficient. To address these limitations, Gland-MSConNet, a novel model designed for the accurate segmentation of cotton leaf pigment glands in complex backgrounds was proposed. The model integrated the convolutional bidirectional Mamba (ConBimamba) and multi-scale attention aggregation (MSAA) modules, significantly enhancing its ability to capture multi-scale features and improving robustness in challenging scenarios. Additionally, the incorporation of sub-pixel convolution facilitated efficient upsampling, preserving fine-grained details. Experimental results demonstrated that Gland-MSConNet achieved a segmentation mIoU of 89.83% and a recall rate of 95.03%, representing improvements of 4.66 percentage points and 5.78 percentage points, respectively, over the U-Net model. These findings highlighted the model’s high segmentation accuracy and robustness. The Gland-MSConNet model provided a strong technical foundation for the segmentation and phenotypic quantification of cotton leaf pigment glands, offering a reliable basis for the automated evaluation of gossypol content.