A fruit disease detection method and system based on machine learning

By combining pre-trained models and transfer learning methods with weighted ensemble learning of hierarchical optimization dual-path pre-trained models, the problem of detecting biotic and abiotic diseases in fruit disease detection was solved, achieving efficient and accurate comprehensive disease detection.

CN118628875BActive Publication Date: 2024-11-12陕西麦克斯农业科技股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411099374.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-11-12
Estimated Expiration
2044-08-12

AI Technical Summary

Technical Problem

Existing fruit disease detection methods cannot effectively and uniformly detect biotic and abiotic diseases, resulting in limited usability and versatility. Furthermore, biotic diseases are diverse in type and have complex symptoms, making them easy to confuse with abiotic diseases. The limited amount of data on abiotic diseases leads to insufficient detection accuracy.

Method used

We employ a pre-trained model combined with transfer learning to detect details of biological and non-biological diseases. Biological diseases are classified into two categories using convolutional support vector machines. We use a weighted ensemble learning method that combines hierarchical optimization of dual-path pre-trained models to improve detection performance. We optimize accuracy through residual networks and efficiency through dense convolutional networks. Finally, we combine transfer learning to optimize the detection of non-biological diseases.

Benefits of technology

It has enabled unified detection of fruit diseases, improved the accuracy and efficiency of biological disease detection, optimized the data processing capabilities for non-biological disease detection, and enhanced the overall accuracy and real-time performance of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628875B_ABST
    Figure CN118628875B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for detecting fruit diseases based on machine learning, and the method includes fruit data collection, data enhancement, biological disease detection, non-biological disease detection and fruit disease detection. The present invention relates to the technical field of fruit disease detection, and specifically refers to a method and system for detecting fruit diseases based on machine learning. The present invention adopts a pre-training model combined with a transfer learning method to perform detailed detection of biological diseases and non-biological diseases, and provides a feasible solution for the detection process of fruit diseases from abstract to detailed; adopts a weighted ensemble learning method combined with a hierarchical optimization dual-path pre-training model to perform biological disease detection, and improves the detection performance of fruit biological disease detection as a whole; adopts a transfer learning method, and optimizes the processing capacity of new data of non-biological detection by migrating the model of biological disease detection with a large amount of data to non-biological disease detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of fruit disease detection, and in particular to a fruit disease detection method and system based on machine learning. Background Art

[0002] A fruit disease detection method and system based on machine learning uses artificial intelligence algorithms to process and analyze fruit images, thereby automatically identifying and classifying various diseases. The system collects fruit images through a camera, and after preprocessing, inputs them into a trained model. The model outputs the type and severity of the disease through feature extraction and pattern recognition. Its function is to improve the accuracy and efficiency of disease detection, reduce the error and cost of manual detection, and ensure the quality and yield of fruits.

[0003] However, in the existing fruit disease detection methods, there are types of fruit diseases that include both biological diseases and non-biological diseases, and it is difficult to classify and further detect the two diseases in detail. Traditional methods either focus on separate biological or non-biological classification detection, or focus on the subdivision detection of a specific disease, without unified detection of fruit diseases, resulting in technical problems of limited usability and versatility; in the existing fruit disease detection methods, there are various types of biological diseases and complex types of fruits involved, and the characteristics of symptoms are diverse and easily have vague similar characteristics with non-biological diseases. Therefore, it is necessary to optimize the accuracy of detection and to address the technical problem of real-time detection to improve detection efficiency; in the existing fruit disease detection methods, there are characteristics of non-biological diseases that are easily confused with those of biological diseases, and the data scale of non-biological diseases is relatively smaller than that of biological diseases. Therefore, to adapt to the detection of non-biological diseases, it is necessary to deal with the problem of small data volume and to improve the accuracy of detection at the same time in order to cooperate with the two tests for comprehensive fruit disease detection. Summary of the invention

[0004] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides a fruit disease detection method and system based on machine learning. In the existing fruit disease detection methods, there are types of fruit diseases, including both biological diseases and non-biological diseases, and the classification and further detailed detection of the two diseases are difficult. Traditional methods either focus on separate biological or non-biological classification detection, or focus on the subdivision detection of a specific disease, without unified detection of fruit diseases, resulting in technical problems of limited usability and versatility. This solution creatively adopts a pre-training model combined with a transfer learning method to perform detailed detection of biological and non-biological diseases, and performs biological binary classification detection of fruit diseases through a convolutional support vector machine, providing a feasible solution for the detection process of fruit diseases from abstract to detailed; in the existing fruit disease detection methods, there are various types of biological diseases and complex types of fruits involved, and the characteristics of symptoms are diverse and easily have vague similarities with non-biological diseases, so it is necessary to detect In order to optimize the accuracy, it is also necessary to deal with the technical problem of improving detection efficiency in real-time detection. This solution creatively adopts a weighted ensemble learning method combined with a hierarchical optimization dual-path pre-training model to detect biological diseases. The residual network optimizes the accuracy and the dense convolutional network optimizes the detection efficiency. The overall detection performance of fruit biological disease detection is improved, and the special detection ability of biological diseases is optimized by distinguishing data set training. In the existing fruit disease detection methods, there are characteristics of non-biological diseases that are easily confused with biological disease characteristics, and the data scale of non-biological diseases is relatively smaller than that of biological diseases. Therefore, adapting to the detection of non-biological diseases requires not only dealing with the problem of small data volume, but also improving the detection accuracy at the same time to cooperate with the two tests for comprehensive fruit disease detection. Technical problems, this solution creatively adopts a transfer learning method. By migrating the model of biological disease detection with large amounts of data to non-biological disease detection, it not only guarantees the basic model detection performance, but also optimizes the processing capacity of new data for non-biological detection.

[0005] The technical solution adopted by the present invention is as follows: The present invention provides a fruit disease detection method based on machine learning, the method comprising the following steps:

[0006] Step S1: Fruit data collection;

[0007] Step S2: data enhancement;

[0008] Step S3: biological disease detection;

[0009] Step S4: abiotic disease detection;

[0010] Step S5: Fruit disease detection.

[0011] Furthermore, in step S1, the fruit data collection is used to collect basic images of fruit diseases, specifically, to obtain a set of original images of fruit diseases from the fruit harvesting process through image data collection and manual data marking;

[0012] The fruit disease original image set is classified according to the data mark type, specifically including disease-free images, biological disease images and non-biological disease images.

[0013] Furthermore, in step S2, the data enhancement is used to enhance the data quality of the original image, specifically, performing basic preprocessing, histogram equalization, filtering denoising and data segmentation operations on the original fruit disease image set to obtain optimized fruit disease detection image data.

[0014] Further, in step S3, the biological disease detection is used to perform sub-item detection on biological fruit diseases, specifically, based on the biological disease detection optimization data in the optimized fruit disease detection image data, a weighted ensemble learning method combined with a hierarchical optimization dual-path pre-training model is used to perform biological disease detection to obtain biological disease detection classification data;

[0015] The combined hierarchical optimization dual-path pre-training model specifically includes a parameter-optimized ResNet50 pre-training model and a parameter-optimized DenseNet201 pre-training model;

[0016] The parameter-optimized ResNet50 pre-trained model is used to optimize the gradient vanishing problem and ensure that the multi-classification detection of fruit diseases retains the detection performance of the model while deepening the model depth;

[0017] The parameter-optimized DenseNet201 pre-trained model is used to improve the computational and memory efficiency of the model, and optimize feature transfer and the overall detection speed of the model;

[0018] The weighted ensemble learning is used to integrate the prediction output results of the two pre-trained models and perform weighted ensemble settings to obtain a comprehensive detection prediction result for biological disease detection;

[0019] The step of using a weighted ensemble learning method combined with a hierarchical optimization dual-path pre-training model to perform biological disease detection and obtain biological disease detection classification data includes:

[0020] Step S31: constructing a residual network pre-training model, specifically using a pre-trained ResNet50 as the residual network pre-training model, and constructing a basic residual network including an input layer, a residual layer, and an output layer as a basic prediction subnet of the biological disease detection path of the residual network pre-training model;

[0021] Step S32: residual network parameter optimization design, specifically, optimizing the structural parameters of the residual network pre-training model by introducing a two-dimensional global average pooling layer, and modifying and adjusting the residual network parameters to obtain a parameter-optimized residual subnet. The calculation formula of the parameter-optimized residual subnet is:

[0022] ;

[0023] In the formula, y RN is the predicted output of the parameter-optimized residual subnet, Dense(·) is the dense layer function, DropOut(·) is the random dropout layer function, AvgPool 2D (·) is the 2D global average pooling layer function, ResNet 50 (·) is the standard ResNet50 pre-trained network layer representation function, x input is the network raw data input, used to represent the optimized fruit disease detection image data;

[0024] Step S33: constructing a densely connected convolutional network pre-training model, specifically using the pre-trained DenseNet201 as the densely connected convolutional network pre-training model, and constructing a basic densely connected convolutional network including an input layer, a densely connected convolutional layer and an output layer as a basic prediction subnet of the biological disease detection path of the densely connected convolutional network pre-training model;

[0025] Step S34: Optimization design of densely connected convolutional network parameters, specifically, optimizing the structural parameters of the densely connected convolutional network pre-training model by introducing a two-dimensional global average pooling layer, and modifying and adjusting the parameters of the densely connected convolutional network to obtain a parameter-optimized dense convolutional subnet. The calculation formula of the parameter-optimized dense convolutional subnet is:

[0026] ;

[0027] In the formula, y DN is the predicted output of the parameter-optimized dense convolutional subnetwork, Dense(·) is the dense layer function, DropOut(·) is the random dropout layer function, AvgPool 2D (·) is the 2D global average pooling layer function, DenseNet 201 (·) is the standard DenseNet201 pre-trained network layer representation function, x input is the network raw data input, used to represent the optimized fruit disease detection image data;

[0028] Step S35: dual-path weighted integration, specifically weighted integration of the prediction outputs of the parameter-optimized residual subnet and the parameter-optimized dense convolutional subnet to obtain a comprehensive prediction result for fruit biological disease detection, and the calculation formula is:

[0029] ;

[0030] In the formula, y final is the comprehensive prediction result of fruit biological disease detection, w RN is the residual subnetwork weight, y RN is the predicted output of the parameter-optimized residual subnet, w DN is the dense convolutional subnet weight, y DN is the predicted output of the parameter-optimized dense convolutional subnetwork, where the residual subnetwork weight w RN and the dense convolutional subnetwork weights w DN Satisfy w DN +w RN =1;

[0031] Step S36: biological disease detection model training, specifically, through the construction of the residual network pre-training model, the residual network parameter optimization design, the construction of the dense connection convolutional network pre-training model, the dense connection convolutional network parameter optimization design and the dual-path weighted integration, the biological disease detection model training is performed to obtain the biological disease detection model Model GP ;

[0032] Step S37: Biological disease detection, specifically, using the biological disease detection model Model according to the optimized fruit disease detection image data GP , conduct biological disease detection and obtain biological disease detection classification data.

[0033] Further, in step S4, the abiotic disease detection is used to perform sub-item detection on abiotic fruit diseases, specifically, based on the abiotic disease detection optimization data in the optimized fruit disease detection image data, a transfer learning method is used to perform abiotic disease detection to obtain abiotic disease detection classification data;

[0034] The transfer learning method specifically performs transfer learning from biological disease detection to abiotic disease detection by using the weighted ensemble learning method combined with the hierarchical optimization dual-path pre-training model in step S3, and uses transfer learning combined with the abiotic disease detection optimization data in the optimized fruit disease detection image data to perform abiotic disease detection model training;

[0035] The step of using the transfer learning method to detect abiotic diseases and obtain abiotic disease detection classification data includes:

[0036] Step S41: Model loading and reproduction, specifically loading the biological disease detection model Model GP and through the biological disease detection model Model GP Reproduce the weighted ensemble learning model structure combining the hierarchical optimization dual-path pre-training model;

[0037] Step S42: freezing the model, specifically freezing the ResNet50 pre-trained network layer and the DenseNet201 pre-trained network layer of the model, and adding a new output layer to the model for model training;

[0038] Step S43: Modify the model output layer, specifically using a softmax layer to replace the biological disease detection model Model GP The original dense layer is used to adapt to the abiotic disease detection task;

[0039] Step S44: training the abiotic disease detection model, specifically, training the abiotic disease detection model by reproducing the model loading, modifying the model output layer, and freezing the model, to obtain the abiotic disease detection model Model NP ;

[0040] Step S45: abiotic disease detection, specifically, using the abiotic disease detection model Model according to the abiotic disease detection optimization data in the optimized fruit disease detection image data NP Conduct abiotic disease detection and obtain abiotic disease detection classification data.

[0041] Further, in step S5, the fruit disease detection is used to perform type classification detection of fruit diseases, and to perform overall fruit disease detection in combination with the contents of the two sub-item detections, specifically, based on the fruit disease detection optimization data in the optimized fruit disease detection image data, combined with the biological disease detection classification data and the abiotic disease detection classification data, a convolution support vector machine method is used to perform overall fruit disease detection, and by distinguishing the biological or abiotic nature of fruit diseases, combined with the biological disease detection and the abiotic disease detection, a comprehensive fruit disease detection is performed to obtain fruit disease detection reference data;

[0042] The fruit disease detection reference data specifically includes the biological classification of fruit diseases and the detailed detection classification of fruit disease symptoms;

[0043] The biological classification of fruit diseases specifically includes biological diseases and abiotic diseases;

[0044] The detailed detection and classification of fruit diseases and symptoms specifically include powdery mildew, anthracnose, brown rot, fire blight, angular spot, rot mosaic, nutrient deficiency and sunscald.

[0045] The present invention provides a fruit disease detection system based on machine learning, comprising a fruit data collection module, a data enhancement module, a biological disease detection module, a non-biological disease detection module and a fruit disease detection module;

[0046] The fruit data collection module is used for fruit data collection, and obtains a set of original images of fruit diseases through fruit data collection, and sends the set of original images of fruit diseases to the data enhancement module;

[0047] The data enhancement module is used for data enhancement, and obtains optimized fruit disease detection image data through data enhancement, and sends the optimized fruit disease detection image data to the biological disease detection module, the non-biological disease detection module and the fruit disease detection module;

[0048] The biological disease detection module is used for biological disease detection, obtains biological disease detection classification data through biological disease detection, and sends the biological disease detection classification data to the fruit disease detection module;

[0049] The abiotic disease detection module is used for abiotic disease detection, obtains abiotic disease detection classification data through abiotic disease detection, and sends the abiotic disease detection classification data to the fruit disease detection module;

[0050] The fruit disease detection module is used for fruit disease detection, and obtains fruit disease detection reference data through fruit disease detection.

[0051] The beneficial effects achieved by the present invention using the above scheme are as follows:

[0052] (1) In the existing fruit disease detection methods, there are types of fruit diseases, including both biological diseases and non-biological diseases, and it is difficult to classify and further detect the two diseases in detail. Traditional methods either focus on separate biological or non-biological classification detection, or focus on the subdivision detection of a specific disease, without unified detection of fruit diseases, resulting in technical problems of limited usability and versatility. This solution creatively uses a pre-trained model combined with a transfer learning method to perform detailed detection of biological and non-biological diseases, and uses a convolutional support vector machine to perform biological binary classification detection of fruit diseases, providing a feasible solution for the detection process of fruit diseases from abstract to detailed.

[0053] (2) In the existing fruit disease detection methods, there are various types of biological diseases and the types of fruits involved are complex. The characteristics of symptoms are diverse and easily have vague similarities with non-biological diseases. Therefore, it is necessary to optimize the accuracy of detection and address the technical issues of real-time detection and improving detection efficiency. This solution creatively adopts a weighted ensemble learning method combined with a hierarchical optimization dual-path pre-training model to detect biological diseases. The residual network optimizes the accuracy and the dense convolutional network optimizes the detection efficiency. The overall detection performance of fruit biological disease detection is improved. By training with differentiated data sets, the detection capability of biological diseases is optimized.

[0054] (3) In the existing fruit disease detection methods, the characteristics of abiotic diseases are easily confused with those of biological diseases. The data scale of abiotic diseases is relatively smaller than that of biological diseases. Therefore, to adapt to the detection of abiotic diseases, it is necessary to deal with the problem of small data volume and improve the detection accuracy at the same time so that the two tests can be combined for comprehensive fruit disease detection. This scheme creatively adopts the transfer learning method. By transferring the model of biological disease detection with large amounts of data to abiotic disease detection, it not only guarantees the basic model detection performance, but also optimizes the processing capacity of new data for abiotic detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 A schematic diagram of a process for detecting fruit diseases based on machine learning provided by the present invention;

[0056] Figure 2 A schematic diagram of a fruit disease detection system based on machine learning provided by the present invention;

[0057] Figure 3 Schematic diagram of the process of data enhancement in step S2;

[0058] Figure 4 This is a schematic diagram of the process of biological disease detection in step S3;

[0059] Figure 5 This is a schematic diagram of the process of abiotic disease detection in step S4.

[0060] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION

[0061] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0062] In the description of the present invention, it should be understood that terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “top”, “bottom”, “inside” and “outside” indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as limiting the present invention.

[0063] Example 1, see Figure 1 The present invention provides a method for detecting fruit diseases based on machine learning, the method comprising the following steps:

[0064] Step S1: Fruit data collection;

[0065] Step S2: data enhancement;

[0066] Step S3: biological disease detection;

[0067] Step S4: abiotic disease detection;

[0068] Step S5: Fruit disease detection.

[0069] By performing the above operations, in the existing fruit disease detection methods, there are types of fruit diseases, including both biological diseases and non-biological diseases, and the classification and further detailed detection of the two diseases are more difficult. Traditional methods either focus on separate biological or non-biological classification detection, or focus on the subdivision detection of a specific disease, but do not perform unified detection on fruit diseases, resulting in technical problems with limited usability and versatility. This solution creatively uses a pre-trained model combined with a transfer learning method to perform detailed detection of biological and non-biological diseases, and uses a convolutional support vector machine to perform biological binary classification detection of fruit diseases, providing a feasible solution for the detection process of fruit diseases from abstract to detailed.

[0070] Example 2, see Figure 1 and Figure 2 In step S1, the fruit data collection is used to collect basic images of fruit diseases, specifically, to obtain a set of original images of fruit diseases from the fruit harvesting process through image data collection and manual data marking;

[0071] The fruit disease original image set is classified according to the data mark type, specifically including disease-free images, biological disease images and non-biological disease images;

[0072] The biological disease images specifically include fungal diseases, bacterial diseases and viral diseases;

[0073] The abiotic diseases specifically include nutrient deficiency and sunburn;

[0074] The fungal diseases specifically include powdery mildew, anthracnose and brown rot;

[0075] The bacterial diseases specifically include fire blight and angular leaf spot;

[0076] The viral diseases specifically include rot spot and mosaic disease;

[0077] The powdery mildew specifically collects images of apple and peach fruit trees;

[0078] The anthrax disease specifically collects images of citrus and mango fruits;

[0079] The brown rot disease specifically collects fruit images of apples, pears and peaches;

[0080] The fire blight disease specifically collects branch images and leaf images of apples and pears;

[0081] For the angular leaf spot disease, specifically collect images of citrus fruits and leaves;

[0082] The peach tree image and leaf image are specifically collected for the peach spot disease;

[0083] The mosaic disease specifically collects images of citrus leaves;

[0084] For the deficiency disease, images of fruits such as apple, orange, mango, pear and peach are collected;

[0085] The sunburn disease specifically collects fruit images of apples, citrus, mangoes, pears and peaches.

[0086] Example 3, see Figure 1 , Figure 2 and Figure 3 This embodiment is based on the above embodiment. In step S2, the data enhancement is used to enhance the data quality of the original image, specifically performing basic preprocessing, histogram equalization, filtering and denoising, and data segmentation operations on the original fruit disease image set to obtain optimized fruit disease detection image data, specifically including the following steps:

[0087] Step S21: basic preprocessing, specifically, performing random displacement, flipping, scaling, cropping and rotation operations on the image data in the original image set of fruit diseases to obtain an enhanced image data set, and performing denoising, size normalization, data type conversion and data partitioning operations on the enhanced image data set in sequence to obtain basic optimized image data;

[0088] The basic optimized image data specifically includes biological disease detection optimization data, abiotic disease detection optimization data and fruit disease detection optimization data;

[0089] The enhanced image dataset specifically includes 500 healthy fruit images, 1000 abiotic disease images and 6900 biotic disease images, wherein the biotic disease images specifically include 1100 powdery mildew images, 1150 anthracnose images, 1500 brown rot images, 1000 fire blight images, 900 angular leaf spot images, 750 rot spot images and 500 mosaic images;

[0090] The size normalization is specifically to adjust the image of the enhanced image dataset to 256×256 pixels;

[0091] The data type conversion specifically includes converting the image data in the enhanced image data set into a data structure of a NumPy array using an Open_CV library function;

[0092] The data division is specifically to perform random sampling from the enhanced image data set to obtain basic optimized image data;

[0093] The biological disease detection optimization data specifically includes 500 healthy fruit images and 6900 biological disease images, 30% of the randomly sampled data in the biological disease detection optimization data is used as a test set, and 70% of the randomly sampled data is used as a training set;

[0094] The abiotic disease detection optimization data specifically includes 500 healthy fruit images and 1000 abiotic disease images, wherein the 1000 abiotic disease images specifically include 600 nutrient deficiency images and 400 sunburn images, and 30% of the randomly sampled data in the abiotic disease detection optimization data is used as a test set, and 70% of the randomly sampled data is used as a training set;

[0095] The fruit disease detection optimization data specifically includes 500 healthy fruit images and 500 diseased fruit images, wherein the diseased fruit images are specifically obtained by randomly sampling from the biological disease detection optimization data and the abiotic disease detection optimization data, and 30% of the randomly sampled data in the fruit disease detection optimization data is used as a test set, and 70% of the randomly sampled data is used as a training set;

[0096] Step S22: histogram equalization, specifically, using a histogram equalization technique to perform pixel brightness conversion on the basic optimized image data and expand the image intensity range to obtain histogram optimized image data;

[0097] Step S23: filtering and denoising, specifically using an anisotropic diffusion filter to filter the image, and using a Gaussian blur denoising method to remove noise, to obtain filtered denoising smoothed image data;

[0098] Step S24: data segmentation, specifically using a binary inverse threshold method to perform image segmentation to obtain segmented image data, wherein the segmented image data specifically includes a foreground image and a background image;

[0099] The calculation formula of the binary inverse threshold method is:

[0100] ;

[0101] Where g(x,y) is the pixel value of the image pixel after segmentation, x is the horizontal coordinate value pixel value corresponding to the pixel point, y is the vertical coordinate value pixel value corresponding to the pixel point, 0 is the background pixel value, used to represent black, V is the foreground pixel value, specifically set to 255, used to represent white, f(x,y) is the pixel value of the original image pixel point before segmentation, and T is the segmentation threshold;

[0102] Step S25: data enhancement, specifically, performing data enhancement on the original fruit disease image set through the basic preprocessing, the histogram equalization, the filtering denoising and the data segmentation to obtain optimized fruit disease detection image data.

[0103] Example 4, see Figure 1 , Figure 2 and Figure 4 This embodiment is based on the above embodiment. In step S3, the biological disease detection is used to perform sub-item detection on biological fruit diseases. Specifically, based on the biological disease detection optimization data in the optimized fruit disease detection image data, a weighted ensemble learning method combined with a hierarchical optimization dual-path pre-training model is used to perform biological disease detection to obtain biological disease detection classification data;

[0104] The combined hierarchical optimization dual-path pre-training model specifically includes a parameter-optimized ResNet50 pre-training model and a parameter-optimized DenseNet201 pre-training model;

[0105] The parameter-optimized ResNet50 pre-trained model is used to optimize the gradient vanishing problem and ensure that the multi-classification detection of fruit diseases retains the detection performance of the model while deepening the model depth;

[0106] The parameter-optimized DenseNet201 pre-trained model is used to improve the computational and memory efficiency of the model, and optimize feature transfer and the overall detection speed of the model;

[0107] The weighted ensemble learning is used to integrate the prediction output results of the two pre-trained models and perform weighted ensemble settings to obtain a comprehensive detection prediction result for biological disease detection;

[0108] The step of using a weighted ensemble learning method combined with a hierarchical optimization dual-path pre-training model to perform biological disease detection and obtain biological disease detection classification data includes:

[0109] Step S31: constructing a residual network pre-training model, specifically using a pre-trained ResNet50 as the residual network pre-training model, and constructing a basic residual network including an input layer, a residual layer, and an output layer as a basic prediction subnet of the biological disease detection path of the residual network pre-training model;

[0110] Step S32: residual network parameter optimization design, specifically, optimizing the structural parameters of the residual network pre-training model by introducing a two-dimensional global average pooling layer, and modifying and adjusting the residual network parameters to obtain a parameter-optimized residual subnet. The calculation formula of the parameter-optimized residual subnet is:

[0111] ;

[0112] In the formula, y RN is the predicted output of the parameter-optimized residual subnet, Dense(·) is the dense layer function, DropOut(·) is the random dropout layer function, AvgPool 2D (·) is the 2D global average pooling layer function, ResNet 50 is the standard ResNet50(·) pre-trained network layer representation function, x input is the network raw data input, used to represent the optimized fruit disease detection image data;

[0113] Table 1 is the specific content of modifying and adjusting the residual network parameters in the fourth embodiment of the present invention. As shown in the table, the modification and adjustment of the residual network parameters specifically includes:

[0114] The output specification of the input layer of the parameter-optimized residual subnet is set to (None, 256, 256, 3), and the parameter is set to 0 to indicate that there are no trainable parameters. In the output specification, None is used to indicate the batch size, and the value of None indicates that it is not fixed and can be adjusted dynamically. The first 256 is used to indicate the height pixel value parameter of the input image, and the second 256 is used to indicate the width pixel value parameter of the input image. 3 is used to indicate the number of channels of the input image;

[0115] The ResNet50 pre-trained network layer output specification of the parameter-optimized residual subnet is set to (None, 8, 8, 2048), and the parameter is set to 23587612, which is used to represent non-trainable parameters, specifically, the layer weights and bias parameters of the pre-trained ResNet50 network remain fixed during the training process and do not participate in the training. In the output specification, None is used to represent the batch size, the first 8 is used to represent the height dimension parameter of the feature map, the second 8 is used to represent the width dimension parameter of the feature map, and 2048 is used to represent the number of channels of the feature map;

[0116] The output specification of the two-dimensional global average pooling layer of the parameter-optimized residual subnetwork is set to (None, 2048), and the parameter is set to 0 to indicate that there are no trainable parameters. In the output specification, None is used to indicate the batch size, and 2048 is used to indicate the number of channels of the feature map after global average pooling.

[0117] The output specification of the dropout layer of the parameter-optimized residual subnet is set to (None, 2048), and the parameter is set to 0 to indicate that there are no trainable parameters. In the output specification, None is used to indicate the batch size, and 2048 is used to indicate the number of channels of the feature map after dropout.

[0118] The dense layer output specification of the parameter-optimized residual subnet is set to (None, 1), and the parameter is set to 2059, which is used to represent the trainable parameters, specifically including the weights and bias parameters that need to be trained and optimized, and the total parameter is 23589671, which is used to represent the sum of the parameters of all layers. In the output specification, None is used to represent the batch size, and 1 is used to represent that the output prediction value is a separate value;

[0119] Table 1 Residual network parameter modification and adjustment

[0120]

[0121] Step S33: constructing a densely connected convolutional network pre-training model, specifically using the pre-trained DenseNet201 as the densely connected convolutional network pre-training model, and constructing a basic densely connected convolutional network including an input layer, a densely connected convolutional layer and an output layer as a basic prediction subnet of the biological disease detection path of the densely connected convolutional network pre-training model;

[0122] Step S34: Optimization design of densely connected convolutional network parameters, specifically, optimizing the structural parameters of the densely connected convolutional network pre-training model by introducing a two-dimensional global average pooling layer, and modifying and adjusting the parameters of the densely connected convolutional network to obtain a parameter-optimized dense convolutional subnet. The calculation formula of the parameter-optimized dense convolutional subnet is:

[0123] ;

[0124] In the formula, y DN is the predicted output of the parameter-optimized dense convolutional subnetwork, Dense(·) is the dense layer function, DropOut(·) is the random dropout layer function, and AvgPool l2D (·) is the 2D global average pooling layer function, DenseNet 201 (·) is the standard DenseNet201 pre-trained network layer representation function, x input is the network raw data input, used to represent the optimized fruit disease detection image data;

[0125] Table 2 is the specific content of modifying and adjusting the parameters of the densely connected convolutional network in the fourth embodiment of the present invention. As shown in the table, the modification and adjustment of the parameters of the densely connected convolutional network specifically includes:

[0126] The output specification of the input layer of the parameter-optimized residual subnet is set to (None, 256, 256, 3), and the parameter is set to 0 to indicate that there are no trainable parameters. In the output specification, None is used to indicate the batch size, and the value of None indicates that it is not fixed and can be adjusted dynamically. The first 256 is used to indicate the height pixel value parameter of the input image, and the second 256 is used to indicate the width pixel value parameter of the input image. 3 is used to indicate the number of channels of the input image;

[0127] The output specification of the DenseNet201 pre-trained network layer of the parameter-optimized residual subnet is set to (None, 8, 8, 1920), and the parameters are set to 18321894, which are used to represent non-trainable parameters, specifically, the layer weights and bias parameters of the pre-trained DenseNet201 network remain fixed during the training process and do not participate in the training. In the output specification, None is used to represent the batch size, the first 8 is used to represent the height dimension parameter of the feature map, the second 8 is used to represent the width dimension parameter of the feature map, and 1920 is used to represent the number of channels of the feature map;

[0128] The output specification of the two-dimensional global average pooling layer of the parameter-optimized residual subnetwork is set to (None, 1920), and the parameter is set to 0 to indicate that there are no trainable parameters. In the output specification, None is used to indicate the batch size, and 1920 is used to indicate the number of channels of the feature map after global average pooling;

[0129] The output specification of the dropout layer of the parameter-optimized residual subnet is set to (None, 1920), and the parameter is set to 0 to indicate that there are no trainable parameters. In the output specification, None is used to indicate the batch size, and 1920 is used to indicate the number of channels of the feature map after dropout.

[0130] The dense layer output specification of the parameter-optimized residual subnet is set to (None, 1), and the parameters are set to 1921, which are used to represent the trainable parameters, specifically including the weights and bias parameters that need to be trained and optimized, and the total parameters are 18323815, which are used to represent the sum of the parameters of all layers. In the output specification, None is used to represent the batch size, and 1 is used to represent that the output prediction value is a separate value;

[0131] Table 2 Densely connected convolutional network parameter modification and adjustment

[0132]

[0133] Step S35: dual-path weighted integration, specifically weighted integration of the prediction outputs of the parameter-optimized residual subnet and the parameter-optimized dense convolutional subnet to obtain a comprehensive prediction result for fruit biological disease detection, and the calculation formula is:

[0134] ;

[0135] In the formula, y final is the comprehensive prediction result of fruit biological disease detection, w RN is the residual subnetwork weight, y RN is the predicted output of the parameter-optimized residual subnet, w DN is the dense convolutional subnet weight, y DNis the predicted output of the parameter-optimized dense convolutional subnetwork, where the residual subnetwork weight w RN and the dense convolutional subnetwork weights w DN Satisfy w DN +w RN =1;

[0136] The residual subnetwork weight w RN The specific value of is 0.65;

[0137] The dense convolutional subnetwork weights w DN The specific value of is 0.35;

[0138] Step S36: biological disease detection model training, specifically, through the construction of the residual network pre-training model, the residual network parameter optimization design, the construction of the dense connection convolutional network pre-training model, the dense connection convolutional network parameter optimization design and the dual-path weighted integration, the biological disease detection model training is performed to obtain the biological disease detection model Model GP ;

[0139] Step S37: Biological disease detection, specifically, using the biological disease detection model Model according to the optimized fruit disease detection image data GP , conduct biological disease detection and obtain biological disease detection classification data.

[0140] By performing the above operations, in view of the fact that in the existing fruit disease detection methods, there are various types of biological diseases and the types of fruits involved are complex, the characteristics of symptoms are diverse and easily have vague similarities with non-biological diseases, and therefore it is necessary to optimize the accuracy of detection and also to address the technical problem of real-time detection to improve detection efficiency. This solution creatively adopts a weighted ensemble learning method combined with a hierarchical optimization dual-path pre-training model to detect biological diseases, optimizes accuracy through a residual network, and optimizes detection efficiency through a dense convolutional network, which improves the detection performance of fruit biological disease detection as a whole, and optimizes the special detection capabilities of biological diseases by training with differentiated data sets.

[0141] Example 5, see Figure 1 , Figure 2 , Figure 5 This embodiment is based on the above embodiment. In step S4, the abiotic disease detection is used to perform sub-item detection on abiotic fruit diseases. Specifically, based on the abiotic disease detection optimization data in the optimized fruit disease detection image data, a transfer learning method is used to perform abiotic disease detection to obtain abiotic disease detection classification data;

[0142] The transfer learning method specifically performs transfer learning from biological disease detection to abiotic disease detection by using the weighted ensemble learning method combined with the hierarchical optimization dual-path pre-training model in step S3, and uses transfer learning combined with the abiotic disease detection optimization data in the optimized fruit disease detection image data to perform abiotic disease detection model training;

[0143] The step of using the transfer learning method to detect abiotic diseases and obtain abiotic disease detection classification data includes:

[0144] Step S41: Model loading and reproduction, specifically loading the biological disease detection model Model GP and through the biological disease detection model Model GP Reproduce the weighted ensemble learning model structure combining the hierarchical optimization dual-path pre-training model;

[0145] Step S42: freezing the model, specifically freezing the ResNet50 pre-trained network layer and the DenseNet201 pre-trained network layer of the model, and adding a new output layer to the model for model training;

[0146] Step S43: Modify the model output layer, specifically using a softmax layer to replace the biological disease detection model Model GP The original dense layer is used to adapt to the abiotic disease detection task;

[0147] Step S44: training the abiotic disease detection model, specifically, training the abiotic disease detection model by reproducing the model loading, modifying the model output layer, and freezing the model, to obtain the abiotic disease detection model Model NP ;

[0148] Step S45: abiotic disease detection, specifically, using the abiotic disease detection model Model according to the abiotic disease detection optimization data in the optimized fruit disease detection image data NP Conduct abiotic disease detection and obtain abiotic disease detection classification data.

[0149] By performing the above operations, in the existing fruit disease detection methods, there is a phenomenon that the characteristics of abiotic diseases are easily confused with the characteristics of biological diseases, and the data scale of abiotic diseases is relatively smaller than that of biological diseases. Therefore, to adapt to the detection of abiotic diseases, it is necessary to deal with the problem of small data volume and improve the detection accuracy at the same time to coordinate the two tests for comprehensive fruit disease detection. Technical problems, this scheme creatively adopts the transfer learning method, by migrating the model of biological disease detection with large amounts of data to abiotic disease detection, which not only guarantees the basic model detection performance, but also optimizes the processing capacity of new data for abiotic detection.

[0150] Example 6, see Figure 1 and Figure 2 This embodiment is based on the above embodiment. In step S5, the fruit disease detection is used to perform type classification detection of fruit diseases, and to perform overall fruit disease detection in combination with the contents of the two sub-item detections. Specifically, the fruit disease detection optimization data in the optimized fruit disease detection image data is combined with the biological disease detection classification data and the abiotic disease detection classification data, and the convolution support vector machine method is used to perform overall fruit disease detection. By distinguishing the biological or abiotic nature of fruit diseases, combined with the biological disease detection and the abiotic disease detection, a comprehensive fruit disease detection is performed to obtain fruit disease detection reference data;

[0151] The fruit disease detection reference data specifically includes the biological classification of fruit diseases and the detailed detection classification of fruit disease symptoms;

[0152] The biological classification of fruit diseases specifically includes biological diseases and abiotic diseases;

[0153] The detailed detection and classification of fruit diseases and symptoms specifically include powdery mildew, anthracnose, brown rot, fire blight, angular spot, rot mosaic, nutrient deficiency and sunscald.

[0154] Embodiment 7, see Figure 1 and Figure 2 , this embodiment is based on the above embodiment, and the present invention provides a fruit disease detection system based on machine learning, including a fruit data collection module, a data enhancement module, a biological disease detection module, a non-biological disease detection module and a fruit disease detection module;

[0155] The fruit data collection module is used for fruit data collection, and obtains a set of original images of fruit diseases through fruit data collection, and sends the set of original images of fruit diseases to the data enhancement module;

[0156] The data enhancement module is used for data enhancement, and obtains optimized fruit disease detection image data through data enhancement, and sends the optimized fruit disease detection image data to the biological disease detection module, the non-biological disease detection module and the fruit disease detection module;

[0157] The biological disease detection module is used for biological disease detection, obtains biological disease detection classification data through biological disease detection, and sends the biological disease detection classification data to the fruit disease detection module;

[0158] The abiotic disease detection module is used for abiotic disease detection, obtains abiotic disease detection classification data through abiotic disease detection, and sends the abiotic disease detection classification data to the fruit disease detection module;

[0159] The fruit disease detection module is used for fruit disease detection, and obtains fruit disease detection reference data through fruit disease detection.

[0160] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0161] While the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions and variations can be made to the embodiments without departing from the principles and spirit of the invention.

[0162] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.

Claims

1. A fruit disease detection method based on machine learning, characterized in that: The method comprises the following steps: Step S1: fruit data collection, specifically, obtaining a set of original images of fruit diseases through image data collection and manual data labeling during the fruit harvesting process; Step S2: data enhancement, specifically, performing basic preprocessing, histogram equalization, filtering and denoising, and data segmentation operations on the original fruit disease image set to obtain optimized fruit disease detection image data, specifically including biological disease detection optimized data, abiotic disease detection optimized data, and fruit disease detection optimized data; Step S3: biological disease detection, used for performing sub-item detection on biological fruit diseases, specifically, based on the biological disease detection optimization data in the optimized fruit disease detection image data, a weighted ensemble learning method combined with a hierarchical optimization dual-path pre-training model is used to perform biological disease detection to obtain biological disease detection classification data, specifically including the following steps: step S31: constructing a residual network pre-training model; step S32: residual network parameter optimization design; step S33: constructing a densely connected convolutional network pre-training model; step S34: densely connected convolutional network parameter optimization design; step S35: dual-path weighted integration; step S36: biological disease detection model training; step S37: biological disease detection; Step S4: abiotic disease detection, which is used to perform item-by-item detection on abiotic fruit diseases, specifically, based on the abiotic disease detection optimization data in the optimized fruit disease detection image data, a transfer learning method is used to perform abiotic disease detection to obtain abiotic disease detection classification data; The transfer learning method specifically performs transfer learning from biological disease detection to abiotic disease detection by using the weighted ensemble learning method combined with the hierarchical optimization dual-path pre-training model in step S3, and uses transfer learning combined with the abiotic disease detection optimization data in the optimized fruit disease detection image data to train the abiotic disease detection model, specifically comprising the following steps: Step S41: Model loading and reproduction, specifically loading the biological disease detection model Model GP , and through the biological disease detection model Model GP Reproduce the weighted ensemble learning model structure combining the hierarchical optimization dual-path pre-training model; Step S42: freezing the model, specifically freezing the ResNet50 pre-trained network layer and the DenseNet201 pre-trained network layer of the model, and adding a new output layer to the model for model training; Step S43: Modify the model output layer, specifically using a softmax layer to replace the biological disease detection model Model GP The original dense layer is used to adapt to the abiotic disease detection task; Step S44: training the abiotic disease detection model, specifically, training the abiotic disease detection model by reproducing the model loading, modifying the model output layer, and freezing the model, to obtain the abiotic disease detection model Model NP ; Step S45: abiotic disease detection, specifically, using the abiotic disease detection model Model according to the abiotic disease detection optimization data in the optimized fruit disease detection image data NP Conduct abiotic disease detection and obtain abiotic disease detection classification data; Step S5: Fruit disease detection, using the convolution support vector machine method to perform overall fruit disease detection, and by distinguishing the biological or non-biological nature of fruit diseases, combining the biological disease detection and the non-biological disease detection, performing comprehensive fruit disease detection to obtain fruit disease detection reference data.

2. A method for detecting fruit diseases based on machine learning according to claim 1, characterized in that: In step S1, the original fruit disease image set is classified according to the data tag type, specifically including disease-free images, biological disease images and non-biological disease images.

3. A method for detecting fruit diseases based on machine learning according to claim 2, characterized in that: In step S3, the combined hierarchical optimization dual-path pre-training model specifically includes a parameter-optimized ResNet50 pre-training model and a parameter-optimized DenseNet201 pre-training model; The parameter-optimized ResNet50 pre-trained model is used to optimize the gradient vanishing problem and ensure that the multi-classification detection of fruit diseases retains the detection performance of the model while deepening the model depth; The parameter-optimized DenseNet201 pre-trained model is used to improve the computational and memory efficiency of the model, and optimize feature transfer and the overall detection speed of the model; The weighted ensemble learning is used to integrate the prediction output results of the two pre-trained models and perform weighted ensemble settings to obtain a comprehensive detection prediction result for biological disease detection.

4. The method for detecting fruit diseases based on machine learning according to claim 3, characterized in that: In step S3, the step of using a weighted ensemble learning method combined with a hierarchical optimization dual-path pre-training model to perform biological disease detection and obtain biological disease detection classification data includes: Step S31: constructing a residual network pre-training model, specifically using a pre-trained ResNet50 as the residual network pre-training model, and constructing a basic residual network including an input layer, a residual layer, and an output layer as a basic prediction subnet of the biological disease detection path of the residual network pre-training model; Step S32: residual network parameter optimization design, specifically, optimizing the structural parameters of the residual network pre-training model by introducing a two-dimensional global average pooling layer, and modifying and adjusting the residual network parameters to obtain a parameter-optimized residual subnet. The calculation formula of the parameter-optimized residual subnet is: y RN =Dense(DropOut(AvgPool 2D (ResNet 50 (x input )))); In the formula, y RN is the predicted output of the parameter-optimized residual subnet, Dense(·) is the dense layer function, DropOut(·) is the random dropout layer function, AvgPool 2D (·) is the 2D global average pooling layer function, ResNet 50 (·) is the standard ResNet50 pre-trained network layer representation function, x input is the network raw data input, used to represent the optimized fruit disease detection image data; Step S33: constructing a densely connected convolutional network pre-training model, specifically using the pre-trained DenseNet201 as the densely connected convolutional network pre-training model, and constructing a basic densely connected convolutional network including an input layer, a densely connected convolutional layer and an output layer as a basic prediction subnet of the biological disease detection path of the densely connected convolutional network pre-training model; Step S34: Optimization design of densely connected convolutional network parameters, specifically, optimizing the structural parameters of the densely connected convolutional network pre-training model by introducing a two-dimensional global average pooling layer, and modifying and adjusting the parameters of the densely connected convolutional network to obtain a parameter-optimized dense convolutional subnet. The calculation formula of the parameter-optimized dense convolutional subnet is: y DN =Dense(DropOut(AvgPool 2p (DenseNet 201 (x input )))); In the formula, y DN is the predicted output of the parameter-optimized dense convolutional subnetwork, Dense(·) is the dense layer function, DropOut(·) is the random dropout layer function, AvgPool 2D (·) is the 2D global average pooling layer function, DenseNet 201 (·) is the standard DenseNet201 pre-trained network layer representation function, x input is the network raw data input, used to represent the optimized fruit disease detection image data; Step S35: dual-path weighted integration, specifically weighted integration of the prediction outputs of the parameter-optimized residual subnet and the parameter-optimized dense convolutional subnet to obtain a comprehensive prediction result for fruit biological disease detection, and the calculation formula is: y final =w RN y RN +w DN y DN ; In the formula, y final is the comprehensive prediction result of fruit biological disease detection, w RN is the residual subnetwork weight, y RN is the predicted output of the parameter-optimized residual subnet, w DN is the dense convolutional subnet weight, y DN is the predicted output of the parameter-optimized dense convolutional subnetwork, where the residual subnetwork weight w RN and the dense convolutional subnetwork weights w DN Satisfy w DN +w RN =1; Step S36: biological disease detection model training, specifically, through the construction of the residual network pre-training model, the residual network parameter optimization design, the construction of the dense connection convolutional network pre-training model, the dense connection convolutional network parameter optimization design and the dual-path weighted integration, the biological disease detection model training is performed to obtain the biological disease detection model Model GP ; Step S37: Biological disease detection, specifically, using the biological disease detection model Model according to the optimized fruit disease detection image data GP , conduct biological disease detection and obtain biological disease detection classification data.

5. The method for detecting fruit diseases based on machine learning according to claim 4, characterized in that: In step S5, the fruit disease detection is used to perform type classification detection of fruit diseases, and to perform overall fruit disease detection in combination with the contents of the two sub-item detections, specifically, based on the fruit disease detection optimization data in the optimized fruit disease detection image data, combined with the biological disease detection classification data and the abiotic disease detection classification data, a convolution support vector machine method is used to perform overall fruit disease detection, and by distinguishing the biological or abiotic nature of fruit diseases, combined with the biological disease detection and the abiotic disease detection, a comprehensive fruit disease detection is performed to obtain fruit disease detection reference data; The fruit disease detection reference data specifically includes the biological classification of fruit diseases and the detailed detection classification of fruit disease symptoms; The biological classification of fruit diseases specifically includes biological diseases and abiotic diseases; The detailed detection and classification of fruit diseases and symptoms specifically include powdery mildew, anthracnose, brown rot, fire blight, angular spot, rot mosaic, nutrient deficiency and sunscald.

6. A fruit disease detection system based on machine learning, used to implement a fruit disease detection method based on machine learning as claimed in any one of claims 1 to 5, characterized in that: It includes a fruit data collection module, a data enhancement module, a biological disease detection module, a non-biological disease detection module and a fruit disease detection module.

7. The fruit disease detection system based on machine learning according to claim 6, characterized in that: The fruit data collection module is used for fruit data collection, and obtains a set of original images of fruit diseases through fruit data collection, and sends the set of original images of fruit diseases to the data enhancement module; The data enhancement module is used for data enhancement, and obtains optimized fruit disease detection image data through data enhancement, and sends the optimized fruit disease detection image data to the biological disease detection module, the non-biological disease detection module and the fruit disease detection module; The biological disease detection module is used for biological disease detection, obtains biological disease detection classification data through biological disease detection, and sends the biological disease detection classification data to the fruit disease detection module; The abiotic disease detection module is used for abiotic disease detection, obtains abiotic disease detection classification data through abiotic disease detection, and sends the abiotic disease detection classification data to the fruit disease detection module; The fruit disease detection module is used for fruit disease detection, and obtains fruit disease detection reference data through fruit disease detection.