Crop identification model training method and related equipment

By using labeled and unlabeled images to generate pseudo-labels and enhancement images, dynamically update crop recognition model parameters, the problem of low prediction accuracy of traditional crop recognition models is solved, and the recognition accuracy and training efficiency are improved.

CN119516308APending Publication Date: 2025-02-25AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411744305.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-30
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

Traditional crop identification methods and models have poor prediction accuracy for crop species, which has affected the smooth progress of farmland asset appraisal.

Method used

By acquiring labeled and unlabeled training images, the first and second crop recognition models generate pseudo-label images and enhancement images, and dynamically update model parameters to improve the prediction accuracy of the crop recognition model.

Benefits of technology

Improve the prediction accuracy of crop recognition models, especially for categories with poor prediction results, increases training opportunities and reduces training costs and difficulty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119516308A_ABST
    Figure CN119516308A_ABST
Patent Text Reader

Abstract

The invention provides a crop identification model training method. The crop identification model training method comprises the steps of obtaining a labeled training image and an unlabeled training image, inputting the labeled training image into a first crop identification model to obtain a first prediction result, and inputting the unlabeled training image into a second crop identification model to obtain a pseudo label image. And determining a category sampling rate according to the first prediction result and the annotation information. And generating an enhanced image and a pseudo label image of the enhanced image according to the pseudo label image, the unlabeled training image and the category sampling rate. And inputting the enhanced image into the first crop identification model to obtain a second prediction result, and updating parameters of the first crop identification model in combination with the labeling information, the first prediction result and a pseudo label image of the enhanced image. According to the method, the enhanced image can be generated for the category with the poor prediction result to train the model, so that the crop category with the poor prediction result can have more opportunities to participate in the training of the model, and the prediction accuracy of the model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to a crop identification model training method, a crop identification model training device, a computer device, and a computer-readable storage medium. Background Art

[0002] In the farmer loan process, farmland asset evaluation plays a pivotal role. However, due to the vastness of rural areas, sparse population and inconvenient transportation, it is difficult for banks to conduct on-site investigations and evaluations in rural areas, which leads to challenges in bank loan approval.

[0003] Faced with the difficulty of farmland asset evaluation in farmer loans, technicians can use satellite remote sensing images to accurately obtain farmland information, and combine area measurement and yield prediction technologies to value farmland assets, thereby simplifying the evaluation process and reducing the difficulty of work. Among them, crop identification is an indispensable part of this link. Bank staff need to accurately identify the types of crops planted in each area, so as to make farmland asset evaluation more efficient, accurate and comprehensive.

[0004] However, traditional crop identification methods and crop identification models have poor prediction accuracy for crop types, which affects the smooth progress of farmland asset evaluation. Summary of the invention

[0005] The present application provides a crop identification model training method, which can solve the problem of poor prediction accuracy for crop types in related technologies.

[0006] In a first aspect, the present application provides a method for training a crop recognition model. The method comprises:

[0007] Acquire training samples, wherein the training samples include labeled training images and unlabeled training images, wherein the labeled training images include labeling information, and the labeling information is used to label category information of the tested crops;

[0008] Inputting the labeled training image into a first crop recognition model to obtain a first prediction result;

[0009] Inputting the first unlabeled training image and the second unlabeled training image into a second crop recognition model to obtain a first pseudo-labeled image and a second pseudo-labeled image, wherein the pseudo-labeled image includes a category recognition result of the tested crop in the unlabeled training image by the second crop recognition model;

[0010] Determine a category sampling rate according to the first prediction result and the labeling information, wherein the category sampling rate is used to determine the category of crops selected for retraining;

[0011] Generate an enhanced image and a third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the category sampling rate;

[0012] Inputting the enhanced image into the first crop recognition model to obtain a second prediction result;

[0013] According to the annotation information, the first prediction result, the third pseudo-label image and the second prediction result, the parameters of the first crop recognition model are updated to obtain a trained first crop recognition model.

[0014] In some possible implementations, determining the category sampling rate according to the first prediction result and the labeling information may be performed in the following manner:

[0015] generating a category confidence library according to the first prediction result and the annotation information, wherein the category confidence library is used to record the prediction accuracy of the first crop recognition model for different crop categories;

[0016] The category sampling rate is determined according to the confidence library.

[0017] In some possible implementations, generating an enhanced image and a third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the category sampling rate is performed in the following manner:

[0018] generating a mask according to the first unlabeled training image and the category sampling rate, wherein the mask includes pixels corresponding to the selected crop in the first unlabeled training image;

[0019] The enhanced image and the third pseudo-label image are generated according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the mask.

[0020] In some possible implementations, the enhanced image and the third pseudo-label image are generated according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the mask, in the following manner:

[0021] generating the enhanced image according to the first unlabeled training image, the second unlabeled training image and the mask;

[0022] The third pseudo label image is generated according to the first pseudo label image, the second pseudo label image and the mask.

[0023] In some possible implementations, updating the parameters of the first crop recognition model according to the annotation information, the first prediction result, the third pseudo-label image, and the second prediction result is performed in the following manner:

[0024] Determine a supervision loss function according to the labeling information and the first prediction result;

[0025] Determine an unsupervised loss function according to the third pseudo-label image and the second prediction result;

[0026] The parameters of the first crop recognition model are updated according to the supervised loss function and the unsupervised loss function.

[0027] In some possible implementations, the method further includes:

[0028] The parameters of the second crop recognition model are updated based on the updated parameters of the first crop recognition model to obtain a trained second crop recognition model.

[0029] In some possible implementations, the method further includes:

[0030] Acquire the image under test;

[0031] The detected image is input into the trained first crop recognition model to obtain a prediction result of the category of the crop in the detected image.

[0032] In a second aspect, the present application provides a crop recognition model training device. The device comprises:

[0033] An acquisition module, used for acquiring training samples, wherein the training samples include labeled training images and unlabeled training images, wherein the labeled training images include labeling information, and the labeling information is used for labeling category information of the tested crops;

[0034] A first prediction module, configured to obtain a first prediction result according to a labeled training image input into a first crop recognition model;

[0035] A second prediction module is used to obtain a first pseudo-label image and a second pseudo-label image according to the first unlabeled training image and the second unlabeled training image input into a second crop recognition model, wherein the pseudo-label image includes a category recognition result of the tested crop in the unlabeled training image by the second crop recognition model;

[0036] a determination module, configured to determine a category sampling rate according to the first prediction result and the labeling information, wherein the category sampling rate is used to determine a category of crops selected for retraining;

[0037] A generating module, configured to generate an enhanced image and a third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image and the category sampling rate;

[0038] The first prediction module is further used to obtain a second prediction result according to the enhanced image input into the first crop recognition model;

[0039] A parameter updating module is used to update the parameters of the first crop recognition model according to the annotation information, the first prediction result, the third pseudo-label image and the second prediction result to obtain a trained first crop recognition model.

[0040] In some possible implementations, when determining the category sampling rate according to the first prediction result and the labeling information, the determination module is specifically used to:

[0041] generating a category confidence library according to the first prediction result and the annotation information, wherein the category confidence library is used to record the prediction accuracy of the first crop recognition model for different crop categories;

[0042] The category sampling rate is determined according to the confidence library.

[0043] In some possible implementations, when generating an enhanced image and a third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the category sampling rate, the generating module is specifically used to:

[0044] generating a mask according to the first unlabeled training image and the category sampling rate, wherein the mask includes pixels corresponding to the selected crop in the first unlabeled training image;

[0045] The enhanced image and the third pseudo-label image are generated according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the mask.

[0046] In some possible implementations, when generating the enhanced image and the third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the mask, the generating module is specifically configured to:

[0047] generating the enhanced image according to the first unlabeled training image, the second unlabeled training image and the mask;

[0048] The third pseudo label image is generated according to the first pseudo label image, the second pseudo label image and the mask.

[0049] In some possible implementations, the parameters of the first crop recognition model are updated according to the annotation information, the first prediction result, the third pseudo-label image, and the second prediction result, and the parameter updating module is specifically used to:

[0050] Determine a supervision loss function according to the labeling information and the first prediction result;

[0051] Determine an unsupervised loss function according to the third pseudo-label image and the second prediction result;

[0052] The parameters of the first crop recognition model are updated according to the supervised loss function and the unsupervised loss function.

[0053] In some possible implementations, the parameter updating module is further used to:

[0054] The parameters of the second crop recognition model are updated based on the updated parameters of the first crop recognition model to obtain a trained second crop recognition model.

[0055] In a third aspect, the present application provides a device, wherein the device includes a processor and a memory.

[0056] The processor is used to execute instructions stored in the memory, so that the device performs the crop recognition model training method as described in the first aspect or any implementation manner of the first aspect.

[0057] In a fourth aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium includes instructions, which, when executed on a device, enable the device to execute the crop recognition model training method as described in the first aspect or any implementation of the first aspect.

[0058] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on a device, enables the device to execute the crop recognition model training method described in the first aspect or any one of the implementations of the first aspect.

[0059] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations.

[0060] It can be seen from the above technical solutions that the embodiments of the present application have at least the following advantages:

[0061] This method dynamically records the prediction of each crop category in supervised learning by adding a confidence library. For categories with poor prediction results, enhanced images and pseudo-label images are generated to train the model. This allows crop categories with poor prediction results to have more opportunities to participate in model training and improve the prediction accuracy of the model. At the same time, this method can generate pseudo-labels for a large number of unlabeled images when there are limited labeled images to help model training, reducing the cost and difficulty of training. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0063] Figure 1 A flowchart of a crop recognition model training method disclosed in an embodiment of the present application;

[0064] Figure 2 This is a schematic diagram of the structure of a crop recognition model training device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0065] The scheme in the embodiments provided in this application will be described below in conjunction with the drawings in this application.

[0066] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. The terms "first" and "second" in the embodiments of the present application are only used for descriptive purposes and cannot be understood as indicating or implying relative importance, operation time sequence, or implicitly indicating the number of indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.

[0067] In order to facilitate understanding of the technical solution of the present application, the background technology involved in the present application is first introduced in detail.

[0068] In the farmer loan process, farmland asset assessment plays a pivotal role, and farmland crop identification is an indispensable part of this process. The crop identification model can be, for example, a remote sensing image semantic segmentation model, which can use satellite remote sensing images to assign each pixel in the image to a corresponding semantic category, thereby quickly and accurately extracting crop information in the farmland. This technology can not only clearly define the boundaries of the land owned by farmers, but also accurately identify the types of crops planted in each area. This provides strong data support for bank branch staff, making farmland asset assessment more efficient and accurate, and helping to more comprehensively assess the value of farmers' farmland assets.

[0069] Semi-supervised learning (SSL) methods are often used in related technologies to train remote sensing image semantic segmentation models. For example, the Teacher-Student framework is selected as the basic framework. Specifically, the framework uses the Teacher model to generate pseudo labels for unlabeled images, and then uses the pseudo labels to help train the Student model to improve the final segmentation effect of the Student model. However, due to the limited training data obtained in semi-supervised image semantic segmentation and the imbalanced number of samples in each category, the trained model performs poorly in some categories, making it difficult to improve the segmentation accuracy of the image semantic segmentation model.

[0070] In view of this, the present application provides a method for training a crop recognition model. The method includes: obtaining a labeled training image and an unlabeled training image, inputting the labeled training image into a first crop recognition model, obtaining a first prediction result, inputting the first unlabeled training image and the second unlabeled training image into a second crop recognition model, obtaining a first pseudo-label image and a second pseudo-label image, wherein the pseudo-label image includes the category recognition result of the second crop recognition model for the tested crop in the unlabeled training image. Then, the category sampling rate is determined according to the first prediction result and the labeling information, and the category sampling rate is used to determine the selected crop. Next, an enhanced image and a third pseudo-label image are generated according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image and the category sampling rate. Finally, the enhanced image is input into the first crop recognition model to obtain a second prediction result, and the parameters of the first crop recognition model are updated according to the labeling information, the first prediction result, the third pseudo-label image and the second prediction result to obtain the trained first crop recognition model.

[0071] This method can generate enhanced images and pseudo-label images for poorly predicted categories to train the model, so that crop categories with poorly predicted results can have more opportunities to participate in model training and improve the prediction accuracy of the model. At the same time, this method can generate pseudo-labels for a large number of unlabeled images when there are limited labeled images to help model training, reducing the cost and difficulty of training.

[0072] Next, the crop recognition model training method provided in the embodiment of the present application will be introduced with reference to the accompanying drawings.

[0073] See also Figure 1 This is a flow chart of a crop recognition model training method disclosed in an embodiment of the present application, the method comprising:

[0074] S102: The training device obtains training samples, where the training samples include labeled training images and unlabeled training images.

[0075] The labeled training images refer to images including labeling information, and the labeling information is used to label the category information of the tested crops. The labeled training images and the unlabeled training images can be obtained by various methods such as digital cameras, smart terminal cameras, infrared cameras, satellite remote sensing technology, scanners, online image libraries, etc., and this application does not make any limitation on this.

[0076] S104: Inputting the labeled training image into a first crop recognition model to obtain a first prediction result.

[0077] The first crop recognition model may be any image semantic segmentation model, which is used to recognize the type of crops in the detected image. For example, the first crop recognition model may be a DeepLab V2 image semantic segmentation model.

[0078] By inputting the labeled training image including the labeling information into the first crop recognition model, a prediction result under supervised learning can be obtained. Specifically, the first crop recognition model can perform category prediction on each pixel in the input labeled training image to determine the crop category to which the pixel belongs. In some possible implementations, the first crop recognition model can also provide a probability that the pixel belongs to the target crop category.

[0079] S106: Inputting the first unlabeled training image and the second unlabeled training image into a second crop recognition model to obtain a first pseudo-label image and a second pseudo-label image.

[0080] The second crop recognition model may also be any image semantic segmentation model, and the second crop recognition model may use the same image semantic segmentation model as the first crop recognition model. Relevant technicians may select a suitable model based on actual conditions, and the present application embodiment does not make any limitation on this.

[0081] By inputting the unlabeled training image into the second crop recognition model, the prediction result under unsupervised learning can be obtained. Specifically, the second crop recognition model can generate a first pseudo-label image and a second pseudo-label image based on the input first unlabeled training image and the second unlabeled training image. Among them, the pseudo-label image includes the category recognition result of the tested crop in the unlabeled training image by the second crop recognition model. The pseudo-label can be regarded as a temporary label of the unlabeled data, which can be used to calculate the loss value and update the parameters of the model. In this way, the crop recognition model can utilize the information in the unlabeled image, expand the training sample library, and improve the prediction accuracy.

[0082] Of course, in this method, the two steps S104 and S106 are independent of each other, and the execution order thereof is not strictly defined, that is, S104 may be executed first and then S106, or S106 may be executed first and then S104, or S104 and S106 may be executed simultaneously.

[0083] S108: Determine a category sampling rate according to the first prediction result and the labeling information.

[0084] The category sampling rate is used to determine the crop category selected for retraining, specifically the crop category with lower prediction accuracy determined according to the first prediction result and the labeling information.

[0085] In some possible implementations, the category sampling rate may be determined as follows:

[0086] The training device first generates a category confidence library according to the first prediction result and the annotation information, wherein the category confidence library is used to record the prediction accuracy of the first crop recognition model for different crop categories, and then determines the category sampling rate according to the confidence library.

[0087] Specifically, the training device can first generate the confidence of the target crop in a training session based on the probability that each pixel in the annotated image belongs to the target crop category in the first prediction result, and then summarize the confidence of all categories of crops into a confidence library. For example, for the confidence of the corn category in the annotated image during a certain training iteration, the training device first needs to obtain the prediction result of the first crop recognition model for the target annotated image, and then sum up the probability values ​​of all pixels in the image that are predicted to be corn, and then divide it by the number of pixels that are actually corn in the real annotation of the image according to the annotation information to obtain the confidence of the corn category. The calculation formula is as follows:

[0088]

[0089] Among them, Conf crepresents the confidence of category c (such as corn), C represents the number of categories contained in the data set, It indicates the model's prediction result of the cth channel of the jth pixel in the i-th labeled image in this training batch. Indicates the number of pixels in the image that are actually labeled as category c, N l The number of labeled image samples in the batch. The larger the confidence value, the more accurate the prediction result of the crop category. Conversely, the prediction result of the category is not ideal.

[0090] The confidence information of all categories of crops is aggregated to obtain a confidence library. At the end of each iteration, the information in the confidence library needs to be updated. For example, the Exponential Moving Average (EMA) method can be used to use the confidence library information before the update and the confidence library information calculated by the prediction results of this iteration to jointly update the confidence library information for the next time. For the update method of a confidence in the confidence library, the specific calculation formula is as follows:

[0091]

[0092] Where k is the kth iteration, and τ∈[0,1] is the coefficient for updating the confidence base. In this way, the prediction of each crop category in supervised learning can be dynamically recorded, and subsequent training can be carried out in a targeted manner.

[0093] Since the larger the confidence value, the more accurate the prediction result of the crop category, and vice versa, it means that the prediction result of the category is not ideal, so if the confidence of a category in the confidence library is lower, it is considered that the performance of the category is poor, and its sampling rate should be higher. Specifically, there is a formula:

[0094] s c =1-Conf c ,c∈{1,...,C}

[0095] In addition, in order to ensure that the sum of the sampling rates of all crop categories is 1, the above formula needs to be normalized. The modified sampling rate calculation method is as follows, where e is the natural logarithm.

[0096]

[0097] S110: Generate an enhanced image and a third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and a category sampling rate.

[0098] In order to enable the first crop recognition model to make full use of the information in the unlabeled images with larger data volume and easier collection, the training device can generate enhanced images and third pseudo-label images based on the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image and the category sampling rate to train the first crop recognition model.

[0099] Specifically, the training device can generate a mask based on the first unlabeled training image and the category sampling rate, wherein the mask includes pixels corresponding to the selected crops in the first unlabeled training image, and then generate an enhanced image and a third pseudo-label image based on the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image and the mask.

[0100] The selected crops included in the mask are selected by the aforementioned category sampling rate, and the category with a higher sampling rate is more likely to be selected to generate the mask. In this way, the mask can include the crop categories that are expected to have poor results in supervised learning, and the corresponding pixels in the unlabeled image. The number of categories selected by the mask can be fixed, such as half of the total number of categories, or can be determined based on the sampling rate, such as all or part of the categories whose sampling rate is lower than a threshold, and the embodiments of the present application are not limited to this.

[0101] In some possible implementations, the training device may generate an enhanced image according to the first unlabeled training image, the second unlabeled training image, and the mask, which may be specifically expressed as:

[0102] XC←M⊙A+(1-M)⊙B

[0103] Wherein, ⊙ represents an XOR operation, M is a mask, A and B are the first unlabeled training image and the second unlabeled training image, respectively, and XC is the generated enhanced image, which includes pixels corresponding to the selected crop category in the first unlabeled image.

[0104] In some possible implementations, the training device may also generate a third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, and the mask, which may be specifically expressed as:

[0105] SC←M⊙SA+(1-M)⊙SB

[0106] Among them, SC represents the generated third pseudo-label image, SA and SB represent the first pseudo-label image and the second pseudo-label image, respectively.

[0107] S112: Inputting the enhanced image into the first crop recognition model to obtain a second prediction result.

[0108] The training model can input the enhanced image into the first crop recognition model to obtain a second prediction result. The second prediction result includes the recognition result of the first crop recognition model on the crop category in the enhanced image, which can be used together with the third pseudo-label image to calculate the loss value and train the first crop recognition model.

[0109] S114: updating the parameters of the first crop recognition model according to the annotation information, the first prediction result, the third pseudo-label image and the second prediction result to obtain a trained first crop recognition model.

[0110] Since the above method needs to train the model with both unlabeled images and labeled images, it is necessary to add a consistency loss function to the supervised loss function to form a total loss function. The first crop recognition model is trained by minimizing the total loss to improve the prediction effect of the model. Therefore, the designed total loss function L can be expressed as:

[0111] L=L s +λL u

[0112] Where L s is a supervised loss function obtained based on the annotation information and the first prediction result, L u is the unsupervised loss function, i.e., the consistency loss function, obtained through the third pseudo-label image and the second prediction result, and λ is a hyperparameter that controls the contribution of the unsupervised loss function to the total loss function. Among them, the specific calculation formulas of the supervised loss function and the unsupervised loss function are as follows:

[0113]

[0114] Where N l Indicates the number of labeled images in the batch, N u represents the number of unlabeled images in the batch, W and H represent the width and height of the input image, and y ij Represents the real annotation information of the annotated image, y′ ij represents the pseudo label of the unlabeled image, p ij represents the predicted value of the first crop recognition model for the jth pixel of the i-th image sample in the batch, l ce represents the cross entropy loss function.

[0115] In some possible implementations, the training device may also update the parameters of the second crop recognition model based on the updated parameters of the first crop recognition model to obtain a trained second crop recognition model. For example, the second crop recognition model may be updated using the EMA method, and the specific formula may be:

[0116] θ t =αθ′t +(1-α)θ s

[0117] where θ t is the parameter of the second crop recognition model after this update, θ′ t is the second crop identification model parameter of the previous time, θ s is the parameter of the updated first crop recognition model. α is a hyperparameter that can control the update speed of the second crop recognition model and make the update of the second crop recognition model smoother.

[0118] In some possible implementations, after obtaining the trained first crop recognition model, the method further includes: obtaining a tested image, inputting the tested image into the trained first crop recognition model, and obtaining a prediction result of the category of the crops in the tested image. In this way, the category of the crops in the tested image can be accurately predicted, thereby facilitating a more accurate valuation of farmland assets and improving the efficiency of loan approval.

[0119] Based on the above description, the embodiment of the present application provides a method for training a crop recognition model. The method dynamically records the prediction of each crop category in supervised learning by adding a confidence library. For categories with poor prediction results, enhanced images and pseudo-label images are generated to train the model, so that crop categories with poor prediction results can have more opportunities to participate in the training of the model, thereby improving the prediction accuracy of the model. At the same time, the method can generate pseudo-labels for a large number of unlabeled images when the labeled images are limited to help the model train, reducing the cost and difficulty of training.

[0120] The above is a detailed introduction to the crop recognition model training method provided in the embodiment of the present application. Next, the crop recognition model training device and equipment provided in the embodiment of the present application will be introduced in conjunction with the accompanying drawings.

[0121] See also Figure 2 A crop recognition model training device 200 is shown. The device comprises:

[0122] An acquisition module 202 is used to acquire training samples, where the training samples include labeled training images and unlabeled training images, where the labeled training images include labeling information, and the labeling information is used to label category information of the tested crops;

[0123] A first prediction module 204, configured to obtain a first prediction result according to the labeled training image input into the first crop recognition model;

[0124] A second prediction module 206 is used to obtain a first pseudo-label image and a second pseudo-label image according to the first unlabeled training image and the second unlabeled training image input into the second crop recognition model, wherein the pseudo-label image includes a category recognition result of the tested crop in the unlabeled training image by the second crop recognition model;

[0125] A determination module 208, configured to determine a category sampling rate according to the first prediction result and the labeling information, wherein the category sampling rate is used to determine a crop category selected for retraining;

[0126] A generating module 210, configured to generate an enhanced image and a third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image and the category sampling rate;

[0127] The first prediction module 204 is further used to obtain a second prediction result according to the enhanced image input into the first crop recognition model;

[0128] The parameter updating module 212 is used to update the parameters of the first crop recognition model according to the annotation information, the first prediction result, the third pseudo-label image and the second prediction result to obtain the trained first crop recognition model.

[0129] In some possible implementations, when determining the category sampling rate according to the first prediction result and the labeling information, the determination module 208 is specifically used to:

[0130] generating a category confidence library according to the first prediction result and the annotation information, wherein the category confidence library is used to record the prediction accuracy of the first crop recognition model for different crop categories;

[0131] Determine the category sampling rate based on the confidence base.

[0132] In some possible implementations, when generating the enhanced image and the third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the category sampling rate, the generating module 210 is specifically used to:

[0133] Generate a mask according to the first unlabeled training image and the category sampling rate, the mask including pixels corresponding to the selected crop in the first unlabeled training image;

[0134] An enhanced image and a third pseudo-label image are generated according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the mask.

[0135] In some possible implementations, when generating the enhanced image and the third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the mask, the generating module 210 is specifically used to:

[0136] Generate an enhanced image according to the first unlabeled training image, the second unlabeled training image and the mask;

[0137] A third pseudo label image is generated according to the first pseudo label image, the second pseudo label image and the mask.

[0138] In some possible implementations, when updating the parameters of the first crop recognition model according to the annotation information, the first prediction result, the third pseudo-label image, and the second prediction result, the parameter updating module 212 is specifically used to:

[0139] Determine a supervision loss function according to the annotation information and the first prediction result;

[0140] Determining an unsupervised loss function based on the third pseudo-label image and the second prediction result;

[0141] The parameters of the first crop recognition model are updated according to the supervised loss function and the unsupervised loss function.

[0142] In some possible implementations, the parameter updating module 212 is further configured to:

[0143] The parameters of the second crop recognition model are updated based on the updated parameters of the first crop recognition model to obtain a trained second crop recognition model.

[0144] The present application provides a device for implementing a crop identification model training method. The device includes a processor and a memory. The processor and the memory communicate with each other. The processor is used to execute instructions stored in the memory so that the device executes the crop identification model training method.

[0145] The present application provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a device, the device executes the above-mentioned crop recognition model training method.

[0146] The present application provides a computer program product comprising instructions, which, when executed on a device, enables the device to execute the above-mentioned crop identification model training method.

[0147] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0148] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0149] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0150] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0151] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A crop recognition model training method, characterized in that: The method comprises: Acquire training samples, wherein the training samples include labeled training images and unlabeled training images, wherein the labeled training images include labeling information, and the labeling information is used to label category information of the tested crops; Inputting the labeled training image into a first crop recognition model to obtain a first prediction result; Inputting the first unlabeled training image and the second unlabeled training image into a second crop recognition model to obtain a first pseudo-labeled image and a second pseudo-labeled image, wherein the pseudo-labeled image includes a category recognition result of the tested crop in the unlabeled training image by the second crop recognition model; Determine a category sampling rate according to the first prediction result and the labeling information, wherein the category sampling rate is used to determine the category of crops selected for retraining; Generate an enhanced image and a third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the category sampling rate; Inputting the enhanced image into the first crop recognition model to obtain a second prediction result; According to the annotation information, the first prediction result, the third pseudo-label image and the second prediction result, the parameters of the first crop recognition model are updated to obtain a trained first crop recognition model.

2. The method according to claim 1, characterized in that: The determining the category sampling rate according to the first prediction result and the labeling information includes: generating a category confidence library according to the first prediction result and the annotation information, wherein the category confidence library is used to record the prediction accuracy of the first crop recognition model for different crop categories; The category sampling rate is determined according to the confidence library.

3. The method according to claim 1, characterized in that The step of generating an enhanced image and a third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the category sampling rate includes: Generate a mask according to the first unlabeled training image and the category sampling rate, wherein the mask includes pixels corresponding to the crop selected for retraining in the first unlabeled training image; The enhanced image and the third pseudo-label image are generated according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the mask.

4. The method according to claim 3, characterized in that The step of generating the enhanced image and the third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image, and the mask comprises: generating the enhanced image according to the first unlabeled training image, the second unlabeled training image and the mask; The third pseudo label image is generated according to the first pseudo label image, the second pseudo label image and the mask.

5. The method according to claim 1, characterized in that The updating of the parameters of the first crop recognition model according to the labeling information, the first prediction result, the third pseudo-label image and the second prediction result includes: Determine a supervision loss function according to the labeling information and the first prediction result; Determine an unsupervised loss function according to the third pseudo-label image and the second prediction result; The parameters of the first crop recognition model are updated according to the supervised loss function and the unsupervised loss function.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: The parameters of the second crop recognition model are updated based on the updated parameters of the first crop recognition model to obtain a trained second crop recognition model.

7. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Acquire the image under test; The detected image is input into the trained first crop recognition model to obtain a prediction result of the category of the crop in the detected image.

8. A crop recognition model training device, characterized in that: The device comprises: An acquisition module, used for acquiring training samples, wherein the training samples include labeled training images and unlabeled training images, wherein the labeled training images include labeling information, and the labeling information is used for labeling category information of the tested crops; A first prediction module, configured to obtain a first prediction result according to a labeled training image input into a first crop recognition model; A second prediction module is used to obtain a first pseudo-label image and a second pseudo-label image according to the first unlabeled training image and the second unlabeled training image input into a second crop recognition model, wherein the pseudo-label image includes a category recognition result of the tested crop in the unlabeled training image by the second crop recognition model; a determination module, configured to determine a category sampling rate according to the first prediction result and the labeling information, wherein the category sampling rate is used to determine crops selected for retraining; A generating module, configured to generate an enhanced image and a third pseudo-label image according to the first pseudo-label image, the second pseudo-label image, the first unlabeled training image, the second unlabeled training image and the category sampling rate; The first prediction module is further used to obtain a second prediction result according to the enhanced image input into the first crop recognition model; A parameter updating module is used to update the parameters of the first crop recognition model according to the annotation information, the first prediction result, the third pseudo-label image and the second prediction result to obtain a trained first crop recognition model.

9. A computer device, characterized in that: The computer equipment comprises: Memory for storing computer programs or computer instructions; A processor, configured to execute a computer program or computer instruction stored in the memory, so that the computer device executes the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and when the computer program is executed, it is used to implement the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Object recognition model training method, obstacle recognition method and vehicle

    CN121305514A