Method for acquiring coverage rate of fog drops on blade based on neural network
Through the neural network-based image processing method, efficient and accurate detection of the distribution of mist droplets on crop leaves in the sprayed pesticides by drones, solving the problem of low detection efficiency in the prior art and improving the spraying effect.
Patent Information
- Application Number
- CN202411539498.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-03-18
AI Technical Summary
The prior art is difficult to achieve efficient and accurate detection of the distribution of droplets on crop leaves, affecting the efficiency of the drone's spraying of pesticides.
Using a neural network-based image processing method, the original image is segmented through a pre-trained image processing model, the images of the blades and droplets are obtained respectively, and the coverage ratio of the droplets on the blades is calculated.
It realizes efficient and accurate detection of the distribution of fog droplets on the blades, and improves the efficiency of the drone's spraying of pesticides.
Smart Images

Figure CN119649206A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to image processing technology, and in particular to a method for obtaining droplet coverage on a leaf based on a neural network. Background Art
[0002] Pesticide spraying is a common method for preventing and controlling crop diseases and pests. Spraying pesticides by drone is an efficient and convenient way. Compared with traditional manual spraying, drone spraying has significant advantages such as high automation and flexible operation. It can effectively improve the efficiency of pesticide spraying and is widely used in precision agriculture practice.
[0003] However, the spraying effect of pesticides is closely related to the deposition distribution of droplets in the spraying area. Therefore, it is necessary to obtain the deposition distribution data of droplets on crops to improve the pesticide spraying effect of drones. Summary of the invention
[0004] The purpose of the present disclosure is to provide a method, device, storage medium, electronic device and program product for obtaining the droplet coverage on the blade based on a neural network. The method, device, storage medium, electronic device and program product for obtaining the droplet coverage on the blade based on a neural network can realize efficient and accurate detection of the distribution of droplets on the blade.
[0005] In order to achieve the above-mentioned objectives, in a first aspect, the present disclosure provides a method for obtaining the coverage rate of droplets on blades based on a neural network, comprising: obtaining an original image, wherein the original image includes blades and droplets deposited on the blades; segmenting the blades in the original image according to a pre-trained first image processing model to obtain a leaf image; determining a processed original image according to the leaf image and the original image; segmenting the droplets in the processed original image according to a pre-trained second image processing model to obtain a droplet image; determining the coverage rate of the droplets on the blades according to the leaf image and the droplet image.
[0006] Optionally, the loss function corresponding to the pre-trained second image processing model is a loss function that combines a cross entropy loss function with an image segmentation loss function.
[0007] Optionally, the pre-trained second image processing model includes an encoder, which includes a convolutional layer and an attention mechanism module connected to the convolutional layer.
[0008] Optionally, determining the coverage of the droplets on the blade based on the blade image and the droplet image includes: determining a first number of pixels occupied by the blade in the leaf image; determining a second number of pixels occupied by the droplets in the droplet image; and determining the coverage of the droplets on the blade based on the first number of pixels and the second number of pixels.
[0009] Optionally, determining a first number of pixels occupied by leaves in the leaf image includes: converting the leaf image into a leaf color model; creating a first mask based on a preset color range in the leaf color model, and calculating the first number of pixels based on the first mask; determining a second number of pixels occupied by droplets in the droplet image includes: converting the leaf image into a droplet color model; creating a second mask based on a preset color range in the droplet color model, and calculating the second number of pixels based on the second mask.
[0010] Optionally, the method for obtaining the droplet coverage rate on the blade based on a neural network also includes: determining a spraying strategy of a spraying device according to the coverage rate of the droplets on the blade, the spraying device being used to spray a target liquid onto a spraying object, and the original image being obtained by performing image acquisition on the spraying object; synchronizing the spraying strategy to the spraying device so that the spraying device sprays the target liquid onto the spraying object according to the spraying strategy.
[0011] In a second aspect, an embodiment of the present disclosure provides a device for obtaining the coverage rate of droplets on blades based on a neural network, comprising: an acquisition module, configured to obtain an original image, wherein the original image includes blades and droplets deposited on the blades; a first segmentation module, configured to segment the blades in the original image according to a pre-trained first image processing model, to obtain a leaf image; a determination module, configured to determine a processed original image according to the leaf image and the original image; a second segmentation module, configured to segment the droplets in the processed original image according to a pre-trained second image processing model, to obtain a droplet image; the determination module is further configured to determine the coverage rate of the droplets on the blade according to the leaf image and the droplet image.
[0012] In a third aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for obtaining droplet coverage on a blade based on a neural network as described in the first aspect.
[0013] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, comprising: a memory on which a computer program is stored; and a processor for executing the computer program in the memory to implement the method for obtaining droplet coverage on a blade based on a neural network as described in the first aspect.
[0014] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the method for obtaining droplet coverage on a blade based on a neural network as described in the first aspect.
[0015] Through the above technical solution, the first image processing model is used to obtain a leaf image based on the original image segmentation, and the second image processing model is used to obtain a droplet image based on the processed original image segmentation. Then, based on the leaf image and the droplet image, the coverage rate of the droplets on the leaf is determined, and the coverage rate can characterize the distribution of the droplets on the leaf. On the one hand, since the leaves and droplets are segmented separately, the segmentation results remove other irrelevant image information, which can improve the accuracy of image processing. Then, combined with the separate segmentation results, the distribution of the droplets on the leaf can be accurately detected. On the other hand, the segmentation of the leaves and droplets is achieved through the image processing model, and the image processing model can achieve efficient and accurate image segmentation. Therefore, this technical solution can achieve efficient and accurate detection of the distribution of droplets on the leaf.
[0016] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings: Figure 1 The present invention is a flowchart of a method for obtaining droplet coverage on a blade based on a neural network according to an exemplary embodiment.
[0018] Figure 2 It is a schematic diagram of a model structure of a first image processing model according to an exemplary embodiment.
[0019] Figure 3 is a schematic diagram of a model structure of a second image processing model according to an exemplary embodiment.
[0020] Figure 4 It is a flowchart of an application process for obtaining the droplet coverage on a blade based on a neural network according to an exemplary embodiment.
[0021] Figure 5It is a structural block diagram of a device for obtaining droplet coverage on a blade based on a neural network according to an exemplary embodiment.
[0022] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0023] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.
[0024] Pesticide spraying is a common method for preventing and controlling crop diseases and pests. Spraying pesticides by drone is an efficient and convenient way. Compared with traditional manual spraying, drone spraying has significant advantages such as high automation and flexible operation. It can effectively improve the efficiency of pesticide spraying and is widely used in precision agriculture practice.
[0025] However, the spraying effect of pesticides is closely related to the deposition distribution of droplets in the spraying area. Therefore, it is necessary to obtain the deposition distribution data of droplets on crops to improve the pesticide spraying effect of drones.
[0026] Moreover, when drones are spraying pesticides, their spraying effect is easily affected by flight speed, altitude, natural wind, and crop canopy structure. Therefore, before using drones to spray pesticides, in a specific spraying scenario, determining the deposition distribution of droplets in the spraying area can ensure the spraying effect of the target crops and reduce droplet drift.
[0027] In the related art, the detection of droplet deposition based on water-sensitive test paper, fluorescent tracer and sensor cannot directly detect the droplets on the leaves. For example, water-sensitive paper is used to collect droplets, and then the droplet deposition distribution data is obtained by manual measurement or image processing. Specifically, the water-sensitive paper image is segmented to obtain a binary image, the number of droplets in the binary image is counted, and then the initial droplets are analyzed for droplet overlap using confidence interval and credibility methods. The structure of water-sensitive paper is quite different from that of leaves, and cannot accurately reflect the distribution of droplets.
[0028] In addition, this method of detecting droplet deposition distribution has some problems, such as the dyed area is easily contaminated when collecting droplets and processing droplet images, which affects the accuracy of droplet deposition distribution detection. In order to make up for this shortcoming, a new spray deposition pattern measurement system was developed based on fluorescent tracers, which can improve the measurement accuracy of droplet deposition. However, the fluorescent tracer method relies on expensive equipment and cannot be widely used.
[0029] In addition, there are methods that use sensor platforms to evaluate droplet deposition distribution, but these methods have defects such as complex experimental procedures and difficulty in using in field environments.
[0030] Therefore, the droplet detection method of the related art cannot achieve efficient and accurate detection of droplet deposition distribution.
[0031] Based on this, an embodiment of the present disclosure provides a technical solution, which detects the distribution of droplet deposition on blades based on an image processing model, and can achieve accurate and efficient droplet deposition distribution detection.
[0032] It can be understood that this technical solution can be applied to the above-mentioned drone pesticide spraying scenario, and can also be applied to other scenarios that require droplet deposition distribution detection. For example, the spraying equipment is not a drone, but other equipment; for another example, the sprayed liquid is not pesticide, but water or other objects. And the hardware execution subject of this technical solution can be a terminal with image processing capabilities.
[0033] Figure 1 The present invention is a flow chart of a method for obtaining the coverage rate of fog droplets on a blade based on a neural network according to an exemplary embodiment. The method for obtaining the coverage rate of fog droplets on a blade based on a neural network comprises the following steps: Step S11, obtaining an original image, wherein the original image includes a blade and droplets deposited on the blade.
[0034] Step S12, segmenting the leaves in the original image according to the pre-trained first image processing model to obtain a leaf image.
[0035] Step S13, determining a processed original image according to the leaf image and the original image.
[0036] Step S14, segmenting the fog droplets in the processed original image according to the pre-trained second image processing model to obtain a fog droplet image.
[0037] Step S15, determining the coverage of the mist droplets on the blades according to the blade images and the mist droplet images.
[0038] In step S11, the original image can be obtained in different ways. For example, based on the aforementioned drone pesticide spraying scene, liquid can be sprayed on the leaves in the corresponding spraying scene before the drone sprays the pesticide, and then the leaves sprayed with liquid are imaged to obtain the original image. The leaves can be leaves of crops that need to be sprayed, such as corn leaves.
[0039] In some embodiments, different spraying modes may be used, and images of leaves in different spraying modes may be captured to obtain multiple original images.
[0040] Therefore, in step S11, the number of original images may be one or more. If there are more than one original images, the multiple original images can be processed respectively according to the same image processing method, and then, in step S15, the coverage rates corresponding to the multiple original images can be obtained.
[0041] In the embodiment of the present disclosure, the coverage rate of the droplets on the leaves is used to characterize the distribution of the deposition of the droplets on the leaves. It can be understood that the higher the coverage rate, the better the spraying effect. Therefore, characterizing the deposition distribution by the coverage rate can improve the pesticide spraying effect.
[0042] It is understandable that although the original image includes the leaves and the droplets deposited on the leaves, if the original image is directly detected, the final detection result may be less accurate. Therefore, in the embodiment of the present disclosure, two stages of segmentation are performed based on the original image.
[0043] In step S12, the leaves in the original image are segmented using the pre-trained first image processing model to obtain a leaf image. It is understood that the leaf image may only include leaves without other objects. For example, the original image includes not only leaves but also background parts and mist droplets, while the leaf image removes the background and mist droplets and retains the leaf part.
[0044] In some embodiments, the first image processing model may adopt a deepplabv3+ model structure.
[0045] Figure 2 is a schematic diagram of a model structure of a first image processing model according to an exemplary embodiment. Figure 2 As shown, the first image processing model includes an encoder and a decoder. In the encoder, it includes: a lightweight deep learning architecture, multiple convolutional layers and pooling layers in sequence, and the convolution kernels of the multiple convolutional layers may be different. In addition, the multiple convolutional layers may involve depthwise separable convolutional layers, and the channel multiplication rates of the depthwise separable convolutional layers may be different.
[0046] The depthwise separable convolutional layer is an efficient convolution operation in a convolutional neural network. It decomposes the standard convolution operation into two smaller operations to reduce the complexity and computational cost of the model. Different channel multiplication rates can output different numbers of channel features. For example, rate6 means that the channel multiplication rate is 6, and the number of channels in the corresponding output feature map will be 6 times the number of channels in the input feature map, which can enhance the learning ability of the network without significantly increasing the amount of calculation.
[0047] exist Figure 2 In the figure, the convolution kernel sizes of the involved convolution layers include: 1×1 and 3×3; the channel multiplication rates of the involved depthwise separable convolution layers include: 6, 12, and 18.
[0048] The pooling layer, also known as spatial pooling, is a commonly used feature dimension reduction operation in convolutional neural networks. The pooling operation is performed on the spatial dimensions (width and height) of the input image or feature map to help reduce the dimension of the feature map, thereby reducing the number of parameters and computation in the network.
[0049] Among them, the input of the lightweight deep learning architecture is the input of the model, the output of the lightweight deep learning architecture is used as the input of some convolutional layers and one of the inputs of the decoder, and the output of one of the convolutional layers is used as one of the inputs of the decoder.
[0050] Regarding lightweight deep learning architectures, MobileNetV2 can be mentioned. MobileNetV2 is a popular lightweight deep learning architecture designed mainly for computer vision tasks on mobile and edge devices, such as smartphones, tablets, and IoT devices.
[0051] In the decoder, there are convolutional layers, image magnification layers, and splicing operation layers.
[0052] The convolutional layer involves convolutional layers with different convolution kernel sizes, where the input of one convolutional layer is the output of the lightweight deep learning architecture, and the input of the other convolutional layer is the output of the concatenation operation layer.
[0053] The image magnification layer involves two parts, one of which is used to process the output of the encoder and output the processing result to the splicing operation layer. The input of the other image magnification layer is the output of another convolution layer, and its output is the output of the decoder.
[0054] One input of the splicing operation layer is the input of the convolution layer, and the other input is the output of the image magnification layer. The output of the splicing operation layer is input into another convolution layer.
[0055] Regarding the image upscaling layer, it can be a 4-fold image upscaling layer, for example: Upsample by 4, in the field of image processing and computer vision, it means to enlarge the size of the image by 4 times. Image upscaling can involve the enlargement of each dimension (width and height) in the image, which can be achieved through interpolation methods. In addition, in semantic segmentation, after downsampling through convolutional neural networks to extract features, upsampling is required to restore the original resolution for accurate pixel-level prediction.
[0056] Regarding the splicing operation layer, it is used to splice two or more tensors in a certain dimension. This operation is widely used in deep learning and can be used to process images or feature maps. The splicing operation can increase the number of channels or feature dimensions so that the relationship between different features can be better captured in subsequent layers. The splicing operation layer can also be understood as a fusion layer that can achieve feature or image fusion.
[0057] Understandably, Figure 2 In the example, different model layers or model modules have different output feature maps. Figure 2 In , feature maps are used to represent the output or input of the corresponding layer or block.
[0058] It can be seen from the structure of the above-mentioned first image processing model that the first image processing model can realize accurate image segmentation processing.
[0059] As an optional implementation, the training process of the first image processing model includes: obtaining a first training data set, the first training data set including multiple sample images, the multiple sample images respectively corresponding to leaf segmentation labels, and training the first image processing model to be trained based on the first training data set to obtain a pre-trained first image processing model.
[0060] In some embodiments, the plurality of sample images may be images acquired in the manner of acquiring the original image, or may be images acquired without involving droplets. The leaf segmentation labels corresponding to the plurality of sample images are used to identify the leaves in the sample images.
[0061] Therefore, by training the first image processing model based on the first training data set, a pre-trained first image processing model can be obtained.
[0062] In step S12, the original image is input into the pre-trained first image processing model, and the pre-trained first image processing model can output a segmented leaf image.
[0063] In step S13, the processed original image is determined based on the leaf image and the original image. It can be understood that the leaf image does not include fog droplets, so in order to segment the fog droplets, the leaf image and the original image can be processed accordingly to obtain an image including only the leaf and fog droplets. That is, in the processed original image, other invalid information is removed, and only valid information for realizing fog droplet segmentation is included.
[0064] For example, based on the leaf position information in the leaf image, the leaf region can be located in the original image, and the information outside the leaf region can be deleted. Since the mist droplets are also located in the leaf region, the processed original image includes the leaves and the mist droplets.
[0065] In step S14, the fog droplets in the processed original image are segmented according to the pre-trained second image processing model to obtain a fog droplet image. It can be understood that the fog droplet image may only include fog droplets without other objects. For example, the processed original image includes not only fog droplets but also leaf parts. In the fog droplet image, the leaf parts are removed and the fog droplets are retained.
[0066] Regarding the second image processing model, the deepplabv3+ model structure can also be used.
[0067] Figure 3 is a schematic diagram of a model structure of a second image processing model according to an exemplary embodiment. Figure 3 As shown, the second image processing model includes an encoder and a decoder.
[0068] Will Figure 3 and Figure 2 For comparison, both are based on the deeplabv3+ model structure, but Figure 3 Compared to Figure 2 In the encoder part, a new attention mechanism module is added, which is connected behind the convolution layer with a 1×1 convolution kernel size. Figure 2 Consistent, therefore, with regard to Figure 3 For a detailed introduction to the model structure, please refer to the aforementioned embodiments and will not be repeated here.
[0069] In the disclosed embodiment, the second image processing model not only improves the deepplabv3+ model structure, but also improves the loss function.
[0070] As an optional implementation, the loss function corresponding to the pre-trained second image processing model is a loss function that combines a cross entropy loss function with an image segmentation loss function.
[0071] In this implementation, a loss function that combines a cross entropy loss function with an image segmentation loss function is used to improve the accuracy of the model.
[0072] Regarding the cross entropy loss function, for example: Cross Entropy Loss; regarding the image segmentation loss function, for example: Dice loss.
[0073] In some embodiments, the loss function corresponding to the pre-trained second image processing model may also be an image segmentation loss function, which is not limited here.
[0074] It can be seen from the structure of the above-mentioned second image processing model that the second image processing model can realize accurate image segmentation processing.
[0075] As an optional implementation, the training process of the second image processing model includes: obtaining a second training data set, the second training data set including multiple sample images, the multiple sample images respectively corresponding to droplet segmentation labels, and training the second image processing model to be trained based on the second training data set to obtain a pre-trained second image processing model.
[0076] In some embodiments, the plurality of sample images may be images acquired in the manner of acquiring the original image described above. The droplet segmentation labels corresponding to the plurality of sample images are used to identify the droplets in the sample images.
[0077] Therefore, by training the second image processing model based on the second training data set, a pre-trained second image processing model can be obtained.
[0078] In step S14, the processed original image is input into a pre-trained second image processing model, and the pre-trained second image processing model can output a segmented droplet image.
[0079] In step S15 , based on the blade image and the mist droplet image, the coverage of the mist droplets on the blade may be determined.
[0080] In some embodiments, coverage may represent the percentage of droplets relative to leaves.
[0081] Therefore, as an optional implementation, step S15 includes: determining the first number of pixels occupied by the leaves in the leaf image; determining the second number of pixels occupied by the droplets in the droplet image; and determining the coverage of the droplets on the leaves based on the first number of pixels and the second number of pixels.
[0082] In some embodiments, determining a first number of pixels occupied by a leaf in a leaf image may include: converting the leaf image into a leaf color model; creating a first mask based on a preset color range in the leaf color model, and calculating the first number of pixels based on the first mask.
[0083] In some embodiments, determining a second number of pixels occupied by droplets in the droplet image includes: converting the leaf image into a droplet color model; creating a second mask based on a preset color range in the droplet color model, and calculating a second number of pixels based on the second mask.
[0084] Regarding the preset color range, it may be a red color space range.
[0085] In this embodiment, the number of foreground pixels may be calculated by converting the image into a color space (color model) and creating a mask using a specified range of the color space.
[0086] It can be understood that in addition to this method of determining the number of pixels, other methods of determining the number of pixels may also be used, which are not limited here.
[0087] In some embodiments, the ratio of the second number of pixels to the first number of pixels is determined as the coverage of the droplets on the blade.
[0088] In some embodiments, the first number of pixels and the second number of pixels can also be understood as a type of pixel area.
[0089] Figure 4 is a flowchart of an application process for obtaining the droplet coverage on a blade based on a neural network according to an exemplary embodiment. Figure 4 As shown, the first image processing model can be regarded as a leaf segmentation model, and the second image processing model can be regarded as a droplet deposition segmentation model. The leaf segmentation model is used to segment the original input to obtain a leaf mask; the leaf mask and the original input are used to obtain the segmented leaf. The droplet deposition segmentation model is used to segment the segmented leaf to obtain the segmented droplet deposition.
[0090] Then, the leaf pixel area and the droplet deposition pixel area are determined respectively, and the ratio of the two is determined as the droplet coverage.
[0091] Through this method of determining the droplet coverage, the droplets in the leaves are segmented as a whole. The two-stage segmentation method is more robust and more accurate. The detection efficiency is high, automatic, and the cost is low.
[0092] After the droplet coverage is determined in step S15, the droplet coverage may be utilized.
[0093] As an optional embodiment, the method also includes: determining a spraying strategy of a spraying device based on the coverage rate of droplets on the blades, the spraying device being used to spray the target liquid onto the spraying object, and the original image being obtained by capturing the image of the spraying object; synchronizing the spraying strategy to the spraying device so that the spraying device sprays the target liquid onto the spraying object according to the spraying strategy.
[0094] In this embodiment, the spraying device may be a drone, the spraying object may be crops, and the target liquid may be pesticide.
[0095] In some embodiments, if the original image includes multiple images collected under different spraying modes, the spraying mode corresponding to the original image with the highest coverage rate can be determined as the spraying strategy of the spraying device.
[0096] In some embodiments, spraying strategies corresponding to different coverage rates may be preset, and the corresponding spraying strategy may be determined based on the current coverage rate.
[0097] In this way, the spraying device can be guided to spray the spraying object to achieve effective application of coverage.
[0098] It can be seen from the introduction of the embodiments of the present disclosure that, using the first image processing model, a blade image is obtained based on the segmentation of the original image, and using the second image processing model, a droplet image is obtained based on the segmentation of the processed original image, and then based on the blade image and the droplet image, the coverage rate of the droplets on the blade is determined, and the coverage rate can characterize the distribution of the droplets on the blade. On the one hand, since the blades and droplets are segmented separately, the segmentation results remove other irrelevant image information, which can improve the accuracy of image processing. Then, combined with the separate segmentation results, the distribution of the droplets on the blades can be accurately detected. On the other hand, the segmentation of the blades and droplets is achieved through the image processing model, and the image processing model can achieve efficient and accurate image segmentation. Therefore, this technical solution can achieve efficient and accurate detection of the distribution of droplets on the blades.
[0099] Figure 5 is a structural block diagram of a device for obtaining droplet coverage on a leaf based on a neural network according to an exemplary embodiment, such as Figure 5 As shown, the device comprises: The acquisition module 501 is configured to acquire an original image, wherein the original image includes a blade and droplets deposited on the blade.
[0100] The first segmentation module 502 is configured to segment the leaves in the original image according to a pre-trained first image processing model to obtain a leaf image.
[0101] The determination module 503 is configured to determine a processed original image according to the leaf image and the original image.
[0102] The second segmentation module 504 is configured to segment the droplets in the processed original image according to a pre-trained second image processing model to obtain a droplet image.
[0103] The determination module 503 is further configured to determine the coverage of the mist droplets on the blade according to the blade image and the mist droplet image.
[0104] Optionally, the loss function corresponding to the pre-trained second image processing model is a loss function that combines a cross entropy loss function with an image segmentation loss function.
[0105] Optionally, the pre-trained second image processing model includes an encoder, which includes a convolutional layer and an attention mechanism module connected to the convolutional layer.
[0106] Optionally, the determination module 503 is also configured to: determine a first number of pixels occupied by the leaves in the leaf image; determine a second number of pixels occupied by the droplets in the droplet image; and determine the coverage of the droplets on the leaves based on the first number of pixels and the second number of pixels.
[0107] Optionally, the determination module 503 is also configured to: convert the leaf image into a leaf color model; create a first mask based on a preset color range in the leaf color model, and calculate the first number of pixels based on the first mask; convert the leaf image into a droplet color model; create a second mask based on a preset color range in the droplet color model, and calculate the second number of pixels based on the second mask.
[0108] Optionally, the determination module 503 is also configured to: determine a spraying strategy of a spraying device according to the coverage rate of the droplets on the blades, the spraying device being used to spray a target liquid onto a spraying object, and the original image being obtained by performing image acquisition on the spraying object; and synchronize the spraying strategy to the spraying device so that the spraying device sprays the target liquid onto the spraying object according to the spraying strategy.
[0109] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0110] Figure 6 FIG. 6 is a block diagram of an electronic device 600 according to an exemplary embodiment. Figure 6 As shown, the electronic device 600 may include: a processor 601 , a memory 602 . The electronic device 600 may also include one or more of a multimedia component 603 , an input / output (I / O) interface 604 , and a communication component 605 .
[0111] The processor 601 is used to control the overall operation of the electronic device 600 to complete all or part of the steps in the method for obtaining the droplet coverage on the leaf based on the neural network. The memory 602 is used to store various types of data to support the operation of the electronic device 600. For example, these data may include instructions for any application or method used to operate on the electronic device 600, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 602 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 603 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone, which is used to receive external audio signals. The received audio signal may be further stored in the memory 602 or sent through the communication component 605. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 604 provides an interface between the processor 601 and other interface modules, and the above-mentioned other interface modules may be a keyboard, a mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 605 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 605 may include: Wi-Fi module, Bluetooth module, NFC module.
[0112] In an exemplary embodiment, the electronic device 600 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned method for obtaining droplet coverage on leaves based on neural networks.
[0113] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the method for obtaining the droplet coverage on the blade based on the neural network are implemented. For example, the computer-readable storage medium may be the memory 602 including the program instructions, and the program instructions may be executed by the processor 601 of the electronic device 600 to complete the method for obtaining the droplet coverage on the blade based on the neural network.
[0114] In another exemplary embodiment, a computer program product is also provided, which includes a computer program that can be executed by a processor, and when the computer program is executed by the processor, the steps of the method for obtaining the droplet coverage on the blade based on the neural network are implemented.
[0115] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments. Within the technical concept of the present disclosure, a variety of simple modifications can be made to the technical solution of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.
[0116] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.
[0117] In addition, various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A method for obtaining droplet coverage on leaves based on a neural network, characterized in that: include: Acquire an original image, wherein the original image includes a leaf and droplets deposited on the leaf; Segmenting leaves in the original image according to a pre-trained first image processing model to obtain a leaf image; Determining a processed original image according to the leaf image and the original image; According to the pre-trained second image processing model, the fog droplets in the processed original image are segmented to obtain a fog droplet image; The coverage rate of the mist droplets on the blade is determined according to the blade image and the mist droplet image.
2. The method for obtaining the droplet coverage on leaves based on a neural network according to claim 1, characterized in that: The loss function corresponding to the pre-trained second image processing model is a loss function that combines a cross entropy loss function with an image segmentation loss function.
3. The method for obtaining the droplet coverage on leaves based on a neural network according to claim 1 or 2, characterized in that: The pre-trained second image processing model includes an encoder, which includes a convolutional layer and an attention mechanism module connected to the convolutional layer.
4. The method for obtaining the droplet coverage on leaves based on a neural network according to claim 1, characterized in that: The determining, according to the leaf image and the droplet image, the coverage rate of the droplets on the leaf comprises: determining a first number of pixels occupied by a leaf in the leaf image; Determining the number of second pixels occupied by the fog droplets in the fog droplet image; The coverage rate of the droplets on the blade is determined according to the first number of pixels and the second number of pixels.
5. The method for obtaining the droplet coverage on leaves based on a neural network according to claim 4, characterized in that: The determining a first number of pixels occupied by leaves in the leaf image comprises: Converting the leaf image into a leaf color model; Creating a first mask based on a preset color range in the leaf color model, and calculating the first number of pixels based on the first mask; The determining the second number of pixels occupied by the fog droplets in the fog droplet image comprises: Converting the leaf image into a droplet color model; A second mask is created based on a preset color range in the droplet color model, and the second number of pixels is calculated based on the second mask.
6. The method for obtaining the droplet coverage on leaves based on a neural network according to claim 1, characterized in that: The method for obtaining the droplet coverage on the leaf based on the neural network also includes: Determining a spraying strategy of a spraying device according to the coverage rate of the droplets on the blades, wherein the spraying device is used to spray a target liquid onto a spraying object, and the original image is obtained by performing image acquisition on the spraying object; The spraying strategy is synchronized to the spraying device, so that the spraying device sprays the target liquid to the spraying object according to the spraying strategy.
7. A device for obtaining droplet coverage on leaves based on a neural network, characterized in that: include: An acquisition module is configured to acquire an original image, wherein the original image includes a blade and droplets deposited on the blade; A first segmentation module is configured to segment the leaves in the original image according to a pre-trained first image processing model to obtain a leaf image; A determination module, configured to determine a processed original image according to the leaf image and the original image; A second segmentation module is configured to segment the droplets in the processed original image according to a pre-trained second image processing model to obtain a droplet image; The determination module is further configured to determine the coverage of the mist droplets on the blade according to the blade image and the mist droplet image.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for obtaining the droplet coverage on a leaf based on a neural network as described in any one of claims 1 to 6 is implemented.
9. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor is used to execute the computer program in the memory to implement the method for obtaining the droplet coverage on the blade based on a neural network as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for obtaining the droplet coverage on a leaf based on a neural network as described in any one of claims 1 to 6 is implemented.