Fruit quality detection method and system based on MobileNetV2 and automatic hierarchical learning rate

By optimizing the fruit quality detection model using an automatic hierarchical learning rate strategy based on MobileNetV2, the problems of low training efficiency and unstable detection accuracy were solved, achieving efficient and highly adaptable fruit quality detection.

CN121920900APending Publication Date: 2026-04-24LIAONING UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LIAONING UNIVERSITY
Filing Date
2026-01-15
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing fruit quality testing technologies have shortcomings in terms of training efficiency and generalization ability, detection accuracy, and practicality of deployment. In particular, when dealing with fruits of different varieties and origins, the adaptability and stability of the models need to be improved.

Method used

We adopt a fruit quality detection method based on MobileNetV2, combined with an automatic hierarchical learning rate strategy. By automatically analyzing the network structure and dynamically allocating differentiated learning rates, we construct a lightweight model and introduce an early stopping mechanism and gradient pruning strategy to optimize the training process.

Benefits of technology

It significantly improves the training efficiency and detection accuracy of the model, reduces deployment costs, enhances the adaptability and practicality of the model, and supports rapid adaptation to quality detection tasks of different fruit varieties.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121920900A_ABST
    Figure CN121920900A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision, and discloses a fruit quality detection method and system based on MobileNetV2 and an automatic hierarchical learning rate. The core of the method is that when a MobileNetV2 model is adopted for fruit image quality detection, a hierarchical learning rate strategy is automatically implemented. According to the strategy, a model depth structure can be automatically analyzed, differentiated learning rates from low to high can be allocated to network layers with different depths without manual intervention, and a classifier layer automatically obtains a remarkably improved learning rate. Through the method, training is carried out in combination with gradient cutting and an early stop mechanism, and finally, the optimized model is deployed as an online detection system. According to the method, the training process is automatically optimized, the model training efficiency and the accuracy of fruit quality detection are remarkably improved, and meanwhile, the light weight and easy deployment of the model are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and artificial intelligence, specifically to a fruit quality detection method based on MobileNetV2 and automatic hierarchical learning rate, and in particular to an intelligent detection technology solution that can automatically analyze the network structure and dynamically allocate differentiated learning rates. Background Technology

[0002] With the rapid development of the fruit industry and the increasing demands of consumers for fruit quality, traditional manual quality inspection methods can no longer meet the needs of large-scale, high-efficiency production. Existing computer vision-based fruit quality inspection technologies face numerous technical bottlenecks in practical applications:

[0003] Training efficiency and generalization ability face challenges: When using deep neural networks for fruit quality detection, the traditional uniform learning rate strategy has limitations in adapting to the feature learning needs of different levels. Shallow networks typically learn general features, while deep networks learn task-specific features. Using a uniform learning rate may lead to less than ideal model convergence speed, and relatively high training time and computational resource consumption. Furthermore, the model's generalization ability still has room for improvement when dealing with fruits of different varieties and origins.

[0004] The accuracy and adaptability of existing fruit quality testing methods need further optimization: Their ability to identify subtle surface defects, color gradations, and texture variations needs improvement. The stability of testing results may be affected under complex backgrounds and varying lighting conditions, and the false positive and false negative rates need to be further reduced. Furthermore, the adaptability of existing methods to different fruit varieties, growing environments, and quality standards typically requires targeted adjustments and optimization.

[0005] Balancing deployment usability with resource consumption: Some highly complex deep learning models may face challenges in terms of operating efficiency, memory usage, and inference speed when deployed on mobile devices or embedded systems, which limits their widespread application in resource-constrained environments.

[0006] Therefore, there is an urgent need for a fruit quality testing technology solution that can improve training efficiency, reduce deployment costs, and enhance adaptability while maintaining high detection accuracy. Summary of the Invention

[0007] To address the technical problems of insufficient generalization ability, low training efficiency, and unstable detection accuracy of existing fruit quality detection models when faced with fruits of different varieties and origins, this invention proposes a fruit quality detection method based on MobileNetV2 and automatic hierarchical learning rate. This method effectively improves model training efficiency and detection accuracy through an automatic hierarchical learning rate strategy, while ensuring the practicality and ease of deployment of the technical solution.

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

[0009] Step 1) Construct a basic fruit quality detection model based on MobileNetV2. A MobileNetV2 model pre-trained on the large ImageNet dataset is used as the basic network architecture, and the model's output layer is configured based on the specific task requirements of fruit quality detection. The classifier module of the MobileNetV2 model is replaced with a fully connected layer adapted to fruit quality classification, and the output dimension is dynamically adjusted according to the number of fruit quality categories (e.g., intact, damaged, rotten, insect-infested, etc.). This basic model inherits the general visual feature extraction capabilities learned on ImageNet, providing high-quality initial weights for subsequent fruit quality detection tasks.

[0010] Step 2) Automatically execute the hierarchical learning rate strategy, automatically analyze the complete network structure of the MobileNetV2 model, automatically divide the parameter groups according to the network depth dimension, and automatically calculate and assign differentiated learning rate ratios to each parameter group. The specific implementation process includes:

[0011] Step 2.1) Automatic network structure analysis: Traverse all sub-layer structures in the features module of the MobileNetV2 model, and identify the type, depth, and parameter scale of each sub-layer. Based on the network depth, the sub-layers are automatically divided into three levels: shallow network (layers 1-6), medium network (layers 7-12), and deep network (layers 13-18), and the classifier module is identified separately as a special parameter group.

[0012] Step 2.2) Automatic learning rate ratio calculation: Based on predefined ratio configuration parameters, the learning rate ratio for each layer is automatically calculated using a deep association algorithm. The calculation formula is as follows:

[0013] L = i × d (c / t)

[0014] Where L is the final learning rate, i is the initial learning rate, d is the depth growth factor, c is the current depth, and t is the total depth.

[0015] Step 2.3) Automatic parameter group allocation: The identified network parameters are automatically divided into multiple parameter groups, and a calculated learning rate is assigned to each parameter group. Shallow parameter groups are assigned a lower learning rate ratio (0.1-0.3) to stabilize general feature extraction, deep parameter groups are assigned a higher learning rate ratio (0.7-1.2) to accelerate specific feature learning, and classifier parameter groups are assigned a significantly increased learning rate ratio (1.5-2.0) to quickly optimize classification weights.

[0016] Step 3) Model Training and Optimization: Using an image dataset containing various fruit categories and different quality states, the hierarchical learning rate strategy is applied to iteratively train the model. Several optimization techniques are introduced during the training process:

[0017] Step 3.1) Optimizer configuration: Use the AdamW optimizer combined with an automatic hierarchical learning rate strategy to assign a corresponding learning rate to each parameter group. Simultaneously, configure a cosine annealing learning rate scheduler to automatically adjust the global learning rate during training.

[0018] Step 3.2) Joint Optimization Mechanism: Implement a joint optimization mechanism consisting of an early stopping mechanism and a gradient pruning strategy. The early stopping mechanism monitors the changes in the validation set loss in real time and automatically stops training when the loss no longer decreases for several consecutive training epochs, avoiding over-iteration and overfitting. The gradient pruning strategy limits the gradient update magnitude by setting a gradient threshold, effectively suppressing the gradient explosion problem.

[0019] Step 3.3) Automated management of the training process: The system automatically executes the complete training loop, including forward propagation, loss calculation, backpropagation, gradient pruning, and parameter updates. The system automatically saves the optimal model weights, generates visual charts of the training process, and automatically outputs a training summary report.

[0020] Step 4) Fruit Quality Inspection Application: A complete fruit quality inspection system is built using the trained optimal model. The system receives input images of the fruit to be inspected, processes them through a standardized preprocessing procedure, and then inputs them into the model for inference. It outputs specific quality classification results, including detailed information such as quality grade and defect type. A web application interface is also provided to support real-time online inspection and batch processing functions.

[0021] The MobileNetV2 model employs a depthwise separable convolutional structure, significantly reducing computational parameters while maintaining feature extraction capabilities. The model's feature extraction module comprises 18 convolutional layers: the first six layers primarily extract basic edge and texture features, the middle six layers extract intermediate semantic features, and the last six layers extract high-level abstract features. The classifier module includes Dropout layers and fully connected layers, effectively preventing overfitting and achieving multi-class classification.

[0022] The core configuration parameters of the automatic layered learning rate strategy include: initial learning rate ratio 0.1, depth growth factor 1.2, classifier boost ratio 1.8, minimum learning rate ratio 0.05, and maximum learning rate ratio 2.0. The system automatically calculates the learning rate for each layer based on these parameters, ensuring the stability and efficiency of the training process.

[0023] The model training process uses the cross-entropy loss function, combined with class weights, to address the imbalance problem in the training data. L2 norm regularization and Dropout strategies are employed during training to further prevent overfitting.

[0024] The image dataset contains various fruit varieties (such as apples, bananas, oranges, strawberries, mangoes, etc.) in different quality states (fresh, rotten, etc.), with the image resolution uniformly adjusted to 224×224 pixels. The dataset is automatically divided into training, validation, and test sets in a 7:2:1 ratio to ensure the objectivity and accuracy of model evaluation.

[0025] The web application deployment module is built using the Flask framework and provides a RESTful API interface to support image uploading and detection result return. The system automatically handles image preprocessing, model inference, and result parsing, with a response time of less than 100ms, and supports high-concurrency user access.

[0026] The beneficial effects of this invention are as follows:

[0027] 1) Significantly improved training efficiency: Through the automatic hierarchical learning rate strategy, the model convergence speed is significantly improved and the training time is greatly shortened.

[0028] 2) Significantly improved detection accuracy: The accuracy on multiple fruit quality detection datasets reaches 99%-100%, which is a significant improvement compared to the uniform learning rate strategy.

[0029] 3) Enhanced deployment usability: The optimized model size is controlled within 9.5MB, and the single inference time in a normal CPU environment is less than 100ms, supporting the real-time detection requirements in actual production environments.

[0030] 4) Enhanced automation: The entire process from network analysis to training optimization is automated, significantly reducing technical barriers and maintenance costs, enabling non-professionals to quickly build high-performance detection systems.

[0031] 5) Wide technical adaptability: It can be quickly adapted to the quality testing tasks of different fruit varieties, and shows stable performance in the quality grading of various fruits. It has good generalization ability and practical value. Attached Figure Description

[0032] Figure 1Overall flowchart of the method of this invention;

[0033] Figure 2 Schematic diagram of automatic hierarchical learning rate strategy;

[0034] Figure 3 Comparison chart of training loss effects;

[0035] Figure 4 Comparison chart of test accuracy results;

[0036] Figure 5 A schematic diagram of the system application interface. Detailed Implementation

[0037] The fruit quality detection method and system based on deep learning provided by the present invention will be described in detail below with reference to the accompanying drawings.

[0038] A fruit quality detection method based on MobileNetV2 and automatic hierarchical learning rate includes the following steps:

[0039] Step 1: Construct a deep learning model based on the MobileNetV2 architecture, instantiate the MobileNetV2 basic network architecture, and configure the output layer dimension of the model based on the classification task requirements of fruit quality detection.

[0040] Step 2: Automatically execute the hierarchical learning rate strategy: Analyze the complete network structure of the MobileNetV2 model, automatically divide the parameter groups according to the network depth dimension, and automatically calculate and assign a differentiated learning rate ratio to each parameter group. The core rule is: the learning rate ratio of shallow parameter groups is lower than that of deep parameter groups, which adapts to the update needs of different levels of parameters.

[0041] The method for automatically implementing a hierarchical learning rate strategy is as follows:

[0042] A2.1) Automatically traverse multiple sub-layer structures of the MobileNetV2 model feature extraction module and record the network depth information of each sub-layer;

[0043] A2.2) Based on the network depth position of each sub-layer and combined with the predefined ratio benchmark configuration, the learning rate ratio corresponding to each sub-layer is automatically calculated through the deep association algorithm;

[0044] A2.3) The classifier module parameters of the model are automatically identified as independent parameter groups and assigned a predefined high-priority learning rate ratio, which is higher than the learning rate ratio of the deep layer of the feature extraction module.

[0045] The method for automatically dividing parameter groups according to network depth is as follows: the feature extraction module of the MobileNetV2 model is automatically divided into three parameter groups according to network depth, and the classifier module is identified as an independent parameter group; the three parameter groups include:

[0046] B2.1) Shallow parameter group: network depth 1-6, responsible for basic feature extraction;

[0047] B2.2) Intermediate Parameter Group: Network depth 7-12 layers, responsible for intermediate semantic feature extraction;

[0048] B2.3) Deep parameter group: Network depth 13-18 layers, responsible for high-level abstract feature extraction.

[0049] The formula used to automatically calculate the learning rate ratio is:

[0050] L = i × d(c / t)

[0051] Where L is the final learning rate, i is the initial learning rate, d is the depth growth factor, ranging from 1.1 to 1.3, c is the current layer depth, and t is the total network depth.

[0052] The range of the differential learning rate ratio is as follows:

[0053] C2.1) Learning rate ratio for shallow parameter groups: 0.1-0.3;

[0054] C2.2) Learning rate ratio for the middle layer parameter group: 0.4-0.6;

[0055] C2.3) Learning rate ratio for deep parameter groups: 0.7-1.2;

[0056] C2.4) Learning rate ratio of classifier parameter group: 1.5-2.0.

[0057] Step 3: Using an image dataset containing multiple fruit categories and different quality states, apply a hierarchical learning rate strategy to iteratively train the model;

[0058] During model training, a joint optimization mechanism consisting of an early stopping mechanism and a gradient pruning strategy is introduced: the early stopping mechanism monitors the changes in the loss on the validation set in real time and stops training when the loss does not decrease for several consecutive rounds to avoid over-iteration; the gradient pruning strategy limits the gradient update magnitude by setting a gradient threshold to suppress the gradient explosion problem. The two work together to suppress overfitting.

[0059] The formula used to automatically calculate and allocate differentiated learning rate ratios incorporates a depth growth factor, establishing a positive correlation between the learning rate ratio and network depth, so that the learning rate ratio increases regularly with the increase of network depth.

[0060] Step 4: Utilize the trained optimal model to receive the input fruit image to be detected, perform quality detection through model inference, and output the specific quality classification result.

[0061] The detection system used in the fruit quality detection method based on MobileNetV2 and automatic hierarchical learning rate includes the following functional modules:

[0062] Model building module: Used to instantiate the MobileNetV2 base network and configure the output layer parameters according to the classification target of fruit quality detection, thus completing the model initialization.

[0063] Automatic hierarchical learning rate configuration module: used to automatically parse the network hierarchy of the model, divide the parameter groups according to the depth dimension, calculate the learning rate ratio of each parameter group through the deep association algorithm and complete the allocation.

[0064] Model training module: Used to load datasets and execute model training process. The above-mentioned joint optimization mechanism is integrated during training, and the optimal model parameters are saved after training is completed.

[0065] Image detection interface module: This module provides a standardized image input interface, receives images of fruits to be detected, transmits them to the trained model, and outputs fruit quality classification results.

[0066] Web application deployment module: Used to engineer the optimal model after training, build web service interfaces, support real-time online invocation and application deployment of fruit quality detection, and improve the convenience of practical application of the method.

[0067] Example 1:

[0068] 1. System Overall Architecture and Workflow: The deep learning-based fruit quality inspection system adopts a modular architecture design, and its overall workflow is as follows: Figure 1 As shown, the system begins with fruit images as input. The data preprocessing module performs standardization processing, including uniformly adjusting the image size to 224×224 pixels, performing data augmentation operations such as random horizontal flipping, and normalization processing based on the ImageNet dataset. The system is compatible with three datasets of different sizes: the Augmented-Resized Image dataset containing 51,160 images, the Augmented Image dataset containing 12,335 images, and the sprinkled-fresh dataset containing 16,000 labeled images. A unified data loading interface ensures data format consistency.

[0069] During the model building phase, the system adopts a lightweight deep learning architecture, represented by MobileNetV2, as the base model. During training, the system introduces an innovative automatic hierarchical learning rate strategy (its working mechanism is as follows...). Figure 2 (As shown). This strategy is specifically designed for networks with hierarchical structures, such as MobileNetV2. By analyzing the depth of network layers, the learning rate is dynamically adjusted to achieve fine-tuning of different functional layers. This allows shallow basic feature extraction layers to maintain stability with a lower learning rate, while deep semantic feature layers use a higher learning rate to accelerate convergence.

[0070] Model training employs a fixed 10-episode setting to ensure fair comparison of all models under identical conditions. During training, the system continuously monitors key metrics such as training loss and test accuracy (their trends are shown in the table below). Figure 3 , Figure 4 As shown), the optimal model is selected through a performance evaluation mechanism. The trained model weights are then deployed to a Flask-based web application system, forming a graphical user interface (such as...). Figure 5 As shown in the figure, it supports real-time fruit quality classification and intuitively outputs the test results of "fresh and edible" or "not recommended for consumption" and the corresponding credibility, providing reliable technical support for fruit quality assessment.

[0071] 2. Data Preprocessing and Augmentation Strategies: The system employs an image preprocessing workflow, uniformly adjusting all input images to a 224×224 pixel resolution and performing standardization. For the training data, the system implements various data augmentation techniques, including random horizontal flipping, color perturbation, and geometric transformations, to enhance the model's generalization ability and robustness. These augmentation strategies effectively expand the diversity of training samples, enabling the model to adapt to fruit images under different lighting conditions, shooting angles, and background environments.

[0072] The system supports flexible switching between three datasets through a unified data loader interface. Each dataset undergoes rigorous training-test splitting (typically in an 8:2 ratio) to ensure the fairness and reliability of model evaluation. A class weight balancing mechanism is also implemented during data loading, automatically calculating and applying class weights to effectively address the problem of imbalanced data distribution.

[0073] 3. The key innovation of this invention is the automatic hierarchical learning rate strategy, the core idea of ​​which is to dynamically allocate different learning rates based on the importance and depth characteristics of different layers in the network structure. For example... Figure 2The diagram clearly illustrates how this strategy works. For hierarchical networks like MobileNetV2, shallower layers are responsible for extracting basic visual features, which typically have good generality, and therefore are assigned lower learning rates to maintain stability. Deeper layers, on the other hand, are responsible for learning more abstract, high-level semantic features, which are closely related to specific tasks, and therefore are assigned higher learning rates to accelerate convergence.

[0074] In practice, the layered learning rate configuration automatically sets the learning rate ratio based on network depth. The initial layer's learning rate ratio is set to 0.05, and as the network depth increases, the learning rate gradually increases by a factor of 1.1, with the classifier layer's learning rate further increased by 1.5 times. This refined learning rate scheduling strategy effectively balances the need for feature preservation and rapid convergence, significantly improving the final performance while ensuring stable model training.

[0075] The automatic learning rate ratio calculation, based on predefined ratio configuration parameters, uses a deep association algorithm to automatically calculate the learning rate ratio according to the network depth. Its core formula is:

[0076] L = i × d (c / t)

[0077] Where L is the final learning rate, i is the initial learning rate, d is the depth growth factor, c is the current depth, and t is the total depth.

[0078] 4. To verify the effectiveness of the automatic hierarchical learning rate strategy proposed in this invention, a comparative experiment was designed. The performance of the MobileNetV2 model using the automatic hierarchical learning rate strategy was compared with that of the baseline MobileNetV2 model using a uniform learning rate strategy. Furthermore, a comprehensive comparison was also made with traditional EfficientNet-B0, DenseNet121, Vision Transformer, and Swin Transformer V2. The results are as follows: Figure 3 and Figure 4 As shown, the strategy of the present invention exhibits significant advantages in both training convergence speed and final detection accuracy.

[0079] During training, the system monitors multiple performance metrics in real time, including training loss, test accuracy, and learning rate changes, and generates detailed comparison charts using visualization tools. Figure 3 The training loss comparison chart shown and Figure 4 The test accuracy comparison chart shown clearly demonstrates the performance differences and convergence characteristics of different models under the same training conditions.

[0080] It is particularly worth noting the automatic hierarchical learning rate strategy for the MobileNetV2 model (such as...). Figure 2 The strategy (as shown in the diagram) demonstrates significant advantages. By analyzing the network structure depth, it assigns differentiated learning rates to parameter groups at different levels. Shallow parameters use lower learning rates to maintain general feature extraction capabilities, while deeper parameters use higher learning rates to accelerate the learning of task-specific features. The classifier layer employs an increased learning rate to quickly adapt to the target task. This refined learning rate scheduling strategy significantly improves model performance while ensuring training stability.

[0081] 5. Learning Rate Optimization and Training Stability: The system employs a cosine annealing learning rate scheduling strategy to ensure a smooth decrease in the learning rate throughout the training process. For layered learning rate experiments, the system implements a dynamic parameter grouping mechanism, which can automatically identify and group network layers of different depths based on the model structure.

[0082] Several stability safeguards were implemented during training, including gradient clipping (maximum norm of 1.0), numerical stability checks (detecting and handling NaN / Inf values), and an early stopping mechanism. These measures effectively prevented gradient explosion and overfitting, ensuring the reliability and repeatability of the training process.

[0083] 6. Performance Evaluation and Model Selection: The system comprehensively evaluates model performance using multiple metrics, including final accuracy, training time, loss convergence curve, and accuracy improvement trajectory. Evaluation results show that different models exhibit varying performance characteristics on different datasets: lightweight models (such as MobileNetV2) achieve competitive accuracy while maintaining high inference speed; while more complex models (such as Swin Transformer) demonstrate higher peak performance on some datasets but require longer training times.

[0084] Based on comprehensive evaluation results, the system can automatically select the model that achieves the best balance between accuracy, inference speed, and resource consumption for final deployment.

[0085] 7. System Application and Deployment: such as Figure 5 As shown, the trained model is integrated into an intuitive user interface, supporting various application scenarios. Users can submit fruit images to be detected by simply dragging and dropping or selecting image files. The system will return detection results in real time, including fruit category (such as fresh bananas, spoiled oranges, etc.), confidence score, and consumption suggestions.

[0086] The system backend employs an optimized inference engine, ensuring rapid response on common hardware configurations. For deployment needs on mobile and edge computing devices, the system also provides model quantization and compression options, further expanding its application scope.

[0087] 8. Technical advantages and innovations: The main technical advantages of the embodiments of this application are reflected in the following aspects:

[0088] (1) Multi-model unified training framework: It realizes the unified training and comparative evaluation of five advanced deep learning architectures, providing a scientific basis for model selection in different application scenarios.

[0089] (2) Innovative hierarchical learning rate strategy: The automatic hierarchical learning rate mechanism designed for MobileNetV2 adjusts the learning rate based on network depth intelligence, which significantly improves model performance and learning efficiency.

[0090] (3) Comprehensive visualization analysis: Provides comprehensive visualization monitoring of the training process, including loss curves, accuracy trends, learning rate changes, etc., which greatly facilitates model tuning and problem diagnosis.

[0091] (4) Strong generalization ability: It demonstrates excellent performance on three datasets of different sizes and qualities, proving that the system has good generalization ability and practicality.

[0092] (5) Stability guarantee: Through multiple guarantee measures such as gradient clipping, numerical stability check and early stopping mechanism, the stability and repeatability of the training process are guaranteed.

[0093] In summary, the fruit quality detection system provided in this application, through its innovative multi-model comparison framework and refined training strategy, significantly improves training efficiency and stability while maintaining high accuracy, providing a reliable technical solution for the application of fruit quality detection.

Claims

1. A fruit quality detection method based on MobileNetV2 and automatic hierarchical learning rate, characterized in that, Includes the following steps: Step 1: Construct a deep learning model based on the MobileNetV2 architecture, instantiate the MobileNetV2 basic network architecture, and configure the output layer dimension of the model based on the classification task requirements of fruit quality detection. Step 2: Automatically execute the hierarchical learning rate strategy: Analyze the complete network structure of the MobileNetV2 model, automatically divide the parameter groups according to the network depth dimension, and automatically calculate and allocate a differentiated learning rate ratio for each parameter group. The core rule is: the learning rate ratio of shallow parameter groups is lower than that of deep parameter groups, which adapts to the update needs of different levels of parameters. Step 3: Using an image dataset containing multiple fruit categories and different quality states, apply a hierarchical learning rate strategy to iteratively train the model; Step 4: Receive the input fruit image to be detected using the trained optimal model, perform quality detection through model inference, and output the specific quality classification result.

2. The fruit quality detection method based on MobileNetV2 and automatic hierarchical learning rate according to claim 1, characterized in that, The method for automatically executing the hierarchical learning rate strategy in step 2 is as follows: A2.1) Automatically traverse multiple sub-layer structures of the MobileNetV2 model feature extraction module and record the network depth information of each sub-layer; A2.2) Based on the network depth position of each sub-layer and combined with the predefined ratio benchmark configuration, the learning rate ratio corresponding to each sub-layer is automatically calculated through the deep association algorithm; A2.3) The classifier module parameters of the model are automatically identified as independent parameter groups and assigned a predefined high-priority learning rate ratio, which is higher than the learning rate ratio of the deep layer of the feature extraction module.

3. The fruit quality detection method based on MobileNetV2 and automatic hierarchical learning rate according to claim 1, characterized in that, The method for automatically dividing parameter groups according to network depth in step 2 is as follows: the feature extraction module of the MobileNetV2 model is automatically divided into three parameter groups according to network depth, and the classifier module is identified as an independent parameter group; the three parameter groups include: B2.1) Shallow parameter group: network depth 1-6, responsible for basic feature extraction; B2.2) Intermediate Parameter Group: Network depth 7-12 layers, responsible for intermediate semantic feature extraction; B2.3) Deep parameter group: Network depth 13-18 layers, responsible for high-level abstract feature extraction.

4. The fruit quality detection method based on MobileNetV2 and automatic hierarchical learning rate according to claim 1, characterized in that, The range of the differential learning rate ratio in step 2 is as follows: C2.1) Learning rate ratio for shallow parameter groups: 0.1-0.3; C2.2) Learning rate ratio for the middle layer parameter group: 0.4-0.6; C2.3) Learning rate ratio for deep parameter sets: 0.7-1.2; C2.4) Learning rate ratio of classifier parameter group: 1.5-2.

0.

5. The fruit quality detection method based on MobileNetV2 and automatic hierarchical learning rate according to claim 1, characterized in that, The formula used to automatically calculate and allocate differentiated learning rate ratios incorporates a depth growth factor, establishing a positive correlation between the learning rate ratio and network depth, so that the learning rate ratio increases regularly with the increase of network depth.

6. The fruit quality detection method based on MobileNetV2 and automatic hierarchical learning rate according to claim 5, characterized in that, The formula used to automatically calculate the learning rate ratio is: L = i × d(c / t) Where L is the final learning rate, i is the initial learning rate, d is the depth growth factor, c is the current layer depth, and t is the total network depth.

7. The fruit quality detection method based on MobileNetV2 and automatic hierarchical learning rate according to claim 6, characterized in that, The depth growth factor d ranges from 1.1 to 1.

3.

8. The fruit quality detection method based on MobileNetV2 and automatic hierarchical learning rate according to claim 1, characterized in that, In step 3, during model training, a joint optimization mechanism consisting of an early stopping mechanism and a gradient clipping strategy is introduced: the early stopping mechanism monitors the change in the loss of the validation set in real time, and stops training when the loss does not decrease for several consecutive rounds to avoid over-iteration; the gradient clipping strategy limits the gradient update magnitude by setting a gradient threshold to suppress the gradient explosion problem, and the two work together to suppress overfitting.

9. A detection system used in the fruit quality detection method based on MobileNetV2 and automatic hierarchical learning rate as described in any one of claims 1-8, characterized in that, Includes the following functional modules: Model building module: Used to instantiate the MobileNetV2 base network and configure the output layer parameters according to the classification target of fruit quality detection, thus completing the model initialization; Automatic hierarchical learning rate configuration module: used to automatically parse the network hierarchy of the model, divide the parameter groups according to the depth dimension, calculate the learning rate ratio of each parameter group through the deep association algorithm and complete the allocation; Model training module: Used to load datasets and execute model training process. The above joint optimization mechanism is integrated during training, and the optimal model parameters are saved after training is completed. Image detection interface module: This module provides a standardized image input interface, receives images of fruits to be detected, transmits them to the trained model, and outputs fruit quality classification results.

10. The detection system according to claim 9, characterized in that, Includes a Web application deployment module: used to engineer the trained optimal model, build a Web service interface, support real-time online invocation and application deployment for fruit quality detection, and improve the convenience of practical application of the method.