Time series anomaly detection method, device, equipment and medium based on KAN network

Through the time series anomaly detection method based on the KAN network, the time series data of multi-dimensional soil parameters are encoded and self-attention mechanism processed to generate encoding noise, which solves the problem of inaccurate detection results in the traditional method and achieves higher detection accuracy and adaptability.

CN120067999BActive Publication Date: 2025-08-22SHIJIAZHUANG TIEDAO UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510525772.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-22
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

The traditional time series anomaly detection method lacks flexibility in multi-dimensional soil parameter detection, and it is difficult to adapt to dynamic changes in complex environments, resulting in inaccurate detection results.

Method used

Using a KAN network-based method, trigonometric function encoding and convolutional activation encoding are performed on the time series data of multi-dimensional soil parameters, encoding noise is generated in combination with the self-attention mechanism, and input it into the pre-constructed anomaly detection model for abnormal detection.

Benefits of technology

It improves the adaptability and flexibility of time series data abnormal detection, enhances nonlinear processing capabilities, and improves detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067999B_ABST
    Figure CN120067999B_ABST
Patent Text Reader

Abstract

The present invention provides a time series anomaly detection method, apparatus, device, and medium based on a KAN network, relating to the technical field of data anomaly detection. The method comprises: obtaining first time series data based on multidimensional soil parameters and encoding the data to obtain a first position code and a spatiotemporal feature code for the first time series data; performing a weighted summation of the first position code and the spatiotemporal feature code based on a self-attention mechanism to obtain a second position code for the first time series data; and obtaining second time series data based on the first time series data and the second position code; performing noise generation processing on the second time series data based on a KAN network to generate encoding noise for the second time series data; and inputting the encoding noise of the second time series data into a pre-established anomaly detection model to obtain an anomaly detection result for the multidimensional soil parameters. The present invention can improve the adaptability, flexibility, and detection accuracy of time series data anomaly detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data anomaly detection, and in particular to a time series anomaly detection method, device, equipment and medium based on a KAN network. Background Art

[0002] In today's era of rapid digital development, time series data has been widely used in soil information monitoring. Time series data plays a crucial role in soil information monitoring. It can reveal dynamic changes in key indicators such as soil moisture, soil salinity, soil temperature, and soil nutrient content. Therefore, time series data provides continuous and rich data support for soil research and management. Time series data can reflect dynamic soil changes, provide historical comparative analysis, and support soil model construction and prediction.

[0003] Soil information can be obtained through the combination of remote sensing technology and ground-based sensors. Remote sensing technology offers advantages such as a wide monitoring range, strong information continuity, and high information processing efficiency. It can quickly and extensively acquire surface information, providing high-precision, multi-temporal data support for soil parameter monitoring. Remote sensing technology is primarily used in soil monitoring in the following areas. First, soil moisture monitoring: Remote sensing technology can obtain soil moisture information through a variety of sensors. Second, soil quality assessment: Remote sensing technology can assess soil quality using high-resolution satellite imagery and spectral data. Third, soil erosion monitoring: Remote sensing technology can monitor soil erosion by monitoring soil spectral information. Fourth, soil pollution monitoring: Remote sensing technology also has important applications in this area. Fifth, soil type identification: Remote sensing technology can identify soil types using multispectral and hyperspectral imagery.

[0004] However, in practical applications, time series data may exhibit various anomalies during monitoring. The causes of these anomalies are complex and can be caused by equipment failure, human error, external interference, market emergencies, and other factors. These anomalies can also severely impact the construction and use of soil monitoring models, the normal operation of soil information monitoring systems, and the smooth implementation of soil information monitoring services. Therefore, research on time series anomaly detection methods is crucial.

[0005] However, the temporal dependence of time series data is not static, but will evolve dynamically with the complex environment. Traditional methods of anomaly detection in time series lack flexibility and are difficult to adapt to such changes. Summary of the Invention

[0006] The embodiments of the present invention provide a time series anomaly detection method, apparatus, device and medium based on a KAN network to solve the problem that the traditional method of anomaly detection for time series is not accurate enough when used to detect anomalies in multi-dimensional time series data.

[0007] In a first aspect, an embodiment of the present invention provides a time series anomaly detection method based on a KAN network, comprising:

[0008] obtaining first time series data based on multi-dimensional soil parameters, performing trigonometric function coding and convolution activation coding on the first time series data, and obtaining first position coding and spatiotemporal feature coding of the first time series data;

[0009] Performing weighted summation on the first position code and the spatiotemporal feature code based on the self-attention mechanism to obtain a second position code of the first time series data, and obtaining second time series data based on the first time series data and the second position code;

[0010] performing noise generation processing on the second time series data based on the KAN network to generate coding noise for the second time series data;

[0011] The second time series data and the coding noise of the second time series data are input into a pre-built anomaly detection model to obtain an anomaly detection result of the multi-dimensional soil parameters.

[0012] In a second aspect, an embodiment of the present invention provides a time series anomaly detection device based on a KAN network, comprising:

[0013] An encoding module is used to obtain first time series data based on multi-dimensional soil parameters, and perform trigonometric function encoding and convolution activation encoding on the first time series data to obtain a first position code and a spatiotemporal feature code of the first time series data;

[0014] A self-attention module is configured to perform a weighted summation of the first position code and the spatiotemporal feature code based on a self-attention mechanism to obtain a second position code of the first time series data, and obtain second time series data based on the first time series data and the second position code;

[0015] a generating module, configured to perform noise generation processing on the second time series data based on a KAN network to generate coding noise for the second time series data;

[0016] The detection module is used to input the second time series data and the coding noise of the second time series data into a pre-built anomaly detection model to obtain an anomaly detection result of the multi-dimensional soil parameters.

[0017] In a third aspect, an embodiment of the present invention provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method in the first aspect or any possible implementation of the first aspect is implemented.

[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method in the first aspect or any possible implementation of the first aspect.

[0019] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements the method in the first aspect or any possible implementation of the first aspect.

[0020] In an embodiment of the present invention, first time series data of multi-dimensional soil parameters is encoded and convolutionally activated to obtain a first positional encoding and spatiotemporal feature encoding of the first time series data. The first positional encoding and spatiotemporal feature encoding are then weighted and summed using a self-attention mechanism to obtain a second positional encoding of the first time series data. Second time series data is then obtained based on the first and second positional encodings. Coding noise for the second time series data is generated using the second time series data and a KAN network. The second time series data and the coding noise for the second time series data are then input into a pre-built anomaly detection model to obtain anomaly detection results for multiple soil parameters. Combining the first positional encoding and spatiotemporal feature encoding through a self-attention mechanism enables targeted positional encoding, improving the adaptability and flexibility of the model and thereby increasing the accuracy of anomaly detection for time series data. Generating coding noise for the second time series data through a KAN network and inputting it into the anomaly detection model enhances the nonlinear processing capabilities of the anomaly detection model, thereby improving the accuracy of anomaly detection for time series data. Therefore, the anomaly detection method provided by an embodiment of the present invention not only improves the adaptability and flexibility of anomaly detection for time series data, but also improves the accuracy of anomaly detection for time series data. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is a flowchart of an implementation method for time series anomaly detection based on a KAN network provided by an embodiment of the present invention;

[0022] Figure 2 Schematic diagram of an adaptive attention module of a time series anomaly detection method based on a KAN network provided by an embodiment of the present invention;

[0023] Figure 3This is a flowchart of performing noise generation processing on second time series data in a time series anomaly detection method based on a KAN network provided by an embodiment of the present invention;

[0024] Figure 4 Schematic diagram of an IMDiffusion model of a time series anomaly detection method based on a KAN network provided in an embodiment of the present invention;

[0025] Figure 5 Schematic diagram of a KAN_IMDiffusion model of a time series anomaly detection method based on a KAN network provided by an embodiment of the present invention;

[0026] Figure 6 Schematic diagram of the structure of a time series anomaly detection device based on a KAN network provided by an embodiment of the present invention;

[0027] Figure 7 is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0029] See also Figure 1 , which shows a flow chart of the implementation of the time series anomaly detection method based on the KAN network provided by an embodiment of the present invention, which is detailed as follows:

[0030] Step S110: obtaining first time series data based on multi-dimensional soil parameters, performing trigonometric function coding and convolution activation coding on the first time series data, respectively, to obtain first position coding and spatiotemporal feature coding of the first time series data.

[0031] In some embodiments, soil parameters can be acquired through the combined use of ground sensor networks and remote sensing technology. This combination enables the construction of a comprehensive and accurate soil information monitoring system. Ground sensors are widely deployed across target areas, collecting key parameters such as soil moisture, salinity, temperature, and nutrient content in real time, providing high-resolution local data.

[0032] Remote sensing technology can periodically acquire surface soil information over a wide area, compensating for the limited spatial coverage of ground sensors. Through steps such as spatiotemporal alignment, missing value filling, and normalization, ground sensor data and remote sensing data are fused to form a unified, high-quality soil information dataset.

[0033] In some embodiments, Figure 2 It is an adaptive attention module, including trigonometric function encoding module, convolution activation encoding module, self-attention module and residual connection module, see Figure 2, trigonometric function coding refers to the use of trigonometric functions to generate initial position coding for time series data. The specific formula is as follows:

[0034]

[0035]

[0036] in, represents the time step, is the dimension index in the positional encoding vector, is the total dimension of the position encoding vector. Among them, the time series data is , where T represents the time step, and the first position code generated is .

[0037] In some embodiments, see Figure 2 , the specific implementation steps of convolutional activation coding are as follows:

[0038] In the first step, a convolution operation is performed on the first time series data X, using a convolution kernel of size 3 to extract local features from the data. During the convolution process, the convolved data is padded to maintain the same data size. This ensures that the time step of the output data remains the same after the convolution.

[0039] In the second step, the data after the first convolution operation is passed through the Relu activation function to increase the nonlinear expression ability of the model. The formula is:

[0040]

[0041] Among them, X is the output data after the convolution operation, and y is the result after activation by the Relu activation function.

[0042] In the third step, the data after Relu activation is subjected to the same convolution operation as the first time, and a convolution kernel of size 3 is used and padded to further extract and enhance the important features in the time series. After these two convolution operations and Relu activation, the spatiotemporal feature encoding in the time series is finally obtained. The specific formula is as follows:

[0043]

[0044] in, represents the convolution operation, is the data obtained after filling the input data X, express Activation function: = .

[0045] Passing the data after the first convolution operation through the Relu activation function can increase the nonlinear expression ability of the model. Using the convolution kernel of the same size to perform convolution operation and padding on the data after Relu activation can further extract and enhance the important features in the time series.

[0046] In a possible implementation, a specific processing method of step S110 is: determining initial time series data based on multi-dimensional soil parameters; filling missing values ​​and normalizing the data on the initial time series data to obtain first time series data.

[0047] In some embodiments, during the data processing phase, the fused data is first preprocessed to fill in any missing values ​​and normalize the data to eliminate dimensional differences between different data sources and parameters. Next, adaptive attention position encoding is used in conjunction with convolution operations to extract spatiotemporal features from soil time series information. This approach dynamically generates attention weights based on data characteristics, placing greater emphasis on key spatiotemporal features. This allows for more accurate capture of changing patterns in soil information and provides rich and valuable feature representations for anomaly detection.

[0048] In some embodiments, the multi-dimensional soil parameters are data obtained through monitoring by a soil information monitoring system. After obtaining the multi-dimensional soil parameters, the multi-dimensional soil parameters are fused to obtain initial time series data.

[0049] In some embodiments, missing values ​​are filled by linear interpolation. Assume that the time series data is ,in Indicates the The data value at a time point. is a missing value, and and If the data is valid, the following formula is used for linear interpolation:

[0050]

[0051] in, After filling value.

[0052] In some embodiments, data normalization refers to scaling the data to a consistent range. The minimum and maximum normalization method can be used to normalize the data to the interval [0, 1]. The normalization formula is:

[0053]

[0054] in, and Represents time series The minimum and maximum values ​​in . For the The value after normalization of the data.

[0055] In addition, in order to evaluate the performance of the model, the first time series data needs to be divided into a training set and a test set according to a preset ratio. The preset ratio can be 7:3, that is, the training set accounts for 70% of the total data and the test set accounts for 30% of the total data.

[0056] Step S120 is used to perform weighted summation on the first position code and the spatiotemporal feature code based on the self-attention mechanism to obtain the second position code of the first time series data, and obtain the second time series data based on the first time series data and the second position code.

[0057] In some embodiments, see Figure 2 After obtaining the second position code of the first time series data, the first time series data X1 and the second position code can be connected in a residual connection manner. By adding, we can get the second time series data .

[0058] The residual connection formula is: .

[0059] The specific formula of the adaptive attention position encoding module is as follows:

[0060]

[0061] in, is the first position code of the first time series data, Encode the spatiotemporal features of the first time series data.

[0062] In one possible implementation, the specific processing method of step S120 is: perform a linear transformation on the first position code to obtain a first attention vector, and perform a linear transformation on the spatiotemporal feature code to obtain a second attention vector and a third attention vector; calculate the attention score matrix based on the second attention vector and the third attention vector; perform weighted summation on the first attention vector according to the attention score matrix to obtain the second position code of the first time series data.

[0063] In some embodiments, see Figure 2, a linear transformation of the first position code P1 can be used to obtain the first attention vector V, and a linear transformation of the spatiotemporal feature code F can be used to obtain the second attention vector K and the third attention vector Q. Among them, the full name of V is Value, which represents the value vector, the full name of K is Key, which represents the key vector, and the full name of Q is Query, which represents the query vector. The first attention vector, the second attention vector, and the third attention vector are used to determine the degree of association between different positions.

[0064] Among them, the attention score matrix is ​​represented by A, and the calculation formula is:

[0065]

[0066] in, is the dimension of K.

[0067] In some embodiments, the second position encoding can be obtained by weighted summing V through the attention score matrix A , the calculation formula is:

[0068]

[0069] By performing trigonometric encoding, it is possible to take into account the changes in temporal dependencies brought about by the dynamic evolution of complex environments when detecting anomalies in time series data. By performing two convolutional activations, the spatiotemporal features of the input data can be extracted. Then, through the self-attention mechanism, the spatiotemporal feature encoding and the first positional encoding are weighted to obtain a second positional encoding containing the data features of the time series data, thereby improving the adaptability and flexibility of anomaly detection for time series data. Combining trigonometric encoding with convolutional activation coding not only takes into account the changes in temporal dependencies brought about by the dynamic evolution of complex environments, but also improves the adaptability and flexibility of anomaly detection for time series data.

[0070] Step S130 is used to perform noise generation processing on the second time series data based on the KAN network to generate coding noise for the second time series data.

[0071] In some embodiments, the KAN network has strong nonlinear processing capabilities. Therefore, using the KAN network to generate coding noise for the second time series data and adding the KAN network to the existing anomaly detection model can enhance the nonlinear processing capabilities of the anomaly detection model and further improve the accuracy of anomaly detection for time series data.

[0072] In one possible implementation, the specific processing method of step S130 is: performing trigonometric function encoding on the second time series data to obtain a third position encoding of the second time series data; performing data transformation on the third position encoding based on the KAN network, and obtaining the encoding noise of the second time series data based on the data transformation result.

[0073] In some embodiments, Figure 3 For the specific steps of noise generation processing for the second time series data, see Figure 3 , the noise generation process first needs to process the second time series through trigonometric function encoding, that is, position embedding of the second time series is performed to obtain the third position encoding, and then data transformation of the third position encoding is required to obtain the encoding noise of the second time series data.

[0074] In one possible implementation, the specific processing method of step S130 is: performing data transformation on the third position code based on the KAN network, and inputting the data transformation result of the third position code into a preset activation function to obtain the initial coding noise of the second time series data; performing data transformation on the initial coding noise based on the KAN network, and inputting the data transformation result of the initial coding noise into a preset activation function to obtain the coding noise of the second time series data.

[0075] In some embodiments, the transformation formula for data transformation performed by the KAN network is:

[0076]

[0077] in, is the output of data transformation through the KAN network at time step t, is the input of data transformation through the KAN network at time step t.

[0078] The specific formula is:

[0079]

[0080] in, is the outer function, summing the inner results. For internal functions.

[0081]

[0082] in, 、 is the weight coefficient, is the spline function, is the basis function.

[0083]

[0084]

[0085] Where n is Dimensions, is the weight coefficient, is the b-spline function.

[0086] In some embodiments, the preset activation function is a SiLU function, and the activation function formula is:

[0087]

[0088] It should be noted that, when in use, the KAN network can be used to construct Figure 3 The KAN module shown includes an encoding module that uses trigonometric function encoding for position encoding and two KAN_Layer modules. The second time series data is input into the KAN_Layer module to obtain encoding noise of the second time series data.

[0089] The KAN_Layer module is constructed through the KAN network to generate coding noise for the second time series data. With the help of the powerful feature extraction capability of the KAN network, the diversity of coding noise can be improved and more robust features of multidimensional time series data can be extracted.

[0090] Step S140 is used to input the second time series data and the coding noise of the second time series data into a pre-built anomaly detection model to obtain an anomaly detection result of the multi-dimensional soil parameters.

[0091] In some embodiments, the pre-built anomaly detection model is an IMDiffusion model. The schematic diagram of the IMDiffusion model is as follows: Figure 4 shown.

[0092] In one possible implementation, the specific processing method of step S140 is: inputting the second time series data into the first sub-model of the anomaly detection model to obtain the first noise and the second noise of the second time series data; inputting the second time series data, the coding noise, the first noise and the second noise into the second sub-model of the anomaly detection model to obtain the anomaly detection result of the multi-dimensional soil parameters.

[0093] In some embodiments, the anomaly detection model is an IMDiffusion model. The first sub-model and the second sub-model are specifically described in Figure 4Among them, reshape means changing the shape of the feature map, 1D Conv means one-dimensional convolution, positional encoding means encoding generated by trigonometric functions, sigmoid and tanh mean activation functions, concat means concatenation operation, and Transformer encoder means the encoder part in the Transformer model.

[0094] In some embodiments, the model improved by the method provided by this application is a KAN_IMDiffusion model. The schematic diagram of the KAN_IMDiffusion model is as follows: Figure 5 shown.

[0095] The following describes the training and testing process of the KAN_IMDiffusion model:

[0096] In the first step, the original data is converted into noisy data by gradually adding noise. This process is controlled by a fixed forward diffusion process, and the formula is as follows:

[0097]

[0098] in, is a predefined decay function, is the noise sampled from a normal distribution.

[0099] The second step is to train the neural network To predict the noise added at each step. During the training process, a random time step is selected , sample a sample from the dataset , obtained through the forward diffusion process , and then calculate the prediction noise With real noise The loss function used is MSE, and the specific formula is as follows:

[0100]

[0101] The third step is to use the optimization algorithm Adam to update the parameters of the model according to the gradient of the calculation function. .

[0102] The fourth step is to select the optimal model based on the evaluation indicators, including precision, recall, and F1 value. The specific formula is as follows:

[0103]

[0104]

[0105]

[0106] in, is the number of true positives (predicted positive and actually positive), is the number of false positives (predicted to be positive but actually negative), is the number of false negatives (predicted to be negative but actually positive).

[0107] In the fifth step, the parameters of the KAN_IMDiffusion model are set to the optimal parameters and the test set is used to test to obtain the anomaly detection results.

[0108] The KAN_IMDiffusion model presented in this application boasts strong feature extraction and adaptive capabilities, as well as robustness in processing complex data. This model offers significant advantages in soil anomaly detection. It can promptly detect anomalies in soil information, such as abnormal soil moisture and abnormal changes in soil fertility, providing a scientific basis for decision-making in related fields. It is widely applicable in various fields, such as agricultural production, where it can guide irrigation and fertilization, and ecological protection, where it can monitor soil degradation and pollution. This model can promote the development and application of soil anomaly detection technology.

[0109] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0110] The following are device embodiments of the present invention. For details not fully described therein, reference may be made to the corresponding method embodiments described above.

[0111] Figure 6 The following is a schematic diagram showing the structure of a time series anomaly detection device based on a KAN network according to an embodiment of the present invention. For ease of explanation, only the parts related to the embodiment of the present invention are shown, which are described in detail as follows:

[0112] like Figure 6 As shown, the time series anomaly detection device 6 based on the KAN network includes:

[0113] An encoding module 61 is configured to obtain first time series data based on multi-dimensional soil parameters, and perform trigonometric function encoding and convolution activation encoding on the first time series data to obtain a first position code and a spatiotemporal feature code for the first time series data;

[0114] A self-attention module 62 is configured to perform a weighted summation of the first position code and the spatiotemporal feature code based on a self-attention mechanism to obtain a second position code of the first time series data, and obtain second time series data based on the first time series data and the second position code;

[0115] A generating module 63 is configured to perform noise generation processing on the second time series data based on the KAN network to generate coding noise for the second time series data;

[0116] The detection module 64 is configured to input the second time series data and the coding noise of the second time series data into a pre-built anomaly detection model to obtain an anomaly detection result of the multi-dimensional soil parameters.

[0117] In a possible implementation, the encoding module 61 is specifically configured to: determine initial time series data based on multi-dimensional soil parameters; and perform missing value filling and data normalization on the initial time series data to obtain first time series data.

[0118] In one possible implementation, the self-attention module 62 is specifically used to: perform a linear transformation on the first position code to obtain a first attention vector, and perform a linear transformation on the spatiotemporal feature code to obtain a second attention vector and a third attention vector; calculate an attention score matrix based on the second attention vector and the third attention vector; and perform a weighted summation on the first attention vector according to the attention score matrix to obtain a second position code of the first time series data.

[0119] In one possible implementation, the generation module 63 is specifically used to: perform trigonometric function encoding on the second time series data to obtain a third position encoding of the second time series data; perform data transformation on the third position encoding based on the KAN network, and obtain the encoding noise of the second time series data based on the data transformation result.

[0120] In one possible implementation, the generation module 63 is also used to: perform data transformation on the third position code based on the KAN network, and input the data transformation result of the third position code into a preset activation function to obtain the initial coding noise of the second time series data; perform data transformation on the initial coding noise based on the KAN network, and input the data transformation result of the initial coding noise into a preset activation function to obtain the coding noise of the second time series data.

[0121] In one possible implementation, the detection module 64 is specifically used to: input the second time series data into the first sub-model of the anomaly detection model to obtain the first noise and the second noise of the second time series data; input the second time series data, the encoded noise, the first noise and the second noise into the second sub-model of the anomaly detection model to obtain the anomaly detection results of the multi-dimensional soil parameters.

[0122] Figure 7 Schematic diagram of an electronic device provided by an embodiment of the present invention. Figure 7As shown, the electronic device 7 of this embodiment includes a processor 70 and a memory 71. The memory 71 stores a computer program 72. When the processor 70 executes the computer program 72, the steps of the above-described method embodiments are implemented. Alternatively, when the processor 70 executes the computer program 72, the functions of the modules / units in the above-described device embodiments are implemented.

[0123] Exemplarily, the computer program 72 may be divided into one or more modules / units, which are stored in the memory 71 and executed by the processor 70 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 72 in the electronic device 7.

[0124] The electronic device 7 may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that Figure 7 It is only an example of the electronic device 7 and does not constitute a limitation of the electronic device 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 7 may also include input and output devices, network access devices, buses, etc.

[0125] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0126] The memory 71 can be an internal storage unit of the electronic device 7, such as the hard drive or memory of the electronic device 7. The memory 71 can also be an external storage device of the electronic device 7, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. equipped on the electronic device 7. Furthermore, the memory 71 can include both the internal storage unit of the electronic device 7 and an external storage device. The memory 71 is used to store the computer program 72 and other programs and data required by the electronic device 7. The memory 71 can also be used to temporarily store data that has been output or is about to be output.

[0127] For the sake of convenience and brevity, the division of the above functional modules / units is only used as an example. In actual applications, the above functions can be assigned to different functional modules / units as needed. The above modules / units can be implemented in the form of hardware, software, or a combination of hardware and software.

[0128] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods in the above-mentioned method embodiments.

[0129] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the methods in the above-mentioned method embodiments.

[0130] The term "computer program" includes computer program code, which may be in source code form, object code form, executable file, or some intermediate form. Computer-readable media may include any entity or device capable of carrying computer program code, recording media, USB flash drives, removable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media.

[0131] In the above embodiments, the descriptions of each embodiment have their own focus. For parts not described or recorded in detail in one embodiment, please refer to the relevant descriptions of other embodiments. Unless otherwise specified or there is a logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced to each other. The technical features of different embodiments can be combined to form new embodiments based on their inherent logical relationships.

[0132] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A soil parameter anomaly detection method based on KAN network, characterized in that: include: Based on the soil information monitoring system, multi-dimensional soil parameters are collected and data fused to obtain initial time series data; the multi-dimensional soil parameters include moisture, salinity, temperature, and nutrient content; Filling missing values ​​and normalizing the data on the initial time series data to obtain first time series data, and performing trigonometric function coding and convolution activation coding on the first time series data to obtain first position coding and spatiotemporal feature coding of the first time series data; Performing weighted summation on the first position code and the spatiotemporal feature code based on a self-attention mechanism to obtain a second position code of the first time series data, and obtaining second time series data based on the first time series data and the second position code; performing noise generation processing on the second time series data based on the KAN network to generate coding noise for the second time series data; The second time series data and the coding noise of the second time series data are input into a pre-built anomaly detection model to obtain the anomaly detection results of the multi-dimensional soil parameters; the anomaly detection results of the multi-dimensional soil parameters include soil moisture anomaly and soil fertility change anomaly.

2. The soil parameter anomaly detection method based on KAN network according to claim 1 is characterized in that: The step of performing weighted summation on the first position code and the spatiotemporal feature code based on the self-attention mechanism to obtain a second position code of the first time series data includes: Performing a linear transformation on the first position code to obtain a first attention vector, and performing a linear transformation on the spatiotemporal feature code to obtain a second attention vector and a third attention vector; Calculating an attention score matrix based on the second attention vector and the third attention vector; A weighted summation is performed on the first attention vector according to the attention score matrix to obtain a second position encoding of the first time series data.

3. The soil parameter anomaly detection method based on KAN network according to claim 1 is characterized in that: The generating, based on the second time series data and the KAN network, coding noise of the second time series data includes: performing trigonometric function encoding on the second time series data to obtain a third position code of the second time series data; Data transformation is performed on the third position code based on the KAN network, and coding noise of the second time series data is obtained based on the data transformation result.

4. The soil parameter anomaly detection method based on KAN network according to claim 3 is characterized in that: The performing data transformation on the third position code based on the KAN network, and obtaining coding noise of the second time series data based on the data transformation result, includes: Performing data transformation on the third position code based on the KAN network, and inputting the data transformation result of the third position code into a preset activation function to obtain initial coding noise of the second time series data; The initial coding noise is subjected to data transformation based on the KAN network, and the data transformation result of the initial coding noise is input into the preset activation function to obtain the coding noise of the second time series data.

5. The soil parameter anomaly detection method based on KAN network according to claim 1 is characterized in that: Inputting the second time series data and the coding noise of the second time series data into a pre-built anomaly detection model to obtain an anomaly detection result of the multi-dimensional soil parameter includes: Inputting the second time series data into the first sub-model of the anomaly detection model to obtain first noise and second noise of the second time series data; The second time series data, the coded noise, the first noise and the second noise are input into the second sub-model of the anomaly detection model to obtain an anomaly detection result of the multi-dimensional soil parameter.

6. A soil parameter anomaly detection device based on KAN network, characterized in that: include: An encoding module is configured to collect multi-dimensional soil parameters based on a soil information monitoring system, perform data fusion on the multi-dimensional soil parameters to obtain initial time series data; the multi-dimensional soil parameters include moisture, salinity, temperature, and nutrient content; perform missing value filling and data normalization on the initial time series data to obtain first time series data; and perform trigonometric function encoding and convolution activation encoding on the first time series data to obtain a first position code and spatiotemporal feature code for the first time series data; a self-attention module, configured to perform a weighted summation of the first position code and the spatiotemporal feature code based on a self-attention mechanism to obtain a second position code of the first time series data, and obtain second time series data based on the first time series data and the second position code; a generating module, configured to perform noise generation processing on the second time series data based on a KAN network to generate coding noise for the second time series data; The detection module is used to input the second time series data and the coding noise of the second time series data into a pre-built anomaly detection model to obtain an anomaly detection result of the multi-dimensional soil parameter; the anomaly detection result of the multi-dimensional soil parameter includes soil moisture anomaly and soil fertility change anomaly.

7. The soil parameter anomaly detection device based on the KAN network according to claim 6 is characterized in that: The self-attention module is specifically used to: Performing a linear transformation on the first position code to obtain a first attention vector, and performing a linear transformation on the spatiotemporal feature code to obtain a second attention vector and a third attention vector; Calculating an attention score matrix based on the second attention vector and the third attention vector; A weighted summation is performed on the first attention vector according to the attention score matrix to obtain a second position encoding of the first time series data.

8. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

9. A computer-readable medium, characterized in that The computer-readable medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Text embedding vector generation method and device based on pre-training model

    CN118586399A

  • Abnormality detection method, device, equipment and medium

    CN119577635A