Citrus disease identification method and device based on transfer learning

Transfer learning with a pre-trained model on natural images enhances citrus disease recognition accuracy by addressing overfitting issues, leveraging existing knowledge to improve model generalization and adapt to citrus-specific datasets.

CN120318576APending Publication Date: 2025-07-15HUBEI CHUANGSINUO ELECTRICAL TECH CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510394440.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

In the prior art, the citrus disease identification model is prone to overfitting due to the lack of data set samples, resulting in low recognition accuracy and is difficult to be applicable to disease prevention and control in large-area orchards.

Method used

Using the transfer learning method, the generalization ability of the model is enhanced by pre-training the convolutional neural network model on a natural image dataset with a larger data volume and fine-tuning it on the citrus disease dataset, the citrus disease recognition model is constructed, partial layers are frozen and new fully connected layers and softmax classifiers are added.

Benefits of technology

It improves the identification accuracy of the citrus disease recognition model, reduces the risk of overfitting, enhances the generalization ability of the model, and can better identify citrus diseases such as fruit anthrax, fruit ulcer disease, gall mite disease, leaf anthrax and leaf ulcer disease.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318576A_ABST
    Figure CN120318576A_ABST
Patent Text Reader

Abstract

The invention provides a citrus disease identification method and device based on transfer learning. The method comprises the following steps: acquiring a citrus disease image data set and a natural image data set; on the citrus disease image data set, performing fine adjustment on a preparation model obtained by training on the natural image data set to obtain a citrus disease recognition model; and inputting a to-be-recognized image into the citrus disease recognition model to obtain the citrus disease type of the to-be-recognized image output by the citrus disease recognition model. According to the method, the generalization ability of the citrus disease recognition model is enhanced in a transfer learning mode, the over-fitting phenomenon caused by the fact that the model is too complex is prevented, and therefore the recognition accuracy of the citrus disease recognition model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of plant disease identification, and in particular to a citrus disease identification method and device based on transfer learning. Background Art

[0002] At present, my country's prevention and control of citrus diseases is still mainly based on manual visual detection. However, due to factors such as insufficient disease monitoring and reporting personnel and differences in levels, the citrus disease monitoring and reporting rate is low and the reliability is poor, which makes it unsuitable for disease prevention and control in large-scale orchards.

[0003] Scholars at home and abroad have proposed to use a variety of deep learning models to identify citrus diseases. By identifying lesion images, the types of viruses that infect citrus can be accurately identified. However, due to the diversity, differences and imbalance of citrus diseases, the number of samples in citrus disease datasets is often very small, which leads to overfitting of existing recognition models during training and low recognition accuracy. Summary of the invention

[0004] The present invention provides a citrus disease recognition method and device based on transfer learning, so as to solve the defect in the prior art that the lack of citrus disease data set samples leads to the overfitting of the model, and realizes a citrus disease recognition method and device with higher recognition accuracy.

[0005] The present invention provides a citrus disease identification method based on transfer learning, comprising: Obtain citrus disease image datasets and natural image datasets; Fine-tuning the preliminary model trained on the natural image dataset on the citrus disease image dataset to obtain a citrus disease recognition model; The image to be identified is input into the citrus disease identification model to obtain the citrus disease type of the image to be identified output by the citrus disease identification model.

[0006] According to a citrus disease identification method based on transfer learning provided by the present invention, the citrus disease types include fruit anthracnose, fruit canker, gall mite disease, leaf anthracnose and leaf canker.

[0007] According to a citrus disease identification method based on transfer learning provided by the present invention, before the step of fine-tuning the preliminary model trained on the natural image dataset on the citrus disease image dataset, the method further comprises: Constructing a convolutional neural network model, wherein the convolutional neural network model includes an input layer, a convolution layer, a pooling layer, and a fully connected layer; The convolutional neural network model is trained on the natural image dataset to obtain the preliminary model.

[0008] A citrus disease recognition method based on transfer learning provided by the present invention, the convolutional layer includes a convolutional kernel and an activation function, and feature extraction is performed on the input content through convolutional operation; the pooling layer uses a sliding window with a stride of 2 for pooling calculation.

[0009] A citrus disease recognition method based on transfer learning provided by the present invention, the step of fine-tuning a preliminary model trained on the natural image dataset on the citrus disease image dataset specifically includes: Freeze all layers in the preliminary model and delete the fully connected layer in the preliminary model; After establishing a new fully connected layer including a classifier, train the modified preliminary model on the citrus disease image dataset to obtain the citrus disease recognition model.

[0010] A citrus disease recognition method based on transfer learning provided by the present invention, the step of obtaining the citrus disease image dataset and the natural image dataset includes: Collect images containing various plant diseases, preprocess the collected images, and construct a natural dataset. The preprocessing includes cropping, rotating, and Gaussian blurring of the collected images.

[0011] The present invention also provides a citrus disease recognition device based on transfer learning, including: An acquisition module for acquiring a citrus disease image dataset and a natural image dataset; A training module for fine-tuning a preliminary model trained on the natural image dataset on the citrus disease image dataset to obtain a citrus disease recognition model; An identification module for inputting an image to be identified into the citrus disease recognition model to obtain the citrus disease type of the image to be identified output by the citrus disease recognition model.

[0012] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the citrus disease recognition method based on transfer learning as described in any one of the above.

[0013] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the citrus disease recognition method based on transfer learning as described in any one of the above.

[0014] The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the citrus disease recognition method based on transfer learning as described in any one of the above.

[0015] The citrus disease recognition method and device based on transfer learning provided by the present invention pre-train a preliminary model on a natural image data set with a larger data volume, and then fine-tune the preliminary model on the citrus disease data set to obtain a citrus disease recognition model, so as to enhance the generalization ability of the citrus disease recognition model, prevent the overfitting phenomenon caused by the model being too complex, and thus improve the recognition accuracy of the citrus disease recognition model. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0017] Figure 1 is one of the flow diagrams of the citrus disease recognition method based on transfer learning provided by the present invention; Figure 2 is another flow diagram of the citrus disease recognition method based on transfer learning provided by the present invention; Figure 3 is the structural diagram of the citrus disease recognition device based on transfer learning provided by the present invention; Figure 4 is the structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] In order to make the purpose, technical solutions and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention in conjunction with the drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0019] The following will be combined with Figure 1 and Figure 2 to introduce the citrus disease recognition method based on transfer learning of the present invention. As Figure 1 shown, it includes: Step 101, obtain a citrus disease image data set and a natural image data set; Collect images of various citrus diseases and construct a citrus disease image data set.

[0020] Among them, the citrus disease image data set is the data set corresponding to images of various citrus diseases, mainly including images of citrus leaves or other diseased parts affected by various citrus diseases.

[0021] It is understandable that for some relatively rare citrus diseases, it is difficult to collect their disease images, or even if collected, the number of images that can be obtained is also difficult to be used for model training. Therefore, in this embodiment, a natural image dataset is additionally obtained.

[0022] The natural image dataset contains images of other plant lesions similar to the manifestations of citrus diseases, aiming to train the citrus disease recognition model through transfer learning.

[0023] It should be noted that for some relatively rare citrus diseases, the images with similar lesion manifestations in other plants are also less in proportion to other lesion images. Therefore, in order to make the number of images corresponding to various diseases in the obtained natural image dataset relatively average, optionally, when obtaining the natural image dataset, first classify and obtain the images of other plant lesions similar to the manifestations of each citrus disease, and then screen the images of other plant lesions corresponding to other citrus diseases based on the number of images of other plant lesions corresponding to rare citrus diseases, and use the disease type corresponding to each image as the corresponding label.

[0024] On this basis, mix all the screened images of other plant lesions corresponding to citrus diseases to obtain a natural image dataset for pre-training the citrus disease recognition model.

[0025] Step 102: Fine-tune the preliminary model trained on the natural image dataset on the citrus disease image dataset to obtain a citrus disease recognition model; Optionally, in this embodiment, a citrus disease recognition model is constructed based on a convolutional neural network and trained on the natural image dataset.

[0026] It is understandable that the constructed convolutional neural network model takes the images in the natural image dataset as input, uses the disease categories corresponding to the images as labels, and enables the model to output the same label as the image through iterative training, so as to obtain a preliminary model and enable the preliminary model to have the ability of basic feature extraction.

[0027] On this basis, fine-tune the preliminary model on the citrus disease image dataset so that the model can be applied to the recognition of citrus diseases.

[0028] Optionally, delete the last fully connected layer of the preliminary model, freeze the other parameters of the preliminary model, and reconstruct the fully connected layer based on the citrus disease categories. It is understandable that the fully connected layer includes a softmax classifier to use the softmax function to complete the classification and recognition of citrus diseases, and output the citrus disease category with the highest probability as the recognition result.

[0029] Fine-tune the preliminary model on the citrus disease image dataset, that is, fine-tune and update the newly added softmax classifier in the fully connected layer, so that the preliminary model achieves the optimal effect when performing citrus disease recognition. Use the fine-tuned preliminary model as the obtained citrus disease recognition model.

[0030] Step 103: Input the image to be recognized into the citrus disease recognition model, and obtain the citrus disease type of the image to be recognized output by the citrus disease recognition model.

[0031] When there is only a small amount of citrus disease training data, fully training a deep convolutional neural network is likely to cause the model to overfit and it is difficult to generalize to new data. In this embodiment, a preliminary model is pre-trained on the natural image dataset. Since the source domain and the target domain recognition tasks are similar, both are plant disease category recognition based on images, so by freezing some layers of the preliminary model, the general features already learned by the preliminary model are retained, reducing training resources; by adding a new fully connected layer and a softmax classifier, the classification logic is fine-tuned according to the new citrus disease recognition task to make it quickly adapt to the new task. On this basis, only the newly added fully connected layer needs to be trained, the model will converge faster, and the amount of data required for training is also smaller.

[0032] Based on the above transfer method, the risk of overfitting of the trained citrus disease recognition model is reduced, and the citrus disease recognition model learns general features that can be used for performing different tasks, thus having higher generalization ability.

[0033] On this basis, input the image to be recognized into the trained citrus disease recognition model, and the citrus disease type in the image to be recognized output by the model can be obtained.

[0034] In the present invention, a preliminary model is pre-trained on a natural image dataset with a larger amount of data, and then the preliminary model is fine-tuned on the citrus disease dataset to obtain a citrus disease recognition model, so as to enhance the generalization ability of the citrus disease recognition model, prevent the overfitting phenomenon caused by the model being too complex, and thus improve the recognition accuracy of the citrus disease recognition model.

[0035] In the citrus disease recognition method based on transfer learning of the present invention, the citrus disease types include fruit anthracnose, fruit canker, eriophyid mite disease, leaf anthracnose, and leaf canker.

[0036] In this embodiment, the constructed citrus disease recognition model is specifically used to recognize fruit anthracnose, fruit canker, eriophyid mite disease, leaf anthracnose, and leaf canker.

[0037] Among them, anthracnose of fruits is manifested as small yellowish-brown sunken spots initially appearing on the surface of citrus fruits. As the disease progresses, they expand into round or irregular dark brown lesions, with a dark brown concentric ring along the edge. In a humid environment, pink sticky spore masses are produced on the surface of the lesions.

[0038] Citrus canker is manifested as raised corky lesions formed on the surface of citrus fruits, with a crater-like crack in the center and a yellow halo around the lesion. The diameter of the lesion is about 3-5 mm, and the surface is rough and spongy. In severe cases, multiple lesions fuse, resulting in deformed fruits.

[0039] Eriophyid mite disease is manifested as coppery rust-colored or dark brown reticulate markings on the surface of citrus fruits, and the peel is rough, showing a "sesame cake" shape. When the leaves are damaged, reddish-brown rust spots appear on the back of the leaves, and the leaves curl and become brittle.

[0040] Anthracnose of leaves is initially manifested as small water-soaked yellowish-brown spots at the tip or edge of citrus leaves. After expansion, they form large round or irregular-shaped spots, with a dark brown edge, a grayish-white center, and scattered small black dots. There is an obvious yellow halo at the junction between the diseased and healthy parts. In the later stage, the lesions have perforations.

[0041] Citrus canker of leaves is manifested as small yellow oil stain-like dots the size of a needle tip initially appearing on the front of citrus leaves, gradually expanding into round lesions, penetrating both sides of the leaf to form grayish-white ulcer-like patches, with a dark brown raised edge and a yellow halo around the periphery.

[0042] In a specific embodiment, based on the understanding of the above-mentioned manifestations of different types of citrus diseases, in order to enable the preliminary model to better learn the extraction of image features of different types of citrus diseases, it is also possible to generate citrus disease images based on text guidance and mix the generated citrus disease images into the natural image dataset for pre-training the preliminary model.

[0043] Specifically, obtain the manifestation characteristics of each of the above diseases at different development stages, and organize them into multiple description texts corresponding to each citrus disease category in the format of "disease type", "development stage", "symptom characteristics", and "pathogen". On this basis, generate a corresponding structured enhancement based on the description text corresponding to each citrus disease category, where the structured enhancement represents the development stage, symptom location, and symptom characteristics of each citrus disease.

[0044] In a specific embodiment, extract the entity information of the description text corresponding to each citrus disease category, and generate a citrus disease block diagram based on the extracted structural information. Among them, the entity information includes at least the disease entity, disease location, disease color, and disease shape. Among them For example, for the text description of citrus leaf anthracnose, "In the initial stage, citrus leaf anthracnose appears as small water-soaked yellowish-brown spots at the leaf tip or leaf margin of citrus leaves", the disease entity is identified as citrus leaves, the disease locations are the leaf tip and leaf margin, the disease color is yellowish-brown, and the disease shapes are water-soaked and small spots.

[0045] On this basis, image frames are generated for the disease entity and disease shapes, the disease color is used as an additional description of the image frame, and a citrus disease block diagram is generated based on the disease location. Based on the generated citrus disease block diagram, the diagram can be edited, for example, by adjusting the proportion, quantity, and / or position of the image frame corresponding to the leaf in the overall image, and setting the shape, quantity, and position of the image frame corresponding to the disease shape, so as to generate multiple different citrus disease block diagrams based on a single description text.

[0046] It should be noted that since the block diagram of the disease entity in this embodiment is used to generate the image frame corresponding to the disease entity, and the disease entities of citrus diseases are mostly citrus fruits and citrus leaves, the image frames of the disease entity are pre-defined using the shapes of real citrus fruits and citrus leaves, so that the image frame corresponding to the disease shape can be adjusted to the disease location. For example, the water-soaked disease entity image frame is moved to the leaf tip of the leaf shape.

[0047] Furthermore, each generated citrus disease block diagram and its corresponding description text are jointly encoded, so that the encoded features jointly contain the semantic information of the original description text and the semantic information represented by the citrus disease block diagram adjusted by the user. Image generation is performed based on the encoded features obtained by joint encoding, so as to obtain a large number of generated images corresponding to each citrus disease, and a citrus disease augmented image dataset is obtained after classification and sorting according to citrus disease categories.

[0048] It can be understood that the generated citrus disease augmented image dataset is considered to be able to more accurately reflect the image features of citrus diseases compared to the natural image dataset, but has a lower data accuracy compared to the real citrus disease image dataset.

[0049] Therefore, in order to apply the generated citrus disease image dataset to the pre-training and fine-tuning of the preliminary model to obtain a more accurate citrus disease recognition model, the images in the citrus disease augmented image dataset can be further divided in this embodiment.

[0050] Specifically, for each type of citrus disease, a representative real image is determined in the citrus disease image dataset, and the feature similarity between it and each production image corresponding to this type of citrus disease in the citrus disease augmented image dataset is calculated. The top 10% of the generated images with the calculated similarity values are mixed into the citrus disease image dataset for fine-tuning the preliminary model, and the remaining images are mixed into the natural image dataset for pre-training to obtain the preliminary model.

[0051] Through the above method, the generation of citrus disease images guided by citrus disease text is realized. Some of the generated images are applied to pre-train and obtain the preliminary model, strengthening the understanding of the image features of various citrus diseases by the preliminary model, so that the preliminary model can be better applied to feature extraction for citrus disease recognition; some of the generated images with higher authenticity are applied to fine-tune the preliminary model, which can further improve the generalization degree of the trained citrus disease recognition model and reduce the possibility of overfitting of the model for the citrus disease image dataset.

[0052] In the citrus disease recognition method based on transfer learning of the present invention, before the step of fine-tuning the preliminary model trained on the natural image dataset on the citrus disease image dataset, it further includes: Construct a convolutional neural network model, which includes an input layer, a convolutional layer, a pooling layer, and a fully connected layer; Train the convolutional neural network model on the natural image dataset to obtain the preliminary model.

[0053] The convolutional layer includes a convolutional kernel and an activation function, and performs feature extraction on the input content through convolutional operation; the pooling layer performs pooling calculation using a sliding window with a stride of 2. In this embodiment, based on the convolutional neural network model, a preliminary model is constructed and trained.

[0054] Among them, the convolutional neural network model includes an input layer, a convolutional layer, a pooling layer, and a fully connected layer.

[0055] The input layer regards the image as a multi-dimensional array composed of pixel values. Each element of this matrix represents the pixel intensity at the corresponding position on the image. A color image has three RGB channels.

[0056] The convolutional layer includes a convolutional kernel with a size of 3*3 and an activation function, and performs feature extraction on the input content through convolutional operation. The ReLU activation function is used, and the definition of the ReLU function is: ; In the formula, the input parameter is x. When the input x is greater than 0, the function value is equal to the input x itself. When the input x is less than or equal to 0, the function value is always 0.

[0057] The pooling layer has a stride of 2, and the sliding window moves 2 unit pixels each time for pooling calculation, enabling the model to reduce the demand for computing resources while retaining key features, thus facilitating the construction of a deeper and more complex network structure.

[0058] The fully connected layer integrates all local features, facilitating classification and result prediction.

[0059] Pre-train the constructed convolutional neural network model on the natural image dataset. After the model reaches a high recognition accuracy on the recognition task in the source domain through multiple rounds of iterative optimization, export the obtained preliminary model.

[0060] In the citrus disease recognition method based on transfer learning of the present invention, the step of fine-tuning the preliminary model trained on the natural image dataset on the citrus disease image dataset specifically includes: Freeze all layers in the preliminary model and delete the fully connected layer in the preliminary model; After establishing a new fully connected layer including a classifier, train the modified preliminary model on the citrus disease image dataset to obtain the citrus disease recognition model.

[0061] In order to transfer the knowledge learned by the preliminary model in the source domain to the target domain, in this embodiment, first freeze all layers in the preliminary model to retain the basic feature extraction ability learned in the source domain, then delete the original fully connected layer, and establish a new fully connected layer including a softmax classifier.

[0062] It can be understood that the categories of the classifier are predefined according to citrus types, enabling the fine-tuned model to perform probability prediction for different citrus disease categories.

[0063] Divide the citrus disease image dataset into a training set and a test set according to a ratio of 7:3. Train the preliminary model with the new fully connected layer added on the training set and test it on the test set. After multiple iterations, obtain the citrus disease recognition model. The complete process is as Figure 2 shown.

[0064] In the citrus disease recognition method based on transfer learning of the present invention, the step of obtaining the citrus disease image dataset and the natural image dataset includes: Collect images containing various plant diseases, preprocess the collected images to construct a natural dataset, and the preprocessing includes cropping, rotating, and Gaussian blurring of the collected images.

[0065] Collect images containing various plant diseases as the basis for constructing the natural image dataset. Preferably, the disease manifestations corresponding to the selected images are similar to those of citrus diseases.

[0066] Preprocess the collected images, specifically implementing data augmentation through operations such as cropping, rotation, and Gaussian blurring to further expand the natural image dataset, and use the expanded dataset as the natural image dataset for pre-training to obtain a preliminary model.

[0067] Next, the citrus disease recognition device based on transfer learning provided by the present invention will be described. The citrus disease recognition device based on transfer learning described below can be correspondingly referred to the citrus disease recognition method based on transfer learning described above.

[0068] As Figure 3 shown, the citrus disease recognition device based on transfer learning includes an acquisition module 301, a training module 302, and an identification module 303; The acquisition module 301 is used to acquire a citrus disease image dataset and a natural image dataset; Collect images of various citrus diseases and construct a citrus disease image dataset.

[0069] Among them, the citrus disease image dataset is the dataset corresponding to various citrus disease images, mainly including images of citrus leaves or other diseased parts caused by various citrus diseases.

[0070] It can be understood that for some relatively rare citrus diseases, it is difficult to collect their disease images, or even if collected, the number of images that can be obtained is also difficult to be used for model training. Therefore, in this embodiment, a natural image dataset is additionally acquired.

[0071] The natural image dataset contains images of other plant lesions similar to the manifestations of citrus diseases, aiming to train the citrus disease recognition model through transfer learning.

[0072] It should be noted that for some relatively rare citrus diseases, the images of other plants with similar lesion manifestations to them are also less in proportion to other lesion images. Therefore, in order to make the number of images corresponding to various diseases in the acquired natural image dataset relatively average, optionally, when acquiring the natural image dataset, first classify and acquire images of other plant lesions similar to each citrus disease manifestation, and then screen the images of other plant lesions corresponding to other citrus diseases based on the number of images of other plant lesions corresponding to rare citrus diseases, and use the disease type corresponding to each image as the corresponding label.

[0073] On this basis, mix all the screened images of other plant lesions corresponding to citrus diseases to obtain a natural image dataset for pre-training the citrus disease recognition model.

[0074] The training module 302 is configured to fine-tune a preliminary model trained on the natural image dataset on the citrus disease image dataset to obtain a citrus disease recognition model; Optionally, in this embodiment, a citrus disease recognition model is constructed based on a convolutional neural network and trained on a natural image dataset.

[0075] It can be understood that the constructed convolutional neural network model takes the images in the natural image dataset as inputs and the corresponding disease categories of the images as labels. Through iterative training, the model outputs the same label as the image, so as to obtain a preliminary model, enabling the preliminary model to have the ability of basic feature extraction.

[0076] On this basis, the preliminary model is fine-tuned on the citrus disease image dataset, enabling the model to be applied to the recognition of citrus diseases.

[0077] Optionally, the last fully connected layer of the preliminary model is deleted, other parameters of the preliminary model are frozen, and a fully connected layer is re-constructed based on the citrus disease categories. It can be understood that the fully connected layer includes a softmax classifier to complete the classification recognition of citrus diseases using the softmax function, and the citrus disease category with the highest probability is output as the recognition result.

[0078] The preliminary model is fine-tuned on the citrus disease image dataset, that is, the newly added softmax classifier in the fully connected layer is fine-tuned and updated, so that the preliminary model achieves the optimal effect when performing citrus disease recognition. The fine-tuned preliminary model is used as the obtained citrus disease recognition model.

[0079] The recognition module 303 is configured to input the image to be recognized into the citrus disease recognition model to obtain the citrus disease type of the image to be recognized output by the citrus disease recognition model.

[0080] When there is only a small amount of citrus disease training data, fully training a deep convolutional neural network is likely to cause the model to overfit and be difficult to generalize to new data. In this embodiment, a preliminary model is pre-trained on the natural image dataset. Since the source domain and the target domain recognition tasks are similar, both are plant disease category recognition based on images, so by freezing some layers of the preliminary model, the general features already learned by the preliminary model are retained, reducing training resources; by adding a new fully connected layer and a softmax classifier, the classification logic is fine-tuned according to the new citrus disease recognition task to enable it to quickly adapt to the new task. On this basis, only the newly added fully connected layer needs to be trained, the model will converge faster, and the amount of data required for training is also smaller.

[0081] Based on the above migration method, the risk of overfitting of the trained citrus disease recognition model is reduced, enabling the citrus disease recognition model to learn general features that can be used for different tasks, thus having higher generalization ability.

[0082] On this basis, by inputting the image to be recognized into the trained citrus disease recognition model, the citrus disease type in the image to be recognized output by the model can be obtained.

[0083] In the present invention, a preliminary model is pre-trained on a natural image dataset with a larger amount of data, and then the preliminary model is fine-tuned on a citrus disease dataset to obtain a citrus disease recognition model, so as to enhance the generalization ability of the citrus disease recognition model, prevent the overfitting phenomenon caused by the model being too complex, and thus improve the recognition accuracy of the citrus disease recognition model.

[0084] Figure 4 An example of a schematic physical structure diagram of an electronic device is shown as Figure 4 shown. The electronic device may include: a processor 410, a communication interface 420, a memory 430, and a communication bus 440. Among them, the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call the logical instructions in the memory 430 to execute a citrus disease recognition method based on transfer learning. The method includes: obtaining a citrus disease image dataset and a natural image dataset; fine-tuning a preliminary model trained on the natural image dataset on the citrus disease image dataset to obtain a citrus disease recognition model; inputting the image to be recognized into the citrus disease recognition model to obtain the citrus disease type of the image to be recognized output by the citrus disease recognition model.

[0085] In addition, when the logical instructions in the above-mentioned memory 430 are implemented in the form of a software functional unit and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc that can store program codes.

[0086] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the citrus disease recognition method based on transfer learning provided by the above-mentioned various methods. The method includes: obtaining a citrus disease image data set and a natural image data set; fine-tuning a preliminary model trained on the natural image data set on the citrus disease image data set to obtain a citrus disease recognition model; inputting an image to be recognized into the citrus disease recognition model to obtain the citrus disease type of the image to be recognized output by the citrus disease recognition model.

[0087] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the citrus disease recognition method based on transfer learning provided by the above-mentioned various methods. The method includes: obtaining a citrus disease image data set and a natural image data set; fine-tuning a preliminary model trained on the natural image data set on the citrus disease image data set to obtain a citrus disease recognition model; inputting an image to be recognized into the citrus disease recognition model to obtain the citrus disease type of the image to be recognized output by the citrus disease recognition model.

[0088] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0089] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, also by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A citrus disease recognition method based on transfer learning, characterized in that, Including: Obtain a citrus disease image dataset and a natural image dataset; Fine-tune a preliminary model trained on the natural image dataset on the citrus disease image dataset to obtain a citrus disease recognition model; Input the image to be recognized into the citrus disease recognition model to obtain the citrus disease type of the image to be recognized output by the citrus disease recognition model.

2. The citrus disease recognition method based on transfer learning according to claim 1, wherein The citrus disease types include fruit anthracnose, fruit canker, eriophyid mite disease, leaf anthracnose, and leaf canker.

3. The citrus disease recognition method based on transfer learning according to claim 1, wherein, Before the step of fine-tuning the preliminary model trained on the natural image dataset on the citrus disease image dataset, it further includes: Construct a convolutional neural network model, which includes an input layer, a convolutional layer, a pooling layer, and a fully connected layer; Train the convolutional neural network model on the natural image dataset to obtain the preliminary model.

4. The citrus disease recognition method based on transfer learning according to claim 3, characterized in that, The convolutional layer includes a convolutional kernel and an activation function, and performs feature extraction on the input content through convolutional operation; the pooling layer performs pooling calculation using a sliding window with a stride of 2.

5. The citrus disease recognition method based on transfer learning according to claim 3, wherein The step of fine-tuning the preliminary model trained on the natural image dataset on the citrus disease image dataset specifically includes: Freeze all layers in the preliminary model and delete the fully connected layer in the preliminary model; After establishing a new fully connected layer including a classifier, train the modified preliminary model on the citrus disease image dataset to obtain the citrus disease recognition model.

6. The citrus disease recognition method based on transfer learning according to claim 1, characterized in that The step of obtaining the citrus disease image dataset and the natural image dataset includes: Collect images containing various plant diseases, preprocess the collected images, and construct a natural dataset. The preprocessing includes cropping, rotating, and Gaussian blurring of the collected images.

7. A citrus disease recognition device based on transfer learning, characterized in that, Including: An acquisition module for obtaining a citrus disease image dataset and a natural image dataset; A training module for fine-tuning a preliminary model trained on the natural image dataset on the citrus disease image dataset to obtain a citrus disease recognition model; An identification module for inputting the image to be recognized into the citrus disease recognition model to obtain the citrus disease type of the image to be recognized output by the citrus disease recognition model.

8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the citrus disease recognition method based on transfer learning according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the citrus disease recognition method based on transfer learning according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the citrus disease recognition method based on transfer learning according to any one of claims 1 to 6.