Abnormal time series detection method and storage medium based on self-supervised representation network

Through the method based on self-supervised characterization network, OBD data is used to identify high-emission concentration sequences, which solves the problem that high-emission source screening methods in the prior art are affected by external factors, and accurately identify and screen high-emission mobile sources are achieved.

CN115439956BActive Publication Date: 2024-11-26ARTIFICIAL INTELLIGENCE RES INST OF HEFEI COMPREHENSIVE NAT SCI CENT (ANHUI ARTIFICIAL INTELLIGENCE LAB)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211066771.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-01
Publication Date
2024-11-26
Estimated Expiration
2042-09-01

AI Technical Summary

Technical Problem

The existing high-emission source screening methods rely on periodic detection and are greatly affected by external factors, resulting in randomness and contingency of the detection results, making it difficult to accurately identify mobile sources on high-emission roads.

Method used

Using an abnormal timing sequence detection method based on self-supervised characterization network, using NOx emission concentration, engine speed and other information in OBD data, through self-supervised learning and characterization memory modules, a high emission concentration sequence recognition model is constructed to reduce interference from external factors and improve the Identify accuracy.

Benefits of technology

It realizes accurate identification of high-emission mobile sources, reduces the randomness and contingency of detection results, provides a stable data basis, and provides a basis for relevant governance policies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115439956B_ABST
    Figure CN115439956B_ABST
Patent Text Reader

Abstract

The present invention discloses an abnormal time series sequence detection method and storage medium based on a self-supervised characterization network, comprising the following steps: S1: extracting a road mobile source OBD data set and preprocessing it; S2: constructing a time series driving condition data set; forming a multi-dimensional OBD condition time series data set with the pollutant NOx concentration and other characteristic attributes, and sorting out the emission sequence of the continuous time period according to the timestamp; S3: constructing a high emission concentration sequence recognition model, specifically constructing an abnormal time series sequence detection model based on a self-supervised characterization network. The present invention combines the multivariate vehicle operation attribute information in the OBD data set to avoid the interference of external factors on the monitoring environment, and provides a prerequisite for obtaining real emission status data. At the same time, a reconstruction-based method is used to divide the characterization of high emission and normal emission sequences. It solves the problem of low accuracy in high emission source recognition caused by similar deep learning-based methods due to rich and varied driving conditions and insufficient emission characterization learning capabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of environmental monitoring, and in particular to an abnormal time series detection method based on a self-supervised characterization network. Background Art

[0002] With the improvement of the national economic level, the number of motor vehicles has increased year by year, and the exhaust emissions have posed a serious threat to urban air quality. Among them, high-emission mobile sources with a relatively low number often contribute to the majority of total vehicle emissions. Therefore, it is very necessary to accurately identify and screen high-emission mobile sources, and at the same time provide a certain basis for the formulation of relevant governance policies.

[0003] The existing high emission source screening methods mainly rely on the annual vehicle inspection station, that is, every six months or one year, the vehicle is required to pass through the road section equipped with a fixed exhaust emission monitoring device, and then compare it with the fixed emission standards to finally determine the vehicle's emission category. For example, the remote sensing detection device can detect multiple vehicles at the same time without interfering with the normal driving of road vehicles, but its instantaneous monitoring results are very sensitive to external factors (such as wind speed, temperature, air humidity, etc.). At the same time, considering that periodic detection is costly and time-consuming, it cannot be tested frequently, which increases the randomness and contingency of the test results.

[0004] The On-Board Diagnostic (OBD) system is a vehicle-mounted operation monitoring device that can monitor engine operating status and exhaust emissions in real time. Due to its convenient mobility, low cost, and compact size, it has gradually been applied to vehicle emission detection in recent years. Compared with traditional emission detection devices, OBD can continuously record vehicle exhaust emissions and engine parameters and other data characteristics without being affected by environmental factors, which largely avoids the uncertainty brought by instantaneous detection results and provides a more stable data basis for the accurate identification and screening of high-emission road mobile sources. Summary of the invention

[0005] In view of the above practical problems and technical background, the present invention adopts a data-driven method, using information such as NOx emission concentration, engine speed and actual output torque of OBD data, and proposes an abnormal time series detection method based on a self-supervised characterization network. Specifically, to achieve accurate recognition of high emission concentration sequences of vehicles under time series conditions, it is necessary to solve the problem of differences between emission concentration sequences caused by rich and varied driving conditions: (1) There is a large difference between normal and normal emission concentration sequences; (2) There is a large similarity between normal and abnormal emission concentration sequences, which can be used for the identification and screening of high-emission road mobile sources under time series driving conditions.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] An abnormal time series detection method based on a self-supervised representation network includes the following steps: S1: extracting a road mobile source OBD data set and preprocessing it;

[0008] S2: Construct a time series driving condition data set; combine the pollutant NOx concentration and other characteristic attributes into a multi-dimensional OBD condition time series data set, and sort out the emission sequence of continuous time periods according to timestamps;

[0009] S3: Construct a high emission concentration sequence recognition model, specifically, construct an abnormal time series detection model based on a self-supervised representation network.

[0010] Furthermore, step S1 specifically includes collecting real-time monitoring data of the on-board diagnostic system of several motor vehicles over a continuous period of multiple days, including characteristic attributes such as timestamp, post-treatment downstream NOx value, engine speed, actual output torque percentage, accelerator pedal opening, engine instantaneous fuel injection amount, engine instantaneous fuel consumption rate, and longitude and latitude;

[0011] The preprocessing in the above step S1 is specifically subdivided into the following steps:

[0012] S11: For the null values ​​existing in the extracted vehicle OBD data set, the corresponding entire row of data is deleted;

[0013] S12: Several OBD datasets are artificially divided into “normal emission” and “high emission” labels according to the actual emission conditions of the vehicles;

[0014] S13: Normalize the data set, expressed as:

[0015]

[0016] Among them, x i represents the true value, Represents x i The normalized value of x max and x min They are the maximum and minimum values ​​of the current attribute respectively.

[0017] Furthermore, the above step S2 is specifically subdivided into the following steps:

[0018] S21: Consider a vehicle emission characteristic data set obtained by step S1 The x (i) ∈R m is a vector containing m-dimensional features. The dataset is divided into emission sequence sets X = {X 1,X 2 ,…,X N}, where X i ∈R l×m Represents a two-dimensional matrix.

[0019] Furthermore, the above step S3 is specifically subdivided into the following steps:

[0020] S31: encoding; according to the dimension of the vehicle emission input sequence x, an encoding vector z is obtained after being mapped by the encoder;

[0021] S32: self-supervised learning module;

[0022] S33: Representation memory module, which enhances the model's ability to distinguish between normal and abnormal data by recording prototype patterns;

[0023] S34: Decoding: After a series of reconstructions, the vehicle emission input sequence x needs to be decoded by a decoder to obtain an output sequence x′ in the original dimensional space;

[0024] S35: Model training and prediction;

[0025] S36: Model classification performance evaluation.

[0026] Further, the encoding process of step S311 is expressed as:

[0027] z=f e (x;θ e ) (2)

[0028] Among them, f e Represents the mapping function of the encoder, θ e Represents all parameters inside the encoder.

[0029] Further, step S32 specifically includes:

[0030] S321: The following six signal transformations are used to increase the number of representations of the source data set, as described below:

[0031] The time-series emission sequence T = [t 1 ,t 2 ,...,t n ] as an example:

[0032] Noise; Transform with Gaussian noise added;

[0033] Reverse; This transformation reverses the sample along the time dimension, thus obtaining samples T in the opposite direction of time op :

[0034] T op =[tn ,...,t 2 ,t 1 ] (3)

[0035] Permutation: This transformation generates new samples T by slicing and exchanging different time windows. Assuming the slice length is 2, the signal is randomly perturbed along the time dimension, enhancing the permutation invariance of the obtained model. pe :

[0036] T pe =[...,t 1 ,t 2 ,....,t n-l ,t n-l+1 ,....](l <n) (4)

[0037] Scaling: Change the size of a signal within a time window by multiplying it by a random scalar; scale the signal T sc The addition of can help the model learn scale-invariant patterns, which is expressed as:

[0038] T sc =[t 1 ×s,t 2 ×s,...,t n ×s],s∈S (5)

[0039] Negation: Scale by -1 to get the mirror image sequence T of the input signal ne :

[0040] T ne =[-t 1 ,-t 2 ,...,-t n ] (6)

[0041] Smoothing: Apply the Savitzky-Golay method to smooth the signal;

[0042] S322: Use the cross entropy loss function to distinguish their transformation types:

[0043]

[0044] Where C is the number of self-supervised learning categories, including the original signal and 6 transformed signals; i and p i They are predicted labels and predicted probabilities respectively; predicted probability p i It is calculated by applying the Softmax activation function, and its expression is as follows:

[0045]

[0046] Among them, 1≤i≤C, O i It represents the i-th value of the last layer output of the fully connected layer, and exp represents the natural constant e.

[0047] Further, step S33 specifically includes:

[0048] S331: Given a coding vector z∈R obtained in step S31 F , initialize a representation memory matrix M∈R T ×F , memory weight vector w∈R T is calculated as:

[0049] w=S(z,M) (9)

[0050] Among them, S(·) represents the similarity function, and its calculation expression is:

[0051]

[0052] Among them, exp represents the natural constant e, M i represents the i-th row vector representing the memory matrix M and

[0053] S332: Calculate the memory weight vector w obtained in S331 and the representation memory matrix M to obtain the representation memory vector It is represented as:

[0054]

[0055] S333: To promote network update and convergence, it is necessary to calculate the sparse loss value L of the memory weight vector w SPAR , calculated as:

[0056]

[0057] Further, step S34 specifically includes:

[0058] S341: the representation memory vector obtained in step S33 Directly concatenate with the encoding vector z, and concatenate and record as the representation vector z * ∈R 2F ;

[0059] S342: Characterization vector z * After being decoded by the decoder, the output sequence x′ of vehicle emissions is obtained. The process is expressed as:

[0060] x'=f d (z * θ d ) (13)

[0061] Among them, f d Denotes the mapping function of the decoder, θ d Represents all the parameters of the decoder structure that the network needs to learn;

[0062] Calculate the reconstruction loss L between the vehicle emission input sequence x and the output sequence x′ MSe , calculated as:

[0063]

[0064] Among them, ||·|| 2 represents the second norm, l represents the original dimension of the input sequence, and C represents the number of sequence conversion categories.

[0065] Further, step S35 specifically includes:

[0066] S351: Model training process: By replacing the reconstruction loss L in the formula MSE , the self-supervision loss L in formula CE And the sparse loss L in the formula SPAR With the trade-off parameters 1, α 1 and α 2 After integration, the overall training objective of the high emission sequence recognition model will be obtained:

[0067] J(θ)=L MSE +α 1 L CE +α 2 L SPAR (15)

[0068] S352: The prediction process of the model divides the emission instances in the prediction phase into two categories: “normal” and “abnormal” according to the reconstruction error threshold;

[0069] S353: Given a training set X={X 1 ,X 2 ,…,X P}, after the model is reconstructed, the reconstruction error set is L CONS ={L(X 1 ),L(X 2 ),…,L(X P )}, where L(X i ) represents instance X i The reconstruction loss value L MSE ; Then the reconstruction error threshold μ used to judge the test set is defined as the reconstruction error L CONS The 98th percentile of

[0070] S354: After obtaining the threshold μ, the division rule of the two category labels of “normal” and “abnormal” on the test set is expressed as:

[0071]

[0072]

[0073] Among them, T Normal represents the normal emission sequence set on the test set, T Abnormal represents a set of high emission sequences; for the normal emission sequence T i , if it is classified as “normal”, the classification is correct, otherwise the classification is wrong; for the high emission sequence T j , if it is classified as “abnormal”, the classification is correct, otherwise it is wrong.

[0074] On the other hand, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.

[0075] It can be seen from the above technical solution that the abnormal time series detection method based on the self-supervised representation network of the present invention has the following beneficial effects:

[0076] The existing high emission source screening methods rely on the annual vehicle inspection station to require vehicles to pass through sections equipped with fixed exhaust emission monitoring devices within the inspection cycle of every six months or one year, and then compare with fixed emission standards to finally determine the emission category of the vehicle. In this process, the inspection cycle spans a large span, the monitoring time is short, and the detection device is often very sensitive to external factors (such as wind speed, temperature, air humidity, etc.). Therefore, the test results are highly random and accidental, which greatly weakens the accuracy of the vehicle's actual emission status.

[0077] In response to this problem, the present invention adopts a data-driven approach and proposes a high-emission mobile source detection method based on self-supervised learning and adaptive memory networks. Combined with the multivariate vehicle operation attribute information (such as vehicle speed, engine speed, etc.) in the OBD data set, the interference of external factors on the monitoring environment is avoided, providing a prerequisite for obtaining real emission status data. At the same time, a reconstruction-based method is used to divide the representation of high-emission and normal emission sequences. The problem of low accuracy in high-emission source identification caused by similar deep learning-based methods due to rich and varied driving conditions and insufficient emission representation learning capabilities is solved. Specifically, considering the difficulty of labeling in actual scenarios, the self-supervised learning module in the present invention uses data type transformation as a pre-task that avoids manual labeling to assist the model in learning general representations in emission sequences. Considering the richness of emission sequences, the representation memory module learns and memorizes key representations in emission sequences through a memory network. The present invention can provide a new reference solution for relevant departments to accurately monitor road vehicles. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1 It is a comparison between different emission series of the current situation;

[0079] Figure 2 Step S2 of the embodiment of the present invention is to construct a time series operating condition data set;

[0080] Figure 3 is a network model structure diagram of an embodiment of the present invention;

[0081] Figure 4 Schematic diagram of the processing process of the encoder Encoder in an embodiment of the present invention;

[0082] Figure 5 It is a schematic diagram of the processing process of the decoder Decoder according to an embodiment of the present invention. DETAILED DESCRIPTION

[0083] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.

[0084] In order to solve the problem of concentration sequence differences in the time series identification of high emission sources, such as Figure 1 The results show that the differences between normal emission sets are large, and the similarities between normal emission and high emission sets are large. The embodiment of the present invention proposes an abnormal time series detection method based on a self-supervised characterization network, which can classify the exhaust emission concentration sequence at a fine-grained level and increase the recognition accuracy of the high emission sequence.

[0085] The present invention comprises the following steps:

[0086] S1: Extraction and preprocessing of road mobile source OBD data set. Collect real-time monitoring data of the on-board diagnostic system (OBD) of several motor vehicles over a continuous period of multiple days, including timestamp, post-processing downstream NOx value (ppm), engine speed (rpm), actual output torque percentage, accelerator pedal opening (%), engine instantaneous fuel injection volume (L), engine instantaneous fuel consumption rate (L / 100KM), longitude and latitude and other characteristic attributes, and perform preprocessing operations such as missing value deletion, high emission sequence data set label division and data normalization;

[0087] S2: Construction of time series driving condition data set. The pollutant NOx concentration and other characteristic attributes are combined into a multi-dimensional OBD condition time series data set, and the emission sequence of continuous time periods is sorted out according to the timestamp;

[0088] S3: Construction of high emission concentration sequence recognition model. In view of the fact that the actual emission concentration sequence has rich representation problems, an abnormal time series detection model based on a self-supervised representation network is constructed.

[0089] The following are detailed descriptions:

[0090] The above step S1: road mobile source OBD data set extraction and preprocessing is specifically divided into the following steps:

[0091] S11: For the null values ​​existing in the extracted vehicle OBD data set, the corresponding entire row of data is deleted;

[0092] S12: Several OBD datasets are artificially divided into “normal emission” and “high emission” labels according to the actual emission conditions of the vehicles;

[0093] S13: In order to overcome the impact of data dimension differences on data analysis, it is necessary to use normalization processing on the data set. It can be expressed as:

[0094]

[0095] Among them, x i represents the true value, Represents x i The normalized value of x max and x min They are the maximum and minimum values ​​of the current attribute respectively.

[0096] The above step S2: constructing a time series driving condition data set, the specific time series driving condition data set is as follows Figure 2 As shown, the specific steps are as follows:

[0097] S21: Consider a vehicle emission characteristic data set obtained by step S1 The x (i) ∈R m is a vector containing m-dimensional features. The dataset is divided into emission sequence sets X = {X 1 ,X 2 ,…,X N}, where X i ∈R l×m Represents a two-dimensional matrix.

[0098] S22: For ease of understanding, the present invention takes an actual vehicle OBD data set as an example, where the time interval between adjacent emission information is 5 seconds, and the time step l is set to 120, that is, the time span of a single emission sequence is 10 minutes. In addition, the feature dimension m of the data set is 23. The included features are counted in the following table:

[0099]

[0100]

[0101] The above step S3: high emission concentration sequence recognition model construction. The model structure is as follows Figure 3 As shown in the figure, the model mainly consists of two modules, namely the self-supervised learning module and the representation memory module; the specific steps are as follows:

[0102] S31: Encoding. According to the dimension of the vehicle emission input sequence x, the encoding vector z is obtained after being mapped by the encoder;

[0103] S311: Specifically, the encoding process can be expressed as:

[0104] z=f e (x;θ e ) (2)

[0105] Among them, f e Represents the mapping function of the encoder, θ e Represents all parameters inside the encoder.

[0106] S312: Specifically, the processing process of the encoder is as follows: Figure 4 As shown, it contains 1 all-0 padding layer, 2 convolutional layers, 2 RELU activation layers and 2 pooling layers.

[0107] S32: Self-supervised learning module. In order to effectively reduce the impact of the rich differences between normal and normal emission sequences on model recognition and improve the generalization ability of the model, the present invention designs a module based on self-supervised learning, which is used for the model to learn richer data representations during the training stage;

[0108] S321: Specifically, we propose the following six signal transformations to increase the number of representations of the source dataset, which are described as follows:

[0109] The time-series emission sequence T = [t 1 ,t 2 ,...,t n ] as an example:

[0110] Noise: In the real world, there may be noisy sensor signals. Adding noise to the signal can help the model learn more robust features in the noise. Here, a Gaussian noise transformation is added;

[0111] Reverse: This transformation reverses the sample along the time dimension, thus obtaining samples T in the opposite direction of time op :

[0112] T op =[t n ,...,t 2 ,t 1 ] (3)

[0113] Permutation: This transformation randomly perturbs the signal along the time dimension by slicing and exchanging different time windows (assuming the slice length is 2), enhancing the permutation invariance of the resulting model and generating new samples T pe :

[0114] T pe =[...,t 1 ,t 2 ,....,t n-l ,t n-l+1 ,....](l <n) (4)

[0115] Scaling: Change the size of the signal within a time window by multiplying it by a random scalar. Here, we choose S = {0.5, 0.8, 1.5, 2} as the scalar value. Scaling signal T sc The addition of can help the model learn scale-invariant patterns, which can be expressed as:

[0116] T sc =[t 1 ×s,t 2 ×s,...,t n ×s],s∈S (5)

[0117] Negation: This transformation is a special type of scalarization transformation. It scales by -1, resulting in a mirror image sequence T of the input signal ne :

[0118] T ne=[-t 1 ,-t 2 ,...,-t n ] (6)

[0119] Smoothing: Apply the Savitzky-Golay method to smooth the signal;

[0120] S322: In order to learn general feature representations from these transformations, the present invention uses a cross-entropy loss function to distinguish their transformation types:

[0121]

[0122] Wherein, C is the number of self-supervised learning categories (including the original signal and 6 transformed signals, that is, C=7 in the example of the present invention). i and p i are the predicted labels and predicted probabilities respectively. The predicted probability p i It is calculated by applying the Softmax activation function, and its expression is as follows:

[0123]

[0124] Among them, 1≤i≤C, O i It represents the i-th value of the last layer output of the fully connected layer, and exp represents the natural constant e.

[0125] S33: Representation memory module. In order to learn as many rich representations of vehicle emission sequences as possible and improve the generalization ability of the model during training, a representation memory module is designed to enhance the model's ability to distinguish normal and abnormal data by recording prototype patterns. Specifically:

[0126] S331: Given a coding vector z∈R obtained in step S31 F , initialize a representation memory matrix M∈R T ×F , memory weight vector w∈R T is calculated as:

[0127] w=S(z,M) (9)

[0128] Among them, S(·) represents the similarity function, and its calculation expression is:

[0129]

[0130] Among them, exp represents the natural constant e, M i represents the i-th row vector representing the memory matrix M and

[0131] S332: Calculate the memory weight vector w obtained in S331 and the representation memory matrix M to obtain the representation memory vector It is represented as:

[0132]

[0133] S333: To promote network update and convergence, it is necessary to calculate the sparse loss value L of the memory weight vector w SPAR , calculated as:

[0134]

[0135] S34: Decoding. After a series of reconstructions, the vehicle emission input sequence x needs to be decoded by a decoder to obtain the output sequence x′ in the original dimensional space. Specifically, it is divided into the following steps:

[0136] S341: the representation memory vector obtained in step S33 Directly concatenate with the encoding vector z, and concatenate and record as the representation vector z * ∈R 2F ;

[0137] S342: Characterization vector z * After being decoded by the decoder, the output sequence x′ of vehicle emissions is obtained. The process can be expressed as:

[0138] x'=f d (z * θ d ) (13)

[0139] Among them, f d Denotes the mapping function of the decoder, θ d Represents all the parameters of the decoder structure that the network needs to learn.

[0140] S343: Specifically, the processing process of the decoder Decoder is as follows Figure 5 As shown, it contains 4 convolutional layers, 3 RELU activation layers and 1 Sigmoid activation layer.

[0141] S344: To promote network update and convergence, it is necessary to calculate the reconstruction loss value L between the vehicle emission input sequence x and the output sequence x′ MSE , calculated as:

[0142]

[0143] Among them, ||·|| 2represents the second norm, l represents the original dimension of the input sequence, and C represents the number of sequence conversion categories (including the original signal and 6 transformed signals, that is, C=7 in the example of the present invention).

[0144] S35: Model training and prediction. Specifically:

[0145] S351: Model training process: By replacing the reconstruction loss L in the formula MSE , the self-supervision loss L in formula CE And the sparse loss L in the formula SPAR With the trade-off parameters 1, α 1 and α 2 After integration, the overall training objective of the high emission sequence recognition model will be obtained:

[0146] J(θ)=L MSE +α 1 L CE +α 2 L SPAR (15)

[0147] S352: Model prediction process: The method proposed in the present invention belongs to the category of reconstruction-based methods, that is, emission sequences or instances of different categories are generally considered to be different after model reconstruction. During the training process, only data sets containing normal emission instances are used. In the prediction stage, when the model encounters abnormal instances, the reconstruction error will increase significantly. Therefore, the present invention divides the emission instances in the prediction stage into "normal" and "abnormal" categories according to the reconstruction error threshold;

[0148] S353: For example, given a training set X={X 1 ,X 2 ,…,X P}, after the model is reconstructed, the reconstruction error set is L CONS ={L(X 1 ),L(X 2 ),…,L(X P )}(where L(X i ) represents instance X i The reconstruction loss value L MSE ). Then the reconstruction error threshold μ used to judge the test set is defined as the reconstruction error L CONS The 98th percentile of

[0149] S354: After obtaining the threshold μ, the division rule of the two category labels of “normal” and “abnormal” on the test set is expressed as:

[0150]

[0151]

[0152] Among them, T Normal represents the normal emission sequence set on the test set, T Abnormal represents a set of high emission sequences. For the normal emission sequence T i , if it is classified as “normal”, the classification is correct, otherwise the classification is wrong; for the high emission sequence T j , if it is classified as “abnormal”, the classification is correct, otherwise it is wrong.

[0153] S36: Model classification performance evaluation. After obtaining the classification results of the vehicle concentration emission sequence on the test set in step S35, the classification performance of the model is measured using the following indicators: accuracy (Acc), precision (P), recall (R) and F1 value. Specifically:

[0154] S361: Construct a confusion matrix of the test results. Taking this experimental data as an example, the confusion matrix is ​​as follows:

[0155]

[0156] Among them, TP represents true positive examples, FP represents false positive examples, TN represents true negative examples, and FN represents false negative examples.

[0157] S362: Indicator calculation:

[0158]

[0159]

[0160]

[0161]

[0162] S363: Experimental results statistics:

[0163]

[0164] Combined with the experimental results of step S363, the test indicators of this method on the data of normal emission sequence set and abnormal emission (high emission) sequence set all reached above 0.98, indicating that it has fully learned the deep representation of different emission type data, thereby realizing accurate identification of high-emission mobile sources.

[0165] In yet another aspect, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of any of the above methods.

[0166] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any of the above methods.

[0167] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the steps of any method in the above embodiments.

[0168] It is understandable that the system provided by the embodiment of the present invention corresponds to the method provided by the embodiment of the present invention, and the explanation, examples and beneficial effects of the relevant contents can refer to the corresponding parts in the above method.

[0169] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0170] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0171] 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 the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting abnormal time series based on self-supervised representation network, It is characterized in that The following steps are included: S1: Extract road mobile source OBD data set and preprocess; S2: Construct a time series driving condition dataset; The NOx concentration and other characteristic attributes of pollutants are combined into a multi-dimensional OBD operating condition time series data set, and the emission sequence of continuous time periods is sorted out according to timestamps; S3: Construct a high emission concentration sequence recognition model, specifically, construct an abnormal time series detection model based on a self-supervised representation network; Step S3 is specifically divided into the following steps: S31: encoding; according to the dimension of the vehicle emission input sequence x, an encoding vector z is obtained after being mapped by the encoder; S32: self-supervised learning module; S33: Representation memory module, which enhances the model's ability to distinguish between normal and abnormal data by recording prototype patterns; S34: Decoding: After a series of reconstructions, the vehicle emission input sequence x needs to be decoded by a decoder to obtain an output sequence x′ in the original dimensional space; S35: Model training and prediction; S36: Model classification performance evaluation; The encoding process of step S31 is expressed as: z=f e (x;θ e ) (2) Among them, f e Represents the mapping function of the encoder, θ e Represents all parameters inside the encoder; Step S32 specifically includes: S321: The following six signal transformations are used to increase the number of representations of the source data set, as described below: The time-series emission sequence T = [t 1 ,t 2 ,...,t n ] as an example: Noise; Transform with Gaussian noise added; Reverse; This transformation reverses the sample along the time dimension, thus obtaining samples T in the opposite direction of time op : T op =[t n ,...,t 2 ,t 1 ] (3) Permutation: This transformation generates new samples T by slicing and exchanging different time windows. Assuming the slice length is 2, the signal is randomly perturbed along the time dimension, enhancing the permutation invariance of the obtained model. pe : T pe =[...,t 1 ,t 2 ,....,t n-l ,t n-l+1 ,....] (l<n) (4) Scaling: Change the size of a signal within a time window by multiplying it by a random scalar; scale the signal T sc The addition of can help the model learn scale-invariant patterns, which is expressed as: T sc =[t 1 ×s,t 2 ×s,...,t n ×s],s∈S (5) Negation: Scale by -1 to get the mirror image sequence T of the input signal ne : T ne =[-t 1 ,-t 2 ,...,-t n ] (6) Smoothing: Apply the Savitzky-Golay method to smooth the signal; S322: Use the cross entropy loss function to distinguish their transformation types: Where C is the number of self-supervised learning categories, including the original signal and 6 transformed signals; i and p i They are predicted labels and predicted probabilities respectively; predicted probability p i It is calculated by applying the Softmax activation function, and its expression is as follows: Among them, 1≤i≤C, O i represents the i-th value of the last layer output of the fully connected layer, and exp represents the natural constant e; Step S33 specifically includes: S331: Given a coding vector z∈R obtained in step S31 G , initialize a representation memory matrix M∈R T×F , memory weight vector w∈R T is calculated as: w=S(z,M) (9) Among them, S(·) represents the similarity function, and its calculation expression is: Among them, exp represents the natural constant e, M i represents the i-th row vector representing the memory matrix M and S332: Calculate the memory weight vector w obtained in S331 and the representation memory matrix M to obtain the representation memory vector It is represented as: S333: To promote network update and convergence, it is necessary to calculate the sparse loss value L of the memory weight vector w SPAR , calculated as: Step S34 specifically includes: S341: the representation memory vector obtained in step S33 Directly concatenate with the encoding vector z, and concatenate and record as the representation vector z * ∈R 2F ; S342: Characterization vector z * After being decoded by the decoder, the output sequence x′ of vehicle emissions is obtained. The process is expressed as: x'=f d (z * ;θ d ) (13) Among them, f d Denotes the mapping function of the decoder, θ d Represents all the parameters of the decoder structure that the network needs to learn; Calculate the reconstruction loss L between the vehicle emission input sequence x and the output sequence x′ MSE , calculated as: Among them, ||·|| 2 represents the second norm, l represents the original dimension of the input sequence, and C represents the number of sequence conversion categories; Step S35 specifically includes: S351: Model training process: By replacing the reconstruction loss L in the formula MSE , the self-supervision loss L in formula CE And the sparse loss L in the formula SPAR With the trade-off parameters 1, α 1 and α 2 After integration, the overall training objective of the high emission sequence recognition model will be obtained: J(θ)=L MSE +a 1 L CE +a 2 L SPAR (15) S352: The prediction process of the model divides the emission instances in the prediction phase into two categories: "normal" and "abnormal" according to the reconstruction error threshold; S353: Given a training set X={X 1 ,X 2 ,…,X P }, after the model is reconstructed, the reconstruction error set is L CONS ={L(X 1 ),L(X 2 ),…,L(X P )}, where L(X i ) represents instance X i The reconstruction loss value L MSE ; Then the reconstruction error threshold μ used to judge the test set is defined as the reconstruction error L CONS The 98th percentile of S354: After the threshold μ is obtained, the division rule of the two category labels of "normal" and "abnormal" on the test set is expressed as: Among them, T Normal represents the normal emission sequence set on the test set, T Abnormal represents a set of high emission sequences; for the normal emission sequence T i , if it is classified as "normal", the classification is correct, otherwise the classification is wrong; for the high emission sequence T j , if it is classified as "abnormal", the classification is correct, otherwise it is wrong.

2. According to claim 1, the abnormal time series detection method based on the self-supervised representation network, Features: Step S1 specifically includes collecting real-time monitoring data of the on-board diagnostic system of several motor vehicles over a continuous period of multiple days, including characteristic attributes such as timestamp, post-treatment downstream NOx value, engine speed, actual output torque percentage, accelerator pedal opening, engine instantaneous fuel injection amount, engine instantaneous fuel consumption rate, and longitude and latitude; The preprocessing in the above step S1 is specifically subdivided into the following steps: S11: For the null values ​​existing in the extracted vehicle OBD data set, the corresponding entire row of data is deleted; S12: artificially divide several OBD data sets into "normal emission" and "high emission" labels according to the actual emission conditions of the vehicles; S13: Normalize the data set, expressed as: Among them, x i represents the true value, Represents x i The normalized value of x max and x min They are the maximum and minimum values ​​of the current attribute respectively.

3. According to claim 2, the abnormal time series detection method based on the self-supervised representation network, Features: Step S2 is specifically divided into the following steps: S21: Consider a vehicle emission characteristic data set obtained by step S1 The x (i) ∈R m is a vector containing m-dimensional features. The dataset is divided into emission sequence sets X = {X 1 ,X 2 ,…,X N }, where X i ∈R l×m Represents a two-dimensional matrix.

4. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 3.