Method, system and equipment for identifying flowering state of sugarcane and medium
Identifying the flowering state of sugar cane through image processing technology, solving the problem of inaccurate and high cost of identification of the flowering state of sugar cane in the prior art, realizing the automatic identification of the flowering state of sugar cane, saving labor costs and improving the scientific nature of planting management.
Patent Information
- Application Number
- CN202411321889.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-10
AI Technical Summary
In the prior art, the identification of sugarcane flowering states relies on artificial methods, which leads to inaccurate and high cost.
Image processing technology is adopted to obtain the images to be processed, identify the sugarcane parents and flower spikes, identify the flowering state of the sugarcane based on visual features, and use the target recognition model and the flowering state recognition model to achieve automated recognition.
It realizes accurate identification of the flowering state of sugar cane, saves labor costs, and provides a scientific basis for sugar cane planting management.
Smart Images

Figure CN119295921A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing and neural network, and in particular to a method, system, device and medium for identifying the flowering state of sugarcane. Background Art
[0002] Sugarcane is an important economic crop in southern my country. Sexual hybridization is the main way to breed new sugarcane varieties. Parents are the basis for sexual hybridization of sugarcane. The planting and management of sugarcane parents are particularly important. Not only do they need suitable water, nutrients and a good environment to make the sugarcane parents grow healthy and strong, but they also need to prevent the sugarcane plants from lodging. At the same time, the flowering period of the parents should be adjusted through light, so that they can bloom as much as possible within the planned period, so as to select hybrid combinations. Therefore, in the management of sugarcane hybrid parents, it is necessary to take management measures in terms of light, water, fertilizer nutrients and lodging prevention.
[0003] The identification of the flowering state of sugarcane is one of the important links in the sugarcane cultivation process. In the prior art, the flowering state of sugarcane is usually identified manually, which is not only inaccurate but also costs a lot of labor costs. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method, system, device and medium for identifying the flowering state of sugarcane, aiming to solve at least one of the above technical problems.
[0005] In the first aspect, the technical solution of the present invention to solve the above technical problem is as follows: a method for identifying the flowering state of sugarcane, the method comprising:
[0006] S1, obtaining an image to be processed for a target area, wherein the target area is an area for growing sugarcane, and the image to be processed includes sugarcane;
[0007] S2, performing target recognition on the image to be processed, and identifying the image area where the sugarcane parent is located in the image to be processed;
[0008] S3, identifying the image region where the sugarcane parent is located, and obtaining the image region where the sugarcane spike corresponding to the sugarcane parent is located;
[0009] S4, identifying the flowering state of sugarcane based on the visual features of the sugarcane spike in the image area where the sugarcane spike is located.
[0010] The beneficial effect of the present invention is that in the process of identifying the flowering state of sugarcane, image processing technology is used to first identify the sugarcane parent in the image to be processed, then identify the image area where the sugarcane flower spike is located in the image area where the sugarcane parent is located, and finally identify the sugarcane flowering state from the image area where the sugarcane flower spike is located. This hierarchical recognition method can accurately identify the sugarcane flowering state from the image to be processed and saves labor costs compared to manual methods.
[0011] Based on the above technical solution, the present invention can also be improved as follows.
[0012] Furthermore, the method further comprises:
[0013] Based on the image area where the sugarcane spike is located, the pollen fertility and / or germination time of the sugarcane parent are identified.
[0014] Furthermore, S2 and S3 are implemented based on a target recognition model, and the target recognition model is trained in the following manner:
[0015] Acquire training samples, wherein the training samples include a first sample set and a second sample set, wherein the first sample set includes a plurality of sugarcane parent sample images and sample images not including the sugarcane parent, and the second sample set includes a plurality of sugarcane tassel sample images and sample images not including the sugarcane tassel, each of the sugarcane parent sample images corresponds to a first identifier, and each of the sugarcane tassel sample images corresponds to a second identifier, each of the first identifiers is used to characterize the position of the sugarcane parent in the corresponding sugarcane parent sample image and the category recognition result of the sugarcane parent, and each of the second identifiers is used to characterize the position of the sugarcane tassel in the corresponding sugarcane tassel sample image and the category recognition result of the sugarcane tassel;
[0016] According to the sample images in the training samples, a sample frame of each sample image is obtained through an initial model, and for each sample image, the sample frame is used to characterize the predicted position of the target object in the sample image, and each sample image is the sugarcane parent sample image, the sugarcane spike sample image, the sample image not containing the sugarcane spike, or the sample image not containing the sugarcane parent, and the target object is the sugarcane parent or the sugarcane spike;
[0017] Respectively calculating a first weight when each sample frame is a positive sample frame, and a second weight when each sample frame is a negative sample frame;
[0018] respectively calculating a third weight when an object in each of the sample images is a target object and a fourth weight when an object in each of the sample images is not a target object;
[0019] Determining a first loss value of the initial model according to the sample frames of the sample images and the first identifiers, the first weights, and the second weights;
[0020] According to the sample frames of the sample images and the sample images, obtaining the predicted target object recognition result of each sample image through the initial model;
[0021] Determining a second loss value of the initial model according to the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, and each of the fourth weights;
[0022] The initial model is trained according to the first loss value and the second loss value to obtain the target recognition model.
[0023] Furthermore, the method further comprises:
[0024] According to the sample images in the training samples, obtaining a probability value of an object in each of the sample images being a target object through an initial model;
[0025] For each of the sample images, using the probability value corresponding to the sample image as the fifth weight of the predicted target object recognition result corresponding to the sample image;
[0026] The step of determining the second loss value of the initial model according to the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, and each of the fourth weights comprises:
[0027] The second loss value of the initial model is determined based on the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, each of the fourth weights, and each of the fifth weights.
[0028] Further, determining the second loss value of the initial model according to the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, each of the fourth weights, and each of the fifth weights includes:
[0029] For each of the sample images, determining a third loss value corresponding to the sample image according to the predicted target object recognition result, the second identifier, the third weight, the fourth weight, and the fifth weight corresponding to the sample image;
[0030] The second loss value is determined according to the third loss value corresponding to each of the sample images and the total number of the sample images.
[0031] Further, S4 is implemented based on a flowering state recognition model, and the flowering state recognition model is trained based on the following method:
[0032] Acquire training sample pairs, each of the training sample pairs comprising a standard non-interference training sample and an interference training sample;
[0033] The interference training samples are passed through an interference elimination network and then output interference-free samples;
[0034] Extracting standard features from the standard non-interference training samples and generating features from the non-interference samples respectively using a target object recognition network;
[0035] comparing the standard feature and the generated feature to obtain a feature error;
[0036] In the process of training the interference elimination network, assisting in training the interference elimination network based on the characteristic error to complete the training of the interference elimination network;
[0037] Based on the standard features, completing the training of the target object recognition network;
[0038] The trained interference elimination network and the trained target object recognition network are used as the flowering state recognition model.
[0039] Furthermore, the interference elimination network includes at least one first type of interference elimination network based on a generative adversarial network and a second type of interference elimination network connected to the first type of interference elimination network, the first type of interference elimination network is used to eliminate the first type of interference in the interfered training samples, and the second type of interference elimination network is used to eliminate the second type of interference in the interfered training samples.
[0040] In a second aspect, in order to solve the above technical problems, the present invention also provides a sugarcane flowering state recognition system, the system comprising:
[0041] An acquisition module, used for acquiring an image to be processed for a target area, wherein the target area is an area for growing sugarcane, and the image to be processed includes sugarcane;
[0042] A parent identification module, used for performing target identification on the image to be processed, and identifying the image area where the sugarcane parent is located in the image to be processed;
[0043] A flower spike recognition module, used to recognize the image area where the sugarcane parent is located, and obtain the image area where the sugarcane flower spike corresponding to the sugarcane parent is located;
[0044] The flowering state recognition module is used to recognize the flowering state of sugarcane based on the visual features of the sugarcane spike in the image area where the sugarcane spike is located.
[0045] In a third aspect, in order to solve the above-mentioned technical problem, the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the sugarcane flowering state identification method of the present application is implemented.
[0046] In a fourth aspect, in order to solve the above-mentioned technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the sugarcane flowering state identification method of the present application is implemented.
[0047] Additional aspects and advantages of the present application will be partially given in the following description, which will become apparent from the following description, or will be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for describing the embodiments of the present invention are briefly introduced below.
[0049] Figure 1 A schematic flow chart of a method for identifying the flowering state of sugarcane provided by one embodiment of the present invention;
[0050] Figure 2 A schematic diagram of the structure of a sugarcane flowering state recognition system provided by one embodiment of the present invention;
[0051] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The principles and features of the present invention are described below. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0053] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0054] The solution provided by the embodiment of the present invention can be applied to any application scenario where the flowering state of sugarcane needs to be identified. The solution provided by the embodiment of the present invention can be executed by any electronic device, including at least one of the following: a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart TV, and a smart car device.
[0055] The embodiment of the present invention provides a possible implementation method, such as Figure 1 As shown, a flowchart of a method for identifying the flowering state of sugarcane is provided. The scheme can be executed by any electronic device, for example, a terminal device, or a terminal device and a server. For the convenience of description, the method provided by the embodiment of the present invention will be described below by taking the terminal device as the execution subject as an example. Figure 1 The method may include the following steps:
[0056] S1, obtaining an image to be processed for a target area, wherein the target area is an area for growing sugarcane, and the image to be processed includes sugarcane;
[0057] S2, performing target recognition on the image to be processed, and identifying the image area where the sugarcane parent is located in the image to be processed;
[0058] S3, identifying the image region where the sugarcane parent is located, and obtaining the image region where the sugarcane spike corresponding to the sugarcane parent is located;
[0059] S4, identifying the flowering state of sugarcane based on the visual features of the sugarcane spike in the image area where the sugarcane spike is located.
[0060] By the method of the present invention, in the process of identifying the flowering state of sugarcane, image processing technology is used to first identify the sugarcane parent in the image to be processed, then identify the image area where the sugarcane spike is located in the image area where the sugarcane parent is located, and finally identify the flowering state of sugarcane from the image area where the sugarcane spike is located. This hierarchical recognition method can accurately identify the flowering state of sugarcane from the image to be processed, and saves labor costs compared to manual methods.
[0061] The scheme of the present invention is further described below in conjunction with the following specific embodiments. In this embodiment, a method for identifying the flowering state of sugarcane may include the following steps:
[0062] S1, obtaining an image to be processed for a target area, wherein the target area is an area for growing sugarcane, and the image to be processed includes sugarcane;
[0063] Among them, the image to be processed can be obtained based on an image acquisition device, such as a camera, a drone, etc., which is not limited in the present application.
[0064] S2, performing target recognition on the image to be processed, and identifying the image area where the sugarcane parent is located in the image to be processed;
[0065] Among them, identification can be carried out based on the location information, plant height and other characteristics that can characterize the sugarcane parents.
[0066] S3, identifying the image region where the sugarcane parent is located, and obtaining the image region where the sugarcane spike corresponding to the sugarcane parent is located;
[0067] Among them, sugarcane flower spikes can be identified based on visual features that can characterize the flower spikes, such as color, shape, and texture.
[0068] Optionally, the above S2 and S3 are implemented based on a target recognition model, and the target recognition model is trained in the following manner:
[0069] S11, obtaining training samples, wherein the training samples include a first sample set and a second sample set, wherein the first sample set includes a plurality of sugarcane parent sample images and sample images not including the sugarcane parent, and the second sample set includes a plurality of sugarcane tassel sample images and sample images not including the sugarcane tassel, each of the sugarcane parent sample images corresponds to a first identifier, and each of the sugarcane tassel sample images corresponds to a second identifier, each of the first identifiers is used to characterize the position of the sugarcane parent in the corresponding sugarcane parent sample image and the category recognition result of the sugarcane parent, and each of the second identifiers is used to characterize the position of the sugarcane tassel in the corresponding sugarcane tassel sample image and the category recognition result of the sugarcane tassel;
[0070] S12, according to the sample images in the training samples, obtaining a sample frame of each sample image through an initial model, for each sample image, the sample frame is used to characterize the predicted position of the target object in the sample image, each sample image is the sugarcane parent sample image, the sugarcane spike sample image, the sample image not containing the sugarcane spike or the sample image not containing the sugarcane parent, and the target object is the sugarcane parent or the sugarcane spike;
[0071] S13, respectively calculating a first weight when each sample frame is a positive sample frame, and a second weight when each sample frame is a negative sample frame;
[0072] Among them, the positive sample frame indicates that the position corresponding to the sample frame is the position of the target object, and the negative sample frame indicates that the position corresponding to the sample frame is not the position of the target object.
[0073] Optionally, one possible implementation of S13 is as follows:
[0074] For each of the sample frames, a first weight is calculated based on the image distribution and the probability weight to indicate that the sample frame is a positive sample frame, and a second weight is calculated to indicate that the sample frame is a negative sample frame.
[0075] Optionally, the calculating of the first weight of the sample frame as a positive sample frame based on the image distribution and the probability weight includes:
[0076] Calculate the Gaussian distribution of the sample frame based on the position of the target object;
[0077] Calculating a probability weight of the positive sample frame, wherein the probability weight indicates a probability that the positive sample frame contains a target object;
[0078] A first weight of the positive sample frame is calculated according to the Gaussian distribution of the positive sample frame and the probability weight of the positive sample frame.
[0079] Optionally, the calculating the second weight of the sample frame as a negative sample frame includes:
[0080] A second weight of the sample frame being a negative sample frame is calculated based on an intersection-and-union ratio of a target frame formed by the positions of the sample frame and the target object.
[0081] S14, respectively calculating a third weight when an object in each of the sample images is a target object and a fourth weight when an object in each of the sample images is not a target object;
[0082] S15, determining a first loss value of the initial model according to the sample frames of the sample images and the first identifiers, the first weights, and the second weights;
[0083] S16, obtaining a predicted target object recognition result of each sample image through the initial model according to the sample frame of each sample image and each sample image;
[0084] S17, determining a second loss value of the initial model according to the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, and each of the fourth weights;
[0085] S18: Training the initial model according to the first loss value and the second loss value to obtain the target recognition model.
[0086] In the present application, the first loss value and the second loss value can be calculated based on the cross-entropy loss function. Cross-entropy loss can achieve satisfactory results when the samples are balanced. However, when there is a serious sample imbalance problem, the cross-entropy loss function may be invalid. Since there is a serious imbalance in the number of sample images containing sugarcane spikes or sample images containing sugarcane parents and other samples (sample images that do not contain sugarcane spikes or sample images that do not contain sugarcane parents) in this scheme, it is not suitable for this task. In order to solve this problem, the present invention introduces a weight factor (first weight, second weight, third weight and fourth weight) for each category to adjust the ratio of sample images containing sugarcane spikes and sample images that do not contain sugarcane spikes, as well as the ratio of sample images containing sugarcane parents and sample images that do not contain sugarcane parents.
[0087] Although the introduction of weight factors can alleviate the problem of sample imbalance, it ignores the difference between the predicted probability value of the misclassified sample and the true label. The crop phenology prior is conducive to the correct identification of crops. Therefore, this paper uses the crop phenology information of each sample (the probability value of the object in each sample image being the target object) as the prior in the loss function to enhance this difference. It mainly targets the recognition results corresponding to sugarcane parents or sugarcane spikes, and increases the contribution of the recognition results corresponding to sugarcane parents or sugarcane spikes to the final loss, thereby enhancing the network's recognition ability for sugarcane parents or sugarcane spikes.
[0088] Based on the above principles, optionally, the method further includes:
[0089] According to the sample images in the training samples, obtaining a probability value of an object in each of the sample images being a target object through an initial model;
[0090] For each of the sample images, using the probability value corresponding to the sample image as the fifth weight of the predicted target object recognition result corresponding to the sample image;
[0091] In S17, determining the second loss value of the initial model according to the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, and each of the fourth weights includes:
[0092] S171, determining the second loss value of the initial model according to the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, each of the fourth weights and each of the fifth weights.
[0093] On the basis of the above scheme, in the above S171, the second loss value of the initial model is determined according to the predicted target object recognition result of each of the sample images, each of the second identifiers, each of the third weights, each of the fourth weights and each of the fifth weights, including:
[0094] S1711, for each of the sample images, determining a third loss value corresponding to the sample image according to the predicted target object recognition result, the second identifier, the third weight, the fourth weight, and the fifth weight corresponding to the sample image;
[0095] S1712: Determine the second loss value according to the third loss value corresponding to each of the sample images and the total number of the sample images.
[0096] S4, identifying the flowering state of sugarcane based on the visual features of the sugarcane spike in the image area where the sugarcane spike is located.
[0097] The sugarcane flowering state may be unopened, just opened, fully opened or fully opened.
[0098] Optionally, the above S4 is implemented based on a flowering state recognition model, and the flowering state recognition model is trained based on the following method:
[0099] S41, obtaining training sample pairs, each of which includes a standard non-interference training sample and an interference training sample;
[0100] S42, outputting interference-free samples after passing the interference training samples through an interference elimination network;
[0101] S43, using a target object recognition network to extract standard features from the standard non-interference training samples and to extract generated features from the non-interference samples;
[0102] S44, comparing the standard feature and the generated feature to obtain a feature error;
[0103] S45, in the process of training the interference elimination network, assisting in training the interference elimination network based on the characteristic error, so as to complete the training of the interference elimination network;
[0104] S46, completing the training of the target object recognition network based on the standard features, so that the trained target object recognition network can accurately recognize the target object;
[0105] S47, using the trained interference elimination network and the trained target object recognition network as the flowering state recognition model.
[0106] Different from the prior art, in this embodiment, during the training of the interference elimination network, the target object recognition network is used to extract standard features from standard interference-free training samples and to extract generated features from generated interference-free samples obtained after passing through the interference elimination network, and then the standard features and the generated features are compared to obtain feature errors, and then the interference elimination network is assisted in training based on the feature errors, so that the interference elimination network after training has stronger interference elimination capabilities.
[0107] Optionally, the above-mentioned interference elimination network includes at least one first type of interference elimination network based on a generative adversarial network and a second type of interference elimination network connected to the first type of interference elimination network, the first type of interference elimination network is used to eliminate the first type of interference in the interference training sample, and the second type of interference elimination network is used to eliminate the second type of interference in the interference training sample.
[0108] Optionally, the first type of interference elimination network is trained by the following method:
[0109] After the interference training sample passes through the first type of interference elimination network, the first generated interference-free sample is output;
[0110] Extracting a first standard feature from a standard non-interference training sample and a first generated feature from a first generated non-interference sample respectively using the target object recognition network;
[0111] comparing a first standard feature and the first generated feature to obtain a first feature error;
[0112] In the process of training the first type of interference elimination network, the first type of interference elimination network is assisted in training based on the first characteristic error to complete the training of the first type of interference elimination network.
[0113] Optionally, in the process of training the first type of interference elimination network, an implementation method of assisting the training of the first type of interference elimination network based on the first feature error to complete the training of the first type of interference elimination network is:
[0114] Alternately training a generative network and a discriminative network of the generative adversarial network to optimize the generative network and the discriminative network respectively;
[0115] Assisting in training the generating network based on the first feature error;
[0116] The generated network after training is used as the first type of interference elimination network after training is completed.
[0117] Optionally, the second type of interference elimination network is trained by the following method:
[0118] After passing the first generated interference-free sample through the second type of interference elimination network, output a second generated interference-free sample;
[0119] Extracting second standard features from the standard interference-free training samples and second generated features from the second generated interference-free samples respectively using the target object recognition network;
[0120] comparing the second standard feature and the second generated feature to obtain a second feature error;
[0121] In the process of training the second type of interference elimination network, the second type of interference elimination network is assisted in training based on the second characteristic error to complete the training of the second type of interference elimination network.
[0122] Optionally, the first type of interference elimination network may be an interference elimination network determined based on a generative network G in a generative adversarial network (GAN). The second type of interference elimination network may be a direction correction network, for example, a correction network based on a thin plate function model (TPS) or a correction network based on an affine transformation may be used to perform geometric correction on the target object to be identified.
[0123] Optionally, the target object recognition network may adopt an Attention-based recognition network or a CTC (Connectionist Temporal Classification)-based recognition network or other target object recognition networks derived from these two frameworks.
[0124] The target object recognition network includes a feature extraction part, an encoding part (if necessary) and a decoding part. The training of the target object recognition network is to hope that the features extracted from the second generated interference-free samples and the standard interference-free training samples by the trained target object recognition network are basically consistent, so that the trained target object recognition network can correctly identify the target object from the target objects to be identified.
[0125] In order to achieve this goal, the performance of the target object recognition network is not expected to be too strong, so the target object recognition network is first trained using standard non-interference training samples (i.e., the target object recognition network is pre-trained) to make it more sensitive to interference. Then, the pre-trained target object recognition network is used to assist in training the interference elimination network (including the first type of interference elimination network and the second type of interference elimination network). After the interference elimination network is trained, the pre-trained target object recognition network is trained using standard non-interference training samples and interference training samples, thereby completing the training of the target object recognition network, thereby further improving the performance of the target object recognition network.
[0126] Optionally, the method further includes:
[0127] S5, based on the image area where the sugarcane spike is located, identifying the pollen fertility and / or germination time of the sugarcane parent, which can provide decision support for the planting and management of sugarcane.
[0128] Based on Figure 1 Based on the same principle as the method shown in , the embodiment of the present invention also provides a sugarcane flowering state recognition system 20, such as Figure 2 As shown in , the sugarcane flowering state identification system 20 may include an acquisition module 210, a parent identification module 220, a spike identification module 230 and a flowering state identification module 240, wherein:
[0129] An acquisition module 210 is used to acquire an image to be processed for a target area, where the target area is an area for growing sugarcane, and the image to be processed includes sugarcane;
[0130] The parent identification module 220 is used to perform target identification on the image to be processed, and identify the image area where the sugarcane parent is located in the image to be processed;
[0131] The flower spike recognition module 230 is used to recognize the image region where the sugarcane parent is located, and obtain the image region where the sugarcane flower spike corresponding to the sugarcane parent is located;
[0132] The flowering state recognition module 240 is used to recognize the flowering state of sugarcane based on the visual features of the sugarcane spike in the image area where the sugarcane spike is located.
[0133] Optionally, the system further includes:
[0134] The post-processing module is used to identify the pollen fertility and / or germination time of the sugarcane parent based on the image area where the sugarcane spike is located.
[0135] Optionally, the processing of the parent identification module 220 and the flower spike identification module 230 is implemented based on a target recognition model, and the target recognition model is obtained by training based on the following first model training module, and the first model training module is used to:
[0136] Acquire training samples, wherein the training samples include a first sample set and a second sample set, wherein the first sample set includes a plurality of sugarcane parent sample images and sample images not including the sugarcane parent, and the second sample set includes a plurality of sugarcane tassel sample images and sample images not including the sugarcane tassel, each of the sugarcane parent sample images corresponds to a first identifier, and each of the sugarcane tassel sample images corresponds to a second identifier, each of the first identifiers is used to characterize the position of the sugarcane parent in the corresponding sugarcane parent sample image and the category recognition result of the sugarcane parent, and each of the second identifiers is used to characterize the position of the sugarcane tassel in the corresponding sugarcane tassel sample image and the category recognition result of the sugarcane tassel;
[0137] According to the sample images in the training samples, a sample frame of each sample image is obtained through an initial model, and for each sample image, the sample frame is used to characterize the predicted position of the target object in the sample image, and each sample image is the sugarcane parent sample image, the sugarcane spike sample image, the sample image not containing the sugarcane spike, or the sample image not containing the sugarcane parent, and the target object is the sugarcane parent or the sugarcane spike;
[0138] Respectively calculating a first weight when each sample frame is a positive sample frame, and a second weight when each sample frame is a negative sample frame;
[0139] respectively calculating a third weight when an object in each of the sample images is a target object and a fourth weight when an object in each of the sample images is not a target object;
[0140] Determining a first loss value of the initial model according to the sample frames of the sample images and the first identifiers, the first weights, and the second weights;
[0141] According to the sample frames of the sample images and the sample images, obtaining the predicted target object recognition result of each sample image through the initial model;
[0142] Determining a second loss value of the initial model according to the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, and each of the fourth weights;
[0143] The initial model is trained according to the first loss value and the second loss value to obtain the target recognition model.
[0144] Optionally, the system further includes:
[0145] A weight determination module, configured to obtain, based on the sample images in the training samples, a probability value that the object in each sample image is a target object through an initial model; for each sample image, using the probability value corresponding to the sample image as a fifth weight of a predicted target object recognition result corresponding to the sample image;
[0146] When determining the second loss value of the initial model according to the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights and each of the fourth weights, the first model training module is specifically used to:
[0147] The second loss value of the initial model is determined based on the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, each of the fourth weights, and each of the fifth weights.
[0148] Optionally, when determining the second loss value of the initial model according to the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, each of the fourth weights, and each of the fifth weights, the first model training module is specifically used to:
[0149] For each of the sample images, determining a third loss value corresponding to the sample image according to the predicted target object recognition result, the second identifier, the third weight, the fourth weight, and the fifth weight corresponding to the sample image;
[0150] The second loss value is determined according to the third loss value corresponding to each of the sample images and the total number of the sample images.
[0151] Optionally, the flowering state recognition module 240 is implemented based on a flowering state recognition model, and the flowering state recognition model is obtained by training based on the following second model training module, and the second model training module is used to:
[0152] Acquire training sample pairs, each of the training sample pairs comprising a standard non-interference training sample and an interference training sample;
[0153] The interference training samples are passed through an interference elimination network and then output interference-free samples;
[0154] Extracting standard features from the standard non-interference training samples and generating features from the non-interference samples respectively using a target object recognition network;
[0155] comparing the standard feature and the generated feature to obtain a feature error;
[0156] In the process of training the interference elimination network, assisting in training the interference elimination network based on the characteristic error to complete the training of the interference elimination network;
[0157] Based on the standard features, completing the training of the target object recognition network;
[0158] The trained interference elimination network and the trained target object recognition network are used as the flowering state recognition model.
[0159] Optionally, the interference elimination network includes at least one first type of interference elimination network based on a generative adversarial network and a second type of interference elimination network connected to the first type of interference elimination network, the first type of interference elimination network is used to eliminate the first type of interference in the interfered training samples, and the second type of interference elimination network is used to eliminate the second type of interference in the interfered training samples.
[0160] The sugarcane flowering state recognition system of the embodiment of the present invention can execute the sugarcane flowering state recognition method provided by the embodiment of the present invention, and its implementation principle is similar. The actions performed by each module and unit in the sugarcane flowering state recognition system in each embodiment of the present invention correspond to the steps in the sugarcane flowering state recognition method in each embodiment of the present invention. For the detailed functional description of each module of the sugarcane flowering state recognition system, please refer to the description in the corresponding sugarcane flowering state recognition method shown in the previous text, which will not be repeated here.
[0161] Among them, the above-mentioned sugarcane flowering state identification system can be a computer program (including program code) running in a computer device, for example, the sugarcane flowering state identification system is an application software; the system can be used to execute the corresponding steps in the method provided in the embodiment of the present invention.
[0162] In some embodiments, the sugarcane flowering state identification system provided by the embodiments of the present invention may be implemented in a combination of software and hardware. As an example, the sugarcane flowering state identification system provided by the embodiments of the present invention may be a processor in the form of a hardware decoding processor, which is programmed to execute the sugarcane flowering state identification method provided by the embodiments of the present invention. For example, the processor in the form of a hardware decoding processor may be one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic components.
[0163] In other embodiments, the sugarcane flowering state recognition system provided by the embodiment of the present invention can be implemented in software. Figure 2 A sugarcane flowering state recognition system stored in a memory is shown, which may be software in the form of a program and a plug-in, and includes a series of modules, including an acquisition module 210, a parent identification module 220, a spike identification module 230 and a flowering state recognition module 240, for implementing the sugarcane flowering state recognition method provided in an embodiment of the present invention.
[0164] The modules involved in the embodiments of the present invention may be implemented by software or hardware, wherein the name of a module does not limit the module itself in some cases.
[0165] Based on the same principle as the method shown in the embodiments of the present invention, an electronic device is also provided in the embodiments of the present invention, which may include but is not limited to: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the method shown in any embodiment of the present invention by calling the computer program.
[0166] In an alternative embodiment, an electronic device is provided, such as Figure 3 As shown, Figure 3The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.
[0167] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0168] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0169] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.
[0170] The memory 4003 is used to store the application code (computer program) for executing the solution of the present invention, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the application code stored in the memory 4003 to implement the content shown in the above method embodiment.
[0171] The electronic device may also be a terminal device. Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0172] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding contents of the aforementioned method embodiment.
[0173] According to another aspect of the present invention, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the implementation modes of the above-mentioned various embodiments.
[0174] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0175] It should be understood that the flow charts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, the program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0176] The computer-readable storage medium provided by the embodiment of the present invention may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.
[0177] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0178] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the disclosure scope involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) by each other.
Claims
1. A method for identifying the flowering state of sugarcane, characterized in that: include: S1, obtaining an image to be processed for a target area, wherein the target area is an area for growing sugarcane, and the image to be processed includes sugarcane; S2, performing target recognition on the image to be processed, and identifying the image area where the sugarcane parent is located in the image to be processed; S3, identifying the image region where the sugarcane parent is located, and obtaining the image region where the sugarcane spike corresponding to the sugarcane parent is located; S4, identifying the flowering state of sugarcane based on the visual features of the sugarcane spike in the image area where the sugarcane spike is located.
2. The method according to claim 1, characterized in that: The method further comprises: Based on the image area where the sugarcane spike is located, the pollen fertility and / or germination time of the sugarcane parent are identified.
3. The method according to claim 1, characterized in that S2 and S3 are implemented based on a target recognition model, which is trained in the following way: Acquire training samples, wherein the training samples include a first sample set and a second sample set, wherein the first sample set includes a plurality of sugarcane parent sample images and sample images not including the sugarcane parent, and the second sample set includes a plurality of sugarcane tassel sample images and sample images not including the sugarcane tassel, each of the sugarcane parent sample images corresponds to a first identifier, and each of the sugarcane tassel sample images corresponds to a second identifier, each of the first identifiers is used to characterize the position of the sugarcane parent in the corresponding sugarcane parent sample image and the category recognition result of the sugarcane parent, and each of the second identifiers is used to characterize the position of the sugarcane tassel in the corresponding sugarcane tassel sample image and the category recognition result of the sugarcane tassel; According to the sample images in the training samples, a sample frame of each sample image is obtained through an initial model, and for each sample image, the sample frame is used to characterize the predicted position of the target object in the sample image, and each sample image is the sugarcane parent sample image, the sugarcane spike sample image, the sample image not containing the sugarcane spike, or the sample image not containing the sugarcane parent, and the target object is the sugarcane parent or the sugarcane spike; Respectively calculating a first weight when each sample frame is a positive sample frame, and a second weight when each sample frame is a negative sample frame; respectively calculating a third weight when an object in each of the sample images is a target object and a fourth weight when an object in each of the sample images is not a target object; Determining a first loss value of the initial model according to the sample frames of the sample images and the first identifiers, the first weights, and the second weights; According to the sample frames of the sample images and the sample images, obtaining the predicted target object recognition result of each sample image through the initial model; Determining a second loss value of the initial model according to the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, and each of the fourth weights; The initial model is trained according to the first loss value and the second loss value to obtain the target recognition model.
4. The method according to claim 3, characterized in that The method further comprises: According to the sample images in the training samples, obtaining a probability value of an object in each of the sample images being a target object through an initial model; For each of the sample images, using the probability value corresponding to the sample image as the fifth weight of the predicted target object recognition result corresponding to the sample image; The step of determining the second loss value of the initial model according to the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, and each of the fourth weights comprises: The second loss value of the initial model is determined based on the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, each of the fourth weights, and each of the fifth weights.
5. The method according to claim 4, characterized in that Determining the second loss value of the initial model according to the predicted target object recognition results of each of the sample images, each of the second identifiers, each of the third weights, each of the fourth weights, and each of the fifth weights includes: For each of the sample images, determining a third loss value corresponding to the sample image according to the predicted target object recognition result, the second identifier, the third weight, the fourth weight, and the fifth weight corresponding to the sample image; The second loss value is determined according to the third loss value corresponding to each of the sample images and the total number of the sample images.
6. The method according to any one of claims 1 to 5, characterized in that The S4 is implemented based on a flowering state recognition model, and the flowering state recognition model is trained based on the following method: Acquire training sample pairs, each of the training sample pairs comprising a standard non-interference training sample and an interference training sample; The interference training samples are passed through an interference elimination network and then output interference-free samples; Extracting standard features from the standard non-interference training samples and generating features from the non-interference samples respectively using a target object recognition network; comparing the standard feature and the generated feature to obtain a feature error; In the process of training the interference elimination network, assisting in training the interference elimination network based on the characteristic error to complete the training of the interference elimination network; Based on the standard features, completing the training of the target object recognition network; The trained interference elimination network and the trained target object recognition network are used as the flowering state recognition model.
7. The method according to claim 6, characterized in that The interference elimination network includes at least one first type of interference elimination network based on a generative adversarial network and a second type of interference elimination network connected to the first type of interference elimination network, the first type of interference elimination network is used to eliminate the first type of interference in the interference training sample, and the second type of interference elimination network is used to eliminate the second type of interference in the interference training sample.
8. A sugarcane flowering state recognition system, characterized in that: include: An acquisition module, used for acquiring an image to be processed for a target area, wherein the target area is an area for growing sugarcane, and the image to be processed includes sugarcane; A parent identification module, used for performing target identification on the image to be processed, and identifying the image area where the sugarcane parent is located in the image to be processed; A flower spike recognition module, used to recognize the image area where the sugarcane parent is located, and obtain the image area where the sugarcane flower spike corresponding to the sugarcane parent is located; The flowering state recognition module is used to recognize the flowering state of sugarcane based on the visual features of the sugarcane spike in the image area where the sugarcane spike is located.
9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Sugarcane plant pollen fertility determination method based on neural network model
CN120298832A