A heterogeneous cauliflower multi-class classification method based on color features

By constructing a heterogeneous cauliflower classification model, and using image data enhancement and color enhancement modules to extract features in the CIELAB space, combined with the SE attention mechanism and backbone network, the problem of subtle color differences and multi-class recognition in cauliflower image grading was solved, achieving efficient multi-class recognition and discrimination performance improvement.

CN120932017BActive Publication Date: 2026-07-07ZHEJIANG UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG UNIV
Filing Date
2025-08-15
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing deep learning-based cauliflower image grading methods suffer from limited classification performance when dealing with samples with subtle color differences and color variations. They also lack multi-class recognition capabilities and struggle to identify impurities, detached flower heads, and other heterogeneous objects, thus limiting their application in practical grading scenarios.

Method used

A heterogeneous cauliflower classification model was constructed. RGB images were converted to the CIELAB color space through image data augmentation and color enhancement modules. Features were extracted by combining the SE attention mechanism and the backbone network. A multi-task learning structure was adopted for feature extraction and classification. The AdamW optimizer was used for training, and a loss function was constructed to optimize model performance.

Benefits of technology

It significantly enhances the model's ability to express color features and its perceptual robustness, improves its discrimination performance on color-variant samples, achieves efficient multi-class recognition, and is suitable for efficient deployment on resource-constrained devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120932017B_ABST
    Figure CN120932017B_ABST
Patent Text Reader

Abstract

This invention discloses a multi-class classification method for heterogeneous cauliflower based on color features. The method involves acquiring RGB images of broccoli for each category and performing image data augmentation processing. The processed RGB images are then labeled according to their categories to obtain a multi-class broccoli dataset. A heterogeneous cauliflower classification model is constructed, and the multi-class broccoli dataset is input into the model for training, resulting in a trained heterogeneous cauliflower classification model. The RGB images of the broccoli to be tested are then input into the trained heterogeneous cauliflower classification model to obtain the predicted category of the RGB images. This invention enhances the model's ability to perceive cauliflower color features through color space transformation, adaptively optimizes the importance of feature channels using an attention mechanism, and guides the classifier to focus on key color features using a color regressor. This improves the model's comprehensive ability to identify color variations and structural anomalies, thereby increasing the classification accuracy of heterogeneous cauliflower and providing support for cauliflower quality screening.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for classifying heterogeneous cauliflower images, specifically a multi-class classification method for heterogeneous cauliflower based on color features. Background Technology

[0002] Cauliflower is a common edible flower, belonging to the Brassicaceae family and the Brassica genus. It is rich in nutritional value and enjoys strong market demand. my country is one of the world's major cauliflower producers, ranking among the top in both planting area and annual output, with an average annual production exceeding 9 million tons, accounting for more than one-third of global production. my country boasts a rich variety of cauliflower varieties, encompassing multiple color variations including white, purple, and green, reflecting broad diversity and personalized demand in the consumer market.

[0003] In recent years, with the continuous improvement of consumption levels and the gradual establishment of a standardized agricultural product distribution system, cauliflower, as a representative of high-quality vegetables, has seen a significant increase in the requirements for its appearance and quality grade. Among these requirements, surface color (such as purple, green, and yellow) serves as an important basis for variety identification and quality grading, playing a crucial role in actual grading and sales. Furthermore, in the actual post-harvest processing, impurities, residual leaves, mud clumps, stem segments, and other foreign objects must be removed.

[0004] In existing broccoli grading technologies, deep learning-based image grading methods mainly involve manually designing color and morphological features (such as chromaticity value b*, transverse diameter TCD, and hue angle Hdeg) and combining them with traditional neural network structures for classification. For example, after extracting image features through preprocessing methods such as background purification, color segmentation, and grayscale transformation, a BP neural network is used to classify broccoli grades, achieving a prediction accuracy of up to 93.4% (Tu K, Ren K, Pan L, et al. A study of broccoli grading system based on machine vision and neural networks[C] / / 2007 International Conference on Mechatronics and Automation.IEEE,2007:2332-2336). In addition, for the detection of color defects in agricultural products, such as discoloration, missing kernels, and insect infestation in maize ears, existing studies have combined HSV color space and CLBP texture features, and established an abnormal ear identification model based on SVM classifier, with an accuracy rate exceeding 96% (Li Qi, Wang Kang, Qiang Hua, et al. A method for classifying and identifying abnormal maize ears based on color and texture features [J]. Jiangsu Journal of Agricultural Sciences, 2020, 36(01):24-31.). There are also methods that propose to convert RGB images into a set of color indices for specific application scenarios through color mapping technology, so as to support users to customize color preferences or adjust grading parameters, thereby improving the practicality and interactivity of the grading system (Lee DJ, Archibald JK, Xiong G. Rapid color grading for fruit quality evaluation using direct color mapping [J]. IEEE transactions on automation science and engineering, 2010, 8(2):292-302.).

[0005] However, existing deep learning-based cauliflower image grading methods still have several technical limitations when handling samples with subtle color differences or color variations. Existing analysis methods struggle to highlight subtle color differences, resulting in limited classification performance. Furthermore, they neglect the auxiliary role of color continuity information in feature learning, reducing the model's generalization ability and color discrimination accuracy, thus limiting their widespread application in practical grading scenarios. In addition, most current deep learning-based image recognition methods primarily focus on grade classification and variety identification, lacking sufficient ability to identify heterogeneous elements such as impurities and detached flower heads, and lacking multi-class recognition mechanisms, severely restricting their industrial application value. Summary of the Invention

[0006] To address the problems existing in the background technology, this invention proposes a multi-category identification method for heterogeneous cauliflower based on color features.

[0007] The technical solution adopted in this invention is:

[0008] The method of the present invention includes the following steps:

[0009] S1. Collect several RGB images of broccoli for each category, perform image data augmentation on all RGB images of broccoli, and then label the RGB images of broccoli after image data augmentation according to the category to obtain a multi-category dataset of broccoli.

[0010] S2. Construct a heterogeneous cauliflower classification model. Input the multi-class broccoli dataset into the heterogeneous cauliflower classification model for training to obtain a trained heterogeneous cauliflower classification model.

[0011] S3. Input the RGB image of the broccoli to be tested into the trained heterogeneous cauliflower classification model to obtain the predicted category of the RGB image of the broccoli to be tested.

[0012] In step S1, the image data enhancement processing includes data enhancement operations such as adding Gaussian noise, random occlusion, advanced color perturbation, MixUp blending enhancement, random horizontal flipping, random rotation, random cropping, and scaling.

[0013] The heterogeneous cauliflower classification model includes a color enhancement module, a backbone network, a color regressor, and a classifier. The enhanced RGB image of broccoli is input into the color enhancement module to obtain a dual-channel objective color enhancement tensor and an L* channel tensor. Then, the dual-channel objective color enhancement tensor, the R, G, and B channel tensors of the broccoli RGB image, and the L* channel tensor are input into the backbone network for feature extraction and global average pooling to obtain a global feature pooling vector. This global feature pooling vector is then fed into the color regressor and classifier for processing, yielding the Lab normalized mean predicted value and the predicted category of the broccoli RGB image, respectively. The predicted category of the broccoli RGB image is used as the output of the heterogeneous cauliflower classification model, and the Lab normalized mean predicted value is used to construct the loss function.

[0014] The color enhancement module is mainly composed of a color space conversion module and an SE attention mechanism module connected in sequence. The enhanced broccoli RGB image is input into the color space conversion module and converted to the CIELAB color space to obtain three channel tensors: L*, a*, and b*. Then, the a* and b* channel tensors are input into the SE attention mechanism module for attention weighting to obtain a dual-channel objective color enhancement tensor.

[0015] The SE attention mechanism module is mainly composed of an objective color compression module and an objective color activation module connected in sequence. The objective color compression module includes a first global average pooling layer, a first fully connected layer and a first ReLU activation function connected in sequence. The objective color activation module includes a second fully connected layer and a Sigmoid activation function connected in sequence.

[0016] The input of the first global average pooling layer serves as the input of the SE attention mechanism module, the output of the first ReLU activation function is connected to the input of the second fully connected layer, and the output of the Sigmoid activation function serves as the output of the SE attention mechanism module.

[0017] The backbone network is mainly composed of an input convolutional module, seven sets of inverted residual blocks, a feature upscaling module, and a second global average pooling layer connected in sequence. The input convolutional module includes a first convolutional layer, a first normalization layer, and a second ReLU activation function connected in sequence. The seven sets of inverted residual blocks are connected in sequence. The feature upscaling module includes a second convolutional layer, a second normalization layer, and a third ReLU activation function connected in sequence.

[0018] The input of the first convolutional layer serves as the input of the backbone network. The output of the second ReLU activation function is connected to the input of the first set of inverted residual blocks. The output of the last set of inverted residual blocks is connected to the input of the second convolutional layer. The output of the third ReLU activation function is connected to the input of the second global average pooling layer. The output of the second global average pooling layer serves as the output of the backbone network.

[0019] The color regressor is mainly composed of a third fully connected layer, a fourth ReLU activation function, a first regularization layer, and a fourth fully connected layer connected in sequence; the classifier is mainly composed of a second regularization layer and a fifth fully connected layer connected in sequence.

[0020] The input of the third fully connected layer is used as the input of the color regressor, the output of the fourth fully connected layer is used as the output of the color regressor, the input of the second regularization layer is used as the input of the classifier, and the output of the fifth fully connected layer is used as the output of the classifier.

[0021] In step S3, the loss function is set according to the following formula:

[0022] L total =L cls +β·L color

[0023]

[0024] Among them, L total L represents the total loss function. cls For the cross-entropy loss of the classification task, L colorLet y be the cross-entropy loss for the regression task, β represent the weighting coefficient, β∈[0.05,0.3], Batch represent the number of samples in the current batch, C is the number of classes, and y ic For one-hot tags, p ic For the predicted probability distribution, For the predicted value of the Lab normalized mean, Lab i The average value of all pixels in the Lab image. Represents the square of the Euclidean distance.

[0025] In step S3, during the training of the heterogeneous cauliflower classification model, the AdamW optimizer is used.

[0026] The beneficial effects of this invention are:

[0027] By converting the original RGB image to the CIELAB color space and extracting the a* and b* channels reflecting subjective color differences and the L* channel representing brightness, a dual-channel objective color enhancement tensor (a* and b* channels) and an L* channel tensor are introduced, significantly enhancing the model's ability to express color features and its perceptual robustness. Combining this with the SE attention mechanism to adaptively adjust the feature response intensity of the a* and b* channels further highlights key color information, thereby optimizing the feature extraction quality of the backbone network.

[0028] Furthermore, this invention constructs a multi-task learning structure that combines parallel classification and color regression, enabling accurate identification and classification of subtle color differences in heterogeneous cauliflower images. This effectively improves the discrimination performance for color-variant samples, while retaining an efficient single-branch prediction path during the inference stage, thus balancing model accuracy and deployment efficiency. Attached Figure Description

[0029] Figure 1 This is a flowchart of the method of the present invention.

[0030] Figure 2 These are images of heterogeneous cauliflower collected from various sources.

[0031] Figure 3 This is a schematic diagram of the backbone network structure of the LABFusion-SE-Mnet model.

[0032] Figure 4 This is a schematic diagram of the color regressor and classifier structure.

[0033] Figure 5 This is a schematic diagram of the model after the color regressor is turned off.

[0034] Figure 6 This is the confusion matrix result of an embodiment of the present invention. Detailed Implementation

[0035] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0036] like Figure 1 As shown, the heterogeneous cauliflower multi-category classification method includes the following steps:

[0037] S1. Collect several images for each category, such as... Figure 2 The RGB images of broccoli shown are used to perform image data augmentation on all RGB images of broccoli. Then, the RGB images of broccoli after image data augmentation are labeled according to category to obtain a multi-category dataset of broccoli.

[0038] In this embodiment, the enhanced image size is 224×224. The enhanced image is divided into a training set, a validation set, and a test set in a ratio of 7:2:1.

[0039] S2. Construct a heterogeneous cauliflower classification model (LABFusion-SE-MNet). Input the multi-class broccoli dataset into the heterogeneous cauliflower classification model for training to obtain a trained heterogeneous cauliflower classification model.

[0040] S3. Input the RGB image of the broccoli to be tested into the trained heterogeneous cauliflower classification model to obtain the predicted category of the RGB image of the broccoli to be tested.

[0041] Several original RGB images of broccoli were collected from various categories, including normal broccoli, discolored broccoli, detached broccoli, residual leaves, stems, and impurities. Several RGB images of broccoli were collected for each category. The collected broccoli images are RGB images.

[0042] In step S1, the image data enhancement processing includes data enhancement operations such as adding Gaussian noise, random occlusion, advanced color perturbation, MixUp blending enhancement, random horizontal flipping, random rotation, random cropping, and scaling.

[0043] The heterogeneous broccoli classification model includes a color enhancement module, a backbone network, a color regressor, and a classifier. The enhanced RGB image of the broccoli is input into the color enhancement module to obtain a dual-channel objective color enhancement tensor X and an L* channel tensor. Then, the dual-channel objective color enhancement tensor X, the R, G, and B channel tensors of the broccoli RGB image, and the L* channel tensor are input into the backbone network for feature extraction and global average pooling to obtain a global feature pooling vector. This global feature pooling vector is then fed into the color regressor and classifier for further processing, yielding Lab normalized mean predicted values. The predicted categories of the broccoli RGB images are used as the output of the heterogeneous cauliflower classification model. Lab normalized mean predicted values ​​are used to construct the loss function for training the heterogeneous cauliflower classification model. The Lab normalized mean predicted values ​​are the normalized mean predicted values ​​of the L*, a*, and b* channels of the Lab image.

[0044] The color enhancement module mainly consists of a color space conversion module and an SE attention mechanism module connected sequentially. The enhanced broccoli RGB image is input into the color space conversion module and converted to the CIELAB color space to obtain three channel tensors: L*, a*, and b*. In other words, the color space conversion module converts the enhanced image to the CIELAB color space, resulting in a three-channel image (L*, a*, b*). Then, the a* and b* channel tensors are input into the SE attention mechanism module for attention weighting to obtain a two-channel objective color enhancement tensor.

[0045] The color space conversion module converts the enhanced image to the CIELAB color space using the following steps:

[0046] First, the RGB image is normalized to the [0,1] interval using the following formula, and then Gamma correction is performed to calculate the linear RGB values ​​R, G, and B:

[0047]

[0048] Among them, r, g, and b are the original RGB image components, and R, G, and B are the RGB values ​​after Gamma correction.

[0049] Then, convert the image from RGB space to XYZ space using the following formula:

[0050]

[0051] Where X, Y, and Z are the values ​​of the three channels in the XYZ space.

[0052] Then, the image is converted from XYZ space to CIELAB space using the following formula:

[0053]

[0054] Among them, L * a * b * For the values ​​of the three channels in the final CIELAB space, X n Y n Z n The default values ​​are usually 95.047, 100.0, and 108.883.

[0055] The SE attention mechanism module is mainly composed of an objective color compression module and an objective color activation module connected in sequence. The objective color compression module includes a first global average pooling layer, a first fully connected layer and a first ReLU activation function connected in sequence. The objective color activation module includes a second fully connected layer and a Sigmoid activation function connected in sequence.

[0056] The input of the first global average pooling layer serves as the input of the SE attention mechanism module. The output of the first ReLU activation function is connected to the input of the second fully connected layer, and the output of the Sigmoid activation function serves as the output of the SE attention mechanism module. Specifically, both the first and second fully connected layers are 2×2 in size.

[0057] The dual-channel objective color enhancement tensor X is set according to the following formula:

[0058] S=δ(FC1(GAP(ab)))

[0059] X = ab·σ(FC2(S))

[0060] Where GAP(·) is the global average pooling function, FC1 is the weight matrix of the first fully connected layer, and FC1∈R 2 ×2 δ(·) is the ReLU activation function, ab are the a* and b* channels in the Lab image, FC2 is the weight matrix of the second fully connected layer, and FC2∈R 2×2 σ(·) is the Sigmoid function, and S is the characteristic S.

[0061] The objective color compression module includes a global average pooling layer, a first fully connected layer, and a ReLU activation function, obtaining feature S according to the above formula. The objective color activation module includes a second fully connected layer and a Sigmoid function, converting feature S into a two-channel objective color enhancement tensor X according to the above formula. Subsequently, the obtained two-channel objective color enhancement tensor X, the R, G, and B channels of the enhanced image, and the L* channel of the Lab image are used as inputs to the backbone network. The backbone network is composed of the MobileNetV2 backbone network, as follows... Figure 3 As shown, it includes a feature extraction module and a global feature pooling module. The feature extraction module includes an input convolution module, an inverse residual module, and a feature dimensionality enhancement module, while the global feature pooling module is a global average pooling layer.

[0062] The backbone network is mainly composed of an input convolutional module, seven sets of inverted residual blocks, a feature upscaling module, and a second global average pooling layer connected in sequence. The input convolutional module includes a first convolutional layer, a first normalization layer, and a second ReLU activation function connected in sequence. The seven sets of inverted residual blocks are connected in sequence. The feature upscaling module includes a second convolutional layer, a second normalization layer, and a third ReLU activation function connected in sequence.

[0063] The input of the first convolutional layer serves as the input of the backbone network. The output of the second ReLU activation function is connected to the input of the first set of inverted residual blocks. The output of the last set of inverted residual blocks is connected to the input of the second convolutional layer. The output of the third ReLU activation function is connected to the input of the second global average pooling layer. The output of the second global average pooling layer serves as the output of the backbone network.

[0064] Specifically, the dual-channel objective color enhancement tensor X, the R, G, and B channels of the enhanced image, and the L* channel of the Lab image are processed by the input convolution module to obtain feature map X1. Feature map X1 is then input into the inverse residual module to obtain feature map X2. Feature map X2 is then processed by the feature upscaling module to obtain feature map X3. Subsequently, the global feature pooling module inputs feature map X3 into the global average pooling layer, compressing feature map X3 into a global pooling feature vector f. pool f pool The dimension is 1280.

[0065] The input convolutional module includes a first convolutional layer with a size of 3×3 and a stride of 2, connected to a normalization layer and a ReLU activation function, and outputs a feature map X1 with a size of 112×112×32.

[0066] Seven sets of inverted residual blocks: Each set of inverted residual blocks includes a 1×1 point convolutional layer, a 3×3 depthwise separable convolutional layer, and then a 1×1 linear convolutional layer. All of them are connected to a batch normalization layer and a ReLU6 activation function. The structure of the seven sets of inverted residual blocks is shown in Table 1. The output feature map is X2 with a size of 7×7×320.

[0067] Table 1. Network structure of the seven groups of inverted residual blocks

[0068]

[0069] The feature upscaling module includes a second convolutional layer of size 1×1 with a stride of 1, and connects a normalization layer and a ReLU function to output a feature map X3 with a size of 7×7×1280.

[0070] The color regressor is mainly composed of the third fully connected layer, the fourth ReLU activation function, the first regularization layer, and the fourth fully connected layer connected in sequence; the classifier is mainly composed of the second regularization layer and the fifth fully connected layer connected in sequence.

[0071] The input of the third fully connected layer is used as the input of the color regressor, the output of the fourth fully connected layer is used as the output of the color regressor, the input of the second regularization layer is used as the input of the classifier, and the output of the fifth fully connected layer is used as the output of the classifier.

[0072] During the model training phase, a multi-task joint learning approach is adopted, including image classification and color regression tasks, such as... Figure 4 As shown, the specific implementation steps are as follows:

[0073] Two output branches are set in parallel after the feature pooling layer of the backbone network, including a classifier and a color regressor, such as... Figure 5 As shown.

[0074] The classifier consists of a second regularization layer and a fifth fully connected layer, specifically implemented as follows:

[0075] The second regularization layer receives the global pooling feature vector f. pool The feature vector f is obtained after a Dropout operation with a dropout probability of 0.2. pool drop ; will f pool drop Input the fifth fully connected layer and calculate the output class probability p according to the following formula. The dimension of p is 6.

[0076] p = Softmax(f pool drop ·W c +b c )

[0077] Among them W c ∈R 1280×C b c ∈R Batch×C Batch represents the batch size. The final output vector p represents the probability distribution of the cauliflower image belonging to one of the six target classes (normal cauliflower, discolored cauliflower, detached cauliflower, withered leaves, stem, and impurities). The model ultimately uses the class with the highest probability as the classification result. For the obtained class probabilities p, the cross-entropy loss L for the classification task is calculated using the following formula. cls .

[0078] Specifically, the color regressor consists of a third fully connected layer, a ReLU activation function, a first regularization layer, and a fourth fully connected layer, outputting the normalized mean predicted values ​​of the three channels L*, a*, and b* of the Lab image.

[0079] The third fully connected layer receives the feature vector f. pool The feature vector h1 is obtained according to the following formula. The first regularization layer inputs h1 into the Dropout layer with a dropout probability of 0.2 to obtain the feature vector h1. drop The fourth fully connected layer will transfer the feature vector h1 drop Mapped to the normalized mean predicted values ​​of the three channels L*, a*, and b* of the Lab image.

[0080] h1 = ReLU(fpool ·W1+b1)

[0081]

[0082] Where W1∈R 1280×256 b1∈R Batch×256 W2∈R 256×3 b2∈R Batch×3 Batch is the batch size.

[0083] The classifier consists of a second regularization layer and a fifth fully connected layer, and outputs a classification prediction label.

[0084] In step S3, the loss function is set according to the following formula:

[0085] L total =L cls +β·L color

[0086]

[0087] Among them, L total L represents the total loss function. cls For the cross-entropy loss of the classification task, L color Let y be the cross-entropy loss for the regression task, β represent the weighting coefficient, β∈[0.05,0.3], Batch represent the number of samples in the current batch, C is the number of classes, and y ic For one-hot tags, p ic For the predicted probability distribution, For the predicted value of the Lab normalized mean, Lab i The average value of all pixels in the Lab image. Represents the square of the Euclidean distance.

[0088] In step S3, during the training of the heterogeneous cauliflower classification model, the optimizer used is the AdamW optimizer, based on the calculated cross-entropy loss L. total The classification and regression tasks are optimized simultaneously through backpropagation.

[0089] Specifically, this includes: in the SE attention mechanism module, the parameters of the first fully connected layer in the objective color compression module, and the parameters of the second fully connected layer in the objective color activation module; in the backbone network, the parameters of the first convolutional layer and the first normalization layer in the input convolution module, the parameters of the seven inverse residual blocks in the inverse residual module, and the parameters of the second convolutional layer and the second normalization layer in the feature dimensionality enhancement module; the parameters of the fifth fully connected layer in the classifier; and the parameters of the third and fourth fully connected layers in the color regressor.

[0090] This invention compares its performance with other classification models. During training, the weighting coefficient β of the loss function is set to 0.1. The classification results are shown in Table 2. The proposed heterogeneous cauliflower classification model, LABFusion-SE-MNet, achieves superior results. The confusion matrix of the classification results is shown in Table 2. Figure 6 As shown.

[0091] Table 2 Performance Comparison of the Invention Model with Other Models

[0092]

[0093] This invention enhances the model's ability to perceive cauliflower color features through color space transformation and adaptively optimizes the importance of feature channels using an attention mechanism. Simultaneously, it assists the color regressor in guiding the classifier to focus on key color features, improving the model's comprehensive ability to identify color variations and structural anomalies (such as impurities, withered leaves, detached flower heads, and stems). While maintaining high classification accuracy, this method is built on the lightweight MobileNetV2 backbone, resulting in a small number of parameters and low computational overhead. It is suitable for efficient deployment on resource-constrained devices, providing reliable technical support for the quality screening and grading of heterogeneous cauliflower.

Claims

1. A multi-category classification method for heterogeneous cauliflower based on color features, characterized in that, The method includes the following steps: S1. Collect several RGB images of broccoli for each category, perform image data augmentation on all RGB images of broccoli, and then label the RGB images of broccoli after image data augmentation according to the category to obtain a multi-category dataset of broccoli. S2. Construct a heterogeneous cauliflower classification model. Input the multi-class broccoli dataset into the heterogeneous cauliflower classification model for training to obtain a trained heterogeneous cauliflower classification model. S3. Input the RGB image of the broccoli to be tested into the trained heterogeneous cauliflower classification model to obtain the predicted category of the RGB image of the broccoli to be tested. The heterogeneous cauliflower classification model includes a color enhancement module, a backbone network, a color regressor, and a classifier. The enhanced RGB image of broccoli is input into the color enhancement module for processing to obtain a dual-channel objective color enhancement tensor and an L* channel tensor. The dual-channel objective color enhancement tensor, the R, G, and B channel tensors of the broccoli RGB image, and the L* channel tensor are then input into the backbone network for feature extraction and global average pooling to obtain a global feature pooling vector. The global feature pooling vector is then fed into the color regressor and the classifier for processing to obtain the Lab normalized mean prediction value and the predicted category of the broccoli RGB image, respectively. The predicted category of the broccoli RGB image is used as the output of the heterogeneous cauliflower classification model, and the Lab normalized mean prediction value is used to construct the loss function. The color enhancement module is mainly composed of a color space conversion module and an SE attention mechanism module connected in sequence. The enhanced broccoli RGB image is input into the color space conversion module and converted to the CIELAB color space to obtain three channel tensors: L*, a*, and b*. Then, the two channel tensors a* and b* are input into the SE attention mechanism module for attention weighting to obtain a dual-channel objective color enhancement tensor. The SE attention mechanism module is mainly composed of an objective color compression module and an objective color activation module connected in sequence. The objective color compression module includes a first global average pooling layer, a first fully connected layer and a first ReLU activation function connected in sequence. The objective color activation module includes a second fully connected layer and a Sigmoid activation function connected in sequence. The input of the first global average pooling layer serves as the input of the SE attention mechanism module, the output of the first ReLU activation function is connected to the input of the second fully connected layer, and the output of the Sigmoid activation function serves as the output of the SE attention mechanism module.

2. The multi-category classification method for heterogeneous cauliflower based on color features according to claim 1, characterized in that: In step S1, the image data enhancement processing includes data enhancement operations such as adding Gaussian noise, random occlusion, advanced color perturbation, MixUp blending enhancement, random horizontal flipping, random rotation, random cropping, and scaling.

3. The multi-category classification method for heterogeneous cauliflower based on color features according to claim 1, characterized in that: The backbone network is mainly composed of an input convolutional module, seven sets of inverted residual blocks, a feature upscaling module, and a second global average pooling layer connected in sequence. The input convolutional module includes a first convolutional layer, a first normalization layer, and a second ReLU activation function connected in sequence. The seven sets of inverted residual blocks are connected in sequence. The feature upscaling module includes a second convolutional layer, a second normalization layer, and a third ReLU activation function connected in sequence. The input of the first convolutional layer serves as the input of the backbone network. The output of the second ReLU activation function is connected to the input of the first set of inverted residual blocks. The output of the last set of inverted residual blocks is connected to the input of the second convolutional layer. The output of the third ReLU activation function is connected to the input of the second global average pooling layer. The output of the second global average pooling layer serves as the output of the backbone network.

4. The multi-category classification method for heterogeneous cauliflower based on color features according to claim 1, characterized in that: The color regressor is mainly composed of a third fully connected layer, a fourth ReLU activation function, a first regularization layer, and a fourth fully connected layer connected in sequence; the classifier is mainly composed of a second regularization layer and a fifth fully connected layer connected in sequence. The input of the third fully connected layer is used as the input of the color regressor, the output of the fourth fully connected layer is used as the output of the color regressor, the input of the second regularization layer is used as the input of the classifier, and the output of the fifth fully connected layer is used as the output of the classifier.

5. The multi-category classification method for heterogeneous cauliflower based on color features according to claim 1, characterized in that: In step S3, the loss function is set according to the following formula: in, Represents the total loss function. For the cross-entropy loss of the classification task, For the cross-entropy loss of the regression task, Indicates the weighting coefficient. , Batch This indicates the number of samples in the current batch, where C is the number of categories. For one-hot tags, For the predicted probability distribution, This is the predicted value of the Lab normalized mean. The average value of all pixels in the Lab image. Represents the square of the Euclidean distance.

6. The multi-category classification method for heterogeneous cauliflower based on color features according to claim 1, characterized in that: In step S3, during the training of the heterogeneous cauliflower classification model, the AdamW optimizer is used.