Flying insect identification system based on image analysis
By developing a flying insect recognition system based on image analysis, we can monitor insect population changes and interactive behavior in real time, and combine time series analysis and variational autoencoder technology, the problems of inefficiency and limitations of a single data source in the existing technology are solved, and high-precision insect behavior analysis and monitoring are achieved.
Patent Information
- Application Number
- CN202411986615.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing insect monitoring technology is inefficient and cannot reflect the dynamic changes and behavioral characteristics of insect populations in real time. The limitations of a single data source lead to a lack of comprehensiveness and accuracy of the analysis results.
Develop a flying insect recognition system based on image analysis, including a dynamic monitoring module for insect populations and an insect interactive behavior analysis module. Through multiple camera equipment and sensor networks, analyzing the migration patterns and behavior characteristics of insect populations in real time, combining time series analysis and improved variational automatic encoder technology.
Real-time monitoring of insect population changes and migration patterns has been achieved, which significantly improves the accuracy of insect behavior characteristics extraction, can efficiently identify and classify various behaviors of insects, and provides more accurate data support for ecological monitoring.
Smart Images

Figure CN119904692A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of insect identification, and in particular to a flying insect identification system based on image analysis. Background Art
[0002] Flying insects play important roles in the ecosystem, such as pollination, decomposition of organic matter, and as a key link in the food chain. However, the dynamic changes and interactive behaviors of insect populations have a profound impact on the ecological environment and human society. Existing insect monitoring technologies mostly use manual capture and sample analysis methods, which are not only time-consuming and labor-intensive, but also unable to reflect the dynamic changes and behavioral characteristics of insect populations in real time. Therefore, it is of great scientific and practical significance to develop a flying insect recognition system based on image analysis that can monitor the changes in insect population quantity and interactive behaviors in real time. The shortcomings of existing technologies are reflected in the following aspects:
[0003] Limitations of manual monitoring: Traditional insect monitoring methods mainly rely on manual capture and sample analysis, which is not only inefficient, but also unable to continuously and in real time obtain insect population dynamics data. Due to the poor timeliness of data acquisition, it is difficult to accurately reflect the real-time changes and migration patterns of insect populations.
[0004] Limitations of a single data source: Existing insect monitoring technologies usually rely on a single data source, such as image data, which cannot fully capture insect behavior patterns and environmental impacts. The limitations of this single data source make the analysis results lack comprehensiveness and accuracy, making it difficult to provide a strong scientific basis.
[0005] Insufficient behavioral analysis: The interactive behaviors of insects are complex and diverse. Existing technologies have great deficiencies in identifying and analyzing insect behaviors, especially in terms of behavioral characteristics and patterns. Traditional image analysis technology is difficult to accurately capture the subtle interactions between insects and lacks efficient behavioral analysis and classification methods. Summary of the invention
[0006] Based on the above objectives, the present invention provides a flying insect identification system based on image analysis.
[0007] The flying insect recognition system based on image analysis includes:
[0008] The insect population dynamics monitoring module is used to monitor the number changes and migration patterns of insect populations. The insect population dynamics monitoring module includes:
[0009] The population data collection unit monitors the changes in the number of insect populations in a predetermined area through multiple cameras and sensor networks;
[0010] The dynamic analysis unit analyzes the migration patterns and quantity trends of insect populations through time series analysis and spatial statistical methods;
[0011] The insect interaction behavior analysis module is used to analyze the interaction behavior between insects. The insect interaction behavior analysis module includes:
[0012] Behavioral monitoring units, which use video equipment and motion capture technology to record the interactive behaviors of insects;
[0013] An interaction analysis unit, which analyzes interactive behavior characteristics through an improved variational autoencoder technology, wherein the improved variational autoencoder technology introduces an adaptive time window and an attention mechanism;
[0014] The data storage module is connected to the insect population dynamics monitoring module and the insect interactive behavior analysis module, and is used to store monitoring and analysis results.
[0015] Furthermore, the population data collection unit monitors the changes in the number of insect populations in a predetermined area through the following scheme:
[0016] Arrangement of multiple cameras: Arrange multiple cameras in the predetermined area, each of which can capture high-resolution images of insects in real time to ensure full coverage of the predetermined monitoring area;
[0017] Integration of sensor networks: Multiple environmental sensors, including temperature sensors, humidity sensors, and air pressure sensors, are deployed in a predetermined area to monitor environmental parameters in real time and provide auxiliary information;
[0018] Data collection and transmission: The camera equipment and sensors are connected to the central data collection center through a wired network to transmit the real-time captured image data and environmental data to the central data collection center;
[0019] Image processing and recognition: After receiving the image data, the central data collection center uses the image preprocessing module to perform denoising, enhancement and segmentation on the image, and extracts the morphological, color and texture features of the insect from the processed image;
[0020] Insect population counting: Based on the extracted image features, insect recognition algorithms are used to identify insects in the image, count them, and count the changes in the number of insects in a predetermined area in real time;
[0021] Environmental data association: The identified insect population data is associated with the environmental data provided by the environmental sensors, and the relationship between the insect population changes and environmental parameters is recorded to facilitate subsequent analysis.
[0022] Furthermore, the insect recognition algorithm includes feature extraction based on a convolutional neural network (CNN), and then insect detection and counting based on a regional convolutional neural network (R-CNN);
[0023] The regional convolutional neural network R-CNN specifically includes:
[0024] Selective search: Generate candidate regions;
[0025] Feature extraction: Apply CNN to extract features of candidate regions;
[0026] Classifier: Identify insects using a support vector machine classifier:
[0027] Among them, α i is the Lagrange multiplier, y i is the category label, is the kernel function.
[0028] Furthermore, the environmental data association specifically includes:
[0029] Time series association: Record the number of insects and environmental data at each time point to form a time series:
[0030] For each time point t, a multidimensional data point D is formed t =(N t ,T t ,H t ,P t ), where N t is the number of insects at time t, T t is the temperature, H t is humidity, P t It is the air pressure;
[0031] Correlation analysis: Calculate the correlation coefficient between insect population and environmental parameters:
[0032] Among them, E t represents environmental parameters, N and E are the means of insect numbers and environmental parameters, respectively.
[0033] Furthermore, the dynamic analysis unit specifically includes:
[0034] Obtain insect population and environmental data from population data collection units and environmental sensors;
[0035] Time series analysis: Decompose the time series data through the extended seasonal decomposition method (STL) to extract trend, seasonal and random components, analyze the long-term changes and seasonal fluctuations in insect numbers, use the Bayesian structured time series model (BSTS) to model and predict the extracted trend and seasonal components, introduce the Bayesian method, combine historical data and prior knowledge, and improve the model's predictive ability;
[0036] Spatial statistical analysis, including:
[0037] Spatiotemporal density estimation: Use spatiotemporal kernel density estimation methods to analyze the density distribution of insect populations in time and space, and identify high-density areas and migration paths;
[0038] Spatiotemporal regression model: Combine spatiotemporal data to establish a spatiotemporal regression model to analyze the changing trends of insect populations at different locations and times, providing a basis for identifying migration patterns;
[0039] Real-time feedback and early warning: Combine real-time data and analytical models to monitor and predict changes in insect populations. When abnormal conditions are detected, early warnings are issued through the result feedback module to help users take timely measures.
[0040] Furthermore, the extended seasonal decomposition method STL decomposes the time series, which is expressed as:
[0041] N t =T t +S t +R t , where T t is the trend component, S t is the seasonal component, R t It is a random component, and Loess regression is used to smoothly extract trend and seasonal components;
[0042] The Bayesian structural time series model BSTS is used to model and predict trend and seasonal components. The model is expressed as:
[0043] N t =μ t +γ t +δ t + t , where μ t is the long-term trend component, γ t is the seasonal component, δ t is the regression component, t is the error term, and the trend component μ t The update formula is:
[0044] μ t =μ t-1 +β t-1 +η t , where β t is the trend slope, η t is the error term;
[0045] Seasonal ingredients¶ t The update formula is: Where s is the seasonal period, ω t is the error term.
[0046] Furthermore, the spatiotemporal kernel density estimation method analyzes the distribution density of insect populations in time and space, which is expressed as:
[0047] in, is the density estimate at position x and time t, K s and K t are the kernel functions of space and time respectively, h s and h t is the bandwidth parameter in space and time;
[0048] The spatiotemporal regression model analyzes the temporal and spatial variation trend of insect populations, which is expressed as: N(x, t) = β0 + β1T(x, t) + β2H(x, t) + β3P(x, t) + u(x, t), where N(x, t) is the number of insects at position x and time t, T(x, t), H(x, t) and P(x, t) are the temperature, humidity and air pressure at position x and time t, respectively, and u(x, t) is the error term;
[0049] The real-time feedback and early warning are based on the early warning algorithm, which adopts the anomaly detection model with the formula: in, is the predicted insect population, It is the standard deviation of the predicted value. If the Anomaly exceeds the preset threshold, an alert is triggered.
[0050] Furthermore, the behavior monitoring unit specifically includes:
[0051] Motion detection and tracking: The background subtraction method is used to detect the movement of insects. The position and movement trajectory of insects are determined by analyzing the pixel changes in consecutive frame images, which can be expressed as:
[0052] in, and are the image pixel values at time t and t-1, respectively. is the image gradient, v is the motion vector;
[0053] Using the image data from multiple cameras, the three-dimensional position of the insect is reconstructed through stereo vision technology, and the depth information is calculated through the parallax between corresponding image points. The formula is:
[0054] Among them, d is the parallax, B is the camera baseline distance, f is the focal length, and z is the object depth;
[0055] Trajectory recording: The movement trajectory of each insect is recorded to generate time-position series data, including the position and movement status of the insect at each time point.
[0056] Furthermore, the interaction analysis unit uses the improved variational autoencoder technology to analyze the interaction behavior characteristics, specifically including:
[0057] A: Clean the time-location series data recorded by the behavior monitoring unit to remove noise and outliers, ensure data quality, and extract key features from the time-location series data, including speed, acceleration, path length, and residence time features;
[0058] B: Build an improved variational autoencoder model, including:
[0059] Input data preparation: The preprocessed time-position series data is constructed into a format suitable for variational autoencoder input. Each data sample contains the movement trajectory and related features of an insect over a period of time.
[0060] Adaptive time window: dynamically adjust the length of the input sequence to enable the model to capture short-term and long-term behavioral characteristics;
[0061] Encoder based on attention mechanism: The attention mechanism is introduced into the encoder part of the variational autoencoder, so that the encoder can automatically focus on the most important part of the input sequence for behavior recognition, improving the effect of feature extraction. The encoder is expressed as: Among them, x is the input data, z is the hidden variable, μ φ and is the mean and variance of the encoder network output; introduces the attention mechanism: a t =softmax(W a h t +b a ), where a t is the attention weight, h t is the hidden state, W a and b a is a trainable parameter; attention weighted output: c t =∑ t a t h t , where c t is the attention-weighted context vector;
[0062] Decoder: Decode the latent variables back to high-dimensional data and reconstruct the original time-position sequence data. The decoder is expressed as: Among them, μ θ and is the mean and variance of the decoder network output;
[0063] Loss function: Using reconstruction loss and KL divergence as loss functions, the variational autoencoder model is trained to enable it to reconstruct the input data and learn the latent variable distribution;
[0064] C: Behavior classification and recognition: Use the improved variational autoencoder model to map the time-position sequence data to a low-dimensional latent variable space, extract representative features from the latent variables, and label different behavior patterns according to predefined insect behavior patterns, including foraging, mating, and fighting. Perform cluster analysis on insect behaviors in the latent variable space to identify different behavior patterns and interaction types. Input the real-time monitored time-position sequence data into the trained variational autoencoder model to identify and classify insect interaction behaviors in real time.
[0065] D: Conduct statistical analysis on the identified behaviors, calculate the frequency and duration of different behaviors, analyze the interaction patterns between insects, and analyze the long-term change trends and periodic characteristics of insect behaviors based on the statistical results. Use the reconstruction error and latent variable distribution of the variational autoencoder model to detect abnormal behaviors and provide early warning for ecological monitoring.
[0066] Further, the frequency is calculated as: Among them, f i is the frequency of behavior i, n i is the number of times behavior i occurs, and N is the total number of behaviors;
[0067] The duration is calculated as: Among them, t i is the total duration of behavior i, t j,start and t j,end are the start and end time of the jth occurrence of behavior i, respectively;
[0068] Based on the statistical results, analyze the long-term trend and periodic characteristics of insect behavior;
[0069] The reconstruction error is expressed as: Among them, e i is the reconstruction error of sample i, x i is the original data, For latent variable distribution anomaly detection:
[0070] The probability distribution of latent variables is used to detect anomalies. By calculating the probability density of latent variables, if it is lower than the preset threshold, it is considered an anomaly, p(z) <threshold。
[0071] Beneficial effects of the present invention:
[0072] The present invention uses multiple high-resolution cameras and sensor networks to monitor the changes in the number of insect populations in real time. The dynamic analysis unit uses time series analysis and spatiotemporal regression models to accurately capture the migration patterns and number trends of insect populations, and combines insect population data with environmental sensor data (such as temperature, humidity, air pressure, etc.) to perform multivariate autoregression analysis and spatiotemporal density estimation. This multi-dimensional comprehensive analysis capability enables the system to identify the impact of environmental changes on insect population dynamics, provide a scientific basis for ecological and environmental research, and help formulate more effective protection and management strategies.
[0073] The present invention significantly improves the accuracy of insect behavior feature extraction by introducing an improved variational autoencoder (VAE) combined with an adaptive time window and attention mechanism. The VAE model can effectively capture short-term and long-term behavioral characteristics and accurately represent complex interaction patterns in the latent variable space, enabling the system to efficiently identify and classify various behaviors of insects, providing more accurate data support for ecological monitoring.
[0074] The present invention uses the comprehensive analysis capability of multi-source data to not only focus on the movement trajectory of a single insect, but also analyze the dynamic changes of insect populations in time and space through spatiotemporal regression models and spatiotemporal density estimation methods. Combining reconstruction errors and latent variable distribution for anomaly detection can timely detect abnormal behaviors and emergencies in insect populations, and improve the sensitivity and response speed of ecosystem monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only for the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0076] Figure 1 A schematic diagram of the functional modules of the identification system according to an embodiment of the present invention;
[0077] Figure 2 Schematic diagram of an interactive analysis unit according to an embodiment of the present invention. DETAILED DESCRIPTION
[0078] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.
[0079] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0080] Insects play an important role in the ecosystem, including pollination, decomposition of organic matter and as a key component of the food chain. By monitoring the dynamic changes of insect populations, it is possible to timely detect the decline or migration of insect populations, protect and restore endangered species, and maintain biodiversity; insect population dynamics monitoring can help agricultural managers understand the number and migration patterns of pests, formulate scientific prevention and control strategies, reduce the use of pesticides, and improve crop yields and quality. At the same time, it is also possible to protect beneficial insects, such as pollinators, and improve the sustainability of agricultural production; some insects are vectors of disease transmission, such as mosquitoes that spread malaria and dengue fever. By monitoring the population dynamics and interactive behaviors of these insects, it is possible to foresee the risk areas of disease outbreaks, take timely prevention and control measures, and protect public health; insect population dynamics monitoring and interactive behavior analysis provide important data for ecological and environmental research, and can be used to study the impact of climate change, pollution and human activities on ecosystems. These data are helpful in formulating environmental protection policies and measures and promoting ecological balance. Therefore, flying insect identification analysis is carried out.
[0081] like Figure 1-Figure 2 As shown, the flying insect recognition system based on image analysis includes:
[0082] The insect population dynamics monitoring module is used to monitor the number changes and migration patterns of insect populations. The insect population dynamics monitoring module includes:
[0083] The population data collection unit monitors the changes in the number of insect populations in a predetermined area through multiple cameras and sensor networks;
[0084] The dynamic analysis unit analyzes the migration patterns and quantity trends of insect populations through time series analysis and spatial statistical methods;
[0085] The insect interaction behavior analysis module is used to analyze the interaction behavior between insects. The insect interaction behavior analysis module includes:
[0086] Behavioral monitoring units, which use video equipment and motion capture technology to record the interactive behaviors of insects;
[0087] The interaction analysis unit analyzes the interactive behavior characteristics through the improved variational autoencoder technology. The improved variational autoencoder technology introduces adaptive time windows and attention mechanisms. The behavior patterns of insects have time-varying characteristics. By introducing adaptive time windows and dynamically adjusting the length of the input sequence, the variational autoencoder can better capture short-term and long-term behavioral characteristics. The introduction of the attention mechanism enables the encoder to automatically focus on the most important part of the input sequence for behavior recognition, thereby improving the effect of feature extraction.
[0088] The data storage module is connected with the insect population dynamics monitoring module and the insect interactive behavior analysis module, and is used to store monitoring and analysis results.
[0089] The population data collection unit monitors the changes in insect populations in a predetermined area through the following schemes:
[0090] Arrangement of multiple cameras: Arrange multiple cameras in the predetermined area, each of which can capture high-resolution images of insects in real time to ensure full coverage of the predetermined monitoring area;
[0091] Integration of sensor networks: Multiple environmental sensors, including temperature sensors, humidity sensors, and air pressure sensors, are deployed in a predetermined area to monitor environmental parameters in real time and provide auxiliary information;
[0092] Data collection and transmission: The camera equipment and sensors are connected to the central data collection center through a wired network, and the real-time captured image data and environmental data are transmitted to the central data collection center;
[0093] Image processing and recognition: After receiving the image data, the central data collection center uses the image preprocessing module to perform denoising, enhancement and segmentation on the image, and extracts the morphological, color and texture features of the insect from the processed image;
[0094] Insect population counting: Based on the extracted image features, insect recognition algorithms are used to identify insects in the image, count them, and count the changes in the number of insects in a predetermined area in real time;
[0095] Environmental data association: The identified insect population data is associated with the environmental data provided by the environmental sensors, and the relationship between the insect population changes and environmental parameters is recorded to facilitate subsequent analysis.
[0096] Morphological feature extraction:
[0097] Edge Detection: The Canny edge detection algorithm is used to extract the edges of the insects from the image.
[0098] Among them, G x and G y are the gradients of the image in the x-axis and y-axis directions respectively.
[0099] Shape features: Calculate shape features such as area, perimeter, aspect ratio, and shape moments.
[0100] Area A: The number of pixels in the area calculated by the contour after edge detection.
[0101] Perimeter P: Calculate its length by wheel sequence.
[0102] AspectRatioAR: Calculates the aspect ratio of the bounding box.
[0103] Color feature extraction:
[0104] Color Histogram: Calculate the color histogram of the insect image to describe the color distribution: Among them, H(c) is the histogram value of color c, n c is the number of pixels of color c, and N is the total number of pixels in the image.
[0105] Color Mean and Variance: Calculates the color mean and variance of an image.
[0106] Mean μ:
[0107] Variance σ 2 :
[0108] Texture feature extraction:
[0109] Gray Level Co-occurrence Matrix (GLCM): Calculates the gray level co-occurrence matrix of an image to describe the texture characteristics of the image:
[0110] Texture features: Texture features such as contrast, energy, entropy, and homogeneity are extracted from GLCM.
[0111] Contrast:
[0112] Energy:
[0113] Entropy:
[0114] Homogeneity:
[0115] The insect recognition algorithm includes feature extraction based on convolutional neural network (CNN), and then insect detection and counting based on regional convolutional neural network (R-CNN);
[0116] Convolutional Neural Network (CNN) specifically includes:
[0117] Input layer: accepts preprocessed images;
[0118] Convolutional layer: Apply multiple convolution kernels for feature extraction:
[0119] in, is the feature map of layer l, w m,n is the convolution kernel weight, σ is the activation function;
[0120] Pooling layer, applying max pooling or average pooling for dimensionality reduction:
[0121] p i,j =max m,n (f i+m,j+n );
[0122] Fully connected layer: Flatten the pooled feature map and input it into the fully connected layer for classification:
[0123] y = σ(W x + b), where W is the weight matrix, x is the input vector, and b is the bias.
[0124] The regional convolutional neural network R-CNN specifically includes:
[0125] Selective search: Generate candidate regions;
[0126] Feature extraction: Apply CNN to extract features of candidate regions;
[0127] Classifier: Identify insects using a support vector machine classifier:
[0128] Among them, α i is the Lagrange multiplier, y i is the category label, is the kernel function.
[0129] Environmental data associations specifically include:
[0130] Time series association: Record the number of insects and environmental data at each time point to form a time series:
[0131] For each time point t, a multidimensional data point D is formed t =(N t ,T t ,H t ,Pt ), where N t is the number of insects at time t, T t is the temperature, H t is humidity, P t It is the air pressure;
[0132] Correlation analysis: Calculate the correlation coefficient between insect population and environmental parameters:
[0133] Among them, E t Indicates environmental parameters (temperature, humidity or air pressure), and E are the means of insect abundance and environmental parameters, respectively.
[0134] The dynamic analysis unit specifically includes:
[0135] Obtain insect population and environmental data from population data collection units and environmental sensors;
[0136] Time series analysis: Decompose the time series data through the extended seasonal decomposition method (STL) to extract trend, seasonal and random components, analyze the long-term changes and seasonal fluctuations in insect numbers, use the Bayesian structured time series model (BSTS) to model and predict the extracted trend and seasonal components, introduce the Bayesian method, combine historical data and prior knowledge, and improve the model's predictive ability;
[0137] Spatial statistical analysis, including:
[0138] Spatiotemporal density estimation: Use spatiotemporal kernel density estimation methods to analyze the density distribution of insect populations in time and space, and identify high-density areas and migration paths;
[0139] Spatiotemporal regression model: Combine spatiotemporal data to establish a spatiotemporal regression model to analyze the changing trend of insect populations at different locations and times, provide a basis for identifying migration patterns, and be used to macroscopically analyze the distribution and migration patterns of insect populations over time in the entire region. These data are about the overall trend of insect populations and are used to understand the dynamic changes of the entire population;
[0140] Real-time feedback and early warning: Combine real-time data and analytical models to monitor and predict changes in insect populations. When abnormal conditions are detected, early warnings are issued through the result feedback module to help users take timely measures.
[0141] The extended seasonal decomposition method STL decomposes the time series and is expressed as:
[0142] N t =T t +S t +R t , where T tis the trend component, S t is the seasonal component, R t It is a random component, and Loess regression is used to smoothly extract trend and seasonal components;
[0143] The Bayesian structural time series model BSTS is used to model and predict trend and seasonal components. The model is expressed as:
[0144] N t =μ t +γ t +δ t + t , where μ t is the long-term trend component, γ t is the seasonal component, δ t is the regression component, t is the error term, and the trend component μ t The update formula is:
[0145] μ t =μ t-1 +β t-1 +η t , where β t is the trend slope, η t is the error term;
[0146] Seasonal ingredients¶ t The update formula is: Where s is the seasonal period, ω t is the error term.
[0147] The spatiotemporal kernel density estimation method analyzes the distribution density of insect populations in time and space, which is expressed as:
[0148] in, is the density estimate at position x and time t, K s and K t are the kernel functions of space and time respectively, h s and h t is the bandwidth parameter in space and time;
[0149] The spatiotemporal regression model analyzes the temporal and spatial trends of insect populations, which can be expressed as: N(x, t) = β0 + β1T(x, t) + β2H(x, t) + β3P(x, t) + u(x, t), where N(x, t) is the number of insects at position x and time t, T(x, t), H(x, t) and P(x, t) are the temperature, humidity and air pressure at position x and time t, respectively, and u(x, t) is the error term;
[0150] Real-time feedback and early warning are based on the early warning algorithm, which uses an anomaly detection model with the formula: in, is the predicted insect population, It is the standard deviation of the predicted value. If the Anomaly exceeds the preset threshold, an alert is triggered.
[0151] By integrating multi-source data, the insect population data is combined with environmental data, and then the STL method is used to decompose the time series data to extract trend, seasonal and random components. Then, the BSTS model is used to model and predict these components. After that, spatiotemporal density estimation and spatiotemporal regression analysis are performed to reveal the distribution and change trends of insect populations in time and space. Finally, through real-time feedback and early warning mechanisms, the dynamic changes of insect populations are monitored and anomalies are detected. Combining multi-source data and advanced spatiotemporal analysis methods, it can more accurately predict the changing laws of insect populations, improve the accuracy of insect identification and quantity change prediction, and provide effective support for ecological monitoring and management.
[0152] The behavior monitoring unit specifically includes:
[0153] Motion detection and tracking: The background subtraction method is used to detect the movement of insects. By analyzing the pixel changes in continuous frame images, the position and movement trajectory of insects are determined. This is used to monitor and record the specific movement behavior and trajectory of individual insects in real time. These data are about the microscopic movement of individual insects and are used to capture the interactive behavior and movement state of individual insects. They are expressed as:
[0154] in, and are the image pixel values at time t and t-1, respectively. is the image gradient, v is the motion vector;
[0155] Using the image data from multiple cameras, the three-dimensional position of the insect is reconstructed through stereo vision technology, and the depth information is calculated through the parallax between corresponding image points. The formula is:
[0156] Among them, d is the parallax, B is the camera baseline distance, f is the focal length, and z is the object depth;
[0157] Trajectory recording: The movement trajectory of each insect is recorded to generate time-position series data, including the position and movement status of the insect at each time point.
[0158] The interactive analysis unit uses improved variational autoencoder technology to analyze interactive behavior characteristics, including:
[0159] A: Clean the time-location series data recorded by the behavior monitoring unit to remove noise and outliers, ensure data quality, and extract key features from the time-location series data, including speed, acceleration, path length, and residence time features;
[0160] B: Build an improved variational autoencoder model, including:
[0161] Input data preparation: The preprocessed time-position series data is constructed into a format suitable for variational autoencoder input. Each data sample contains the movement trajectory and related features of an insect over a period of time.
[0162] Adaptive time window: Dynamically adjust the length of the input sequence so that the model can capture short-term and long-term behavioral characteristics. The specific methods are as follows:
[0163] Sliding window mechanism: Use the sliding window method to extract subsequences of different lengths from the time position series data.
[0164] Short-term window: Set a smaller window length, such as Used to capture short-term behavioral characteristics.
[0165] Long-term window: set a larger window length, such as W long , used to capture long-term behavioral characteristics.
[0166] Multi-scale feature extraction: Features extracted from short-term and long-term windows are combined to form multi-scale features.
[0167] Short-term window
[0168] Long-term window
[0169] Joint Encoding: Input sequences of different lengths are encoded using a modified variational autoencoder model and fed into the model jointly.
[0170] The features of the short-term and long-term windows are concatenated or input in parallel to form a unified input data: combined =[x s h ort ;x long ];
[0171] Encoder based on attention mechanism: The attention mechanism is introduced into the encoder part of the variational autoencoder, so that the encoder can automatically focus on the most important part of the input sequence for behavior recognition and improve the effect of feature extraction. The encoder is expressed as: Among them, x is the input data, z is the hidden variable, μ φ and is the mean and variance of the encoder network output; introduces the attention mechanism: a t =softmax(W a h t +b a ), where a t is the attention weight, h t is the hidden state, W a and b a is a trainable parameter; attention weighted output: c t =∑ t a t h t , where c t is the attention-weighted context vector;
[0172] Decoder: Decode the hidden variables back to high-dimensional data and reconstruct the original time-position sequence data. The decoder is represented as: Among them, μ θ and is the mean and variance of the decoder network output;
[0173] Loss function: Using reconstruction loss and KL divergence as loss functions, the variational autoencoder model is trained to enable it to reconstruct the input data and learn the latent variable distribution;
[0174] The reconstruction loss is expressed as:
[0175] KL divergence is expressed as:
[0176] The total loss is expressed as: G = G recon +G KL ;
[0177] C: Behavior classification and recognition, using the improved variational autoencoder model to map the time-position sequence data to a low-dimensional latent variable space, extract representative features from the latent variables, and define labels for different behavior patterns according to predefined insect behavior patterns, including foraging, mating, and fighting. Cluster analysis of insect behaviors is performed in the latent variable space to identify different behavior patterns and interaction types. Kmeans clustering is used, expressed as: Among them, r ik is the indicator variable that sample i belongs to cluster k, z i is the latent variable representation of sample i, μ k The center of cluster k is used to input the real-time monitored time-position sequence data into the trained variational autoencoder model to identify the interactive behaviors of insects in real time and classify them;
[0178] D: Conduct statistical analysis on the identified behaviors, calculate the frequency and duration of different behaviors, analyze the interaction patterns between insects, and analyze the long-term change trends and periodic characteristics of insect behaviors based on the statistical results. Use the reconstruction error and latent variable distribution of the variational autoencoder model to detect abnormal behaviors and provide early warning for ecological monitoring.
[0179] The improved variational autoencoder model is used to map the time-position series data to a low-dimensional latent variable space. The detailed steps for extracting key features from the latent variables are as follows:
[0180] Encoder: Input the time-position sequence data into the encoder to generate latent variable representation;
[0181] Input layer: receives time position sequence data x;
[0182] Attention mechanism: Calculate attention weights to focus on the most important parts of the sequence:
[0183] a t =softmax(W a h t +b a );
[0184] Attention weighted output: The attention weights are combined with the hidden state to form a context vector: c t =∑ t a t h t ;
[0185] Hidden variable generation: pass the context vector to the output layer of the encoder to generate the mean μ of the hidden variable φ (x) and variance
[0186] Hidden variable space mapping: The hidden variable z represents the behavior characteristics in the low-dimensional space;
[0187] Sampling: Sampling from the probability distribution of latent variables: z~q φ (z|x);
[0188] Hidden variable representation: z is a low-dimensional representation of the time position series data, which contains representative features of the behavior;
[0189] Decoder: reconstructs the time position sequence data to verify the validity of the latent variables;
[0190] Input layer: receives hidden variables Z;
[0191] Reconstructed output: The decoder generates a sequence of reconstructed time positions
[0192]
[0193] Extract representative features from latent variables: The latent variable z is used as the feature representation after dimensionality reduction to analyze the behavior pattern. Cluster analysis is performed in the latent variable space to identify different behavior patterns and interaction types.
[0194] Representative features include the following:
[0195] Behavioral pattern characteristics: describe the typical behavior patterns of insects within a specific time window, such as foraging, mating, and fighting.
[0196] Movement characteristics: including speed, acceleration, and path length, reflecting the movement state and changes of insects.
[0197] Interaction characteristics: describe the interaction between insects and other insects, such as distance, relative position, and synchronous movement.
[0198] Temporal characteristics: reflect the time period and frequency of behavior, such as diurnal changes and seasonal changes.
[0199] The frequency is calculated as: Among them, f i is the frequency of behavior i, n i is the number of times behavior i occurs, and N is the total number of behaviors;
[0200] Duration is calculated as: Among them, t i is the total duration of behavior i, t j,start and t j,end are the start and end time of the jth occurrence of behavior i, respectively;
[0201] Based on the statistical results, analyze the long-term trend and periodic characteristics of insect behavior;
[0202] The reconstruction error is expressed as: Among them, e i is the reconstruction error of sample i, x i is the original data, For latent variable distribution anomaly detection:
[0203] The probability distribution of latent variables is used to detect anomalies. By calculating the probability density of latent variables, if it is lower than the preset threshold, it is considered an anomaly, p(z) <threshold;
[0204] The probability density of the latent variable is calculated using the generative model of the variational autoencoder (VAE). In the VAE, the latent variable z follows the multivariate normal distribution N(z; μ, σ 2 ), and its probability density calculation formula is:
[0205] Where: z is the latent variable vector, μ is the mean vector of the latent variable, Σ is the covariance matrix of the latent variable (for independent latent variables, it is usually a diagonal matrix with each element being σ 2 ), k is the dimension of latent variables;
[0206] In actual operation, the covariance matrix of the latent variables is assumed to be diagonal, which can be simplified to: where z i is the i-th component of the latent variable z, μ i is the i-th component of the mean, σ i is the i-th component of the standard deviation;
[0207] By calculating the probability density p(z) of the latent variable z, if the density value is lower than the preset threshold, it is considered to be abnormal. The specific steps are as follows:
[0208] 1. Get the mean and standard deviation of the latent variables: Output the mean μ and standard deviation σ of the latent variables from the encoder part of the VAE.
[0209] 2. Calculate the probability density of latent variables: Use the above formula to calculate the probability density of latent variables.
[0210] 3. Anomaly detection: Compare the calculated probability density with the threshold to determine whether it is an anomaly.
[0211] Through the above detailed scheme and specific calculations, the improved VAE model can be more suitable for the analysis of insect interactive behavior characteristics, improve the accuracy and robustness of recognition, and provide strong support for insect population dynamics monitoring and ecological research.
[0212] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present invention is limited to these examples. Under the concept of the present invention, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity.
Claims
1. A flying insect recognition system based on image analysis, characterized in that: include: The insect population dynamics monitoring module is used to monitor the number changes and migration patterns of insect populations. The insect population dynamics monitoring module includes: The population data collection unit monitors the changes in the number of insect populations in a predetermined area through multiple cameras and sensor networks; The dynamic analysis unit analyzes the migration patterns and quantity trends of insect populations through time series analysis and spatial statistical methods; The insect interaction behavior analysis module is used to analyze the interaction behavior between insects. The insect interaction behavior analysis module includes: Behavioral monitoring units, which use video equipment and motion capture technology to record the interactive behaviors of insects; An interaction analysis unit, which analyzes interactive behavior characteristics through an improved variational autoencoder technology, wherein the improved variational autoencoder technology introduces an adaptive time window and an attention mechanism; The data storage module is connected to the insect population dynamics monitoring module and the insect interactive behavior analysis module, and is used to store monitoring and analysis results.
2. The flying insect identification system based on image analysis according to claim 1, characterized in that: The population data collection unit monitors the changes in the number of insect populations in a predetermined area through the following schemes: Arrangement of multiple cameras: Arrange multiple cameras in the predetermined area, each of which can capture high-resolution images of insects in real time to ensure full coverage of the predetermined monitoring area; Integration of sensor networks: Multiple environmental sensors, including temperature sensors, humidity sensors, and air pressure sensors, are deployed in a predetermined area to monitor environmental parameters in real time and provide auxiliary information; Data collection and transmission: The camera equipment and sensors are connected to the central data collection center through a wired network to transmit the real-time captured image data and environmental data to the central data collection center; Image processing and recognition: After receiving the image data, the central data collection center uses the image preprocessing module to perform denoising, enhancement and segmentation on the image, and extracts the morphological, color and texture features of the insect from the processed image; Insect population counting: Based on the extracted image features, insect recognition algorithms are used to identify insects in the image, count them, and count the changes in the number of insects in a predetermined area in real time; Environmental data association: The identified insect population data is associated with the environmental data provided by the environmental sensors, and the relationship between the insect population changes and environmental parameters is recorded to facilitate subsequent analysis.
3. The flying insect identification system based on image analysis according to claim 2, characterized in that: The insect recognition algorithm includes feature extraction based on a convolutional neural network (CNN), and then insect detection and counting based on a regional convolutional neural network (R-CNN); The regional convolutional neural network R-CNN specifically includes: Selective search: Generate candidate regions; Feature extraction: Apply CNN to extract features of candidate regions; Classifier: Identify insects using a support vector machine classifier: Among them, α i is the Lagrange multiplier, y i is the category label, is the kernel function.
4. The flying insect identification system based on image analysis according to claim 2, characterized in that: The environmental data association specifically includes: Time series association: Record the number of insects and environmental data at each time point to form a time series: For each time point t, a multidimensional data point D is formed t =(N t ,T t ,H t ,P t ), where N t is the number of insects at time t, T t is the temperature, H t is humidity, P t It is the air pressure; Correlation analysis: Calculate the correlation coefficient between insect population and environmental parameters: Among them, E t represents environmental parameters, N and E are the means of insect numbers and environmental parameters, respectively.
5. The flying insect identification system based on image analysis according to claim 4, characterized in that: The dynamic analysis unit specifically includes: Obtain insect population and environmental data from population data collection units and environmental sensors; Time series analysis: Decompose the time series data through the extended seasonal decomposition method (STL) to extract trend, seasonal and random components, analyze the long-term changes and seasonal fluctuations in insect numbers, use the Bayesian structured time series model (BSTS) to model and predict the extracted trend and seasonal components, introduce the Bayesian method, combine historical data and prior knowledge, and improve the model's predictive ability; Spatial statistical analysis, including: Spatiotemporal density estimation: Use spatiotemporal kernel density estimation methods to analyze the density distribution of insect populations in time and space, and identify high-density areas and migration paths; Spatiotemporal regression model: Combine spatiotemporal data to establish a spatiotemporal regression model to analyze the changing trends of insect populations at different locations and times, providing a basis for identifying migration patterns; Real-time feedback and early warning: Combine real-time data and analytical models to monitor and predict changes in insect populations. When abnormal conditions are detected, early warnings are issued through the result feedback module to help users take timely measures.
6. The flying insect identification system based on image analysis according to claim 5, characterized in that: The extended seasonal decomposition method STL decomposes the time series, which is expressed as: N t =T t +S t +R t , where T t is the trend component, S t is the seasonal component, R t It is a random component, and Loess regression is used to smoothly extract trend and seasonal components; The Bayesian structural time series model BSTS is used to model and predict trend and seasonal components. The model is expressed as: N t =μ t +γ t +δ t + t , where μ t is the long-term trend component, γ t is the seasonal component, δ t is the regression component, t is the error term, and the trend component μ t The update formula is: μ t =μ t-1 +β t-1 +η t , where β t is the trend slope, η t is the error term; Seasonal ingredients¶ t The update formula is: Where s is the seasonal period, ω t is the error term.
7. The flying insect identification system based on image analysis according to claim 6, characterized in that: The spatiotemporal kernel density estimation method analyzes the distribution density of insect populations in time and space, which is expressed as: in, is the density estimate at position x and time t, K s and K t are the kernel functions of space and time respectively, h s and h t is the bandwidth parameter in space and time; The spatiotemporal regression model analyzes the temporal and spatial variation trend of insect populations, which is expressed as: N(x, t) = β0 + β1T(x, t) + β2H(x, t) + β3P(x, t) + u(x, t), where N(x, t) is the number of insects at position x and time t, T(x, t), H(x, t) and P(x, t) are the temperature, humidity and air pressure at position x and time t, respectively, and u(x, t) is the error term; The real-time feedback and early warning are based on the early warning algorithm, which adopts the anomaly detection model with the formula: in, is the predicted insect population, It is the standard deviation of the predicted value. If the Anomaly exceeds the preset threshold, an alert is triggered.
8. The flying insect identification system based on image analysis according to claim 2, characterized in that: The behavior monitoring unit specifically includes: Motion detection and tracking: The background subtraction method is used to detect the movement of insects. The position and movement trajectory of insects are determined by analyzing the pixel changes in consecutive frame images, which can be expressed as: in, and are the image pixel values at time t and t-1, respectively. is the image gradient, v is the motion vector; Using the image data from multiple cameras, the three-dimensional position of the insect is reconstructed through stereo vision technology, and the depth information is calculated through the parallax between corresponding image points. The formula is: Among them, d is the parallax, B is the camera baseline distance, f is the focal length, and z is the object depth; Trajectory recording: The movement trajectory of each insect is recorded to generate time-position series data, including the position and movement status of the insect at each time point.
9. The flying insect identification system based on image analysis according to claim 8, characterized in that: The interaction analysis unit uses the improved variational autoencoder technology to analyze the interaction behavior characteristics, specifically including: A: Clean the time-location series data recorded by the behavior monitoring unit to remove noise and outliers, ensure data quality, and extract key features from the time-location series data, including speed, acceleration, path length, and residence time features; B: Build an improved variational autoencoder model, including: Input data preparation: The preprocessed time-position series data is constructed into a format suitable for variational autoencoder input. Each data sample contains the movement trajectory and related features of an insect over a period of time. Adaptive time window: dynamically adjust the length of the input sequence to enable the model to capture short-term and long-term behavioral characteristics; Encoder based on attention mechanism: The attention mechanism is introduced into the encoder part of the variational autoencoder, so that the encoder can automatically focus on the most important part of the input sequence for behavior recognition, improving the effect of feature extraction. The encoder is expressed as: Among them, x is the input data, z is the hidden variable, μ φ and is the mean and variance of the encoder network output; introduces the attention mechanism: a t =softmax(W a h t +b a ), where a t is the attention weight, h t is the hidden state, W a and b a is a trainable parameter; attention weighted output: c t =∑ t a t h t , where c t is the attention-weighted context vector; Decoder: Decode the latent variables back to high-dimensional data and reconstruct the original time-position sequence data. The decoder is expressed as: Among them, μ θ and is the mean and variance of the decoder network output; Loss function: Using reconstruction loss and KL divergence as loss functions, the variational autoencoder model is trained to enable it to reconstruct the input data and learn the latent variable distribution; C: Behavior classification and recognition: Use the improved variational autoencoder model to map the time-position sequence data to a low-dimensional latent variable space, extract representative features from the latent variables, and label different behavior patterns according to predefined insect behavior patterns, including foraging, mating, and fighting. Perform cluster analysis on insect behaviors in the latent variable space to identify different behavior patterns and interaction types. Input the real-time monitored time-position sequence data into the trained variational autoencoder model to identify and classify insect interaction behaviors in real time. D: Conduct statistical analysis on the identified behaviors, calculate the frequency and duration of different behaviors, analyze the interaction patterns between insects, and analyze the long-term change trends and periodic characteristics of insect behaviors based on the statistical results. Use the reconstruction error and latent variable distribution of the variational autoencoder model to detect abnormal behaviors and provide early warning for ecological monitoring.
10. The flying insect identification system based on image analysis according to claim 9, characterized in that: The frequency is calculated as: Among them, f i is the frequency of behavior i, n i is the number of times behavior i occurs, and N is the total number of behaviors; The duration is calculated as: Among them, t i is the total duration of behavior i, t j,start and t j,end are the start and end time of the jth occurrence of behavior i, respectively; Based on the statistical results, analyze the long-term trend and periodic characteristics of insect behavior; The reconstruction error is expressed as: Among them, e i is the reconstruction error of sample i, x i is the original data, For latent variable distribution anomaly detection: The probability distribution of latent variables is used to detect anomalies. The probability density of latent variables is calculated. If it is lower than the preset threshold, it is considered an anomaly.
Citation Information
Cited By
Intelligent blood sucking insect monitoring device
CN120615881A
Lightweight disease and pest early warning and capturing system
CN120615888A