Method, device and equipment for detecting water shortage state of green plants and storage medium
By preprocessing the images of three-dimensional greening plants and combining them with multiple network models, the problem of low detection accuracy in existing technologies has been solved, achieving high-precision detection of water shortage status and region extraction, thereby improving the quality of greening plant maintenance and management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-09
- Publication Date
- 2026-03-31
AI Technical Summary
Existing methods for detecting the status of vertical greening plants suffer from low accuracy in detecting target plants and an inability to accurately extract the vertical greening plant area. This is especially true when the image quality is poor and the background is complex, resulting in low detection accuracy and increased detection time.
Images of vertical greening plants are acquired and preprocessed, including operations such as mirroring, offsetting, rotating, and cropping, to adjust the image size. ResNet34, DeepLabv3+, and SwinTransformer network models are used for dataset labeling and training. Combined with transfer learning and backpropagation algorithms, an image detection network model is constructed to detect water shortage status.
It improved the accuracy of target plant detection, enabled accurate extraction of vertical greening plant areas, reduced the difficulty of model deployment, and improved the overall accuracy and real-time performance of detection.
Smart Images

Figure CN116030342B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of green plant maintenance technology, and in particular to methods, apparatus, equipment and storage media for detecting water shortage status of green plants. Background Technology
[0002] Against the backdrop of economic development and continuous social progress, people's demand for a sense of well-being in their surroundings is gradually increasing. Vertical greening plants along urban roads are attracting attention, and with the gradual expansion of road greening areas, it is extremely important to identify and solve various problems in maintenance and management during the construction of urban road greening and to improve the quality of greening maintenance and management.
[0003] Currently, the detection of the status of vertical greening plants involves remote monitoring, image capture, and subsequent detection. However, this method suffers from several drawbacks. First, camera movement and external factors during image acquisition result in low-quality images, which negatively impact the accuracy of the target detection network. Second, the captured images not only contain the vertical greening plant area but also complex street backgrounds. This incorporation of complex backgrounds confuses the target detection network, increasing detection time and reducing accuracy. While this method reduces manual labor, it suffers from low accuracy in detecting target plants and an inability to accurately extract the vertical greening plant area when dealing with images of poor quality or complex backgrounds.
[0004] The existing methods for detecting the status of vertical greening plants have problems such as low accuracy in detecting target plants and inability to accurately extract the area of vertical greening plants. Summary of the Invention
[0005] To overcome, to some extent, the problems of low detection accuracy of target plants and inability to accurately extract the vertical greening plant area in existing detection methods of vertical greening plants in related technologies, this application provides a method, apparatus, equipment and storage medium for detecting the water shortage status of greening plants.
[0006] The proposed solution is as follows:
[0007] Firstly, this application provides a method for detecting water shortage status in green plants, the method comprising:
[0008] Acquire images of vertical greening plants, preprocess the images, use the preprocessing results to classify and label the dataset, and divide the classification and labeling results into training set and test set respectively;
[0009] The training set, which is divided according to the classification and labeling results, is input into a pre-built image detection network model to obtain the trained image detection network model.
[0010] The test set, divided by the classification and labeling results, is input into the trained image detection network model to detect the water shortage status of green plants.
[0011] Furthermore, the images of the captured vertical greening plants undergo preprocessing, including:
[0012] Take images of three-dimensional greening plants, and perform mirroring, offsetting, rotating, and cropping operations on the images to change the position and size of the three-dimensional greening plant area;
[0013] The dimensions of the transformed vertical greening plant images are uniformly adjusted to the preset size.
[0014] Furthermore, the preprocessing results are used to classify and label the dataset, and the classification and labeling results are divided into training and test sets, including:
[0015] Using the preprocessing results, three types of datasets are labeled, and training and test sets are divided respectively.
[0016] The three types of dataset annotation are described, including:
[0017] Using the preprocessing results, binary classification is performed according to a preset first sharpness threshold. If the sharpness of the image in the preprocessing results is greater than or equal to the first sharpness threshold, it is determined to be a sharp image; otherwise, it is determined to be a blurry image, and datasets for sharp and blurry classification are obtained respectively.
[0018] Using the results of the preprocessing, a dataset segmenting the vertical greening plants and the background area is obtained by distinguishing between the plant panel and the background environment;
[0019] Using the results of the preprocessing, the plants in the vertical greening plant area that are in a state of water shortage are labeled, and a dataset of water-scarce plant targets in the labeled plant area is obtained.
[0020] Further, the image detection network model is constructed, including:
[0021] A ResNet34 network model was built based on the ResNet residual network, a DeepLabv3+ network model was built based on the MobileNetV2 backbone, and a SwinTransformer network model was built.
[0022] Further, the step of inputting the training set divided by the classification and labeling results into a pre-built image detection network model to obtain the trained image detection network model includes:
[0023] The ResNet34 network model is loaded with the datasets for clear and fuzzy classification.
[0024] The DeepLabv3+ model loads the dataset of segmented vertical greening plants and background areas.
[0025] The SwinTransformer model is loaded with the target number of water-deficient plants in the labeled plant region.
[0026] According to the data set, the model parameters are trained based on the pre-trained weights through transfer learning, and the network weights are updated through the backpropagation algorithm to obtain the trained image detection network model.
[0027] Further, the step of inputting the test set, which is divided according to the classification and labeling results, into the trained image detection network model to detect the water shortage status of green plants includes:
[0028] The test set, which is divided according to the classification and labeling results, is input into the trained image detection network model. The ResNet34 model classifies the image and outputs the classification result. If the classification result is blurry, an instruction is issued to the collector to re-capture the image.
[0029] If the classification result is clear, the image with the clear classification result is input into the Deeplabv3+ model to segment the vertical greening plant area and the background environment, and add a black mask to the non-plant background area. The ratio of the area of the vertical greening plant to the area of the image is calculated. If the ratio is less than the set first plant area ratio threshold, the acquisition device is given a command to re-capture.
[0030] The obtained image with black masks added to non-plant areas is input into the SwinTransformer model to detect water-deficient plants, and the detection results of the water-deficient state of the plants are obtained.
[0031] Secondly, this application provides an apparatus for detecting water shortage status of green plants, the apparatus comprising:
[0032] The preprocessing module is used to acquire images of the three-dimensional greening plants and to preprocess the images.
[0033] The classification module is used to classify and label the dataset using the preprocessing results, and divide the classification and labeling results into training set and test set respectively;
[0034] The training module is used to input the training set divided by the classification and labeling results into a pre-built image detection network model to obtain the trained image detection network model.
[0035] The detection module is used to input the test set divided by the classification and labeling results into the trained image detection network model to detect the water shortage status of green plants.
[0036] Thirdly, this application provides a device for detecting the water shortage status of green plants, the device comprising:
[0037] Memory, on which executable programs are stored;
[0038] A processor for executing the executable program in the memory to implement the steps of any of the methods described above.
[0039] Fourthly, this application provides a computer-readable storage medium storing computer instructions for causing a computer to perform the steps of any of the methods described above.
[0040] The technical solution provided in this application may include the following beneficial effects:
[0041] This application involves capturing images of vertical greening plants, preprocessing the images, classifying and labeling the dataset using the preprocessing results, and dividing the classification and labeling results into training and testing sets. The training set is input into a pre-constructed image detection network model, and the model parameters are trained based on the pre-trained weights through transfer learning. The network weights are then updated using a backpropagation algorithm to obtain the trained image detection network model. The testing set is then input into the trained image detection network model to detect the water shortage status of the greening plants. This application helps improve the accuracy of target plant detection and facilitates the accurate extraction of vertical greening plant areas.
[0042] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0043] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0044] Figure 1 This is a schematic flowchart of a method for detecting water shortage status of green plants according to an embodiment of this application;
[0045] Figure 2 This is a schematic diagram of a device for detecting water shortage status of green plants provided in another embodiment of this application;
[0046] Figure 3This is a schematic diagram of the device for detecting water shortage status of green plants provided in another embodiment of this application;
[0047] Figure 4 This is a schematic flowchart of the method used by the image detection network model provided in another embodiment of this application;
[0048] Figure 5 This is a schematic flowchart of a method for constructing an image detection network model according to another embodiment of this application;
[0049] Figure 6 This is a schematic diagram of a dataset of three-dimensional greening plants provided in one embodiment of this application;
[0050] Figure 7 This is a schematic diagram of the water shortage detection results of vertical greening plants provided in one embodiment of this application. Detailed Implementation
[0051] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0052] Example 1
[0053] Please see Figure 1 , Figure 1 This is a schematic flowchart of a method for detecting water shortage status of green plants according to an embodiment of this application. The method includes:
[0054] S1. Acquire images of the three-dimensional greening plants and preprocess the images. S2. Using the preprocessing results, classify and label the dataset, and divide the classification and labeling results into training set and test set respectively.
[0055] S3. The training set divided by the classification and labeling results is input into the pre-built image detection network model. The model parameters are trained on the basis of the pre-trained weights through transfer learning, and the network weights are updated through the backpropagation algorithm to obtain the trained image detection network model.
[0056] S4. The test set divided by the classification and labeling results is input into the trained image detection network model to detect the water shortage status of green plants.
[0057] As described in step S1, in one embodiment, the captured image of the vertical greening plant undergoes preprocessing, including:
[0058] The process of capturing images of three-dimensional greening plants includes capturing clear images and blurry images, wherein the ratio of clear images to blurry images is 6:4.
[0059] Since the location of the vertical greening plant area in the captured image is relatively fixed, image preprocessing is required.
[0060] In practice, the image preprocessing includes the following steps:
[0061] Capture images of vertical greening plants, and perform mirroring, offsetting, rotating, and cropping operations on the images to change the position and size of the vertical greening plant areas to increase image diversity;
[0062] The dimensions of the transformed vertical greening plant images were uniformly adjusted to 512x512.
[0063] As described in step S2, in one embodiment, the step of using the preprocessing results to classify and label the dataset, and dividing the classification and labeling results into a training set and a test set, includes:
[0064] Using the preprocessing results, three types of datasets are labeled, and training and test sets are divided respectively.
[0065] The three types of dataset annotation are described, including:
[0066] Using the preprocessing results, binary classification is performed according to a preset first sharpness threshold. If the sharpness of the image in the preprocessing results is greater than or equal to the first sharpness threshold, it is determined to be a sharp image; otherwise, it is determined to be a blurry image, and datasets for sharp and blurry classification are obtained respectively.
[0067] Using the results of the preprocessing, a dataset segmenting the vertical greening plants and the background area is obtained by distinguishing between the plant panel and the background environment;
[0068] Using the results of the preprocessing, the plants in the vertical greening plant area that are in a state of water shortage are labeled, and a dataset of water-scarce plant targets in the labeled plant area is obtained.
[0069] Constructing the image detection network model includes:
[0070] A ResNet34 network model was built based on the ResNet residual network, a DeepLabv3+ network model was built based on the MobileNetV2 backbone, and a SwinTransformer network model was built.
[0071] Specifically, the ResNet34 includes stage 0 to stage 5, where stage 0 includes convolutional layers, BatchNormalization layers, and ReLU activation functions, and stage 1 to stage 4 respectively contain 3, 4, 6, and 3 Bottlenecks, with each Bottleneck containing two 3x3 convolutional layers to introduce residual modules.
[0072] Specifically, the DeepLabv3+ model consists of two parts: an Encoder and an Encoder. The Encoder's main body is a DCNN with dilated convolutions and a spatial pyramid pooling module with dilated convolutions. The Decoder interpolates the features obtained from the Encoder using bilinear interpolation to obtain 4x features, combines them with the corresponding low-level features in the Encoder, and finally interpolates them again using bilinear interpolation to obtain a segmentation prediction with the same size as the original image. The DCNN uses the MobileNetv2 module, and the loss function used is the cross-entropy loss function.
[0073] Specifically, the SwinTransformer model adopts a hierarchical design, including four stages. Each stage includes PatchEmbedding and Block modules. PatchEmbedding is used to reduce the resolution of the input image. The Block module includes LayerNorm, Multilayer Perceptron (MLP), Window Attention, and Shifted Window Attention.
[0074] In one embodiment, inputting the training set partitioned by the classification and labeling results into a pre-built image detection network model includes:
[0075] The ResNet34 network is loaded with the clear and fuzzy classification dataset; the DeepLabv3+ model is loaded with the dataset segmenting the vertical greening plants and background areas;
[0076] The SwinTransformer model loads the target dataset of water-deficient plants in the labeled plant region.
[0077] In specific implementation, the step of inputting the test set divided by the classification and labeling results into the trained image detection network model to detect the water shortage status of green plants includes:
[0078] The test set, which is divided according to the classification and labeling results, is input into the trained image detection network model. The ResNet34 model classifies the image and outputs the classification result. If the classification result is blurry, an instruction is issued to the collector to re-capture the image.
[0079] If the classification result is clear, the image with the clear classification result is input into the Deeplabv3+ model to segment the vertical greening plant area and the background environment, and add a black mask to the non-plant background area. The ratio of the area of the vertical greening plant to the area of the image is calculated. If the ratio is less than the set first plant area ratio threshold, the acquisition device is given a command to re-capture.
[0080] The obtained image with black masks added to non-plant areas is input into the SwinTransformer model to detect water-deficient plants, and the detection results of the water-deficient plants are obtained. The location and confidence of the water-deficient plants are output, and the ratio of the total box area to the area of the vertical greening plants is calculated. The total box area is the area of yellowing leaves detected by the camera, and the total value of the pixels selected after model processing.
[0081] In this embodiment, the application preprocesses images of vertical greening plants by capturing them; uses the preprocessing results to classify and label the dataset, dividing the classification and labeling results into training and testing sets; inputs the training set into a pre-built image detection network model, trains the model parameters based on the pre-trained weights through transfer learning, and updates the network weights through backpropagation to obtain the trained image detection network model; inputs the testing set into the classification and labeling results into the trained image detection network model to detect the water shortage status of the greening plants. This application helps improve the accuracy of target plant detection and helps to accurately extract the vertical greening plant area.
[0082] It should be noted that, compared with existing technologies, this method integrates three network models instead of a single network model, thereby reducing the difficulty of model deployment and solving the shortcomings of existing technologies in detecting plants in complex background environments. This greatly improves the overall accuracy and real-time performance of the detection, which has significant practical and engineering application value in the field of greening plant maintenance.
[0083] Please see Figure 4 , Figure 5 In practical implementation, this application provides a method for detecting the water shortage status of green plants, including the following steps:
[0084] 1. Take images of vertical greening plants, including both their normal and dehydrated states;
[0085] In this embodiment, 600 clear plant images and 400 blurry plant images were captured, such as... Figure 3 As shown.
[0086] 2. Since the location of the vertical greening plant areas in the captured images is relatively fixed, image preprocessing is required. Preprocessing includes the following steps:
[0087] The captured images are subjected to mirroring, offsetting, rotating, and cropping operations to change the position and size of the three-dimensional greening plant area, thereby increasing the diversity of the images;
[0088] In this embodiment, the size of the preprocessed image was adjusted so that the image size input to the network model was uniformly 512x512.
[0089] 3. Label the green plant images preprocessed in step 2 with three types of datasets, and divide them into training and test sets respectively;
[0090] The annotations for the three types of datasets containing the green plant images are as follows:
[0091] All plant images are categorized and labeled according to clarity and blur.
[0092] Select the areas of vertical greenery in all images to distinguish the plant panels from the background environment;
[0093] Mark all plants in the vertical greening area that are in a state of water shortage;
[0094] In this embodiment, a total of 1000 plant images were collected. The three datasets were divided into training and test sets in a 7:3 ratio, as shown below. Figure 6 As shown. Among them. Figure 6 (a) is a clear image of the plant; Figure 6 (b) is a blurry image of the plant; Figure 6 (c) is the separation of the vertical greening plant area from the background environment; Figure 6 (d) is a picture of plants with water shortage.
[0095] 4. Build a ResNet34 network model based on the ResNet residual network, a DeepLabv3+ network model based on the MobileNetV2 backbone, and a Swing Transformer network model.
[0096] 5. Load the dataset obtained in step 3 into the three network models respectively, train the model parameters on the basis of the pre-trained weights through transfer learning, change the output of the last fully connected layer, and update the network weights through the backpropagation algorithm.
[0097] The three network models are loaded with the following datasets: ResNet34 network loaded with clear and fuzzy classification datasets; DeepLabv3+ model loaded with a dataset for segmenting vertical greening plants and background areas; and Swin Transformer model loaded with a dataset of water-deficient plants in labeled plant areas.
[0098] In this embodiment, the method for training the deep network model is as follows: First, the ResNet34 deep learning network model is pre-trained on the ImageNet dataset; second, the common low-level features learned in the pre-training are transferred to the network model of this embodiment, that is, the output category of the last layer of the pre-trained network is replaced with the three-dimensional greening plant image classification category; then, the backpropagation algorithm is used to retrain the obtained network, and the network is fitted by fine-tuning parameters such as weights and learning rate.
[0099] In this embodiment, the backpropagation algorithm inputs the image data from the sample dataset into the network model, calculates the error between the network output value and the actual value, and propagates the error backward. During the backpropagation process, the weights in each layer of the network are adjusted according to the error using the gradient descent method. The above process is iterated continuously until the loss curve converges.
[0100] 6. Using the network model described in step 4 and the training weights obtained in step 5, perform plant water shortage detection on images containing vertical greening plants;
[0101] The detection of plant water shortage status includes the following steps:
[0102] 6-1. Load and initialize the weights of the three network models ResNet34, Deeplabv3+, and Swin Transformer after training;
[0103] 6-2. Input the plant image to be detected into the network. The ResNet34 model classifies the image and inputs the classification result. If the classification result is blurry, it sends a command to the collector to re-capture the image; otherwise, it outputs a clear image.
[0104] 6-3. Input the clear plant images classified in 6-2 into the Deeplabv3+ model to segment the vertical greening plant area from the background environment, add a black mask to the non-plant background area, and calculate the ratio of the area of the vertical greening plant to the area of the image; if the ratio is less than the threshold, issue a command to the collector to re-capture the image.
[0105] 6-4. Input the image obtained in 6-3 with black masks added to non-plant areas into the Swin Transformer model to detect water-deficient plants and obtain the detection results of the water-deficient state of the plants; the output results include the location and confidence of the water-deficient plants, and calculate the ratio of the total area of the box to the area of the vertical greening plants.
[0106] In this embodiment 6-3, the threshold for the ratio of the area of the vertical greening plant panel to the area of the image is set to 0.4. If it is less than 0.4, the image is filtered. In 6-4, the threshold for the ratio of the total area of the box to the area of the vertical greening plant panel is set to 0.02. If the ratio is less than 0.02, it can be considered that there is no water shortage problem in the area. Figure 7 This is the final detection result of a plant's water shortage state, where the total area of the box is the total pixel value of the area of yellowing leaves detected by the camera and the area selected by the model after processing.
[0107] Example 2
[0108] Please see Figure 2 , Figure 2 This is a schematic diagram of a device for detecting water shortage in green plants according to another embodiment of this application. The device includes:
[0109] Preprocessing module 101 is used to acquire images of the three-dimensional greening plants and preprocess the images;
[0110] The classification module 102 is used to classify and label the dataset using the preprocessing results, and to divide the classification and labeling results into training set and test set respectively;
[0111] Training module 103 is used to input the training set divided by the classification and labeling results into a pre-built image detection network model to obtain a trained image detection network model;
[0112] The detection module 104 is used to input the test set divided by the classification and labeling results into the trained image detection network model to detect the water shortage status of green plants.
[0113] Please see Figure 3 , Figure 3 This is a schematic diagram of a device for detecting water shortage in green plants according to another embodiment of this application. The device includes:
[0114] Memory 31, on which an executable program is stored;
[0115] Processor 32 is configured to execute the executable program in the memory 31 to implement the steps of any of the methods described above.
[0116] Furthermore, this application provides a computer-readable storage medium storing computer instructions for causing a computer to perform the steps of any of the methods described above. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium may also include combinations of the above types of memory.
[0117] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0118] It should be noted that in the description of this application, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means at least two.
[0119] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this application pertain.
[0120] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution device. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0121] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0122] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0123] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.
[0124] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0125] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A method for detecting a water deficit state of a green plant, characterized by, The method comprises: acquiring a photographed image of a three-dimensional greening plant, and preprocessing the image; using the preprocessing result, classifying and performing dataset labeling, and dividing the classified and labeled result into a training set and a test set respectively; inputting the training set divided from the classified and labeled result into a pre-constructed image detection network model to obtain a trained image detection network model; inputting the test set divided from the classified and labeled result into the trained image detection network model to detect a water shortage state of the greening plant; the using the preprocessing result, classifying and performing dataset labeling, and dividing the classified and labeled result into a training set and a test set respectively comprises: using the preprocessing result, performing three types of dataset labeling, and dividing a training set and a test set respectively; the performing three types of dataset labeling comprises: using the preprocessing result, performing binary classification labeling according to a preset first definition threshold, if the definition of the image in the preprocessing result is greater than or equal to the first definition threshold, the image is determined as a clear image, otherwise, the image is determined as a fuzzy image, and clear and fuzzy classified datasets are obtained respectively; using the preprocessing result, obtaining a segmented three-dimensional greening plant and background region dataset by distinguishing a plant panel and a background environment; using the preprocessing result, labeling a plant target in a water shortage state in a three-dimensional greening plant region to obtain a labeled water shortage plant target dataset in a plant region; constructing the image detection network model comprises: constructing a ResNet34 network model based on a ResNet residual network, constructing a DeepLabv3+ network model based on a MobileNetV2 backbone, and constructing a Swin Transformer network model; the inputting the training set divided from the classified and labeled result into a pre-constructed image detection network model to obtain a trained image detection network model comprises: the ResNet34 network model loads the clear and fuzzy classified datasets, the DeepLabv3+ model loads the segmented three-dimensional greening plant and background region dataset, the Swin Transformer model loads the labeled water shortage plant target dataset in the plant region, model parameters are trained based on pre-training weights through transfer learning, and network weights are updated through a back propagation algorithm to obtain a trained image detection network model; the inputting the test set divided from the classified and labeled result into the trained image detection network model to detect a water shortage state of the greening plant comprises: inputting the test set divided from the classified and labeled result into the trained image detection network model, the ResNet34 model classifies and outputs a classification result, and if the classification result is fuzzy, an instruction of rephotographing and collecting is sent to a collector; If the classification result is clear, the image with the clear classification result is input into a Deeplabv3+ model to segment the stereoscopic green plant area and the background environment, and a black mask is added to the non-plant background area, the ratio of the stereoscopic green plant area to the image area is calculated, and if the ratio is less than a first plant area proportion threshold, a re-shooting collection instruction is sent to the collector; The obtained image with the added black mask to the non-plant area is input into a SwinTransformer model for water-deficient plant target detection to obtain a detection result of the plant water-deficient state.
2. The method of claim 1, wherein, The photographed image of the stereoscopic green plant is preprocessed, including: The photographed image of the stereoscopic green plant is preprocessed, including: The size of the transformed stereoscopic green plant image is uniformly adjusted to a pre-set size.
3. The device for detecting the water deficit state of the green plants, applied to the method for detecting the water deficit state of the green plants according to any one of claims 1-2, characterized in that, The device includes: A preprocessing module configured to obtain a photographed image of a stereoscopic green plant and pre-process the image; A classification module configured to classify and perform data set labeling using the pre-processed result, and divide the classification labeled result into a training set and a test set respectively; A training module configured to input the training set divided from the classification labeled result into a pre-constructed image detection network model to obtain a trained image detection network model; A detection module configured to input the test set divided from the classification labeled result into the trained image detection network model to detect the water-deficient state of the green plant.
4. An apparatus for detecting a water shortage state of a green plant, characterized by The device includes: A memory having a stored executable program; A processor configured to execute the executable program in the memory to implement the steps of the method in any one of claims 1-2.
5. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing a computer to execute the steps of the method in any one of claims 1-2. The computer readable storage medium stores computer instructions for causing a computer to execute the steps of the method in any one of claims 1-2.
Citation Information
Patent Citations
Plant leaf recognition method and system
CN111476280A