An agricultural and forest area anomaly identification method and system based on image recognition
By combining deep neural networks and multi-scale spatial neighborhood analysis with a bidirectional long short-term memory network based on attention mechanisms, the spatial correlation problem in the identification of anomalies in agricultural and forestry areas in existing technologies has been solved, achieving high-accuracy detection and anti-interference capabilities for anomalies in agricultural and forestry areas.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHAANXI GUANJING INFORMATION TECH CO LTD
- Filing Date
- 2026-07-01
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies for identifying anomalies in agricultural and forestry areas struggle to establish spatial relationships between anomalous regions, cannot distinguish between noise spots and genuine diffuse anomalies, and are susceptible to interference from changes in lighting and image noise, resulting in insufficient detection accuracy and anti-interference capabilities.
An initial anomaly detection is performed using a multilayer perceptron structure based on a deep neural network. A multi-scale spatial neighborhood analysis window is constructed to obtain the distribution and texture features of pixels. The propagation characteristics are quantitatively analyzed through context feature vectors. A bidirectional long short-term memory network with an attention mechanism is used for comprehensive scoring, and the anomaly judgment result is output.
It enables comprehensive perception of anomalies in agricultural and forestry areas, improves the accuracy of anomaly detection, effectively distinguishes between occasional small spots and true diffusion anomalies, reduces interference from image noise and lighting changes, and enhances the anti-interference capability of detection.
Smart Images

Figure CN122493301A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image recognition technology, specifically a method and system for identifying anomalies in agricultural and forestry areas based on image recognition. Background Technology
[0002] Anomaly identification in agricultural and forestry areas is a key technology for ensuring safe production in the agricultural and forestry industries and preventing the spread of forest disasters. Visual recognition technology based on visible light and multispectral images has the advantages of being non-contact, wide-range, and fast-responding, and has become the mainstream technical means for routine monitoring of agricultural and forestry environments and screening for anomalies and hidden dangers. Existing image recognition technologies mostly use models such as convolutional neural networks or support vector machines to perform pixel-level binary classification or patch-level segmentation on visible light and multispectral images, extracting features such as vegetation indices, textures, and edges to identify anomalies such as dead trees, disease spots, and fire spots. Existing agricultural and forestry anomaly identification technologies are mainly divided into two categories: pixel-level binary classification detection and patch-level segmentation classification detection. By performing feature analysis and anomaly determination on independent judgment units of images, preliminary screening of potential anomalies in agricultural and forestry areas can be achieved, which can meet the basic anomaly identification needs of agricultural and forestry monitoring scenarios. Existing identification methods use single pixels or patches as independent analysis units, ignoring the inherent spatial propagation characteristics of agricultural and forestry anomalies from point to area and gradient diffusion. It is difficult to establish spatial correlations between anomaly areas, and it is also difficult to distinguish between noise spots and real diffusion-type anomalies. They are easily affected by changes in lighting and image noise, resulting in false detection problems, and the detection accuracy and anti-interference ability are poor. To address this, the present invention provides an agricultural and forestry anomaly identification method and system based on image recognition. Summary of the Invention
[0003] In order to overcome the shortcomings of the prior art, at least one technical problem raised in the background art is solved.
[0004] The technical solution adopted by this invention to solve its technical problem is: an image recognition-based anomaly identification method for agricultural and forestry areas, comprising the following steps: Step 1: Acquire the image data of the agricultural and forestry area to be detected, calculate the pixels in the agricultural and forestry area image data based on the preset anomaly detection model, output the initial anomaly probability map, and mark the set of anomaly candidate points in the initial anomaly probability map according to the preset probability threshold. Step 2: Construct a spatial neighborhood analysis window to obtain the distribution features, texture features, and spectral gradient features of pixels within the spatial neighborhood, forming a context feature vector; Step 3: Quantitatively analyze the propagation characteristics based on the context feature vector, calculate the probability gradient direction and gradient strength in the spatial neighborhood, identify the spatial diffusion pattern of abnormal distribution, and calculate the abnormal propagation tendency index based on the spatial diffusion pattern. Step 4: Fuse the anomaly propagation tendency index with the context feature vector, use the context-enhanced judgment model to comprehensively score the anomaly candidate points, output the anomaly judgment result based on the comprehensive score, and mark the spatial location and anomaly type of the anomaly region.
[0005] Preferably, in step one, the initial anomaly detection model adopts a multilayer perceptron structure based on a deep neural network. The model input is the multiple spectral channel features of the pixel, and the output is the anomaly probability value of the pixel.
[0006] Preferably, in step two, the spatial neighborhood analysis window includes a first-scale window, a second-scale window, and a third-scale window. The features extracted within each scale window include the mean, standard deviation, entropy value, and covariance matrix features between spectral channels of the neighborhood pixel anomaly probability.
[0007] Preferably, in step three, the spatial diffusion patterns of the abnormal distribution include a central diffusion pattern, an edge diffusion pattern, and a random distribution pattern.
[0008] Preferably, in step four, the context-enhanced judgment model adopts a bidirectional long short-term memory network structure based on the attention mechanism. The model input includes the original spectral features of the abnormal candidate points, the spatial context feature vector, and the quantification results of the propagation characteristics. The model is judged to be a true abnormality if the comprehensive score is not less than a preset threshold.
[0009] An image recognition-based anomaly identification system for agricultural and forestry areas includes: The image acquisition module acquires image data of the agricultural and forestry area to be detected, calculates the anomaly probability of each pixel in the image based on the preset initial anomaly detection model, outputs an initial anomaly probability map, and marks a set of anomaly candidate points in the initial anomaly probability map as the triggering condition for subsequent processing through a preset probability threshold. The anomaly candidate extraction module performs spatial context quantization on each anomaly candidate point based on the anomaly probability distribution characteristics, texture features, and spectral gradient features of pixels in the multi-scale spatial neighborhood, and determines whether it meets the preset multi-scale spatial context feature conditions. The spatial context construction module calculates the probability gradient direction and gradient intensity of the abnormal candidate points in the spatial neighborhood, identifies their spatial diffusion patterns, calculates the propagation tendency index based on the diffusion patterns, and determines whether the conditions for quantitative analysis of propagation characteristics are met. The propagation characteristic analysis module performs a comprehensive scoring algorithm on anomaly candidate points based on the fusion of propagation characteristic quantification results and context feature vectors. It outputs the final anomaly determination result through a preset context-enhanced judgment model, including the spatial location coordinates of the anomaly area, the anomaly type classification result, and the propagation risk level assessment.
[0010] Preferably, the acquired agricultural and forestry area image data includes visible light images or multispectral images, with a visible light camera acquiring RGB three-channel images and a multispectral imaging device acquiring image data from at least five spectral channels.
[0011] Preferably, a feature compression algorithm based on principal component analysis is used to compress high-dimensional feature vectors extracted in the multi-scale spatial neighborhood into a compact feature representation of a preset dimension.
[0012] Preferably, the system further includes a spatial propagation trend prediction unit, which predicts the future propagation direction, propagation speed and impact range of the anomaly based on historical time-series image data.
[0013] Preferably, the system also includes an anomaly visualization output unit, which overlays the judgment results onto the original agricultural and forestry area image, uses different color markers to distinguish the anomaly type and the level of propagation risk, and exports the vector boundary data of the anomaly area.
[0014] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention provides an image recognition-based method and system for identifying anomalies in agricultural and forestry areas. By introducing a multi-scale spatial context construction mechanism, it achieves comprehensive perception of the surrounding environment of anomaly candidate points. The system acquires the anomaly probability distribution features, texture features, and spectral gradient features of pixels in the spatial neighborhood at each scale, forming a high-dimensional context feature vector. This effectively solves the technical defect of the existing technology where a single judgment unit ignores regional context information, and improves the accuracy of anomaly detection.
[0015] 2. The present invention provides an image recognition-based method and system for identifying anomalies in agricultural and forestry areas. Through a quantitative analysis step of propagation characteristics, the system effectively captures the spatial propagation characteristics of agricultural and forestry anomalies. The system identifies spatial diffusion patterns such as center diffusion pattern, edge diffusion pattern, and random distribution pattern by calculating the probability gradient direction and gradient intensity of anomaly candidate points. Based on the spatial diffusion pattern, the system calculates the propagation tendency index, effectively solving the technical problem that existing technologies cannot distinguish between occasional small spots and anomalies in true diffusion.
[0016] 3. The present invention provides an image recognition-based method and system for identifying anomalies in agricultural and forestry areas. Through a context-enhanced anomaly determination step, the system achieves comprehensive optimization of the anomaly determination results. The system integrates the quantitative analysis results of propagation characteristics with spatial context features and performs comprehensive scoring through a bidirectional long short-term memory network with an attention mechanism, effectively reducing the interference of factors such as image noise and local illumination changes on anomaly determination. Attached Figure Description
[0017] The invention will now be further described with reference to the accompanying drawings.
[0018] Figure 1 This is a structural block diagram of an agricultural and forestry area anomaly identification system based on image recognition, as described in this invention. Figure 2 This is a flowchart of an image recognition-based method for identifying anomalies in agricultural and forestry areas, as described in this invention. Detailed Implementation
[0019] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.
[0020] Example 1: This embodiment uses a pine wilt disease monitoring project of a provincial forestry bureau as a specific application scenario to describe in detail the specific implementation of an image recognition-based method and system for identifying anomalies in agricultural and forestry areas provided by this invention.
[0021] like Figure 1 As shown in the figure, an image recognition-based anomaly identification system for agricultural and forestry areas provided in this application includes an image acquisition module, an anomaly candidate extraction module, a spatial context construction module, a propagation characteristic analysis module, and a comprehensive judgment module.
[0022] The image acquisition module is used to acquire image data of the agricultural and forestry area to be detected; The anomaly candidate extraction module is used to perform the action of calculating the anomaly probability of pixels in the image and marking the set of anomaly candidate points based on a preset initial anomaly detection model; The spatial context construction module is used to perform the action of constructing a multi-scale spatial neighborhood analysis window centered on anomaly candidate points and forming a context feature vector; The propagation characteristics analysis module is used to perform actions such as calculating the direction and intensity of the probability gradient and calculating the abnormal propagation tendency index; The comprehensive judgment module is used to perform the action of fusing the results of the quantitative analysis of propagation characteristics with spatial context features and outputting the final anomaly judgment result.
[0023] In terms of system architecture, the agricultural and forestry anomaly identification system is deployed at the forest resource monitoring center of a provincial forestry bureau. The system consists of three parts: a data acquisition subsystem, a data processing subsystem, and a result display subsystem. The data acquisition subsystem includes an image acquisition module, which acquires the required data through visible light cameras and multispectral imaging devices deployed in the monitoring area. The visible light cameras are configured to acquire RGB three-channel images, and the multispectral imaging devices are configured to acquire image data from at least 5 spectral channels, with the wavelength range of each spectral channel covering the visible light to near-infrared band. The data processing subsystem is deployed on the server cluster of the monitoring center, including an anomaly candidate extraction module, a spatial context construction module, a propagation characteristic analysis module, and a comprehensive judgment module. The modules communicate with each other via gigabit Ethernet. The results show that the subsystem includes a large-screen display device in the monitoring center and a geographic information system workstation, which are used to display the anomaly identification results in real time.
[0024] The image acquisition module is set up at the monitoring points in the agricultural and forestry area. This module acquires monitoring images of the agricultural and forestry area through a visible light camera or a multispectral imaging device and stores the image data in a preset image buffer. The image acquisition module's acquisition frequency is set to once a day according to actual monitoring needs, and can be adjusted to twice a day during peak pest and disease seasons. The image data acquired by this module is transmitted to the anomaly candidate extraction module of the data processing subsystem through the data communication network for subsequent processing. When transmitting image data, the image acquisition module performs preprocessing operations on the image, including image format standardization, radiometric correction, and geometric correction, to ensure that the image data transmitted to subsequent modules meets the preset quality standards. For example, the quality standards can be specifically set as follows: the root mean square error between the surface reflectance of each band after radiometric correction and the synchronously measured ground object spectrum is less than 5%; the geometric correction ensures that the plane error of the image registered with the 1:10,000 digital elevation model is less than 2 pixels; the image signal-to-noise ratio is not less than 40dB in the near-infrared band and not less than 30dB in the visible light band; the format is uniformly 16-bit GeoTIFF, and it must meet the requirements of no bad lines, no strip noise, histogram effective gray level coverage of more than 95% of the full dynamic range, and gray level difference in the overlapping area between adjacent frames not exceeding 3 DN values. This indicator quantifies the consistency of radiometrics, geometry, noise, and format, ensuring the reliability and comparability of subsequent feature extraction and analysis results.
[0025] The anomaly candidate extraction module integrates an initial anomaly detection model, which adopts a multilayer perceptron structure based on a deep neural network. The model input is the multiple spectral channel features of a pixel, and the output is the anomaly probability value of that pixel. After receiving the image data transmitted by the image acquisition module, this module calculates the anomaly probability for each pixel in the image. This MLP contains three fully connected hidden layers with 64, 32, and 16 neurons respectively. Each layer is followed by batch normalization and ReLU activation, and the output layer is mapped to [0,1] via Sigmoid. Before inference, the input features are Z-score standardized, meaning that the mean and standard deviation are derived from the training set statistics. The weights are initialized using Xavier, and training uses cross-entropy as the loss and Adam optimizer to iterate until convergence. This structure has moderate complexity, and the pixel-by-pixel forward computation only involves matrix multiplication and addition and activation operations, resulting in high parallel efficiency. Furthermore, batch normalization can suppress the covariate shift caused by differences in spectral magnitudes, ensuring that the probability output is stable and easily reproducible under monitoring at different time periods.
[0026] The module decomposes the input image into multiple spectral channels. For RGB images, it decomposes them into three channels: red, green, and blue. For multispectral images, it decomposes them into at least five spectral channels. The module extracts the spectral channel feature values of the corresponding position of each pixel to form a multidimensional spectral feature vector of the pixel; the multidimensional spectral feature vector is used as the input of the initial anomaly detection model, and the model performs feature learning and anomaly probability calculation through the hidden layer of the multilayer perceptron structure, and finally outputs the anomaly probability value of the pixel. Feature learning is completed layer by layer. The first layer maps the d-dimensional input to 64-dimensional, and captures the nonlinear interaction between spectra through ReLU. The next two layers are compressed to 32-dimensional and 16-dimensional respectively to extract a deep discriminative representation of vegetation stress. The probability calculation is to linearly weight the 16-dimensional features of the last layer and then pass them through Sigmoid to obtain the probability value. Logically, normal pixel spectra follow a stable statistical distribution, while abnormalities such as disease and death will cause a sharp drop in near-infrared reflectance and red edge shift. These deviations form significant embedding differences after multi-layer nonlinear projection. Finally, the probability value quantifies the credibility of the pixel deviating from the normal state, which has clear physical and statistical basis. After processing all pixels in the image one by one, the module generates an initial anomaly probability map at the pixel level. The module marks a set of anomaly candidate points in the initial anomaly probability map according to a preset probability threshold of 0.5. When the anomaly probability value of a pixel is greater than or equal to 0.5, the pixel is marked as an anomaly candidate point. This module transmits the set of anomaly candidate points and their corresponding spatial coordinate information to the spatial context construction module for further processing.
[0027] like Figure 2 As shown, the present invention provides an anomaly identification method for agricultural and forestry areas based on image recognition. This method includes the following steps: In the specific execution of step one, the system first acquires image data of the agricultural and forestry area to be detected through the image acquisition module; the image data includes visible light images or multispectral images. The system acquires RGB three-channel images through a visible light camera, or acquires image data of at least 5 spectral channels through a multispectral imaging device. The acquired image data is transmitted to the anomaly candidate extraction module; The anomaly candidate extraction module calculates the anomaly probability of pixels in the image based on a preset initial anomaly detection model. This initial anomaly detection model adopts a multilayer perceptron structure based on a deep neural network. The model input is the multiple spectral channel features of the pixel, and the output is the anomaly probability value of the pixel. The anomaly candidate extraction module calculates the anomaly probability value for each pixel in the image one by one, and generates an initial anomaly probability map at the pixel level. This module marks pixels with anomaly probability values greater than or equal to 0.5 in the initial anomaly probability map based on a preset probability threshold of 0.5, forming a set of anomaly candidate points; This module transmits the set of anomaly candidate points and their corresponding spatial coordinate information to the spatial context construction module.
[0028] The spatial context construction module is configured to build a multi-scale spatial neighborhood analysis window for each anomaly candidate point. This module obtains the anomaly probability distribution features, texture features and spectral gradient features of pixels in the spatial neighborhood at each scale, and forms a context feature vector that characterizes the environment of the area surrounding the anomaly candidate point through feature fusion processing. The multi-scale spatial neighborhood analysis window in the spatial context construction module includes a first-scale window, a second-scale window, and a third-scale window. The radius of the first-scale window is 1 pixel, the radius of the second-scale window is 3 pixels, and the radius of the third-scale window is 5 pixels. The features extracted within each scale window include the mean, standard deviation, entropy value, and covariance matrix features between spectral channels of the anomalous probability of neighboring pixels. This module employs a feature compression algorithm based on principal component analysis to compress high-dimensional feature vectors extracted from multi-scale spatial neighborhoods into a compact 64-dimensional feature representation, retaining no less than 90% of the original feature variance information during the feature compression process; this module then transmits the context feature vectors to the propagation characteristic analysis module. The feature compression algorithm of principal component analysis includes: mean centering of the high-dimensional feature vector set extracted from each outlier candidate point to make the mean of each feature dimension zero; calculating the covariance matrix among all features and performing eigenvalue decomposition on the covariance matrix to obtain all eigenvalues and their corresponding eigenvectors; sorting the eigenvalues from largest to smallest and accumulating the proportion of each eigenvalue in turn, selecting the top principal components whose cumulative contribution rate first reaches 90% or more, and taking the eigenvectors corresponding to these principal components to form a projection transformation matrix; multiplying each original centered eigenvector with the projection matrix to obtain the dimensionality-reduced 64-dimensional compact feature representation, completing the high-dimensional to low-dimensional compression mapping while retaining the main variance information of the original data.
[0029] In the specific execution of step two, the system constructs a multi-scale spatial neighborhood analysis window centered on the anomaly candidate points; the spatial neighborhood analysis window constructed by the system includes three scale levels: The first scale window is centered on the anomaly candidate point, and its radius covers the central pixel and its eight directly adjacent pixels; the second scale window is centered on the anomaly candidate point, and its radius covers all pixels within a distance of the central pixel and its three surrounding pixels; the third scale window is centered on the anomaly candidate point, and its radius covers all pixels within a distance of the central pixel and its five surrounding pixels. The system acquires the anomaly probability distribution characteristics of pixels in the spatial neighborhood at each scale; For the first scale window, the system calculates the mean, standard deviation, and entropy of the anomaly probability for 9 pixels; for the second scale window, the system calculates the mean, standard deviation, and entropy of the anomaly probability for all pixels within a radius of 3; for the third scale window, the system calculates the mean, standard deviation, and entropy of the anomaly probability for all pixels within a radius of 5; the system acquires the texture features of pixels in the spatial neighborhood of each scale, which are calculated using the gray-level co-occurrence matrix algorithm and include four statistics: contrast, correlation, energy, and uniformity. The gray-level co-occurrence matrix algorithm is a classic method for image texture analysis. This algorithm generates a co-occurrence matrix by statistically analyzing the probability of two pixels with specific spatial distances and orientations, such as 0°, 45°, 90°, and 135°, appearing together in an image. It then extracts statistical quantities such as contrast, correlation, energy, and uniformity as texture features from the matrix. The system acquires the spectral gradient features of pixels in the spatial neighborhood at each scale. These features are obtained by calculating the gradient of the change in spectral channel values between adjacent pixels, reflecting the spectral variation trend of pixels in space. The system concatenates and combines the anomaly probability distribution features, texture features, and spectral gradient features extracted from windows at various scales to form a high-dimensional context feature vector; The high-dimensional feature vector is compressed into a compact 64-dimensional feature representation using a feature compression algorithm based on principal component analysis. This compression process retains no less than 90% of the original feature variance information. The system then forms a context feature vector that characterizes the environment around the anomaly candidate point and transmits this context feature vector to the propagation characteristic analysis module.
[0030] The propagation characteristics analysis module is configured to perform quantitative analysis of anomaly propagation characteristics based on multi-scale spatial context features. This module calculates the probability gradient direction and gradient intensity of anomaly candidate points, identifies the spatial diffusion pattern of anomaly distribution, and calculates the anomaly propagation tendency index based on the spatial diffusion pattern. In the propagation characteristic analysis module, the direction of the probability gradient is determined by calculating the directional derivative of the anomaly probability of the pixels around the anomaly candidate point, and the gradient intensity is determined by the magnitude of the directional derivative. Specifically, a 3×3 neighborhood is taken around the candidate point. The anomaly probability values of each pixel in this neighborhood are convolved using horizontal and vertical difference operators to obtain the rate of change in the horizontal and vertical directions. The horizontal rate of change reflects the rate of change of the anomaly probability in the left-right direction, and the vertical rate of change reflects the rate of change in the up-down direction. The horizontal and vertical rates of change are squared, summed, and then squared to obtain the gradient strength, which represents the maximum spatial variation of the anomaly probability at that point. Based on the relative magnitude and sign of the horizontal and vertical rates of change, the gradient direction is determined, which represents the azimuth angle at which the anomaly probability increases the fastest. The gradient strength and direction angle of the candidate point are output for subsequent diffusion mode determination.
[0031] The propagation tendency index is calculated based on the spatial diffusion pattern: Gradient direction histograms are plotted in eight fan-shaped regions surrounding the candidate point, and the mean gradient intensity is calculated radially as a function of distance. If the direction histogram is concentrated outwards and the intensity decreases with increasing radius, it is considered central diffusion, and the index is assigned 0.9. If the direction points towards the center and the intensity increases with increasing radius, it is considered peripheral diffusion, and the index is assigned 0.6. If the direction distribution is uniform and the intensity does not change significantly, it is considered random, and the index is assigned 0.2. If the direction is concentrated and the intensity increases along a certain direction, it is considered directional diffusion, and the index is assigned 0.7. The index ranges from 0 to 1; the higher the value, the stronger the propagation tendency. The specific process for determining the directional derivative and magnitude is as follows: Taking the candidate point as the center, two symmetrical points one pixel away from the center are selected in each of the four main directions of 0°, 45°, 90°, and 135°. The difference in anomaly probability in each direction is calculated and divided by 2 to obtain four approximate values of the directional derivative. The absolute values are compared, and the largest one is taken as the gradient intensity magnitude, and its corresponding direction is the probability gradient direction. If more precision is required, more directions can be interpolated, but the largest magnitude is still taken. This magnitude represents the maximum spatial rate of change of the anomaly probability at that point, and the direction indicates the fastest rising or falling direction, which is used for subsequent propagation analysis. The spatial diffusion patterns of abnormal distributions include central diffusion, peripheral diffusion, and random distribution. For the central diffusion pattern, the system determines that the anomaly exhibits a gradient decreasing characteristic from the center outwards, and the propagation tendency index is assigned a high value. For the peripheral diffusion pattern, the system determines that the anomaly exhibits a gradient increasing characteristic from the outside inwards, and the propagation tendency index is assigned a medium value. For the random distribution pattern, the system determines that the anomaly does not exhibit obvious spatial propagation characteristics, and the propagation tendency index is assigned a low value. The propagation characteristics analysis module also includes a spatial propagation trend prediction unit. This unit predicts the future propagation direction, propagation speed and impact range of anomalies based on historical time-series image data. The prediction time span is set from 1 day to 7 days according to actual monitoring needs. This module transmits the propagation characteristic quantification results and context feature vectors to the comprehensive judgment module.
[0032] In the specific execution of step three, the system performs quantitative analysis of anomaly propagation characteristics based on multi-scale spatial context features; the system calculates the probability gradient direction and gradient intensity of anomaly candidate points in the spatial neighborhood; The system uses anomaly candidate points as the center, determines their position coordinates on the anomaly probability map, and then calculates the partial derivative of the anomaly probability at that position in the two-dimensional spatial plane. The system calculates the partial derivative of the anomaly probability in the X direction by subtracting the anomaly probability of the neighboring pixel to the right from the anomaly candidate point from the anomaly probability of the neighboring pixel to the left, and then dividing by twice the pixel spacing. It also calculates the partial derivative of the anomaly probability in the Y direction by subtracting the anomaly probability of the neighboring pixel below the anomaly candidate point from the anomaly probability of the neighboring pixel above the anomaly candidate point, and then dividing by twice the pixel spacing. The system uses the partial derivatives in the X and Y directions to form a gradient vector, the direction of which is the probability gradient direction, and the magnitude of which is the gradient strength. The system identifies the spatial diffusion pattern of abnormal distributions based on the direction and intensity of the probability gradient. The system first analyzes the abnormal probability distribution pattern of the pixels around the abnormal candidate point to determine whether it belongs to the central diffusion pattern, the edge diffusion pattern, or the random distribution pattern. The center diffusion pattern is characterized by an anomaly probability value at the anomaly candidate point being higher than that of the surrounding pixels, and exhibiting a gradient decreasing characteristic from the center to the edge; the edge diffusion pattern is characterized by an anomaly probability value at the anomaly candidate point being lower than that of the surrounding pixels, and exhibiting a gradient increasing characteristic from the outside to the inside. The random distribution pattern is characterized by the absence of obvious spatial gradient features in the probability distribution of pixels around the anomalous candidate point, exhibiting a random distribution shape. The system calculates an abnormal propagation tendency index based on the identified spatial diffusion patterns; The propagation tendency index calculation includes: systematically calculating the abnormal probability values of each pixel in the eight neighborhoods of the candidate point, calculating the difference Δ between the probability of the center pixel and the neighborhood mean; taking the probability values of three radial positions along the gradient direction, at a distance of 1, 3, and 5 pixels from the center, and calculating their linear regression slope k; then calculating the entropy value E of the gradient direction histogram to reflect the directional concentration. If Δ > 0.15, k < -0.05, and E < 1.5, it is determined to be central diffusion, and the exponent is assigned 0.9; If Δ < -0.15 and k > 0.05 and E < 1.5, it is determined to be marginal diffusion, and the exponent is assigned 0.6; if E ≥ 1.5 or |k| ≤ 0.02, it is determined to be random distribution, and the exponent is assigned 0.2; in other cases, a continuous value between 0.2 and 0.9 is calculated by linear interpolation of Δ and k. For the center-diffusion pattern, the propagation tendency index is assigned a high value; For the edge diffusion pattern, the propagation tendency index is assigned a value of medium; For random distribution patterns, the propagation tendency index is assigned a low value; The system transmits the propagation characteristic quantification results and context feature vectors to the comprehensive judgment module.
[0033] The comprehensive judgment module integrates a context-enhanced judgment model. This module fuses the propagation characteristic quantification results with spatial context features, performs a comprehensive score on the abnormal candidate points through the context-enhanced judgment model, and outputs the final abnormal judgment result based on the comprehensive score. The context-enhanced judgment model's comprehensive scoring process involves three types of inputs: spectral features, spatial context features, and propagation characteristics. These are concatenated into a fusion vector and then sequentially input into a bidirectional LSTM layer and an attention layer. The attention layer performs a weighted summation of the outputs at each time step, highlighting key spatial location features. The final score is obtained after passing through a fully connected layer and a sigmoid output layer. The model uses Focal Loss as the loss function, with a training positive-to-negative sample ratio of 1:3. On the validation set, the AUC reaches 0.94. The threshold of 0.7 is determined by the optimal Youden exponent using the ROC curve, ensuring a balance between false positives and false negatives. The context-enhanced judgment model adopts a bidirectional long short-term memory network structure based on the attention mechanism. The model input includes the original spectral features of the abnormal candidate points, the spatial context feature vector, and the quantification results of the propagation characteristics. The comprehensive score is greater than or equal to the preset threshold of 0.7 and is judged as true anomaly, while the comprehensive score is less than 0.7 and is judged as non-anomaly. The comprehensive judgment module also outputs the spatial coordinates of the abnormal area, the classification result of the abnormal type, and the assessment of the transmission risk level; This module also includes an anomaly visualization output unit, which overlays the judgment results onto the original agricultural and forestry area image, uses different color markers to distinguish the anomaly type and the level of propagation risk, and exports the vector boundary data of the anomaly area to the geographic information system for further spatial analysis, which will not be elaborated on here.
[0034] In the specific execution of step four, the system fuses the propagation characteristic quantification analysis results with spatial context features; The system combines the probability gradient direction, gradient strength, and propagation tendency index from the propagation characteristic quantification results with the context feature vector output by the spatial context construction module to form a fused feature vector. The system uses a pre-defined context-enhanced judgment model to comprehensively score abnormal candidate points. This context-enhanced judgment model adopts a bidirectional long short-term memory network structure based on an attention mechanism, and the model input is a fused feature vector. The model extracts sequence features from the fused feature vector through a bidirectional long short-term memory network, learning the dependencies of features on time or spatial sequences. The extracted sequence features are weighted using an attention mechanism to generate a comprehensive score. The model expands the fused feature vectors into a sequence by circularly expanding them from the inside out according to the spatial neighborhood; For example, center point, radius 1 circle, radius 3 circles, radius 5 circles; Input a bidirectional LSTM. The forward layer extracts the dependency patterns of each position on the anomaly probability of adjacent positions from left to right, and the backward layer extracts them from right to left. The forward and backward hidden states are concatenated to obtain the deep features at each time step. The attention layer calculates a learnable weight coefficient for each time step, which is normalized by Softmax through a fully connected layer. The coefficient reflects the contribution of the position to the comprehensive judgment. The weights are used to sum the hidden states of all time steps to form a fixed-length context vector. This vector is then activated by a fully connected layer and a sigmoid function to output a comprehensive score from 0 to 1. During model training, the LSTM and attention parameters are optimized simultaneously through backpropagation so that the score accurately reflects the spatial evolution of anomalies. The system outputs the final anomaly determination result based on the comprehensive score. When the comprehensive score is greater than or equal to the preset threshold of 0.7, the anomaly candidate point is determined to be a true anomaly. When the overall score is less than 0.7, the candidate point is determined to be non-abnormal. The system labels the spatial location and anomaly type of abnormal areas, and outputs the spatial coordinates of the abnormal areas, the classification results of the anomaly type, and the assessment of the propagation risk level. The system overlays the judgment results on the original agricultural and forestry area image through the anomaly visualization output unit, uses different color marks to distinguish the anomaly type and the propagation risk level, and exports the vector boundary data of the abnormal areas to the geographic information system for further spatial analysis.
[0035] During the execution of step one, the data acquisition module acquires monitoring images of agricultural and forestry areas through a visible light camera or multispectral imaging device, and stores the image data in a preset image buffer; During the execution of steps two through four, the spatial context construction module, the propagation characteristic analysis module, and the comprehensive judgment module process the abnormal candidate points in sequence, and the modules exchange data through a preset data interface. Throughout the workflow, the system effectively captures the spatial propagation characteristics of agricultural and forestry anomalies through a propagation characteristic quantification analysis step, and comprehensively optimizes the anomaly judgment results through a context-enhanced anomaly judgment step. The various functional modules in the system are electrically connected through preset data interfaces to ensure the real-time performance and reliability of data transmission.
[0036] Example 2: This embodiment uses a crop pest and disease monitoring project in an agricultural park in a certain city as a specific application scenario.
[0037] The agricultural and forestry anomaly identification system is deployed in the smart agriculture management platform of an agricultural park in a certain city. The spatial propagation trend prediction unit in the system predicts the future diffusion direction, diffusion speed and impact range of anomalies based on historical time-series image data. This unit obtains the anomaly probability map of the target area at multiple consecutive time points in the past and constructs a time-series anomaly probability map sequence. This unit analyzes the spatiotemporal evolution of anomalous regions in a time-series anomaly probability map sequence, and calculates the diffusion speed, diffusion direction, and morphological change trend of the anomalous regions. This unit predicts the diffusion trend of the abnormal area in the next 1 to 7 days based on historical diffusion patterns, and outputs the diffusion direction prediction results, diffusion speed estimation results, and impact range assessment results. The diffusion direction prediction results include the primary and secondary diffusion directions in the anomalous area; The diffusion rate estimation results represent the rate of expansion of the anomalous area boundary in pixels per day; the impact range assessment results represent the range that the anomalous area may cover in a specific future time period in pixels or area units. This unit transmits the prediction results to the comprehensive judgment module to assist in anomaly detection and risk assessment; The anomaly visualization output unit in this system overlays the judgment results onto the original agricultural and forestry area image; This unit first converts the spatial coordinates of the abnormal region output by the comprehensive judgment module into pixel coordinates corresponding to the original image, and then draws the abnormal region markers at the corresponding positions in the original image. This unit uses different color markings to distinguish anomaly types and transmission risk levels. For example, red is used to mark high-risk anomaly areas, yellow is used to mark medium-risk anomaly areas, and green is used to mark low-risk anomaly areas. This unit also displays anomaly type classification information, marking different anomaly types such as pine wilt disease, forest fire, and vegetation degradation with different icons in the center of the anomaly area; This unit also has the function of exporting vector boundary data of anomaly areas. The exported data is in the shapefile format or GeoJSON format commonly used by geographic information systems. The exported data includes the polygon boundary coordinates of the anomaly area, anomaly type attributes, and propagation risk level attributes. These exported data can be loaded into geographic information system software for further spatial analysis, including buffer analysis, overlay analysis, and spatial statistics.
[0038] In this embodiment, the initial anomaly detection model in the anomaly candidate extraction module is trained under supervision using a dual-temporal agricultural and forestry image dataset labeled with anomaly and normal regions during the training phase. The training dataset contains no fewer than 100,000 images, each of which is a 256-pixel by 256-pixel image patch. The images are labeled with four categories: normal region, slightly abnormal region, moderately abnormal region, and severely abnormal region. The model training process employs cross-entropy loss function and stochastic gradient descent optimization algorithm; This model can effectively distinguish between normal and abnormal pixels in agricultural and forestry images, providing a reliable initial probability basis for subsequent spatial context analysis and propagation characteristic analysis.
[0039] Example 3: This embodiment uses a forest health monitoring project under a natural forest protection project in a certain county as a specific application scenario; During the multi-scale spatial context construction process, the spatial context construction module constructs three-scale spatial neighborhood analysis windows for each anomaly candidate point; the first-scale window has a radius of 1 pixel and contains 9 pixels, and this scale window is used to capture the local micro-environment features around the anomaly candidate point; The second scale window has a radius of 3 pixels and contains 113 pixels. This scale window is used to capture the mid-scale spatial features around the anomaly candidate points. The third-scale window has a radius of 5 pixels and contains 317 pixels. This scale window is used to capture large-scale spatial background features around the anomaly candidate points.
[0040] Within each scale window, the module extracts three types of features; the first type is the statistical features of the probability of anomalies in neighboring pixels, specifically including: The mean is the arithmetic mean of the anomaly probabilities of all pixels within the window. Standard deviation is the square root of the sum of squared deviations of the outlier probability values of all pixels within a window from the mean. Entropy, or Shannon information entropy calculated based on the anomaly probability distribution within a window, reflects the degree of uncertainty in the anomaly probability distribution. The second category is texture features, which specifically calculate the spatial correlation of pixel gray values within a window using the gray-level co-occurrence matrix algorithm, and obtain four statistical measures: contrast, correlation, energy, and uniformity. The third type is spectral gradient features, which are obtained by calculating the gradient of spectral channel values between adjacent pixels within a window, reflecting the degree of drastic spectral changes of pixels in space.
[0041] The module concatenates and combines the features extracted from the three scale windows to form a high-dimensional context feature vector. Since the concatenated feature vector has a high dimension, the module uses a feature compression algorithm based on principal component analysis to reduce the dimensionality of the high-dimensional feature vector and compress it into a compact 64-dimensional feature representation. During feature compression, the module calculates the covariance matrix of the original features, solves for the eigenvalues and eigenvectors of the covariance matrix, and selects the first few principal components based on the magnitude of the eigenvalues, so that the selected principal components retain no less than 90% of the original feature variance information. The resulting 64-dimensional compact feature vector, used as a contextual feature vector representing the environment surrounding the anomaly candidate point, is transmitted to the propagation characteristic analysis module.
[0042] In the process of spatial diffusion pattern recognition, the propagation characteristic analysis module first calculates the probability gradient of the anomaly candidate point in the spatial neighborhood; the module calculates the directional derivative of the anomaly probability in eight directions around the anomaly candidate point. The module calculates the difference in anomaly probability between adjacent pixels and anomaly candidate points in eight directions: east, west, south, north, northeast, southeast, northwest, and southwest. It then divides the difference by the Euclidean distance between the adjacent pixels and the anomaly candidate points to obtain the directional derivative values in each direction. The module constructs a directional derivative vector from the eight directional derivative values, calculates the magnitude of the vector as the gradient intensity, and calculates the principal direction angle of the vector as the probability gradient direction.
[0043] The module identifies spatial diffusion patterns based on the direction and intensity of the probability gradient. The module first calculates the difference in anomalous probability between the candidate point and the surrounding pixels. If the anomalous probability of the candidate point is significantly higher than that of the surrounding pixels, and the anomalous probability shows a monotonically decreasing trend in all directions outward from the candidate point, then the candidate point is determined to belong to the center diffusion pattern. The central diffusion pattern usually indicates that the anomaly spreads from the point to the surrounding area, and the system assigns a high value to the propagation tendency index. If the module detects that the anomaly probability value of the anomaly candidate point is lower than that of the surrounding pixels, and the anomaly probability shows a monotonically increasing trend from the outside to the inside, then the module determines that the anomaly candidate point belongs to the edge diffusion pattern. The edge diffusion pattern typically indicates that anomalies converge from the outside towards that point, and the system assigns a medium value to the propagation tendency index; If the module detects that the abnormal probability distribution of the pixels around the abnormal candidate point does not have obvious spatial gradient features, and the directional derivative values in each direction fluctuate greatly and have no obvious pattern, then it determines that the abnormal candidate point belongs to a random distribution pattern. Random distribution patterns typically indicate that anomalies are sporadic and do not have a spatial propagation trend; the system assigns a low value to the propagation tendency index.
[0044] When identifying spatial diffusion patterns, the module also takes into account the stability of gradient intensity, the persistence of diffusion direction, and the consistency of diffusion patterns. The stability of gradient strength is measured by calculating the degree of deviation of each derivative value from the average derivative value; The persistence of diffusion direction is measured by analyzing changes in diffusion direction at multiple consecutive time points; Consistency of diffusion patterns is measured by comparing diffusion pattern recognition results within different scale windows; The module integrates the quantitative indicators from the above multiple dimensions to generate a comprehensive dissemination tendency index; The comprehensive propagation tendency index, based on the fundamental judgment value in Example 1, further introduces three correction factors: stability is represented by the reciprocal of the standard deviation of the derivatives and means of each direction; persistence is represented by the mean of the cosine of the angle between the gradient directions of continuous time phases; and consistency is represented by the proportion of diffusion mode labels identified by different scale windows. After normalization, the three factors are weighted and summed with weights of 0.3, 0.3, and 0.4 to obtain the correction coefficient. Multiplying this by the fundamental index and truncating to the [0,1] interval yields the comprehensive index. The standard deviation and angle statistics of stability and persistence are calculated conventionally. The specific process can be referred to the probability statistics method in Example 1, which will not be repeated here.
[0045] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. An image recognition-based forest area anomaly identification method, characterized by, Includes the following steps: Step 1: Obtain image data of the agricultural and forestry area to be detected, calculate the pixels in the agricultural and forestry area image data based on the preset anomaly detection model, output the initial anomaly probability map, and mark the set of anomaly candidate points in the anomaly probability map according to the preset probability threshold. Step 2: Construct a spatial neighborhood analysis window to obtain the distribution characteristics, texture features, and spectral gradient features of pixels within the agricultural and forestry area image data, forming a context feature vector; Step 3: Perform quantitative analysis based on context feature vectors, calculate the probability gradient direction and gradient intensity in the spatial neighborhood, identify the spatial diffusion pattern of abnormal distribution, and calculate the abnormal propagation tendency index based on the spatial diffusion pattern. Step 4: Fuse the anomaly propagation tendency index with the context feature vector, use the context-enhanced judgment model to comprehensively score the anomaly candidate points, output the anomaly judgment result based on the comprehensive score, and mark the spatial location and anomaly type of the anomaly region. 2.The image recognition-based abnormality identification method for an agricultural forest area according to claim 1, characterized in that, In step one, the initial anomaly detection model adopts a multilayer perceptron structure based on a deep neural network. The input is the multiple spectral channel features of the pixel, and the output is the anomaly probability value of the pixel. 3.The image recognition-based abnormality identification method for an agricultural forest area according to claim 1, characterized in that, In step two, the spatial neighborhood analysis window includes a first-scale window, a second-scale window, and a third-scale window. The features extracted within each scale window include the mean, standard deviation, entropy value, and covariance matrix features between spectral channels of the neighborhood pixel anomaly probability. 4.The image recognition-based forest area anomaly identification method according to claim 1, characterized in that, In step three, the spatial diffusion patterns of abnormal distributions include central diffusion patterns, edge diffusion patterns, and random distribution patterns.
5. The image recognition-based forest area anomaly identification method according to claim 1, characterized in that, In step four, the context-enhanced judgment model adopts a bidirectional long short-term memory network structure based on the attention mechanism. The model input includes the original spectral features of the abnormal candidate points, the spatial context feature vector, and the quantification results of the propagation characteristics. The comprehensive score is not less than the preset threshold and is judged as a true abnormality.
6. An image recognition based agricultural and forestry area anomaly identification system, which is suitable for the image recognition based agricultural and forestry area anomaly identification method of any one of claims 1-5, characterized in that, include: The image acquisition module acquires image data of the agricultural and forestry area to be detected, calculates the anomaly probability of each pixel in the image based on the preset initial anomaly detection model, outputs an initial anomaly probability map, and marks a set of anomaly candidate points in the initial anomaly probability map as the triggering condition for subsequent processing through a preset probability threshold. The anomaly candidate extraction module performs spatial context quantization on each anomaly candidate point based on the anomaly probability distribution characteristics, texture features, and spectral gradient features of pixels in the multi-scale spatial neighborhood, and determines whether it meets the preset multi-scale spatial context feature conditions. The spatial context construction module calculates the probability gradient direction and gradient intensity of the abnormal candidate points in the spatial neighborhood, identifies their spatial diffusion patterns, calculates the propagation tendency index based on the diffusion patterns, and determines whether the conditions for quantitative analysis of propagation characteristics are met. The propagation characteristic analysis module performs a comprehensive scoring algorithm on anomaly candidate points based on the fusion of propagation characteristic quantification results and context feature vectors. It outputs the final anomaly determination result through a preset context-enhanced judgment model, including the spatial location coordinates of the anomaly area, the anomaly type classification result, and the propagation risk level assessment. 7.The image recognition based abnormality identification system for agricultural forest area according to claim 6, characterized in that, The acquired agricultural and forestry area image data includes visible light images or multispectral images. The equipped visible light camera acquires RGB three-channel images, and the multispectral imaging device acquires image data from at least five spectral channels. 8.The image recognition based abnormality identification system for agricultural forest area according to claim 6, characterized in that, A feature compression algorithm based on principal component analysis is used to compress high-dimensional feature vectors extracted in the multi-scale spatial neighborhood into a compact feature representation of a preset dimension. 9.The image recognition based abnormality identification system for agricultural forest area according to claim 6, wherein, It also includes a spatial propagation trend prediction unit, which predicts the future direction, speed, and scope of anomalies based on historical time-series image data. 10.The image recognition based abnormality identification system for agricultural forest area according to claim 6, wherein, It also includes an anomaly visualization output unit, which overlays the judgment results onto the original agricultural and forestry area image data, marks the anomaly type and the level of propagation risk, and exports the vector boundary data of the anomaly area.