Crop health monitoring method, device and equipment and storage medium
By obtaining multi-view visual images of crops, using object detection and boundary extraction algorithms, and combining extreme learning machines to monitor and predict health status, the problems of lag in the acquisition of crop health status and low detection efficiency in the prior art are solved, and real-time monitoring and prediction of crop health status are achieved.
Patent Information
- Application Number
- CN202411753281.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-14
AI Technical Summary
In the prior art, crop growth status information is obtained lagging, human work intensity is high and low efficiency is low, patrols are aimless and random, resulting in low real-time acquisition of crop health status and the inability to determine the location of the disease in a timely and effective manner.
The visual images of at least two perspectives of the crop are obtained by interval preset time periods, and the local visual images are extracted and the discolored boundary is faded by using the object detection algorithm and the boundary extraction algorithm. Based on the extreme learning machine training coordinate data set, the enclosed area and area ratio values are predicted to determine whether the crop has an unhealthy state.
Real-time monitoring and prediction of crop health status is achieved, timeliness and accuracy of disease detection is improved, work intensity and errors of people are reduced, and the efficiency of obtaining crop health status is improved.
Smart Images

Figure CN119625047A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of remote sensing data processing, and in particular to a crop health monitoring method, device, equipment and storage medium. Background Art
[0002] Crops are various plants cultivated in agriculture, including food crops and cash crops (oil crops, vegetable crops, flowers, grasses, and trees). “Food is the first necessity of the people” expresses the dependence between people and food. Only a reasonable diet can bring health to human beings.
[0003] In order to ensure the stable, orderly and healthy growth of crops, it is necessary to observe or monitor the growth process of crops to ensure that early diseases and insect pests of crops can be discovered or treated in time.
[0004] At present, there are usually problems such as lag in obtaining information on crop growth status, high intensity and low efficiency of manual labor, aimless and random inspections, and many subjective uncertainties in human monitoring. These problems significantly reduce the efficiency of real-time acquisition of crop health status, and the inability to effectively determine the location of diseases in a timely manner, so that crops cannot be discovered in time when they are initially affected by diseases and insect pests, resulting in the continued expansion of diseases and insect pests, further causing losses. Summary of the invention
[0005] The main purpose of this application is to provide a crop health monitoring method, device, equipment and storage medium to solve the problem in the prior art that green plants in confined spaces are not properly maintained, resulting in the health status and lifespan of the green plants not being guaranteed.
[0006] To achieve the above objectives, this application provides the following technical solutions:
[0007] A method for monitoring the health of crops, wherein the crops are planted in agricultural land in a preset area, and the method for monitoring the health of crops comprises:
[0008] Step S1, acquiring a plurality of visual images of the crop from at least two viewing angles at intervals of a preset time period;
[0009] Step S2, extracting the local visual images with all crops in each visual image by using the target detection algorithm;
[0010] Step S3, extracting all faded heterochromatic boundaries in each local visual image by using a boundary extraction algorithm;
[0011] Step S4, based on the resolution of the current local visual image, the pixel coordinates of all faded different color boundaries of the current local visual image are obtained and packaged into a coordinate data set;
[0012] Step S5, training and learning all coordinate data sets through an extreme learning machine based on the same perspective, and obtaining a predicted coordinate data set based on a prediction step number;
[0013] Step S6, obtaining the enclosed area of all coordinate data sets and the predicted enclosed area of all predicted coordinate data sets;
[0014] Step S7, obtaining an area ratio value between the predicted enclosed area and the enclosed area based on the same viewing angle;
[0015] Step S8, determining whether the area ratio value of each viewing angle is greater than 1, if the area ratio values of all viewing angles are greater than 1, executing step S9;
[0016] Step S9: determine that all crops are in an unhealthy state.
[0017] As a further improvement of the present application, step S2, extracting the local visual images with all crops in each visual image respectively by using the target detection algorithm, includes:
[0018] Step S21, dividing the current visual image into a plurality of square grids on average;
[0019] Step S22, predicting a number of bounding boxes for all crops based on all square grids according to the target detection algorithm;
[0020] Step S23, respectively obtaining the confidence of each bounding box, obtaining the bounding box with the largest confidence and marking it as the first-order bounding box;
[0021] Step S24, calculating the intersection-over-union ratio of each other bounding box with the first-order bounding box;
[0022] Step S25, selecting a bounding box whose intersection-over-union ratio is greater than or equal to a preset threshold as a second-order bounding box;
[0023] Step S26, obtaining a second-order bounding box with the highest confidence and defining it as the crop.
[0024] As a further improvement of the present application, step S3, extracting all faded heterochromatic boundaries in each local visual image by using a boundary extraction algorithm, includes:
[0025] Step S31, converting each local visual image into a grayscale visual image through the cv2.cvtColor() function of the OpenCV environment;
[0026] Step S32, obtaining all image edges of the current grayscale visual image through the Canny edge detection operator;
[0027] Step S33, defining an erosion structure element of a preset pixel size;
[0028] Step S34, traversing all image edges with the center of the eroded structure element;
[0029] Step S35, deleting all paths traversed by the eroded structure element to obtain an eroded image of the current grayscale visual image;
[0030] Step S36, differentiating the current grayscale visual image and the eroded image of the current grayscale visual image to obtain the boundaries of all objects;
[0031] Step S37, obtaining the gray value outside the boundary and the gray value inside the boundary of the current object;
[0032] Step S38, determining whether the gray value outside the boundary of the current object is greater than the gray value inside the boundary of the current object. If the gray value outside the boundary of the current object is greater than the gray value inside the boundary of the current object, executing step S39;
[0033] Step S39, defining the current object boundary as a faded heterochromatic boundary.
[0034] As a further improvement of the present application, step S5, based on the same perspective, all coordinate data sets are trained and learned by an extreme learning machine, and a predicted coordinate data set is obtained based on each prediction step, including:
[0035] Step S51, performing standard normalization processing on all coordinate data sets, and obtaining a normalized data set based on one coordinate data set;
[0036] Step S52, dividing the current normalized data set into a training set and a validation set according to a preset ratio;
[0037] Step S53, defining an extreme learning model according to the data dimension of the training set;
[0038] Step S54, training and learning the extreme learning model through the training set to obtain a prediction model;
[0039] Step S55, outputting the verification set to the prediction model, and obtaining a prediction coordinate data set based on a normalized data set.
[0040] As a further improvement of the present application, step S53, defining an extreme learning model according to the data dimension of the training set, includes:
[0041] Step S531, define the i-th normalized coordinate data of the training set as (x i ,t i );
[0042] Step S532, according to (x i ,t i ) defines the training set x = (x 1 ,x 2 ,…,x i ,…,x m ) T ,x i ∈R m , where m is the number of normalized coordinate data in the training set and is also the transposed matrix (x 1 ,x 2 ,…,x i ,…,x m ) T The dimension of R m is the m-dimensional vector set of the training set x;
[0043] Step S533, according to (x i ,t i ) defines the training result of the training set t = (t 1 ,t 2 ,…,t i ,…,t n ) T ,t i ∈R n , where n is the number of training results of the training set and is also the transposed matrix (t 1 ,t 2 ,…,t i ,…,t n ) T The dimension of R n is the n-dimensional vector set of training results t;
[0044] Step S534, based on the training set x=(x 1 ,x 2 ,…,x i ,…,x m ) T ,x i ∈R m And the training result of the training set t=(t 1 ,t 2 ,…,t i ,…,t n ) T ,t i ∈R n The extreme learning model is defined according to formula (1):
[0045]
[0046] Where β = [β 1 ,β2 ,…,β j ,…β L-1 ,β L ] T , β is the first connection weight between the hidden layer and the output layer of the extreme learning model, β j is the jth first connection weight, L is the number of nodes in the hidden layer, H(x) is the output value of the hidden layer, H(x)=[h 1 (x),h 2 (x),…,hj(x),…,h L-1 (x),h L (x)], hj(x)=g(wj·xi+bj), g(·) is the activation function, w j is the second connection weight between the input layer of the extreme learning model and the jth node of the hidden layer, b j is the threshold of the jth node in the hidden layer.
[0047] As a further improvement of the present application, step S54, training and learning the extreme learning model through the training set to obtain a prediction model, includes:
[0048] Step S541, randomly generating all second connection weights and all thresholds by a nonlinear mapping function in a feature space based on the extreme learning model;
[0049] Step S542, obtaining the output value of the hidden layer by calculating the randomly generated second connection weight and threshold;
[0050] Step S543, according to formula (2), the optimal solution of the first connection weight is solved by minimizing the approximate square error:
[0051]
[0052] Among them, H is the output matrix of the hidden layer, T is the target matrix of the output layer, β * is the optimal solution, H + is the MP generalized inverse matrix of the output matrix H, H + =(H T H) -1 ·H T ;
[0053] Step S544, obtaining the optimal solution and the second connection weight and threshold corresponding to the optimal solution and substituting them into the extreme learning model to obtain the prediction model.
[0054] As a further improvement of the present application, step S9, after determining that all crops are in an unhealthy state, includes:
[0055] Step S10, obtaining the predicted number of steps corresponding to the unhealthy state of all crops;
[0056] Step S20, adding the corresponding predicted step number to the real-time timestamp to obtain a future timestamp;
[0057] Step S30, all crops are in an unhealthy state and a warning signal is generated;
[0058] Step S40: sending the warning signal and the future timestamp to an external receiving end.
[0059] To achieve the above objectives, this application also provides the following technical solutions:
[0060] A crop health monitoring device, the health monitoring device is applied to the above-mentioned health monitoring method, the health monitoring device comprises:
[0061] A visual image acquisition module, used for acquiring a plurality of visual images of the crop from at least two viewing angles at intervals of a preset time period;
[0062] A local visual image acquisition module is used to extract the local visual images with all crops in each visual image through a target detection algorithm;
[0063] A faded heterochromatic boundary acquisition module is used to extract all faded heterochromatic boundaries in each local visual image by using a boundary extraction algorithm;
[0064] A faded heterochromatic boundary coordinate acquisition module is used to acquire the pixel coordinates of all faded heterochromatic boundaries of the current local visual image based on the resolution of the current local visual image and pack them into a coordinate data set;
[0065] A module for predicting coordinates of faded heterochromatic boundaries is used to train and learn all coordinate data sets through an extreme learning machine based on the same perspective, and obtain a predicted coordinate data set based on a prediction step number;
[0066] An enclosed area acquisition module is used to obtain the enclosed areas of all coordinate data sets and the predicted enclosed areas of all predicted coordinate data sets;
[0067] An area ratio value acquisition module, used for acquiring an area ratio value between the predicted enclosed area and the enclosed area based on the same viewing angle;
[0068] An area ratio value judgment module is used to judge whether the area ratio value of each viewing angle is greater than 1;
[0069] The unhealthy state determination module is used to determine that all crops are in an unhealthy state if the area ratio values of all viewing angles are greater than 1.
[0070] To achieve the above objectives, this application also provides the following technical solutions:
[0071] An electronic device comprises a processor and a memory coupled to the processor, wherein the memory stores program instructions executable by the processor; when the processor executes the program instructions stored in the memory, the health monitoring method as described above is implemented.
[0072] To achieve the above objectives, this application also provides the following technical solutions:
[0073] A storage medium stores program instructions, which can implement the above-mentioned health monitoring method when executed by a processor.
[0074] The present application obtains several visual images of crops from at least two perspectives at intervals of preset time periods; extracts local visual images with all crops in each visual image through a target detection algorithm; extracts all faded heterochromatic boundaries in each local visual image through a boundary extraction algorithm; obtains the pixel coordinates of all faded heterochromatic boundaries of the current local visual image based on the resolution of the current local visual image and packages them into a coordinate data set; trains and learns all coordinate data sets through an extreme learning machine based on the same perspective, and obtains a predicted coordinate data set based on a prediction step number; obtains the enclosed area of all coordinate data sets and the predicted enclosed area of all predicted coordinate data sets; obtains the area ratio value of the predicted enclosed area to the enclosed area based on the same perspective; and judges whether the area ratio value of each perspective is greater than 1. If the area ratio values of all perspectives are greater than 1, it is determined that all crops are in an unhealthy state. The present application utilizes the characteristic that when crops are affected by pests and diseases, the withering, falling off, wilting and death of crop leaves, branches, flowers and fruits due to pests and diseases are all shrinkage processes caused by the reduction of water. The intuitive visual effect is that the visual area of the plant is reduced and the visual color becomes lighter under multiple viewing angles. The crops in the same area are photographed from multiple angles through visual technology to verify and judge each other. At the same time, the present application also realizes the trend prediction of the visual fading of crops, avoiding the data interference caused by the recovery process of crops after pest and disease control. Finally, by comparing the fading area at the next moment with the fading area at the previous moment, it is analyzed whether the crops are affected by pests and diseases. If the fading area at the next moment is expanded compared with the fading area at the previous moment, it means that the crops are affected by pests and diseases and the pest and disease area is still expanding. However, since the present application realizes the prediction function, the present application can control the pest and disease area before it further expands, thereby preventing the loss from expanding. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1A schematic diagram of the steps of an embodiment of a crop health monitoring method of the present application;
[0076] Figure 2 This is a schematic diagram of functional modules of an embodiment of a crop health monitoring device of the present application;
[0077] Figure 3 This is a schematic diagram of the structure of an embodiment of the electronic device of the present application;
[0078] Figure 4 This is a schematic diagram of the structure of an embodiment of the storage medium of the present application. DETAILED DESCRIPTION
[0079] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0080] The terms "first", "second" and "third" in this application are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second" and "third" can explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. All directional indications in the embodiments of this application (such as up, down, left, right, front, back...) are only used to explain the relative position relationship, movement, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication also changes accordingly. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units for these processes, methods, products or devices.
[0081] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0082] like Figure 1As shown, this embodiment provides an embodiment of a method for monitoring the health of crops. In this embodiment, crops are planted in agricultural land in a preset area, such as a field, and in order to avoid inaccurate monitoring results in this embodiment, monitoring during the maturity period of crops should be avoided, and there is no need for monitoring during the maturity period of crops.
[0083] Specifically, the health monitoring method comprises the following steps:
[0084] Step S1, acquiring a plurality of visual images of crops from at least two viewing angles at intervals of a preset time period.
[0085] Preferably, at least two viewing angles can be set to four viewing angles for overlooking the corners and one viewing angle for overlooking the center, totaling five viewing angles, which can be completed by aerial photography equipment, and the preset time period can be set to one natural day, three natural days, etc.
[0086] Step S2, extracting the local visual images containing all the crops in each visual image by using the target detection algorithm.
[0087] Preferably, the design intention of step S2 is to shield non-crop objects such as trees, buildings, roads, etc. around the field through the target detection algorithm to reduce errors.
[0088] Preferably, the target detection algorithm can be implemented through VJ, HOG, DPMDetector; deep learning Two-stageRCNN, SPPNet, FastRCNN, FasterRCNN; Trick algorithm FPN, CascadeRCNN; deep learning one-stage Yo lo, X, SSD, Ret i naNet; deep learning Anchor-free CornerNet, CenterNet, FCOS; TransformerDETR, etc.
[0089] Preferably, this embodiment prefers the Yolo algorithm.
[0090] Step S3, extracting all faded heterochromatic boundaries in each local visual image by using a boundary extraction algorithm.
[0091] Preferably, the pests and diseases cause the crops to wither, and the direct visual effect of the withering of the crops is not only a reduction in visual area, but also a fading of color.
[0092] Step S4, based on the resolution of the current local visual image, the pixel coordinates of all faded different color boundaries of the current local visual image are obtained and packaged into a coordinate data set.
[0093] Step S5, training and learning all coordinate data sets through an extreme learning machine based on the same perspective, and obtaining a predicted coordinate data set based on a prediction step number.
[0094] Step S6, obtaining the enclosed area of all coordinate data sets and the predicted enclosed area of all predicted coordinate data sets.
[0095] Step S7, obtaining the area ratio value of the predicted enclosed area and the enclosed area based on the same viewing angle.
[0096] Step S8, determining whether the area ratio value of each viewing angle is greater than 1, if the area ratio values of all viewing angles are greater than 1, executing step S9.
[0097] Step S9: determine that all crops are in an unhealthy state.
[0098] Furthermore, in step S2, a local visual image having all crops in each visual image is extracted by a target detection algorithm, including:
[0099] Step S21, dividing the current visual image into a plurality of square grids on average.
[0100] Specifically, the size of the original image of the image data may be adjusted to 448×448, and then the adjusted image may be evenly divided into S×S (eg, 7×7) grids, and the size of each grid is 64×64.
[0101] Step S22, predicting a number of bounding boxes for all crops based on all square grids according to a target detection algorithm.
[0102] Preferably, each grid is used to predict the horizontal coordinate, vertical coordinate, width, height, and confidence of each detection frame of N detection frames, that is, each grid needs to predict N×(4+1) values. Each grid needs to predict N (x, y, w, h, confidence); where (x, y) is the offset of the center of the detection frame relative to the grid, (w, h) is the ratio of the detection frame to the above-mentioned resized image, and (confidence) is the confidence of the grid, which takes a value of 1 or 0.
[0103] Step S23, respectively obtain the confidence of each bounding box, obtain the bounding box with the largest confidence and mark it as the first-order bounding box.
[0104] Step S24, calculating the intersection-over-union ratio of each other bounding box with the first-order bounding box.
[0105] Step S25 , selecting a bounding box whose intersection-over-union ratio is greater than or equal to a preset threshold as a second-order bounding box.
[0106] Step S26, obtaining the second-order bounding box with the highest confidence and defining it as the crop.
[0107] Preferably, the confidence level can be understood as whether there is a target in the current grid and the accuracy of the detection frame.
[0108] For example: suppose there is an object in a resized image, and the width and height of the resized image are (w a ,h a )but:
[0109] Divide the image into 7×7 (S×S) grids evenly. There is a grid located at the center of the target. The coordinates of the grid are (x i ,y i ), let the coordinates of the center of the target be (x a ,y a ), the above offset (x b ,y b ):
[0110] Preferably, in actual detection, if the predicted detection box and the actual bounding box overlap perfectly, the intersection-and-union ratio is 1. In actual application, the value of the first preset threshold can generally be set to 0.5 to determine whether the predicted bounding box is correct, and the accuracy of the bounding box is positively correlated with the intersection-and-union ratio.
[0111] Preferably, the YOLO algorithm also needs to train the detection frame to improve the accuracy of target detection.
[0112] Next, the training model is trained using a preset pedestrian and vehicle training set, and the weights and biases of the training model are iteratively adjusted a first preset number of times using a back propagation algorithm to reduce the value of the loss function of the training model.
[0113] Preferably, the loss function is as follows:
[0114]
[0115] in, is the indicator function of whether the j detection box of the i-th grid is responsible for the target, and its value is 1 or 0; x i ,y i 、w i 、h i , C i They correspond to the i-th (x, y, w, h, confidence) prediction values respectively.
[0116] It can be understood that the loss function includes the coordinate value deviation of the detection box, the confidence deviation, and the prediction probability deviation (or category deviation).
[0117] in, is the detection frame midpoint loss in the coordinate value deviation, is the loss of detection box width and height in coordinate value deviation, is the confidence deviation, is the deviation of the predicted probability (or class deviation).
[0118] Among them, λ coord is the positioning error penalty, generally λ coord =5;S 2 That is, the S×S grids mentioned above; B is the number of bounding boxes; and is the estimated value of the horizontal and vertical coordinates of the midpoint of the i-th bounding box; and is the estimated value of the width and height of the i-th bounding box; C i is the confidence of the i-th bounding box; is the estimated value of the confidence of the i-th bounding box; noobj is the confidence prediction loss, usually λ noobj =0.5; p i (c) is the category probability of the i-th bounding box; is the estimated value of the category probability of the i-th bounding box; p i (c) with The c in it corresponds to classes.
[0119] It should be noted that since each grid does not necessarily contain a target, if there is no target in the grid, the value of (confidence) will be 0, making the gradient span in the subsequent back propagation algorithm too large, so λ is introduced coord To control the loss of the predicted position of the detection box, and introduce λ noobj Controls the penalty for objects not existing within a single grid.
[0120] It should be noted that the meaning of the symbols used in the principle description of the above target detection algorithm is not interchangeable with the meaning of other symbols in the context.
[0121] Furthermore, in step S3, all faded heterochromatic boundaries in each local visual image are extracted by a boundary extraction algorithm, including:
[0122] Step S31, converting each local visual image into a grayscale visual image through the cv2.cvtColor() function of the OpenCV environment.
[0123] Step S32, obtaining all image edges of the current grayscale visual image through the Canny edge detection operator.
[0124] Preferably, the first step of boundary extraction is usually edge detection. The edge is where the image brightness changes significantly, and is the dividing line between the object and the background or between different objects. The edge detection algorithm finds the edge by identifying the brightness gradient in the image. Commonly used edge detection operators include Sobel, Prewitt, Roberts, and Canny.
[0125] Among them, Sobel operator, Prewitt operator, Roberts operator: The aforementioned operators detect edges by calculating the gradient amplitude of each pixel in the image, and estimate the gradient through filters in the horizontal and vertical directions. Canny edge detector: The Canny algorithm is a more complex edge detection method, which aims to capture the edges in the image as accurately as possible and minimize false detections and missed detections. The Canny detector first uses a Gaussian filter to smooth the image to reduce noise, then calculates the gradient amplitude and direction of each point in the image, then applies non-maximum suppression (NMS) to refine the edges, and finally uses a double threshold method and edge connection technology to detect and connect edges.
[0126] Step S33, defining an erosion structure element of a preset pixel size.
[0127] Preferably, the pixel size of the eroded structure element can be set according to the resolution of the image data, generally set to 3×3 pixels, and one layer of pixels can be eroded once. If the resolution is high, the preset pixel size can be selected as an odd number such as 5×5, 7×7, 9×9, etc.
[0128] Step S34, traverse all image edges with the center of the eroded structure element.
[0129] Step S35, deleting all paths traversed by the eroded structure element to obtain an eroded image of the current grayscale visual image.
[0130] Step S36, differentially performing the current grayscale visual image and the eroded image of the current grayscale visual image to obtain the boundaries of all objects.
[0131] Step S37, obtaining the grayscale value outside the boundary and the grayscale value inside the boundary of the current object.
[0132] Step S38, determining whether the gray value outside the boundary of the current object is greater than the gray value inside the boundary of the current object. If the gray value outside the boundary of the current object is greater than the gray value inside the boundary of the current object, executing step S39.
[0133] Step S39, defining the current object boundary as a faded heterochromatic boundary.
[0134] Further, in step S5, all coordinate data sets are trained and learned by an extreme learning machine based on the same perspective, and a predicted coordinate data set is obtained based on each prediction step, including:
[0135] Step S51, performing standard normalization processing on all coordinate data sets, and obtaining a normalized data set based on a coordinate data set.
[0136] Preferably, this embodiment prefers the normalization method of zero-mean normalization (Z-score normalization), which gives the mean and standard deviation of the original data to standardize the data, and the processed data conforms to the standard normal distribution, that is, the mean is 0 and the standard deviation is 1. For the normalization method, this embodiment can also use batch normalization. Compared with simple normalization, in the previous neural network training, only the input layer data is normalized, but not in the middle layer. Although the data set of the input node is normalized, the data distribution of the input data after matrix multiplication is likely to change greatly, and as the number of hidden layer network layers continues to deepen, the change in data distribution will become greater and greater. Therefore, the normalization processing performed by batch normalization in the middle layer of the neural network makes the training effect better.
[0137] Step S52, dividing the current normalized data set into a training set and a validation set according to a preset ratio.
[0138] Preferably, the preset ratio is usually 80%:20% to divide the image data into a training set and a validation set, that is, 80% of the data is the training set and 20% of the data is the validation set.
[0139] Step S53, defining an extreme learning model according to the data dimension of the training set.
[0140] Preferably, the extreme learning model is a feedforward neural network that can be used to train a single hidden layer. The extreme learning machine is different from the traditional single hidden layer feedforward neural network training algorithm. The extreme learning machine randomly selects the input layer weights and hidden layer biases, and the output layer weights are calculated and analyzed based on the Moore-Penrose (MP) generalized inverse matrix theory by minimizing the loss function composed of the training error term and the regularization term of the output layer weight norm. Even if the extreme learning machine randomly generates hidden layer nodes, the extreme learning machine still maintains the general approximation ability of the single hidden layer feedforward neural network.
[0141] Step S54, training and learning the extreme learning model through the training set to obtain a prediction model.
[0142] Step S55, outputting the verification set to the prediction model, and obtaining a prediction coordinate data set based on a normalized data set.
[0143] Furthermore, step S53, defining an extreme learning model according to the data dimension of the training set, includes:
[0144] Step S531, define the i-th normalized coordinate data of the training set as (x i ,t i ).
[0145] Step S532, according to (x i ,t i )Define the training set x=(x 1 ,x 2 ,…,x i ,…,x m ) T ,x i ∈R m , where m is the number of normalized coordinate data in the training set and is also the transposed matrix (x 1 ,x 2 ,…,x i ,…,x m ) T The dimension of R m is the m-dimensional vector set of the training set x.
[0146] Step S533, according to (x i ,t i )Define the training result of the training set t=(t 1 ,t 2 ,…,t i ,…,t n ) T ,t i ∈R n , where n is the number of training results in the training set and is also the transposed matrix (t 1 ,t 2 ,…,t i ,…,t n ) T The dimension of R n is the n-dimensional vector set of training results t.
[0147] Step S534, based on the training set x=(x 1 ,x 2 ,…,x i ,…,x m ) T ,x i ∈R m And the training result of the training set t=(t 1 ,t2 ,…,t i ,…,t n ) T ,t i ∈R n According to formula (1), the extreme learning model is defined as:
[0148]
[0149] Where β = [β 1 ,β 2 ,…,β j ,…β L-1 ,β L ] T , β is the first connection weight between the hidden layer and the output layer of the extreme learning model, β j is the jth first connection weight, L is the number of nodes in the hidden layer, H(x) is the output value of the hidden layer, H(x) = [h 1 (x),h 2 (x),…,h j (x),…,h L-1 (x),h L (x)], hj(x) = g(wj·xi+bj), g(·) is the activation function, wj is the second connection weight between the input layer and the jth node of the hidden layer of the extreme learning model, b j is the threshold of the jth node in the hidden layer.
[0150] Preferably, g(·) can be set to an activation function such as a Sigmoid function or a Gaussian function.
[0151] Preferably, if the Sigmoid function is selected, g(a) can be expressed as:
[0152] Here a=w j ·x i +b j .
[0153] It should be noted that the above g(a) formula is only used to explain the principle of the Sigmoid function, and its symbolic meaning is not interoperable with other parts of the embodiment.
[0154] Furthermore, step S54, training and learning the extreme learning model through the training set to obtain a prediction model, includes:
[0155] Step S541: randomly generate all second connection weights and all thresholds through a nonlinear mapping function in a feature space based on an extreme learning model.
[0156] Step S542, obtaining the output value of the hidden layer through the randomly generated second connection weight and threshold calculation.
[0157] Step S543, according to formula (2), the optimal solution of the first connection weight is obtained by minimizing the approximate square error:
[0158]
[0159] Among them, H is the output matrix of the hidden layer, T is the target matrix of the output layer, β * is the optimal solution, H + is the MP generalized inverse matrix of the output matrix H, H + =(H T H) -1 ·H T .
[0160] Step S544, obtaining the optimal solution and the second connection weight and threshold corresponding to the optimal solution and substituting them into the extreme learning model to obtain a prediction model.
[0161] Preferably, the Moore-Penrose generalized inverse matrix H can be calculated by singular value decomposition + .
[0162] It can be understood that the training of a single hidden layer feedforward neural network by an extreme learning machine is divided into two main stages:
[0163] Random feature mapping: The hidden layer parameters are randomly initialized, and then some nonlinear mapping is used as the activation function to map the input data to a new feature space (called the extreme learning machine feature space). In simple terms, the weights and biases on the hidden layer nodes of the extreme learning machine are randomly generated. The random feature mapping stage is different from many existing learning algorithms, such as support vector machines using kernel functions for feature mapping, restricted Boltzmann machines in deep neural networks, and autoencoders / autodecoders for feature learning. The nonlinear mapping function in the extreme learning machine can be any nonlinear piecewise continuous function. In the extreme learning machine, the hidden layer node parameters are randomly generated according to any continuous probability distribution and are independent of the training data.
[0164] Linear parameter solution: After the first stage, the second connection weight and threshold are randomly generated. In the second stage, only the first connection weight β needs to be solved. In order to obtain the first connection weight with good effect on the training sample set, it is necessary to ensure that its training error is minimized. The square difference between H(x)β and the target matrix T of the training sample can be minimized as the objective function for evaluating the training error. The solution with the minimum objective function is the optimal solution.
[0165] Preferably, the eigenspace is a vector space that represents a special property of a matrix. The eigenspace is a vector space composed of all eigenvectors of the matrix. For example, for an n×n matrix A, if there exists a scalar λ and a non-zero vector x such that Ax=λx, then x is the eigenvector of A, and the vector space where the vector x is located is the eigenspace of A.
[0166] It should be noted that the meaning of the symbols in the above additional content is not interoperable with other parts of the embodiment.
[0167] Furthermore, in step S9, it is determined that all crops are in an unhealthy state, and then the following steps are performed:
[0168] Step S10, obtaining the predicted number of steps corresponding to the unhealthy state of all crops.
[0169] Step S20, adding the corresponding predicted step number to the real-time timestamp to obtain a future timestamp.
[0170] Step S30: All crops are in an unhealthy state and a warning signal is generated.
[0171] Step S40, sending the warning signal and the future timestamp to an external receiving end.
[0172] This embodiment obtains a plurality of visual images of crops from at least two perspectives at intervals of a preset time period; extracts the local visual images of all crops in each visual image by a target detection algorithm; extracts all faded heterochromatic boundaries in each local visual image by a boundary extraction algorithm; obtains the pixel coordinates of all faded heterochromatic boundaries of the current local visual image based on the resolution of the current local visual image and packages them into a coordinate data set; trains and learns all coordinate data sets by an extreme learning machine based on the same perspective, and obtains a predicted coordinate data set based on a prediction step number; obtains the enclosed area of all coordinate data sets and the predicted enclosed area of all predicted coordinate data sets; obtains the area ratio value of the predicted enclosed area to the enclosed area based on the same perspective; and judges whether the area ratio value of each perspective is greater than 1. If the area ratio values of all perspectives are greater than 1, it is determined that all crops are in an unhealthy state. This embodiment utilizes the characteristic that when crops are affected by pests and diseases, the withering, falling off, wilting and death of leaves, branches, flowers and fruits of crops due to pests and diseases are all shrinkage processes caused by water reduction. Its intuitive visual effect is that the visual area of plants under multiple viewing angles is reduced and the visual color becomes lighter. Crops in the same area are photographed from multiple angles through visual technology to verify and judge each other. At the same time, this embodiment also realizes the trend prediction of visual fading of crops, avoiding the data interference caused by the recovery process of crops after pest and disease control. Finally, by comparing the fading area at the next moment with the fading area at the previous moment, it is analyzed whether the crops are affected by pests and diseases. If the fading area at the next moment is expanded compared with the fading area at the previous moment, it means that the crops are affected by pests and diseases and the pest and disease area is further expanding. However, since this embodiment realizes the prediction function, this embodiment can be controlled before the pest and disease area is further expanded, thereby preventing the loss from expanding.
[0173] like Figure 2 As shown, this embodiment provides an embodiment of a health monitoring device for crops. In this embodiment, the health monitoring device is applied to the health monitoring method in the above embodiment.
[0174] Specifically, the health monitoring device includes a visual image acquisition module 1, a local visual image acquisition module 2, a faded different color boundary acquisition module 3, a faded different color boundary coordinate acquisition module 4, a faded different color boundary coordinate prediction module 5, an enclosed area acquisition module 6, an area ratio value acquisition module 7, an area ratio value judgment module 8, and an unhealthy state judgment module 9, which are electrically connected in sequence.
[0175] Among them, the visual image acquisition module 1 is used to acquire a plurality of visual images of crops from at least two perspectives at intervals of a preset time period; the local visual image acquisition module 2 is used to extract the local visual images of all crops in each visual image by means of a target detection algorithm; the faded heterochromatic boundary acquisition module 3 is used to extract all faded heterochromatic boundaries in each local visual image by means of a boundary extraction algorithm; the faded heterochromatic boundary coordinate acquisition module 4 is used to acquire the pixel coordinates of all faded heterochromatic boundaries of the current local visual image based on the resolution of the current local visual image and pack them into a coordinate data set; the faded heterochromatic boundary coordinate prediction module 5 is used to train and learn all coordinate data sets through the extreme learning machine based on the same viewing angle, and obtain a predicted coordinate data set based on a prediction step number; the enclosed area acquisition module 6 is used to obtain the enclosed area of all coordinate data sets and the predicted enclosed area of all predicted coordinate data sets; the area ratio value acquisition module 7 is used to obtain the area ratio value of the predicted enclosed area and the enclosed area based on the same viewing angle; the area ratio value judgment module 8 is used to judge whether the area ratio value of each viewing angle is greater than 1; the unhealthy state judgment module 9 is used to judge that all crops are in an unhealthy state if the area ratio values of all viewing angles are greater than 1.
[0176] Further, the local visual image acquisition module 2 specifically includes a first local visual image acquisition submodule, a second local visual image acquisition submodule, a third local visual image acquisition submodule, a fourth local visual image acquisition submodule, a fifth local visual image acquisition submodule, and a sixth local visual image acquisition submodule which are electrically connected in sequence;
[0177] Among them, the first local visual image acquisition submodule is used to divide the current visual image into several square grids on average; the second local visual image acquisition submodule is used to predict several bounding boxes for all crops based on all square grids according to the target detection algorithm; the third local visual image acquisition submodule is used to obtain the confidence of each bounding box respectively, and obtain the bounding box with the largest confidence and mark it as the first-order bounding box; the fourth local visual image acquisition submodule is used to calculate the intersection and union ratio of each other bounding box with the first-order bounding box; the fifth local visual image acquisition submodule is used to select the bounding box whose intersection and union ratio is greater than or equal to a preset threshold as the second-order bounding box; the sixth local visual image acquisition submodule is used to obtain the second-order bounding box with the highest confidence and define it as a crop.
[0178] Furthermore, the faded heterochromatic boundary acquisition module 3 specifically includes a first faded heterochromatic boundary acquisition submodule, a second faded heterochromatic boundary acquisition submodule, a third faded heterochromatic boundary acquisition submodule, a fourth faded heterochromatic boundary acquisition submodule, a fifth faded heterochromatic boundary acquisition submodule, a sixth faded heterochromatic boundary acquisition submodule, a seventh faded heterochromatic boundary acquisition submodule, an eighth faded heterochromatic boundary acquisition submodule, and a ninth faded heterochromatic boundary acquisition submodule, which are electrically connected in sequence; the first faded heterochromatic boundary acquisition submodule is electrically connected to the sixth local visual image acquisition submodule, and the ninth faded heterochromatic boundary acquisition submodule is electrically connected to the faded heterochromatic boundary coordinate acquisition module 4.
[0179] Among them, the first faded heterochromatic boundary acquisition submodule is used to convert each local visual image into a grayscale visual image through the cv2.cvtCo l or() function of the OpenCV environment; the second faded heterochromatic boundary acquisition submodule is used to obtain all image edges of the current grayscale visual image through the Canny edge detection operator; the third faded heterochromatic boundary acquisition submodule is used to define an erosion structure element of a preset pixel size; the fourth faded heterochromatic boundary acquisition submodule is used to traverse all image edges with the center of the erosion structure element; the fifth faded heterochromatic boundary acquisition submodule is used to delete all paths traversed by the erosion structure element to obtain the erosion image of the current grayscale visual image; the sixth faded heterochromatic boundary acquisition submodule is used to obtain the erosion image of the current grayscale visual image. The acquisition submodule is used to differentiate the current grayscale visual image and the eroded image of the current grayscale visual image to obtain the boundaries of all objects; the seventh faded heterochromatic boundary acquisition submodule is used to obtain the outer boundary grayscale value and the inner boundary grayscale value of the current object boundary; the eighth faded heterochromatic boundary acquisition submodule is used to determine whether the outer boundary grayscale value of the current object boundary is greater than the inner boundary grayscale value of the current object boundary; the ninth faded heterochromatic boundary acquisition submodule is used to define the current object boundary as a faded heterochromatic boundary if the outer boundary grayscale value of the current object boundary is greater than the inner boundary grayscale value of the current object boundary.
[0180] Furthermore, the faded heterochromatic boundary coordinate prediction module 5 specifically includes a first faded heterochromatic boundary coordinate prediction submodule, a second faded heterochromatic boundary coordinate prediction submodule, a third faded heterochromatic boundary coordinate prediction submodule, a fourth faded heterochromatic boundary coordinate prediction submodule, and a fifth faded heterochromatic boundary coordinate prediction submodule, which are electrically connected in sequence; the first faded heterochromatic boundary coordinate prediction submodule is electrically connected to the faded heterochromatic boundary coordinate acquisition module 4, and the fifth faded heterochromatic boundary coordinate prediction submodule is electrically connected to the enclosed area acquisition module 6.
[0181] Among them, the first faded heterochromatic boundary coordinate prediction submodule is used to perform standard normalization processing on all coordinate data sets, and obtain a normalized data set based on a coordinate data set; the second faded heterochromatic boundary coordinate prediction submodule is used to divide the current normalized data set into a training set and a verification set according to a preset ratio; the third faded heterochromatic boundary coordinate prediction submodule is used to define an extreme learning model according to the data dimension of the training set; the fourth faded heterochromatic boundary coordinate prediction submodule is used to train and learn the extreme learning model through the training set to obtain a prediction model; the fifth faded heterochromatic boundary coordinate prediction submodule is used to output the verification set to the prediction model, and obtain a predicted coordinate data set based on a normalized data set.
[0182] Furthermore, the third faded color boundary coordinate prediction submodule specifically includes a first faded color boundary coordinate prediction unit, a second faded color boundary coordinate prediction unit, a third faded color boundary coordinate prediction unit, and a fourth faded color boundary coordinate prediction unit, which are electrically connected in sequence; the first faded color boundary coordinate prediction unit is electrically connected to the second faded color boundary coordinate prediction submodule, and the fourth faded color boundary coordinate prediction unit is electrically connected to the fourth faded color boundary coordinate prediction submodule.
[0183] The first faded heterochromatic boundary coordinate prediction unit is used to define the i-th normalized coordinate data of the training set as (x i ,t i ).
[0184] The second faded different color boundary coordinate prediction unit is used to predict the coordinates of the boundary according to (x i ,t i )Define the training set x=(x 1 ,x 2 ,…,x i ,…,x m ) T ,x i ∈R m , where m is the number of normalized coordinate data in the training set and is also the transposed matrix (x 1 ,x 2 ,…,x i ,…,x m ) T The dimension of R m is the m-dimensional vector set of the training set x.
[0185] The third faded different color boundary coordinate prediction unit is used to predict the coordinates of the boundary according to (x i ,t i )Define the training result of the training set t=(t 1 ,t 2 ,…,t i ,…,t n )T ,t i ∈R n , where n is the number of training results in the training set and is also the transposed matrix (t 1 ,t 2 ,…,t i ,…,t n ) T The dimension of R n is the n-dimensional vector set of training results t.
[0186] The fourth faded different color boundary coordinate prediction unit is used to predict the coordinates of the training set x=(x 1 ,x 2 ,…,x i ,…,x m ) T ,x i ∈R m And the training result of the training set t=(t 1 ,t 2 ,…,t i ,…,t n ) T ,t i ∈R n According to formula (1), the extreme learning model is defined as:
[0187]
[0188] Where β = [β 1 ,β 2 ,…,β j ,…β L-1 ,β L ] T , β is the first connection weight between the hidden layer and the output layer of the extreme learning model, β j is the jth first connection weight, L is the number of nodes in the hidden layer, H(x) is the output value of the hidden layer, H(x) = [h 1 (x),h 2 (x),…,h j (x),…,h L-1 (x),h L (x)], hj(x) = g(wj·xi+bj), g(·) is the activation function, wj is the second connection weight between the input layer and the jth node of the hidden layer of the extreme learning model, b j is the threshold of the jth node in the hidden layer.
[0189] Furthermore, the fourth faded heterochromatic boundary coordinate prediction submodule specifically includes a fifth faded heterochromatic boundary coordinate prediction unit, a sixth faded heterochromatic boundary coordinate prediction unit, a seventh faded heterochromatic boundary coordinate prediction unit, and an eighth faded heterochromatic boundary coordinate prediction unit which are electrically connected in sequence; the fifth faded heterochromatic boundary coordinate prediction unit is electrically connected to the fourth faded heterochromatic boundary coordinate prediction unit, and the eighth faded heterochromatic boundary coordinate prediction unit is electrically connected to the fourth faded heterochromatic boundary coordinate prediction submodule.
[0190] The fifth faded heterochromatic boundary coordinate prediction unit is used to randomly generate all second connection weights and all thresholds through a nonlinear mapping function in a feature space based on an extreme learning model.
[0191] The sixth faded different color boundary coordinate prediction unit is used to obtain the output value of the hidden layer through the randomly generated second connection weight and threshold calculation.
[0192] The seventh faded different color boundary coordinate prediction unit is used to solve the optimal solution of the first connection weight by minimizing the approximate square error according to formula (2):
[0193]
[0194] Among them, H is the output matrix of the hidden layer, T is the target matrix of the output layer, β * is the optimal solution, H + is the MP generalized inverse matrix of the output matrix H, H + =(H T H) -1 ·H T .
[0195] The eighth faded different color boundary coordinate prediction unit is used to obtain the optimal solution and the second connection weight and threshold corresponding to the optimal solution and substitute them into the extreme learning model to obtain a prediction model.
[0196] Furthermore, the health monitoring device also includes an unhealthy state corresponding predicted step number acquisition module, a future timestamp acquisition module, an early warning signal generation module, and an early warning signal and future timestamp sending module, which are electrically connected in sequence; the unhealthy state corresponding predicted step number acquisition module is electrically connected to the unhealthy state determination module 9.
[0197] Among them, the unhealthy state corresponding prediction step acquisition module is used to obtain the prediction step number corresponding to the unhealthy state of all crops; the future timestamp acquisition module is used to add the corresponding prediction step number and the real-time timestamp to obtain the future timestamp; the early warning signal generation module is used to generate early warning signals when all crops produce unhealthy states; the early warning signal and future timestamp sending module is used to send the early warning signal and the future timestamp to an external receiving end.
[0198] It should be noted that this embodiment is a functional module embodiment based on the above method embodiment. The optimization, expansion, limitation, example, and principle description of this embodiment can be referred to the above embodiment, and this embodiment will not be repeated.
[0199] This embodiment obtains a plurality of visual images of crops from at least two perspectives at intervals of a preset time period; extracts the local visual images of all crops in each visual image by a target detection algorithm; extracts all faded heterochromatic boundaries in each local visual image by a boundary extraction algorithm; obtains the pixel coordinates of all faded heterochromatic boundaries of the current local visual image based on the resolution of the current local visual image and packages them into a coordinate data set; trains and learns all coordinate data sets by an extreme learning machine based on the same perspective, and obtains a predicted coordinate data set based on a prediction step number; obtains the enclosed area of all coordinate data sets and the predicted enclosed area of all predicted coordinate data sets; obtains the area ratio value of the predicted enclosed area to the enclosed area based on the same perspective; and judges whether the area ratio value of each perspective is greater than 1. If the area ratio values of all perspectives are greater than 1, it is determined that all crops are in an unhealthy state. This embodiment utilizes the characteristic that when crops are affected by pests and diseases, the withering, falling off, wilting and death of leaves, branches, flowers and fruits of crops due to pests and diseases are all shrinkage processes caused by water reduction. Its intuitive visual effect is that the visual area of plants under multiple viewing angles is reduced and the visual color becomes lighter. Crops in the same area are photographed from multiple angles through visual technology to verify and judge each other. At the same time, this embodiment also realizes the trend prediction of visual fading of crops, avoiding the data interference caused by the recovery process of crops after pest and disease control. Finally, by comparing the fading area at the next moment with the fading area at the previous moment, it is analyzed whether the crops are affected by pests and diseases. If the fading area at the next moment is expanded compared with the fading area at the previous moment, it means that the crops are affected by pests and diseases and the pest and disease area is further expanding. However, since this embodiment realizes the prediction function, this embodiment can be controlled before the pest and disease area is further expanded, thereby preventing the loss from expanding.
[0200] Figure 3 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Figure 3 As shown, the electronic device 10 includes a processor 101 and a memory 102 coupled to the processor 101 .
[0201] The memory 102 stores program instructions for implementing a crop health monitoring method according to any one of the above embodiments.
[0202] The processor 101 is used to execute program instructions stored in the memory 102 to perform health monitoring of crops.
[0203] The processor 101 may also be referred to as a CPU (Central Processing Unit). The processor 101 may be an integrated circuit chip having a signal processing capability. The processor 101 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0204] Further, Figure 4 This is a schematic diagram of the structure of a storage medium according to an embodiment of the present application. Figure 4 The storage medium 11 of the embodiment of the present application stores program instructions 111 that can implement all the above methods, wherein the program instructions 111 can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or terminal devices such as a computer, a server, a mobile phone, and a tablet.
[0205] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0206] In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. The above is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of this application, or directly or indirectly used in other related technical fields, is also included in the patent protection scope of the present application.
Claims
1. A method for monitoring the health of crops, wherein the crops are planted in agricultural land in a preset area, characterized in that: The health monitoring method comprises: Step S1, acquiring a plurality of visual images of the crop from at least two viewing angles at intervals of a preset time period; Step S2, extracting the local visual images with all crops in each visual image by using the target detection algorithm; Step S3, extracting all faded heterochromatic boundaries in each local visual image by using a boundary extraction algorithm; Step S4, based on the resolution of the current local visual image, the pixel coordinates of all faded different color boundaries of the current local visual image are obtained and packaged into a coordinate data set; Step S5, training and learning all coordinate data sets through an extreme learning machine based on the same perspective, and obtaining a predicted coordinate data set based on a prediction step number; Step S6, obtaining the enclosed area of all coordinate data sets and the predicted enclosed area of all predicted coordinate data sets; Step S7, obtaining an area ratio value between the predicted enclosed area and the enclosed area based on the same viewing angle; Step S8, determining whether the area ratio value of each viewing angle is greater than 1, if the area ratio values of all viewing angles are greater than 1, executing step S9; Step S9: determine that all crops are in an unhealthy state.
2. The health monitoring method according to claim 1, characterized in that: Step S2, extracting the local visual images with all crops in each visual image by using the target detection algorithm, including: Step S21, dividing the current visual image into a plurality of square grids on average; Step S22, predicting a number of bounding boxes for all crops based on all square grids according to the target detection algorithm; Step S23, respectively obtaining the confidence of each bounding box, obtaining the bounding box with the largest confidence and marking it as a first-order bounding box; Step S24, calculating the intersection-over-union ratio of each other bounding box with the first-order bounding box; Step S25, selecting a bounding box whose intersection-over-union ratio is greater than or equal to a preset threshold as a second-order bounding box; Step S26, obtaining a second-order bounding box with the highest confidence and defining it as the crop.
3. The health monitoring method according to claim 1, characterized in that: Step S3, extracting all faded heterochromatic boundaries in each local visual image by using a boundary extraction algorithm, including: Step S31, converting each local visual image into a grayscale visual image by using the cv2.cvtColor() function of the OpenCV environment; Step S32, obtaining all image edges of the current grayscale visual image through the Canny edge detection operator; Step S33, defining an erosion structure element of a preset pixel size; Step S34, traversing all image edges with the center of the eroded structure element; Step S35, deleting all paths traversed by the eroded structure element to obtain an eroded image of the current grayscale visual image; Step S36, differentiating the current grayscale visual image and the eroded image of the current grayscale visual image to obtain the boundaries of all objects; Step S37, obtaining the gray value outside the boundary and the gray value inside the boundary of the current object; Step S38, determining whether the gray value outside the boundary of the current object is greater than the gray value inside the boundary of the current object. If the gray value outside the boundary of the current object is greater than the gray value inside the boundary of the current object, executing step S39; Step S39, defining the current object boundary as a faded heterochromatic boundary.
4. The health monitoring method according to claim 1, characterized in that: Step S5, based on the same perspective, all coordinate data sets are trained and learned by an extreme learning machine, and a predicted coordinate data set is obtained based on each prediction step, including: Step S51, performing standard normalization processing on all coordinate data sets, and obtaining a normalized data set based on one coordinate data set; Step S52, dividing the current normalized data set into a training set and a validation set according to a preset ratio; Step S53, defining an extreme learning model according to the data dimension of the training set; Step S54, training and learning the extreme learning model through the training set to obtain a prediction model; Step S55, outputting the verification set to the prediction model, and obtaining a prediction coordinate data set based on a normalized data set.
5. The health monitoring method according to claim 3, characterized in that: Step S53, defining an extreme learning model according to the data dimension of the training set, including: Step S531, define the i-th normalized coordinate data of the training set as (x i ,t i ); Step S532, according to (x i ,t i ) defines the training set x = (x1, x2, ..., x i ,…,x m ) T ,x i ∈R m , where m is the number of normalized coordinate data in the training set and is also the transposed matrix (x1, x2, …, x i ,…,x m ) T The dimension of R m is the m-dimensional vector set of the training set x; Step S533, according to (x i ,t i ) defines the training result of the training set t=(t1, t2,…, t i ,…,t n ) T ,t i ∈R n , where n is the number of training results of the training set and is also the transposed matrix (t1, t2, …, t i ,…,t n ) T The dimension of R n is the n-dimensional vector set of training results t; Step S534: based on the training set x=(x1, x2, ..., x i ,…,x m ) T ,x i ∈R m And the training result of the training set t=(t1,t2,…,t i ,…,t n ) T ,t i ∈R n The extreme learning model is defined according to formula (1): Where β=[β1,β2,…,β j ,…β L-1 ,β L ] T , β is the first connection weight between the hidden layer and the output layer of the extreme learning model, β j is the jth first connection weight, L is the number of nodes in the hidden layer, H(x) is the output value of the hidden layer, H(x) = [h1(x), h2(x), …, hj(x), …, h L-1 (x),h L (x)], hj(x)=g(wj·xi+bj), g(·) is the activation function, w j is the second connection weight between the input layer of the extreme learning model and the jth node of the hidden layer, b j is the threshold of the jth node in the hidden layer.
6. The health monitoring method according to claim 5, characterized in that: Step S54, training and learning the extreme learning model through the training set to obtain a prediction model, including: Step S541, randomly generating all second connection weights and all thresholds by a nonlinear mapping function in a feature space based on the extreme learning model; Step S542, obtaining the output value of the hidden layer by calculating the randomly generated second connection weight and threshold; Step S543, according to formula (2), the optimal solution of the first connection weight is solved by minimizing the approximate square error: Among them, H is the output matrix of the hidden layer, T is the target matrix of the output layer, β * is the optimal solution, H + is the MP generalized inverse matrix of the output matrix H, H + =(H T H) -1 ·H T ; Step S544, obtaining the optimal solution and the second connection weight and threshold corresponding to the optimal solution and substituting them into the extreme learning model to obtain the prediction model.
7. The health monitoring method according to claim 1, characterized in that: Step S9, determining that all crops are in an unhealthy state, and then comprising: Step S10, obtaining the predicted number of steps corresponding to the unhealthy state of all crops; Step S20, adding the corresponding predicted step number to the real-time timestamp to obtain a future timestamp; Step S30, all crops are in an unhealthy state and a warning signal is generated; Step S40: sending the warning signal and the future timestamp to an external receiving end.
8. A crop health monitoring device, the health monitoring device being applied to the health monitoring method according to any one of claims 1 to 7, characterized in that: The health monitoring device comprises: A visual image acquisition module, used for acquiring a plurality of visual images of the crop from at least two viewing angles at intervals of a preset time period; A local visual image acquisition module is used to extract the local visual images with all crops in each visual image through a target detection algorithm; A faded heterochromatic boundary acquisition module is used to extract all faded heterochromatic boundaries in each local visual image by using a boundary extraction algorithm; A faded heterochromatic boundary coordinate acquisition module is used to acquire the pixel coordinates of all faded heterochromatic boundaries of the current local visual image based on the resolution of the current local visual image and pack them into a coordinate data set; A module for predicting coordinates of faded heterochromatic boundaries is used to train and learn all coordinate data sets through an extreme learning machine based on the same perspective, and obtain a predicted coordinate data set based on a prediction step number; An enclosed area acquisition module is used to obtain the enclosed areas of all coordinate data sets and the predicted enclosed areas of all predicted coordinate data sets; An area ratio value acquisition module, used for acquiring an area ratio value between the predicted enclosed area and the enclosed area based on the same viewing angle; An area ratio value judgment module is used to judge whether the area ratio value of each viewing angle is greater than 1; The unhealthy state determination module is used to determine that all crops are in an unhealthy state if the area ratio values of all viewing angles are greater than 1.
9. An electronic device, characterized in that: It includes a processor and a memory coupled to the processor, wherein the memory stores program instructions that can be executed by the processor; when the processor executes the program instructions stored in the memory, the health monitoring method as described in any one of claims 1 to 7 is implemented.
10. A storage medium, characterized in that: The storage medium stores program instructions, and when the program instructions are executed by the processor, the health monitoring method according to any one of claims 1 to 7 can be implemented.
Citation Information
Patent Citations
A landslide trailing edge crack displacement image recognition method
CN109584240A
Road anti-icing method, device and equipment and storage medium
CN117822371A
Lightning detection method, device and equipment for wind power plant and storage medium
CN117929861A
Automatic regulation and control method and device for ecological cabin
CN118985332A
Autonomous greenhouse control system
US20220338421A1
Cited By
Farmland dynamic monitoring method and system based on unmanned aerial vehicle
CN122265885A