Distributed optical fiber sensing perimeter intrusion event open set identification method based on self-supervised contrast learning

By adopting a self-supervised comparison learning method in distributed fiber acoustic sensing technology, combining Gram angle field sample conversion and ConvNext network feature learning, the problem of unknown intrusion incident recognition is solved, and efficient perimeter security recognition effect is achieved.

CN119848832APending Publication Date: 2025-04-18ARTIFICIAL INTELLIGENCE INNOVATION RES INST OF ZHEJIANG UNIV OF TECH BINJIANG DISTRICT HANGZHOU
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411925270.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The existing distributed fiber acoustic sensing technology is difficult to effectively identify unknown new intrusion events in perimeter security, and traditional deep learning methods require a large amount of labeled data, making it difficult to obtain.

Method used

A distributed fiber-sensing perimeter intrusion event open-set recognition method based on self-supervised contrast learning is adopted. Through Gram angle field sample conversion, image enhancement, ConvNext network feature learning and two-level confidence detection, combined with BoHo hyperparameter optimization algorithm, an SCOC algorithm model is built to achieve open-set recognition.

Benefits of technology

It improves the detection ability of unknown intrusion events, reduces dependence on tag data, enhances the robustness of the system in a noisy environment, and improves the recognition accuracy of the perimeter security system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848832A_ABST
    Figure CN119848832A_ABST
Patent Text Reader

Abstract

A distributed optical fiber sensing perimeter intrusion event open set identification method based on self-supervised comparative learning comprises the following steps: step 1, an experiment scene: establishing a DAS system, and collecting data samples of various intrusion events; 2, data preprocessing: carrying out noise reduction processing on the experimental data sample, and then converting the experimental data sample into a GASF image; step 3, the processed data is divided into two parts during training, one part is data with labels and known categories, and the other part is data without labels and containing all types of events; step 4, constructing a self-supervised contrast open set class learning (SCOC) algorithm model; step 5, training the constructed SCOC algorithm model, performing hyper-parameter optimization by using a BoHo optimization algorithm, and obtaining an SCOC algorithm training model under the optimal hyper-parameter combination; and step 6, open set event classification testing. According to the invention, the problems of identification and alarm of unknown intrusion events in an open set scene and the like can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of distributed optical fiber sound and vibration sensing, and in particular relates to an open set recognition method for fence perimeter intrusion events based on distributed optical fiber sensing. Background Art

[0002] Distributed acoustic sensing (DAS) technology uses optical fiber as a sensor to perceive sound vibration signals. It is mainly used in traffic management, oil and gas detection, geological monitoring, offshore wind power, perimeter security and other fields. Real-time monitoring is performed through optical fiber vibration signals caused by various events. This technology has the characteristics of high accuracy, wide coverage and strong anti-interference ability, and is suitable for complex outdoor environments and various large-scale monitoring. However, traditional signal processing methods are easily affected by environmental noise and interference signals, resulting in false alarms and missed alarms. In addition, the large amount of DAS data and high data dimension bring great challenges to computing and storage, and put forward higher requirements for real-time processing and classification recognition.

[0003] As we all know, the deep learning methods currently mainly used for DAS data are based on closed-set supervised learning methods, which require a large amount of labeled data. However, in the application of DAS technology, it may be costly or difficult to obtain a large amount of labeled DAS data. The distributed fiber optic sensing security intrusion signal recognition system based on deep learning is that when a disturbance event such as shaking or wind occurs near the fence where the fiber is laid, the signal phase in the fiber will change, and the signal is acquired through DAS. Then, the signal is identified and classified using a deep learning algorithm, forming an intrusion recognition system that combines deep learning and distributed fiber optic sensing.

[0004] Traditional DAS recognition methods are usually based on the closed set assumption, that is, all categories are known in advance, which results in the system being unable to effectively identify new intrusion events of unknown types (Reference 1: An open set recognition method for pattern recognition of distributed fiber optic acoustic vibration sensing systems, CN116842446A). Early open set recognition methods such as Openmax and CPL prototype learning are based on threshold discrimination for recognition. Prototype learning-based methods are very effective in forming compact representations of known classes, but they encounter greater obstacles when facing OSR open set tasks. For example, there is the problem of insufficient category representation, where only a single or limited number of points cannot fully represent the category. Some recent methods use self-supervised training methods such as contrastive learning. How to effectively combine contrastive learning with open set recognition in the field of distributed fiber optic sensing and improve the detection capabilities of perimeter security systems for unknown intrusion events has become a research hotspot at this stage. Summary of the invention

[0005] In order to overcome the shortcomings of the existing technology, the present invention provides an open-set identification method for distributed fiber optic sensing perimeter intrusion events based on self-supervised contrastive learning. This method can solve the application of DAS in perimeter security, especially the identification and alarm of unknown intrusion events in open-set scenarios.

[0006] The technical solution adopted by the present invention to solve its technical problem is:

[0007] A distributed optical fiber sensing perimeter intrusion event open set recognition method based on self-supervised contrastive learning includes the following steps:

[0008] Step 1, Experimental scenario: Build a DAS system and collect data samples of various intrusion events;

[0009] Step 2: Data preprocessing: noise reduction is performed on the experimental data samples, and then they are converted into Gramian Angular Field (GASF) images;

[0010] Step 3: Create a data set: The processed data will be divided into two parts during training, one part is labeled data with known categories, and the other part is unlabeled data containing all types of events;

[0011] Step 4: Construct a self-supervised contrastive open set learning SCOC algorithm model: the whole model is divided into three modules, the first one is the image enhancement module; the second one is the feature learning module; the third one is the open set learning module;

[0012] Step 5: Train the constructed SCOC algorithm model and use the BoHo (Bayesian and hyperband) optimization algorithm to optimize the hyperparameters, and obtain the SCOC algorithm training model under the best hyperparameter combination;

[0013] Step 6: Open set event classification test: load the pre-trained SCOC model weights and test it with the test set collected in the experiment to complete the open set recognition of perimeter fence intrusion events.

[0014] Further, the process of step 1 is as follows: optical fiber is laid around the fence in two ways: S-type hanging net optical cable and ground optical cable, and then the optical cable is connected to the DAS to collect data of different intrusion events. Intrusion events are divided into two types: known category events and unknown category events.

[0015] Furthermore, the process of step 2 is as follows:

[0016] 2.1、DAS collects one-dimensional signal data X={x1,···,x n-1 ,x n}, using the wavelet transform denoising method based on db4 wave basis to reduce the noise of the signal and reduce the impact of surrounding noise on the intrusion signal;

[0017] 2.2. After the noise reduction process, the signal strength is normalized to [-1, 1], and the Gram matrix is ​​converted to polar coordinates to obtain the Gram angular field samples of each signal. The calculation formula is as follows:

[0018]

[0019] The GASF algorithm converts 1D time signals into 2D images with focused features, extracts motion features from the trends and patterns of signal changes over time, and each disturbance signal corresponds to a unique two-dimensional image based on the trends and patterns of signal changes over time, thereby effectively improving the recognition accuracy. The algorithm is robust to noise because the motion trend will not be masked by noise.

[0020] Furthermore, the process of step 3 is as follows:

[0021] 3.1. The preprocessed Gram angle field data is represented by g and divided into training and validation sets according to the set ratio;

[0022] 3.2. The training set is further divided into two parts, one part of unlabeled samples is used for self-supervised comparative learning, and the other part of labeled samples is used for supervised learning. The test set and validation set have the same numbers.

[0023] The process of step 4 is as follows:

[0024] 4.1. The first module is image enhancement, which enhances the Gram angle field samples of various intrusion events. Two image enhancement methods are used here: weak enhancement and strong enhancement. Weak enhancement is a relatively weak enhancement method, including flipping, cropping, time shifting or adding noise; strong enhancement is a relatively strong enhancement method, which adopts a random enhancement method based on Randaugment. It contains two parameters (N, M), which control the number of image transformations applied in sequence and the intensity of image transformation respectively. It combines thirteen transformations of different intensities, including automatic recovery, equalization, rotation, exposure, color, tone separation, contrast, brightness, sharpening, shearing along the X axis, shearing along the Y axis, translation along the X axis and translation along the Y axis; the data entering the supervised learning part uses the weak enhancement method, and the data entering the self-supervised contrastive learning part uses the weak enhancement and strong enhancement methods respectively;

[0025] 4.2. The second module is the feature learning module. The encoder uses the ConvNext network, which consists of six parts: ConvNext block, downsampling, global average pooling layer, fully connected layer and output layer. The process is as follows: the input sample undergoes a convolution operation with a kernel size of 4×4 and a step size of 4, and then undergoes layer normalization. In order to extract deeper features, it then passes through ConvNext Blocks of different dimensions. The ratio of the number of modules between modules of different dimensions is 1:1:3:1, and downsampling modules are applied between them. After a series of convolution operations, the dimension is adjusted through the global average pooling layer, and finally the disturbance event category is output through the fully connected layer. For a sample g in the supervised learning part, it can be enhanced to a weakly enhanced sample g. w and strongly enhanced sample g s , the labeled known category data is input into the encoder through weak enhancement, and L sl The cross entropy loss for supervised learning is as follows,

[0026]

[0027] Where N represents the number of labeled data, P(g s ) represents a labeled sample x s The true class distribution of the supervised learning part, Represents the predicted class distribution of weakly enhanced samples in supervised learning;

[0028] For the self-supervised contrastive learning part that is trained in parallel, the unlabeled data containing all categories are input into the encoder from two branches through two different enhancement methods, strong and weak enhancement. Here, the information noise contrast estimation (infoNCE) loss from the classic contrastive learning architecture SimCLR is selected as the loss function; the positive sample is g w and g s The projection results are recorded as z w and z s , the negative samples in the remaining 2(B-1) samples The projection result is recorded as This part produces L ssl The self-supervised contrastive learning loss is as follows,

[0029]

[0030] Where sim() is the similarity metric function, i.e., cosine similarity, τ is the temperature parameter, n∈{0,1} is the indicator function of whether the kth sample is equal to the jth sample, and B represents the number of batch samples;

[0031] 4.3. The third module is the open set learning module. In the self-supervised learning part, the output branch of the encoder takes the weakly enhanced data and uses Softmax to output the probability distribution, followed by two-level confidence-based detection.

[0032] The process of unknown class detection is:

[0033] The first step is to take the probability distribution P of the training unknown class sample prediction output uk , compared with the lower bound t1 of the unknown class confidence threshold, the samples that meet the threshold greater than t1 are regarded as candidate samples of the unknown class g w1 Enter the second-level confidence test, otherwise it will be misjudged as a known class sample;

[0034] The second step is to collect these candidate samples g w1 Take the maximum value P of the output probability distribution max (g w1 ), compared with the upper bound t2 of the second level confidence threshold of the unknown class, the samples that meet the threshold less than t2 are judged as unknown classes and the unknown class pseudo label matrix W is constructed. uk ; The rules are as follows, where n is the number of unknown class samples during training, is the pseudo label value of the screened unknown class sample,

[0035]

[0036]

[0037] The process of known class detection is:

[0038] Take the maximum value P of the output probability distribution of all sample predictions max (g w ), when it is greater than the set known class confidence threshold t k When the condition is met, it is judged as a known class, otherwise it is misclassified as other classes; then the label is assigned to the class with the largest corresponding probability, and then the known class pseudo-label matrix W is constructed. k ; The rules are as follows, where kr is the number of known class categories, is the pseudo label value of the screened known class samples, m is the number of known class samples of each class during training,,

[0039]

[0040]

[0041] 4.4. After constructing the pseudo-label matrix, the consistency self-training step is finally performed. In the self-supervised learning part, a pseudo-labeled sample g and its weakly enhanced sample g are given. w and strongly enhanced sample g s, the learning model should ensure that g w and g s In this method, P is defined as uk (y|g s ) is the predicted distribution of a batch of internal strong enhancement samples selected as unknown classes, P k (y|g s ) is the predicted distribution of the known class selected by the strong enhancement sample, and the unknown class pseudo label matrix W uk and the known class pseudo-label matrix W k The total pseudo-label matrix W is constructed, and the consistency self-training loss L of known and unknown class samples is obtained. cst And as the third loss is as follows,

[0042]

[0043]

[0044] Where B represents the number of batch samples and H represents the cross entropy loss. The total training loss function is constructed as L sll =L sl +αL ssl +βL cst , where α and β are the weights of the last two loss terms and are parameters that measure the optimization objectives of the model.

[0045] The process of step 5 is as follows:

[0046] 5.1. Since the model has many parameters, in order to save the cost of manual parameter adjustment and find the optimal set of parameters, the BoHo (Hyperband and Bayesian) hyperparameter optimization algorithm is used here to optimize the parameters;

[0047] In the initial stage, Hyperband's elimination mechanism is used to quickly screen out configurations with good performance. Then, Bayesian optimization is used to select new candidate hyperparameters in each screening stage of Hyperband. For Bayesian optimization, the tree structure model TPE is first selected to evaluate the objective function, and then the expected improvement EI strategy is used to select the next sampling point. After each hyperband elimination stage is completed, the evaluation results of the current stage are fed back to the Bayesian optimization model for further iteration, ensuring that BoHo can search the hyperparameter space more accurately in each stage.

[0048] s max =[log η (R)];

[0049] B=(s max +1)R;

[0050]

[0051] r=Rη -s ;

[0052] The above is the formula expression of the elimination mechanism stage, s max is the maximum number of stages in the elimination process, s is each elimination stage, R is the maximum amount of resources for each parameter combination, that is, the maximum number of training rounds, η is the value that controls the elimination ratio in each stage, B is the total amount of resources for this optimization, n is the number of hyperparameter combinations participating in the current elimination stage, and r is the amount of resources used by each hyperparameter combination in the current elimination stage;

[0053] 5.2. Set the number of optimization experiments trails. Each time, assign a continuously optimized hyperparameter combination for training according to the results of the previous experiment. After the model is tuned and trained until the total loss value converges to the lowest and stable level, it ends and saves the best weights for testing.

[0054] The beneficial effects of the present invention are mainly manifested in:

[0055] 1. The self-supervised learning proposed in the present invention is based on the SCOC model, an open set identification method for perimeter intrusion events of distributed fiber optic sensor fences, which converts signal samples into Gram angular field samples. The GASF algorithm is robust to noise because the movement trend will not be masked by noise.

[0056] 2. In the open set learning module, the present invention adopts a detection mechanism based on a two-level confidence threshold, uses a two-level threshold judgment of an upper bound and a lower bound for unknown classes, and then uses a confidence threshold to make a judgment on known classes.

[0057] 3. The present invention adopts the BoHo parameter optimization algorithm for the situation where the model has many hyperparameters. BoHo combines the advantages of Bayesian and hyperband. It uses the elimination mechanism of hyperband's phased resource allocation to continuously screen out better configurations and eliminate worse configurations, and then combines Bayesian sampling mechanism for parameter combinations at each stage of hyperband. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is a flow chart of the open set identification of fence perimeter security intrusion signal in the present invention;

[0059] Figure 2 It is a schematic diagram of the distributed optical fiber acoustic wave sensing system DAS in the present invention;

[0060] Figure 3 This is a diagram of the perimeter security deployment plan of the DAS in the laboratory scenario of the present invention;

[0061] Figure 41 is a diagram of the experimental site for implementing different invasion events in the present invention, wherein (a) is shaking, (b) is cutting, (c) is trampling, (d) is non-invasion, (e) is simulated animal biting, and (f) is wind;

[0062] Figure 5 2 are the Gram angle field diagrams corresponding to different intrusion events in the present invention, where (a) is shaking, (b) is cutting, (c) is trampling, (d) is non-intrusion, (e) is simulated animal biting, and (f) is wind.

[0063] Figure 6 It is a training flow chart of the SCOC algorithm model in the present invention;

[0064] Figure 7 It is the test flow chart of SCOC algorithm model;

[0065] FIG8 is a confusion matrix diagram of the test classification results using different optimization algorithms in the present invention, wherein FIG8(a) represents random search optimization, FIG8(b) represents Bayesian optimization, FIG8(c) represents hyperband optimization, and FIG8(d) represents BoHo optimization. DETAILED DESCRIPTION

[0066] The present invention will be further described below in conjunction with the accompanying drawings.

[0067] Reference Figure 1 ~Figure 8, an open set identification method for distributed optical fiber sensing perimeter intrusion events based on self-supervised contrastive learning, comprising the following steps:

[0068] Step 1, Experimental scenario: Build a DAS system and collect data samples of various intrusion events;

[0069] The process of step 1 is as follows: optical fiber is laid around the fence in two ways: S-type hanging net optical cable and ground optical cable, and then the optical cable is connected to the DAS to collect data of different intrusion events. Intrusion events are divided into two types: known category events and unknown category events.

[0070] Construction method: Figure 3 As shown, the optical fiber is laid in an "S" shape for 10m of hanging net and 5m of laying on the ground. The hanging net optical fiber is fixed with a rolling belt. There is a bundle of 0.5km of optical fiber between the two laying methods. The number of channels for collecting data is 3, the total length of the optical fiber used is 1km, and the single-mode optical fiber model is G652D. The optical fiber is connected to the other end of the DAS. The model of the instrument is DFS-2005, with a detection distance of 5km, a spatial resolution of 5m, and a signal sampling rate of 20kS / s. The instrument is connected to a 5km long single-mode optical fiber with 959 optical fiber points. The acquisition time for each event is 30min, and the frequency of each repeated action is once every 1s.

[0071] Step 2: Data preprocessing: perform noise reduction on the experimental data samples and then convert them into Gramian Angular Field (GASF) images;

[0072] In the laboratory scenario, the data signal is collected through the distributed optical fiber acoustic wave sensing system DAS. The principle is referenced Figure 2 . The main equipment used in the system includes ultra-narrow line laser, acousto-optic modulator, coupler, erbium-doped fiber amplifier, circulator, balanced photodetector, data acquisition card, and host computer. This implementation system uses a narrow linewidth laser source NLL to emit high-coherence continuous light, which is divided into two parts by a coupler. Coupler 1 acts as a local oscillator light and a probe signal to separate, and the detection signal is modulated into an optical pulse by an acousto-optic modulator AOM. Then, after amplification by an erbium-doped fiber amplifier EDFA, the probe pulse will be emitted into the sensing fiber through a circulator for an acoustic sensing link. The backscattered signal from the sensing fiber carries the acoustic signal information generated by the intrusion event, and interferes with the local oscillator light at coupler 2 to form a heterodyne beat signal. The AC component of the beat signal generated at the end is received by a balanced photodetector BPD and recorded by a data acquisition card DAQ. When an intrusion event occurs near the sensing fiber, the phase of the backscattered signal from the sensing fiber will be modulated by the acoustic signal generated by the intrusion event. The demodulated vibration signal is transmitted to the industrial computer or server via Gigabit Ethernet to realize the back-end processing such as signal feature analysis and event identification of vibration data. Animal biting uses toys to simulate the action of biting the optical fiber. The scene pictures of various event experiments are as follows Figure 4 shown.

[0073] The collected raw vibration dat data is subjected to wavelet transform based on the "db4" wavelet basis to reduce noise and normalize the signal intensity, and the time series diagram of the one-dimensional vibration signal of each event is obtained. The normalized sequence data is converted into polar coordinates, where the value is regarded as the cosine of the angle and the timestamp is regarded as the radius. Finally, the polar coordinate form of the time series data is converted into a two-dimensional image. The Gram matrix is ​​obtained by calculating the cosine angle between different points, and the obtained Gram image is as follows Figure 5 As shown. The calculation of the cosine angle and the angle can be simplified by the following formula:

[0074]

[0075] The process of step 2 is as follows:

[0076] 2.1、DAS collects one-dimensional signal data X={x1,···,x n-1 ,x n}, using the wavelet transform denoising method based on db4 wave basis to reduce the noise of the signal and reduce the impact of surrounding noise on the intrusion signal;

[0077] 2.2. After the noise reduction process, the signal strength is normalized to [-1, 1], and the Gram matrix is ​​converted to polar coordinates to obtain the Gram angular field samples of each signal. The calculation formula is as follows:

[0078]

[0079] The GASF algorithm converts 1D time signals into 2D images with focused features, extracts motion features from the trends and patterns of signal changes over time, and each disturbance signal corresponds to a unique two-dimensional image based on the trends and patterns of signal changes over time, thereby effectively improving the recognition accuracy. The algorithm is robust to noise because the motion trend will not be masked by noise.

[0080] Step 3: Create a data set: The processed data will be divided into two parts during training, one part is labeled data with known categories, and the other part is unlabeled data containing all types of events;

[0081] The process of step 3 is as follows:

[0082] 3.1. The preprocessed Gram angle field data is represented by g and divided into training and validation sets according to the set ratio;

[0083] 3.2. The training set is further divided into two parts, one part of unlabeled samples is used for self-supervised comparative learning, and the other part of labeled samples is used for supervised learning. The test set and validation set have the same numbers.

[0084] The data samples collected from various events were labeled as cutting, non-intrusion, shaking, wind, and unknown (consisting of trampling and simulated animal biting events). They were divided into training and validation sets in a ratio of 8:2, with 800 samples for each type of event. The training set was further divided into two parts: 4,000 unlabeled samples for self-supervised comparative learning; and 3,200 labeled samples for supervised learning. The test set had a total of 1,000 samples, the same as the validation set.

[0085] Step 4: Construct a self-supervised contrastive open set learning SCOC algorithm model: the whole model is divided into three modules, the first one is the image enhancement module; the second one is the feature learning module; the third one is the open set learning module;

[0086] The process of step 4 is as follows:

[0087] 4.1. The first module is image enhancement, which enhances the Gram angle field samples of various intrusion events. Two image enhancement methods are used here: weak enhancement and strong enhancement. Weak enhancement is a relatively weak enhancement method, including flipping, cropping, time shifting or adding noise; strong enhancement is a relatively strong enhancement method, which adopts a random enhancement method based on Randaugment. It contains two parameters (N, M), which control the number of image transformations applied in sequence and the intensity of image transformation respectively. It combines thirteen transformations of different intensities, including automatic recovery, equalization, rotation, exposure, color, tone separation, contrast, brightness, sharpening, shearing along the X axis, shearing along the Y axis, translation along the X axis and translation along the Y axis; the data entering the supervised learning part uses the weak enhancement method, and the data entering the self-supervised contrastive learning part uses the weak enhancement and strong enhancement methods respectively;

[0088] like Figure 6 As shown in the figure, the first module of the model is image enhancement. The Gram angle field samples of various intrusion events are first enhanced, and two image enhancement methods are defined: weak enhancement and strong enhancement. Weak enhancement: first flip the image horizontally with a certain probability, and then randomly crop the image; strong enhancement: based on the Randaugment random enhancement method, the two parameters (N, M) control the number of image transformations applied in sequence and the intensity of image transformation respectively. The parameters used here are (3, 5), that is, three strong enhancement methods: rotation, color, and shearing along the X axis. The data entering the supervised training part uses the weak enhancement method, and the data entering the two branches of the self-supervised contrastive learning part uses the weak enhancement and strong enhancement methods respectively. After the image is enhanced, it is input into the encoder with a size of 224×224×3.

[0089] 4.2. The second module is the feature learning module. The encoder uses the ConvNext network, which consists of six parts: ConvNext block, downsampling, global average pooling layer, fully connected layer and output layer. The process is as follows: the input sample undergoes a convolution operation with a kernel size of 4×4 and a step size of 4, and then undergoes layer normalization. In order to extract deeper features, it then passes through ConvNext Blocks of different dimensions. The ratio of the number of modules between modules of different dimensions is 1:1:3:1, and downsampling modules are applied between them. After a series of convolution operations, the dimension is adjusted through the global average pooling layer, and finally the disturbance event category is output through the fully connected layer. For a sample g in the supervised learning part, it can be enhanced to a weakly enhanced sample g. w and strongly enhanced sample g s , the labeled known category data is input into the encoder through weak enhancement, and L sl The cross entropy loss for supervised learning is as follows,

[0090]

[0091] Where N represents the number of labeled data, P(g s ) represents a labeled sample x s The true class distribution of the supervised learning part, Represents the predicted class distribution of weakly enhanced samples in supervised learning;

[0092] For the self-supervised contrastive learning part that is trained in parallel, the unlabeled data containing all categories are input into the encoder from two branches through two different enhancement methods, strong and weak enhancement. Here, the information noise contrast estimation (infoNCE) loss from the classic contrastive learning architecture SimCLR is selected as the loss function; the positive sample is g w and g s The projection results are recorded as z w and z s , the negative samples in the remaining 2(B-1) samples The projection result is recorded as This part produces L ssl The self-supervised contrastive learning loss is as follows,

[0093]

[0094] Where sim() is the similarity metric function, i.e., cosine similarity, τ is the temperature parameter, n∈{0,1} is the indicator function of whether the kth sample is equal to the jth sample, and B represents the number of batch samples;

[0095] 4.3. The third module is the open set learning module. In the self-supervised learning part, the output branch of the encoder takes the weakly enhanced data and uses Softmax to output the probability distribution, followed by two-level confidence-based detection.

[0096] The process of unknown class detection is:

[0097] The first step is to take the probability distribution P of the training unknown class sample prediction output uk , compared with the lower bound t1 of the unknown class confidence threshold, the samples that meet the threshold greater than t1 are regarded as candidate samples of the unknown class g w1 Enter the second-level confidence test, otherwise it will be misjudged as a known class sample;

[0098] The second step is to collect these candidate samples g w1 Take the maximum value P of the output probability distribution max (g w1 ), compared with the upper bound t2 of the second level confidence threshold of the unknown class, the samples that meet the threshold less than t2 are judged as unknown classes and the unknown class pseudo label matrix W is constructed. uk ; The rules are as follows, where n is the number of unknown class samples during training, is the pseudo label value of the screened unknown class sample,

[0099]

[0100]

[0101] The process of known class detection is:

[0102] Take the maximum value P of the output probability distribution of all sample predictions max (g w ), when it is greater than the set known class confidence threshold t k When the condition is met, it is judged as a known class, otherwise it is misclassified as other classes; then the label is assigned to the class with the largest corresponding probability, and then the known class pseudo-label matrix W is constructed. k ; The rules are as follows, where kr is the number of known class categories, is the pseudo label value of the screened known class samples, m is the number of known class samples of each class during training,,

[0103]

[0104]

[0105] 4.4. After constructing the pseudo-label matrix, the consistency self-training step is finally performed. In the self-supervised learning part, a pseudo-labeled sample g and its weakly enhanced sample gw and strongly enhanced sample gs are given. The learning model should ensure the output consistency between gw and gs. In this method, Puk(y|gs) is defined as the predicted distribution of the unknown class selected by the strongly enhanced samples in a batch, and Pk(y|gs) is the predicted distribution of the known class selected by the strongly enhanced samples. The unknown class pseudo-label matrix Wuk and the known class pseudo-label matrix Wk will constitute the total pseudo-label matrix W, and the consistency self-training loss L of the known class and unknown class samples is obtained at the same time. cst And as the third loss is as follows,

[0106]

[0107]

[0108] Where B represents the number of batch samples and H represents the cross entropy loss. The total training loss function is constructed as L sll =L sl +αL ssl +βL cst , where α and β are the weights of the last two loss terms and are parameters that measure the optimization objectives of the model.

[0109] Step 5: Train the constructed SCOC algorithm model and use the BoHo (Bayesian and hyperband) optimization algorithm to optimize the hyperparameters, and obtain the SCOC algorithm training model under the best hyperparameter combination;

[0110] The process of step 5 is as follows:

[0111] 5.1. Since the model has many parameters, in order to save the cost of manual parameter adjustment and find the optimal set of parameters, the BoHo (Hyperband and Bayesian) hyperparameter optimization algorithm is used here to optimize the parameters;

[0112] In the initial stage, Hyperband's elimination mechanism is used to quickly screen out configurations with good performance; then, Bayesian optimization is used to select new candidate hyperparameters in each screening stage of Hyperband. For Bayesian optimization, the tree structure model TPE is first selected to evaluate the objective function, and then the expected improvement EI strategy is used to select the next sampling point; after each hyperband elimination stage is completed, the evaluation results of the current stage are fed back to the Bayesian optimization model for continued iteration, ensuring that BoHo can search the hyperparameter space more accurately in each stage.

[0113] First, install the optuna optimization algorithm library in the python configuration environment. In the initial stage, use Hyperband's phased elimination strategy to quickly screen out configurations with good performance. Then use Bayesian optimization to guide the sampling of the next set of parameter combinations. Select the tree structure model TPE to evaluate the objective function. The value is set to 3 in each stage of Hyperband, that is, the proportion of parameter combinations retained after each screening is 1 / 3.

[0114] s max =[log η (R)];

[0115] B=(s max +1)R;

[0116]

[0117] r=Rη -s ;

[0118] The above is the formula expression of the elimination mechanism stage, s max is the maximum number of stages in the elimination process, s is each elimination stage, R is the maximum amount of resources for each parameter combination, that is, the maximum number of training rounds, η is the value that controls the elimination ratio in each stage, B is the total amount of resources for this optimization, n is the number of hyperparameter combinations participating in the current elimination stage, and r is the amount of resources used by each hyperparameter combination in the current elimination stage;

[0119] 5.2. Set the number of optimization experiments trails. Each time, assign a continuously optimized hyperparameter combination for training according to the results of the previous experiment. After the model is tuned and trained until the total loss value converges to the lowest and stable level, it ends and saves the best weights for testing.

[0120] Set the number of optimization experiments trails to 50, the maximum number of allocated training rounds max_epoch to 100, and the minimum number of allocated resources min_source to 10. The model is tuned and trained until the total loss value converges to the lowest and stable level, and the best model weights are saved. The optimizer uses SGD gradient optimization, the learning rate Ir is 0.005231, the batch size is 32, the temperature parameter τ is 0.0984, the first-level confidence threshold t1 of the unknown class is 0.0145, the second-level confidence threshold t2 of the unknown class is 0.3237, and the confidence threshold t k The weight of the self-supervised contrastive learning loss is 0.8562, the weight of the self-supervised contrastive learning loss is 0.3155, and the weight of the consistency self-training loss is 0.2974.

[0121] Step 6: Open set event classification test: load the pre-trained SCOC model weights and test it with the test set collected in the experiment to complete the open set recognition of perimeter fence intrusion events.

[0122] Test process such as Figure 7 As shown in the figure, the judgment steps are consistent with the training. The samples to be tested for all events are input and the labels are prepared to draw the confusion matrix. Here, the recognition results are compared by using different parameter optimization methods. The confusion matrix is ​​shown in Figure 8. 200 data for each of the five types of events, totaling 1000 data, are used for testing. When the BoHo optimization algorithm is used, the total optimization training time is 70 hours, and the training time of the SCOC model is 1.5 hours. The accuracy of the known class, unknown class and overall test can reach 0.961, 0.87, and 0.942 respectively. The top-1 accuracy of the validation set is 0.928. When using random search optimization, the overall accuracy is 0.93, and the unknown class and overall accuracy of Bayesian optimization are 0.86 and 0.938 respectively. The unknown class and overall accuracy of hyperband optimization are 0.865 and 0.95, and BoHo optimization can achieve the best effect in comparison.

[0123] The contents described in the embodiments of this specification are merely enumerations of implementation forms of the inventive concept and are for illustrative purposes only. The protection scope of the present invention should not be considered to be limited to the specific forms described in this embodiment, and the protection scope of the present invention also extends to equivalent technical means that can be thought of by ordinary technicians in this field based on the inventive concept.

Claims

1. An open set identification method for distributed fiber optic sensing perimeter intrusion events based on self-supervised contrastive learning, characterized in that: The method comprises the following steps: Step 1, Experimental scenario: Build a DAS system and collect data samples of various intrusion events; Step 2: Data preprocessing: noise reduction is performed on the experimental data samples, and then they are converted into Gram angular field GASF images; Step 3: Create a data set: The processed data will be divided into two parts during training, one part is labeled data with known categories, and the other part is unlabeled data containing all types of events; Step 4: Construct a self-supervised contrastive open set learning SCOC algorithm model: the whole model is divided into three modules, the first one is the image enhancement module; the second one is the feature learning module; the third one is the open set learning module; Step 5: Train the constructed SCOC algorithm model and use the BoHo optimization algorithm to optimize the hyperparameters, and obtain the SCOC algorithm training model under the best hyperparameter combination; Step 6: Open set event classification test: load the pre-trained SCOC model weights and test it with the test set collected in the experiment to complete the open set recognition of perimeter fence intrusion events.

2. The open set identification method for distributed optical fiber sensing perimeter intrusion events based on self-supervised contrastive learning according to claim 1, characterized in that: The process of step 1 is as follows: optical fiber is laid around the fence in two ways: S-type hanging optical cable and ground optical cable, and then the optical cable is connected to the DAS to collect data on different intrusion events; intrusion events are divided into two types: known category events and unknown category events.

3. The open set identification method for distributed optical fiber sensing perimeter intrusion events based on self-supervised contrastive learning according to claim 1 or 2, characterized in that: The process of step 2 is as follows: 2.1、DAS collects one-dimensional signal data X={x1,···,x n-1 ,x n }, using the wavelet transform denoising method based on db4 wave basis to reduce the noise of the signal and reduce the impact of surrounding noise on the intrusion signal; 2.

2. After the noise reduction process, the signal strength is normalized to [-1, 1], and the Gram matrix is ​​converted to polar coordinates to obtain the Gram angular field samples of each signal. The calculation formula is as follows: The GASF algorithm extracts motion features from the trend and pattern of signal changes over time by converting 1D time signals into 2D images with focused features. According to the trend and pattern of signal changes over time, each disturbance signal corresponds to a unique two-dimensional image.

4. The method for open set identification of distributed optical fiber sensing perimeter intrusion events based on self-supervised contrastive learning according to claim 1 or 2, characterized in that: The process of step 3 is as follows: 3.

1. The preprocessed Gram angle field data is represented by g and divided into training and validation sets according to the set ratio; 3.

2. The training set is further divided into two parts, one part of unlabeled samples is used for self-supervised comparative learning, and the other part of labeled samples is used for supervised learning. The test set and validation set have the same numbers.

5. The method for open set identification of distributed optical fiber sensing perimeter intrusion events based on self-supervised contrastive learning according to claim 1 or 2, characterized in that: The process of step 4 is as follows: 4.

1. The first module is image enhancement, which enhances the Gram angle field samples of various intrusion events. Two image enhancement methods are used here: weak enhancement and strong enhancement. Weak enhancement is a relatively weak enhancement method, including flipping, cropping, time shifting or adding noise; strong enhancement is a relatively strong enhancement method, which adopts a random enhancement method based on Randaugment. It contains two parameters (N, M), which control the number of image transformations applied in sequence and the intensity of image transformation respectively. It combines thirteen transformations of different intensities, including automatic recovery, equalization, rotation, exposure, color, tone separation, contrast, brightness, sharpening, shearing along the X axis, shearing along the Y axis, translation along the X axis and translation along the Y axis; the data entering the supervised learning part uses the weak enhancement method, and the data entering the self-supervised contrastive learning part uses the weak enhancement and strong enhancement methods respectively; 4.

2. The second module is the feature learning module. The encoder uses the ConvNext network, which consists of six parts: ConvNext block, downsampling, global average pooling layer, fully connected layer and output layer. The process is as follows: the input sample undergoes a convolution operation with a kernel size of 4×4 and a step size of 4, and then undergoes layer normalization. In order to extract deeper features, it then passes through ConvNext Blocks of different dimensions. The ratio of the number of modules between modules of different dimensions is 1:1:3:1, and downsampling modules are applied between them. After a series of convolution operations, the dimension is adjusted through the global average pooling layer, and finally the disturbance event category is output through the fully connected layer. For a sample g in the supervised learning part, it can be enhanced to a weakly enhanced sample g. w and strongly enhanced sample g s , the labeled known category data is input into the encoder through weak enhancement, and L sl The cross entropy loss for supervised learning is as follows, Where N represents the number of labeled data, P(g s ) represents a labeled sample x s The true class distribution of the supervised learning part, Represents the predicted class distribution of weakly enhanced samples in supervised learning; For the self-supervised contrastive learning part that is trained in parallel, the unlabeled data containing all categories are input into the encoder from two branches through two different enhancement methods, strong and weak enhancement. Here, the information noise contrast estimation (infoNCE) loss from the classic contrastive learning architecture SimCLR is selected as the loss function; the positive sample is g w and g s The projection results are recorded as z w and z s , the negative samples in the remaining 2(B-1) samples The projection result is recorded as This part produces L ssl The self-supervised contrastive learning loss is as follows, Where sim() is the similarity metric function, i.e., cosine similarity, τ is the temperature parameter, n∈{0,1} is the indicator function of whether the kth sample is equal to the jth sample, and B represents the number of batch samples; 4.

3. The third module is the open set learning module. In the self-supervised learning part, the output branch of the encoder takes the weakly enhanced data and uses Softmax to output the probability distribution, followed by two-level confidence-based detection. The process of unknown class detection is: The first step is to take the probability distribution P of the training unknown class sample prediction output uk , compared with the lower bound t1 of the unknown class confidence threshold, the samples that meet the threshold greater than t1 are regarded as candidate samples of the unknown class g w1 Enter the second-level confidence test, otherwise it will be misjudged as a known class sample; The second step is to collect these candidate samples g w1 Take the maximum value P of the output probability distribution max (g w1 ), compared with the upper bound t2 of the second level confidence threshold of the unknown class, the samples that meet the threshold less than t2 are judged as unknown classes and the unknown class pseudo label matrix W is constructed. uk ; The rules are as follows, where n is the number of unknown class samples during training, is the pseudo label value of the screened unknown class sample, The process of known class detection is: Take the maximum value P of the output probability distribution of all sample predictions max (g w ), when it is greater than the set known class confidence threshold t k When the condition is met, it is judged as a known class, otherwise it is misclassified as other classes; then the label is assigned to the class with the largest corresponding probability, and then the known class pseudo-label matrix W is constructed. k ; The rules are as follows, where kr is the number of known class categories, is the pseudo label value of the screened known class samples, m is the number of known class samples of each class during training,, 4.

4. After constructing the pseudo-label matrix, the consistency self-training step is finally performed. In the self-supervised learning part, a pseudo-labeled sample g and its weakly enhanced sample g are given w and strongly enhanced sample g s , the learning model should ensure that g w and g s The output consistency between them is defined as P uk (y|g s ) is the predicted distribution of a batch of internal strong enhancement samples selected as unknown classes, P k (y|g s ) is the predicted distribution of the known class selected by the strong enhancement sample, and the unknown class pseudo label matrix W uk and the known class pseudo-label matrix W k The total pseudo-label matrix W is constructed, and the consistency self-training loss L of known and unknown class samples is obtained. cst And as the third loss is as follows, Among them, B represents the number of batch samples, H represents the cross entropy loss, and the total training loss function is constructed as L sll =L sl +αL ssl +βL cst , where α and β are the weights of the last two loss terms and are parameters that measure the optimization objectives of the model.

6. The open set identification method for distributed optical fiber sensing perimeter intrusion events based on self-supervised contrastive learning according to claim 1 or 2, characterized in that: The process of step 5 is as follows: 5.

1. In the initial stage, the elimination mechanism of Hyperband is used to quickly screen out the configurations with good performance. Then, Bayesian optimization is used to select new candidate hyperparameters in each screening stage of Hyperband. For Bayesian optimization, the tree structure model TPE is first selected to evaluate the objective function, and then the expected improvement EI strategy is used to select the next sampling point. After each hyperband elimination stage is completed, the evaluation results of the current stage are fed back to the Bayesian optimization model for further iteration, ensuring that BoHo can search the hyperparameter space more accurately in each stage. s max =[log η (R)]; B=(s max +1)R; r=Rη -s ; The above is the formula expression of the elimination mechanism stage, s max is the maximum number of stages in the elimination process, s is each elimination stage, R is the maximum amount of resources for each parameter combination, that is, the maximum number of training rounds, η is the value that controls the elimination ratio in each stage, B is the total amount of resources for this optimization, n is the number of hyperparameter combinations participating in the current elimination stage, and r is the amount of resources used by each hyperparameter combination in the current elimination stage; 5.

2. Set the number of optimization experiments trails. Each time, assign a continuously optimized hyperparameter combination for training according to the results of the previous experiment. After the model is tuned and trained until the total loss value converges to the lowest and stable level, it ends and saves the best weights for testing.

Citation Information

Cited By

  • Audio counterfeit detection method and system based on audio potential feature comparative learning

    CN120220731A

  • Distributed sound wave sensing anomaly detection method based on self-supervised conformal inference

    CN121598340A

  • A distributed acoustic wave sensing anomaly detection method based on self-supervised conformal inference

    CN121598340B

  • Optical cable perturbation identification method based on physical simulation and self-supervised time sequence decoupling

    CN121615518A

  • A Micro-Disturbance Identification Method for Optical Cables Based on Physical Simulation and Self-Supervised Temporal Decoupling

    CN121615518B