Pest and disease information identification method and device based on video key frame
By adopting pest and disease information identification method based on video keyframes in facility agriculture, using inter-frame difference method and dynamic threshold adjustment method to extract video keyframes and input them into the deep neural network model, the efficiency of pest and disease monitoring in facility agriculture is solved. The problems of low and insufficient accuracy have achieved efficient and real-time pest identification and alarm.
Patent Information
- Application Number
- CN202411121641.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-31
AI Technical Summary
In the prior art, pest and disease monitoring in facility agriculture relies on manual inspection and sampling detection, and there are problems such as low detection efficiency, high false alarm rate, and inability to monitor in real time. The pest and disease recognition methods based on image processing are mainly concentrated on static images, and videos are The stream is processed less.
Using the pest and disease information recognition method based on video keyframes, the target video stream is obtained, the keyframes are extracted and inputted into the pre-trained deep neural network model, and the inter-frame difference method, dynamic threshold adjustment method and adaptive clustering method are used to perform the Keyframe extraction reduces the amount of video data, improves recognition efficiency, and performs data preprocessing to improve recognition accuracy.
It achieves the real-time monitoring while improving the accuracy and efficiency of pest identification, reducing the load on video data processing, and enhancing the ability to identify pests and diseases in a timely manner.
Smart Images

Figure CN119229333A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of agricultural information technology, and in particular to a method and device for identifying pest information based on video key frames. Background Art
[0002] Facility agriculture is an important part of modern agriculture. By building greenhouses and other facilities, it provides ideal growth conditions for crops and improves the yield and quality of agricultural products. However, the identification and timely prevention of crop diseases and pests in facility agriculture remains a major challenge. Diseases and pests not only affect crop growth, but may also cause serious economic losses. Traditional pest and disease monitoring methods mainly rely on manual inspections and sampling detection. This method has problems such as low detection efficiency, high false alarm rate, and inability to monitor in real time.
[0003] In the prior art, with the development of computer vision technology and artificial intelligence, pest and disease identification methods based on image processing and machine learning have gradually become a research hotspot. The application of video surveillance technology in agriculture provides a new means for pest and disease monitoring. By conducting continuous video monitoring of crops in facility agricultural environments, real-time monitoring of the occurrence of pests and diseases can be achieved. However, video surveillance technology also faces some challenges, such as the need to process a large amount of video data, high real-time requirements, and accurate identification of pests and diseases in complex agricultural environments. Existing pest and disease identification methods based on image processing mainly focus on the processing of static images, and there is relatively little research on the processing of video streams.
[0004] How to extract key frames to identify pest and disease features and improve the real-time and accuracy of identification is a technical problem that needs to be solved at present. Summary of the invention
[0005] The present invention provides a method and device for identifying pest information based on video key frames, so as to solve the defects in the prior art.
[0006] The present invention provides a method for identifying pest information based on video key frames, comprising the following steps: Acquire a target video stream, and perform key frame extraction on the target video stream to obtain a target image data set; The target image data set is input into a pre-trained pest and disease recognition model to obtain target pest and disease information; wherein the pest and disease recognition model is obtained by training a deep neural network based on a historical image data set.
[0007] According to a method for identifying pest information based on video key frames provided by the present invention, the key frames of the target video stream are extracted to obtain a target image data set, including: Extracting a first key frame set from the target video stream at a preset time interval, and using the first key frame set and a predetermined second key frame set as a first target image data set; Extracting key frames from the target video stream by a preset key frame extraction method to obtain a second target image data set; wherein the preset key frame extraction method includes: an inter-frame difference method, a dynamic threshold adjustment method, and an adaptive clustering method; A collection of the first target image dataset and the second target image dataset is used as the target image dataset.
[0008] According to a method for identifying pest information based on video key frames provided by the present invention, the key frames of the target video stream are extracted by a preset key frame extraction method to obtain a second target image data set, including: The target video stream is subjected to key frame extraction by the inter-frame difference method and the dynamic threshold adjustment method to obtain an initial second target image data set; wherein the images in the initial second target image data set are: images containing motion change areas; The second target image data set is obtained by performing feature extraction and cluster analysis on the initial second target image data set using the adaptive clustering method.
[0009] According to a method for identifying pest information based on video key frames provided by the present invention, the inter-frame difference method is implemented by the following formula:
[0010] in, Represents the difference image between two consecutive frames of images, and Represent the images at time t and time t-1 respectively, represents the segmentation threshold when the difference image is binarized, represents the foreground of the extracted image, Represents the weight value of the image extracted at time t.
[0011] According to a method for identifying pest information based on video key frames provided by the present invention, the dynamic threshold adjustment method is implemented by the following formula: , ,
[0012] ,
[0013] in, , Represent the average gray value of the foreground and the average gray value of the background in the image, respectively. , Respectively represent the grayscale probability of the foreground and the grayscale probability of the background in the image, T represents the initial threshold, that is, the average value of the minimum grayscale value and the maximum grayscale value in the image, Indicates that the image is at position The pixel value at , N represents the number of pixels.
[0014] According to a method for identifying pest information based on video key frames provided by the present invention, the target image data set is input into a pre-trained pest identification model to obtain target pest information, including: Performing data preprocessing on the target image data set; wherein the data preprocessing includes: image normalization, image scaling, denoising and data enhancement; The target image data set after data preprocessing is input into the pre-trained pest and disease recognition model to obtain the pest and disease target; The identified pest and disease targets are classified to obtain target pest and disease information; wherein the target pest and disease information includes the pest and disease location and pest and disease category.
[0015] According to a method for identifying pest information based on video key frames provided by the present invention, after obtaining the target pest information, the method further includes: Send warning information to the user so that the user can handle the target pest and disease information contained in the warning information.
[0016] The present invention also provides a device for identifying pest information based on video key frames, comprising the following modules: An extraction module is used to obtain a target video stream and perform key frame extraction on the target video stream to obtain a target image data set; The recognition module is used to input the target image data set into a pre-trained pest and disease recognition model to obtain target pest and disease information; wherein the pest and disease recognition model is obtained by training a deep neural network based on a historical image data set.
[0017] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a method for identifying pest and disease information based on video key frames as described above is implemented.
[0018] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for identifying pest information based on video key frames as described above is implemented.
[0019] The present invention also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for identifying pest and disease information based on video key frames.
[0020] The present invention provides a method and device for identifying pest information based on video key frames, which obtains a target image data set by acquiring a target video stream and extracting key frames from the target video stream; the target image data set is input into a pre-trained pest identification model to obtain target pest information; wherein the pest identification model is obtained by training a deep neural network based on a historical image data set. It can be seen that the present invention can reduce the amount of video data and improve data processing efficiency by extracting key frames from the target video stream, identify the extracted key frames, obtain target pest information, and improve the accuracy of identification while ensuring real-time monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 It is a flow chart of the pest information identification method based on video key frames provided by the present invention.
[0023] Figure 2 It is a complete flow chart of the pest information identification method based on video key frames provided by the present invention.
[0024] Figure 3 It is a structural schematic diagram of a device for identifying pest information based on video key frames provided by the present invention.
[0025] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] Combine the following Figure 1-Figure 4The present invention describes a method and device for identifying pest information based on video key frames.
[0028] Figure 1 is a flow chart of the pest information identification method based on video key frames provided by the present invention, such as Figure 1 As shown, the method includes the following: Step 100: Obtain a target video stream, and extract key frames from the target video stream to obtain a target image data set.
[0029] Figure 2 This is a complete flow chart of the pest information identification method based on video key frames provided by the present invention. Figure 2 , a complete description is given of the pest and disease information identification method based on video key frames provided in an embodiment of the present invention.
[0030] Specifically, the hardware architecture part of this embodiment mainly includes video acquisition equipment, processing center, display and alarm equipment. The video acquisition equipment includes: high-resolution camera: installed in a fixed position in the facility agriculture environment, capable of monitoring crop growth around the clock; video acquisition server: responsible for receiving real-time video data transmitted by the camera and performing preliminary processing. The processing center includes: high-performance computing server: equipped with powerful computing resources for video processing and the operation of pest and disease identification algorithms; data storage server: used to store video data, identification results and historical records. The display and alarm equipment includes: display terminal: including high-resolution display screen or user terminal equipment, real-time display of identification results; alarm device: including sound and light alarm, SMS gateway and mobile push device, to realize various forms of alarm notification.
[0031] Before step 100, the video stream is received and processed by a video acquisition device, and a real-time video stream is received from a camera and pre-processed, including video format conversion, resolution adjustment, etc.
[0032] Specifically, step 100 extracts key frames from the target video stream to obtain a target image data set, including: Step 110: extract a first key frame set from the target video stream at a preset time interval, and use the first key frame set and a predetermined second key frame set as a first target image data set.
[0033] It should be noted that for video data, what is processed is generally uncompressed stream data, that is, decoded stream data, called raw stream. Videos are composed of still pictures, which are called frames. Generally speaking, if the frame rate is lower than 15 frames per second, continuous motion video will feel paused. The television standard PAL system stipulates 25 frames per second for video. Therefore, for each frame of each video, it can be regarded as a series of "images" that we usually see, and the entire video can be regarded as an image sequence, which is much richer than an image, with strong expressiveness and large amount of information. The analysis of videos is usually based on video frames, but video frames usually have a lot of redundancy, and the extraction of video frames also has the phenomenon of missing frames and redundancy. Video key frame extraction mainly extracts the significant features of each shot in the video. Through video key frame extraction, the time required for video retrieval can be effectively reduced and the accuracy of video retrieval can be enhanced.
[0034] In the scenario of facility agriculture pest and disease identification, due to the particularity of the scenario and requirements, a combination of manual and automatic methods is used to extract key frames from videos.
[0035] Specifically, manual methods are divided into immediate observation method and time interval method. Immediate observation method (determine the above-mentioned second key frame set by this method): manually select frames with important significance as key frames by watching the video sequence. This method is simple and intuitive, but it takes more time and effort, and can extract representative key frames. Time interval method (determine the above-mentioned first key frame set by this method): extract key frames at fixed time intervals, such as extracting one frame every 1 hour. In the scenario of facility agriculture, crop changes take a long time, and most of the data is redundant and repeated. Therefore, the time interval method can effectively reduce the amount of data processing.
[0036] Step 120, extract key frames from the target video stream using a preset key frame extraction method to obtain a second target image data set; wherein the preset key frame extraction method includes: an inter-frame difference method, a dynamic threshold adjustment method, and an adaptive clustering method.
[0037] Specifically, step 120 includes: Step 120a, extract key frames from the target video stream by using the inter-frame difference method and the dynamic threshold adjustment method to obtain an initial second target image data set; wherein the images in the initial second target image data set are images containing motion change areas.
[0038] Specifically, for the method of automatically extracting key frames, combined with the application scenario of facility agriculture, inter-frame difference calculation is selected. The inter-frame difference method is a method of obtaining the contour of a moving target by performing a difference operation on two consecutive frames of a video image sequence. When abnormal target motion occurs in the monitoring scene, there will be a more obvious difference between the two adjacent frames. The two frames are subtracted to obtain the absolute value of the pixel value difference at the corresponding position of the image, and it is determined whether it is greater than a certain threshold, thereby analyzing the object motion characteristics of the video or image sequence. In the facility agriculture scenario, the inter-frame difference method is introduced. Represents the weight value of the key frame to be extracted. Regarding the color change of the background image, according to the color similarity of the pests and diseases, the value ranges from 1% to 100%. The frame image that is most similar to the pests and diseases has the largest weight value of 100%, and the frame image that is most similar to the background color and crops has the smallest weight value of 1%. This can reduce the impact of background factors on the frame image that highlights the pests and diseases.
[0039] The inter-frame difference method is implemented by the following formula:
[0040] in, Represents the difference image between two consecutive frames of images, and Represent the images at time t and time t-1 respectively, represents the segmentation threshold when the difference image is binarized, represents the foreground of the extracted image, Represents the weight value of the image extracted at time t.
[0041] Furthermore, for the threshold If the value is too high, the moving target area will be severely fragmented. If the value is too low, a lot of noise will be introduced. Therefore, this embodiment proposes a method for determining the dynamic threshold using the grayscale value of the current image: find the minimum and maximum grayscale values in the image, and take their average value as the initial threshold, denoted as T; where is the weight of the image at that moment, highlighting the value of pests and diseases. According to the initial threshold, the image is divided into two parts: the target and the background, and the average gray value of the two parts is calculated. , And the grayscale probability of the two parts , .
[0042] The dynamic threshold adjustment method is implemented by the following formula: , ,
[0043] ,
[0044] in, , Represent the average gray value of the foreground and the average gray value of the background in the image, respectively. , Respectively represent the grayscale probability of the foreground and the grayscale probability of the background in the image, T represents the initial threshold, that is, the average value of the minimum grayscale value and the maximum grayscale value in the image, Indicates that the image is at position The pixel value at , N represents the number of pixels.
[0045] Furthermore, in the actual application process, the three-frame difference method is used to solve the problem of "double shadow" of moving insect images in the binary method. The specific algorithm is: first and Perform difference to get image , then by and Get the image , and finally by Get the final image you need.
[0046] Step 120b: perform feature extraction and cluster analysis on the initial second target image data set by using the adaptive clustering method to obtain the second target image data set.
[0047] It should be noted that in order to make the extracted key frames more universal, this embodiment combines semantics and uses an adaptive clustering method to achieve key frame extraction. Clustering is performed frame by frame, which can cover the entire data set so that the clustering results are true and reliable, and no frames are missed, and basically a sufficient number of accurate key frames can be extracted.
[0048] Specifically, first, the first frame of the initial second target image data set is used as the initial cluster center, and then a frame is taken out to measure the similarity with all the current cluster centers. If the maximum similarity value is still less than a given threshold, it means that the distance between the frame and all the cluster centers is too far, so it must be classified into its own category. Then repeat this process until all frames are taken. Then, the cluster center is calculated. Every time a new image is added to the current class, the cluster center must be recalculated, that is, the average value is calculated. After clustering is completed, the frame closest to the cluster center is calculated in each cluster center as the key frame.
[0049] Step 130: Use the combination of the first target image dataset and the second target image dataset as the target image dataset.
[0050] Step 200: input the target image data set into a pre-trained pest and disease recognition model to obtain target pest and disease information; wherein the pest and disease recognition model is obtained by training a deep neural network based on a historical image data set.
[0051] Specifically, step 200 inputs the target image data set into a pre-trained pest and disease recognition model to obtain target pest and disease information, including: Step 210: perform data preprocessing on the target image data set; wherein the data preprocessing includes: image normalization, image scaling, denoising and data enhancement.
[0052] Specifically, the main task of step 210 is to perform preliminary processing on the key frame images in the input target image data set to improve the accuracy and efficiency of subsequent processing. The main steps are: Image normalization: Normalize the pixel values of the keyframe image to standardize the input data.
[0053] Image Scaling: Scale images to a fixed size to fit the input requirements of deep learning models.
[0054] Denoising: Use filtering technology to remove noise from the image.
[0055] Data enhancement: Perform data enhancement operations such as rotation, scaling, and flipping on key frame images to increase data diversity and improve the generalization ability of the model.
[0056] Step 220: input the target image data set after data preprocessing into the pre-trained pest and disease recognition model to obtain the pest and disease target.
[0057] Specifically, step 220 mainly implements feature extraction and pest and disease identification.
[0058] 1. Feature extraction: Extract high-level feature representations from preprocessed images using a convolutional neural network (CNN). The main steps are as follows: Convolutional layer: Use multiple convolutional layers to extract features from the image. The convolution kernel of each layer extracts features of different scales and directions.
[0059] Pooling layer: Use maximum pooling to reduce the size of feature maps, retain important features, and reduce the amount of calculation. Activation function: Use nonlinear activation function to increase the nonlinear expression ability of the model.
[0060] 2. Pest and disease identification: used to detect targets on feature maps and identify pest and disease targets in images. The main steps are as follows: Candidate region generation: Generate candidate regions using sliding window detection.
[0061] Candidate region classification and regression: Classify each candidate region to determine whether it contains pest targets, and perform bounding box regression to accurately locate the target position.
[0062] Non-maximum suppression: Perform non-maximum suppression on the candidate regions, remove overlapping areas, and retain only the most likely target regions.
[0063] Step 230: classify the identified pest target to obtain target pest information; wherein the target pest information includes the pest location and pest category.
[0064] Specifically, step 230 accurately classifies the detected target and outputs its location and category. The main steps are as follows: Classifier: Use the fully connected layer to classify each candidate area and output the pest category and confidence. Regressor: Regress the bounding box of each candidate area and output the precise target location.
[0065] Result integration: Integrate the classification and positioning results to generate the final recognition result.
[0066] The result output and display submodule is responsible for displaying and storing the recognition results.
[0067] The above is a description of the steps of the pest and disease information identification method based on video key frames provided by the present invention. From the description of the above steps, it can be seen that according to the pest and disease information identification method based on video key frames provided by the present invention, a target image data set is obtained by acquiring a target video stream and extracting key frames from the target video stream; the target image data set is input into a pre-trained pest and disease identification model to obtain target pest and disease information; wherein the pest and disease identification model is obtained by training a deep neural network based on a historical image data set. It can be seen that the present invention can reduce the amount of video data and improve data processing efficiency by extracting key frames from the target video stream, and the extracted key frames are identified to obtain target pest and disease information, thereby improving the accuracy of identification while ensuring real-time monitoring.
[0068] Based on the above embodiment, in this embodiment, after obtaining the target pest information in step 200, the method further includes: Send warning information to the user so that the user can handle the target pest and disease information contained in the warning information.
[0069] Specifically, this embodiment intuitively displays the identification results to the user, provides an alarm reminder function, and transmits relevant information to a remote monitoring center to ensure that pest and disease information is conveyed to farmers and managers in a timely and effective manner.
[0070] The pest and disease information identification method based on video key frames provided in this embodiment is intended to display the identification results of crop pests and diseases to users in a timely and accurate manner, and to issue an alarm signal when necessary, to ensure that users can take quick measures to prevent the further spread of pests and diseases and ensure the healthy growth of crops.
[0071] The following is a description of the pest and disease information identification device based on video key frames provided by the present invention. The pest and disease information identification device based on video key frames described below and the pest and disease information identification method based on video key frames described above can be referenced to each other.
[0072] Figure 3 is a schematic diagram of the structure of the pest information identification device based on video key frames provided by the present invention, such as Figure 3 As shown, the pest information identification device based on video key frames provided by the present invention includes: The extraction module 301 is used to obtain a target video stream and perform key frame extraction on the target video stream to obtain a target image data set; The pruning module 302 is used to input the target image data set into a pre-trained pest and disease recognition model to obtain target pest and disease information; wherein the pest and disease recognition model is obtained by training a deep neural network based on a historical image data set.
[0073] The pest information identification device based on video key frames provided by the present invention obtains a target image data set by acquiring a target video stream and extracting key frames from the target video stream; the target image data set is input into a pre-trained pest identification model to obtain target pest information; wherein the pest identification model is obtained by training a deep neural network based on a historical image data set. It can be seen that the present invention can reduce the amount of video data, improve data processing efficiency, identify the extracted key frames, obtain target pest information, and improve the accuracy of identification while ensuring real-time monitoring.
[0074] Based on the above embodiment, in this embodiment, the extraction module 301 is specifically used for: Extracting a first key frame set from the target video stream at a preset time interval, and using the first key frame set and a predetermined second key frame set as a first target image data set; Extracting key frames from the target video stream by a preset key frame extraction method to obtain a second target image data set; wherein the preset key frame extraction method includes: an inter-frame difference method, a dynamic threshold adjustment method, and an adaptive clustering method; A collection of the first target image dataset and the second target image dataset is used as the target image dataset.
[0075] Based on the above embodiment, in this embodiment, the extraction module 301 is specifically used for: The target video stream is subjected to key frame extraction by the inter-frame difference method and the dynamic threshold adjustment method to obtain an initial second target image data set; wherein the images in the initial second target image data set are: images containing motion change areas; The second target image data set is obtained by performing feature extraction and cluster analysis on the initial second target image data set using the adaptive clustering method.
[0076] Based on the above embodiment, in this embodiment, the inter-frame difference method is implemented by the following formula:
[0077] in, Represents the difference image between two consecutive frames of images, and Represent the images at time t and time t-1 respectively, represents the segmentation threshold when the difference image is binarized, represents the foreground of the extracted image, Represents the weight value of the image extracted at time t.
[0078] Based on the above embodiment, in this embodiment, the dynamic threshold adjustment method is implemented by the following formula: , ,
[0079] ,
[0080] in, , Represent the average gray value of the foreground and the average gray value of the background in the image, respectively. , Respectively represent the grayscale probability of the foreground and the grayscale probability of the background in the image, T represents the initial threshold, that is, the average value of the minimum grayscale value and the maximum grayscale value in the image, Indicates that the image is at position The pixel value at , N represents the number of pixels.
[0081] Based on the above embodiment, in this embodiment, the identification module 302 is specifically used for: Performing data preprocessing on the target image data set; wherein the data preprocessing includes: image normalization, image scaling, denoising and data enhancement; The target image data set after data preprocessing is input into the pre-trained pest and disease recognition model to obtain the pest and disease target; The identified pest and disease targets are classified to obtain target pest and disease information; wherein the target pest and disease information includes the pest and disease location and pest and disease category.
[0082] Based on the above embodiment, in this embodiment, the device further includes a sending module, which is specifically used to: Send warning information to the user so that the user can handle the target pest and disease information contained in the warning information.
[0083] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communications interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the pest information identification method based on the video key frame, and the method includes: Acquire a target video stream, and perform key frame extraction on the target video stream to obtain a target image data set; The target image data set is input into a pre-trained pest and disease recognition model to obtain target pest and disease information; wherein the pest and disease recognition model is obtained by training a deep neural network based on a historical image data set.
[0084] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0085] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the pest information identification method based on video key frames provided by the above methods, the method includes: Obtaining a target video stream, and performing key frame extraction on the target video stream to obtain a target image data set; The target image data set is input into a pre-trained pest and disease recognition model to obtain target pest and disease information; wherein the pest and disease recognition model is obtained by training a deep neural network based on a historical image data set.
[0086] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the pest information identification method based on video key frames provided by the above methods, the method comprising: Acquire a target video stream, and extract key frames from the target video stream to obtain a target image data set; The target image data set is input into a pre-trained pest and disease recognition model to obtain target pest and disease information; wherein the pest and disease recognition model is obtained by training a deep neural network based on a historical image data set.
[0087] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0088] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for identifying pest information based on video key frames, characterized in that: include: Acquire a target video stream, and perform key frame extraction on the target video stream to obtain a target image data set; The target image data set is input into a pre-trained pest and disease recognition model to obtain target pest and disease information; wherein the pest and disease recognition model is obtained by training a deep neural network based on a historical image data set.
2. The method for identifying pest information based on video key frames according to claim 1, characterized in that: The step of extracting key frames from the target video stream to obtain a target image data set includes: Extracting a first key frame set from the target video stream at a preset time interval, and using the first key frame set and a predetermined second key frame set as a first target image data set; Extracting key frames from the target video stream by a preset key frame extraction method to obtain a second target image data set; wherein the preset key frame extraction method includes: an inter-frame difference method, a dynamic threshold adjustment method, and an adaptive clustering method; A collection of the first target image dataset and the second target image dataset is used as the target image dataset.
3. The method for identifying pest information based on video key frames according to claim 2, characterized in that: The step of extracting key frames from the target video stream by a preset key frame extraction method to obtain a second target image data set includes: The target video stream is subjected to key frame extraction by the inter-frame difference method and the dynamic threshold adjustment method to obtain an initial second target image data set; wherein the images in the initial second target image data set are: images containing motion change areas; The second target image data set is obtained by performing feature extraction and cluster analysis on the initial second target image data set using the adaptive clustering method.
4. The method for identifying pest information based on video key frames according to claim 2, characterized in that: The inter-frame difference method is implemented by the following formula: in, Represents the difference image between two consecutive frames of images, and Represent the images at time t and time t-1 respectively, represents the segmentation threshold when the difference image is binarized, represents the foreground of the extracted image, Represents the weight value of the image extracted at time t.
5. The method for identifying pest information based on video key frames according to claim 2, characterized in that: The dynamic threshold adjustment method is implemented by the following formula: , , , in, , Represent the average gray value of the foreground and the average gray value of the background in the image, respectively. , Respectively represent the grayscale probability of the foreground and the grayscale probability of the background in the image, T represents the initial threshold, that is, the average value of the minimum grayscale value and the maximum grayscale value in the image, Indicates that the image is at position The pixel value at , N represents the number of pixels.
6. The method for identifying pest information based on video key frames according to claim 1, characterized in that: The step of inputting the target image data set into a pre-trained pest and disease recognition model to obtain target pest and disease information includes: Performing data preprocessing on the target image data set; wherein the data preprocessing includes: image normalization, image scaling, denoising and data enhancement; The target image data set after data preprocessing is input into the pre-trained pest and disease recognition model to obtain the pest and disease target; The identified pest and disease targets are classified to obtain target pest and disease information; wherein the target pest and disease information includes the pest and disease location and pest and disease category.
7. The method for identifying pest information based on video key frames according to claim 1, characterized in that: After obtaining the target pest information, the method further includes: Send warning information to the user so that the user can handle the target pest and disease information contained in the warning information.
8. A device for identifying pest information based on video key frames, characterized in that: include: An extraction module is used to obtain a target video stream and perform key frame extraction on the target video stream to obtain a target image data set; The recognition module is used to input the target image data set into a pre-trained pest and disease recognition model to obtain target pest and disease information; wherein the pest and disease recognition model is obtained by training a deep neural network based on a historical image data set.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for identifying pest and disease information based on video key frames as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for identifying pest and disease information based on video key frames as described in any one of claims 1 to 7 is implemented.
