Distributed optical fiber drainage pipeline leakage event identification method based on distillation visual converter
By introducing a distillation vision transformer and a teacher-student model structure, the distributed fiber optic water pipe leak identification was optimized, solving the problems of high false alarm rate and high resource requirements in the existing system for leak identification, and achieving high-precision leak event identification.
Patent Information
- Application Number
- CN202511856329.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-04-14
AI Technical Summary
Existing distributed fiber optic acoustic sensing systems struggle to distinguish between different types of leaks and environmental noise when identifying water pipe leaks, resulting in a high false alarm rate. Furthermore, traditional machine learning methods require a large amount of labeled data and computational resources, making it difficult to meet the needs of low-cost deployment.
We introduce the Distillation Vision Transformer (DeiT) structure and training mechanism, and improve the feature representation and classification capabilities of leakage events through teacher-student model distillation learning. We combine residual networks and Transformer encoders to optimize feature representation and classification accuracy.
It significantly improves the accuracy of leak identification and reduces the false alarm rate under limited labeled sample conditions, achieving efficient leak event identification.
Smart Images

Figure CN121858865A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of distributed fiber optic acoustic and vibration sensing technology, and relates to a method for identifying leakage events in distributed fiber optic drainage pipes based on a distillation vision converter. Background Technology
[0002] Leaks in urban water supply networks can lead to serious water waste and potential safety hazards. Distributed fiber optic acoustic sensing (DAS) technology uses optical fiber itself as the sensing medium to achieve long-distance, multi-point online monitoring of vibration signals. It has advantages such as strong resistance to electromagnetic interference and wide coverage, and has become an important development direction for water pipe leak monitoring.
[0003] However, DAS systems essentially sense external disturbances by monitoring changes in the intensity or phase of scattered light in optical fibers, making it difficult to directly distinguish the specific attributes of events from the underlying signal. In practical applications, different types of leaks, mechanical shocks, and environmental noise often exhibit highly similar temporal or frequency-domain characteristics, easily leading to overlapping event features and making it difficult to reduce the system's false alarm rate over a long period. While traditional machine learning methods can extract discriminative features from signals to some extent, their performance typically relies on large-scale labeled datasets and significant computational resource investment, making it difficult to meet the demands of efficient and low-cost deployment in engineering scenarios.
[0004] In existing DAS (Digital Optical Array) water pipe leak detection technologies, Liu Xianzhuo et al. from Beijing Beike Ouyuan Technology Co., Ltd. proposed a fiber optic vibration and temperature measurement diagnostic method and system for drainage pipe leaks (Reference 1: A Fiber Optic Vibration and Temperature Measurement Diagnostic Method and System for Drainage Pipe Leaks CN120927196A). This method combines vibration signals and Raman scattering to obtain temperature characteristics, extracts vibration features through wavelet packet decomposition and adaptive noise reduction, and constructs an LSTM-GRU hybrid neural network for feature fusion and fault type identification. However, it still requires auxiliary features from temperature measurement equipment and fails to fully exploit the effective features of the leak vibration signal. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies that rely solely on traditional features and neural network structures and are insufficient for mining the vibration features of DAS leaks, this invention provides a distributed optical fiber drainage pipe leak event identification method based on a distillation vision transformer (DeiT). The method introduces and improves the structure and training mechanism of the distillation vision transformer (DeiT), which significantly enhances the characterization and classification capabilities of leak event features under limited labeled sample conditions, thereby improving the accuracy of identifying minute leaks and reducing the false alarm rate in complex noise environments.
[0006] The technical solution of the present invention is as follows:
[0007] A method for identifying leakage events in distributed fiber optic drainage pipes based on a distillation vision converter, the method comprising the following steps:
[0008] Step 1. Prepare the DAS system and collect leak data;
[0009] Step 2. Signal preprocessing and feature map construction;
[0010] Step 3. Teacher model network design and initialization;
[0011] Step 4. Input sufficient labeled data to train and validate the teacher model;
[0012] Step 5. DeiT student model construction;
[0013] Step 6. Distill the DeiT student model based on the teacher model.
[0014] Furthermore, the process of step 1 is as follows:
[0015] The DAS system described in step 1.1 uses Φ-OTDR technology to collect optical fiber signals deployed on the pipeline in real time and obtain vibration signals related to leakage in the drainage pipeline.
[0016] The Φ-OTDR optical system described in step 1.2 includes a linewidth laser, an optical amplifier (EDFA), an optical coupler, a local oscillator, an acousto-optic modulator, an optical circulator, an optical filter, a photodetector, a high-speed data acquisition card, and a computer. The laser provides a coherent light source, which is split into probe light and reference light by the coupler. The probe light is modulated and injected into the sensing fiber and modulated by external disturbances. The returned scattered light interferes with the reference light. The distributed vibration information along the entire fiber can be obtained by processing the balanced detector, the high-speed data acquisition card, and the computer.
[0017] Step 1.3 Complete the DAS system assembly;
[0018] Step 1.4 Use a data acquisition card to acquire the backscattered Rayleigh signals returned by N light pulses (N>1);
[0019] Step 1.5 arranges the signals in the computer memory according to their row and column positions to form a two-dimensional spatiotemporal signal matrix, where the row index represents the fiber optic point position and the column index represents the time point of each pulse.
[0020] Step 1.6 Collect a long-term DAS tag data, and manually create corresponding patterns to obtain DAS vibration signals of different types of drainage pipes at selected locations;
[0021] Step 1.7 At the fiber optic point where the event occurred, extract the data signal corresponding to the row index of the spatiotemporal two-dimensional signal matrix. The duration of each signal is t seconds.
[0022] Furthermore, in step 2, the time-frequency diagram of each event signal is calculated and plotted. In the construction of the time-frequency diagram, a one-dimensional time series x for each spatial channel n is constructed. n (t) Applying the short-time Fourier transform:
[0023]
[0024] Where STFT represents Short-Time Fourier Transform, t represents time, f represents frequency, and x n (τ) represents the original time-domain signal of the nth channel (or nth segment), τ represents the integral independent variable (local time variable), w(τ-t) is the Hamming window function, and the modulus of the calculated complex result is taken to obtain the spectral amplitude M(t,f). Then, this amplitude value is converted to M by logarithmic transformation (dB scaling). dB (t,f)=2·log2(M(t,f)) enhances contrast and normalizes M dB Mapping to the [0,1] interval, and finally using a continuous color mapping table to map the normalized result to an RGB pseudo-color time-frequency image, saving it or sending it in a certain data format to establish a label training database.
[0025] Furthermore, step 3 is as follows:
[0026] Step 3.1 Determining the Backbone Network of the Teacher Model: A residual network is selected as the backbone structure of the teacher model, preferably a ResNet network containing several residual modules. The basic residual unit is constructed as follows: the input feature map of the l-th layer residual block is denoted as x. l The residual block contains several convolutional layers, batch normalization layers, and nonlinear activation functions, which are used to construct the residual mapping function F(x). l ,{W l If}), then the output y of the residual block is... l Represented as:
[0027] y l =F(x) l ,{W l})+x l
[0028] Among them, {W l} represents the weight parameters of each convolutional layer within the residual block, F(x) l ,{W l}) represents the condition for input x l Perform convolution, normalization, and nonlinear transformation after activation; x l By adding element-wise the residual branch outputs through identity mapping, cross-layer residual connections are formed;
[0029] Step 3.2 Classification Head Design and Output Dimension Setting: Set a global average pooling layer at the back end of the backbone network to aggregate features in the spatial dimension, and then connect it to a fully connected layer as a classification head. Map the aggregated features to the same output dimension as the number of leakage event categories, and output the predicted probability or logits of each category.
[0030] Step 3.3. Parameter initialization and hyperparameter setting: The backbone network parameters of the teacher model are initialized using weights pre-trained on a large-scale image dataset, and the fully connected layers in the classification head are initialized using random initialization or Gaussian distribution initialization; at the same time, training hyperparameters such as learning rate, weight decay, and momentum coefficient are set.
[0031] Furthermore, step 4 is as follows:
[0032] Step 4.1 Forward Propagation and Loss Function Calculation: Input the feature maps from the training set into the residual network teacher model designed in Step 3 in batches, and denote the teacher model as f. T (·;θ T ), for the input feature map x of the i-th sample i Output the corresponding class logits vector z i =f T (x i ;θ T The logits are converted into predicted probabilities for each category using the Softmax function.
[0033]
[0034] Where C is the number of leakage event categories, p ik Let be the predicted probability that sample i belongs to the k-th class; using cross-entropy loss as the objective function for supervised training, the loss function is defined as follows for a sample set with a batch size of M:
[0035]
[0036] Among them, y ik It is the predicted probability that sample i belongs to class k. When the sample belongs to class k, y ik =1, otherwise y ik =0;
[0037] Step 4.2 Backpropagation and parameter update:
[0038] Based on the L CE For the teacher model parameter θ T Perform backpropagation to calculate the gradient of the loss function with respect to the weights of each layer. Using stochastic gradient descent or the AdamW optimization algorithm with weight decay term for parameter updates, the parameter update process can be expressed as follows when the learning rate is η:
[0039]
[0040] Here, epoch represents the current iteration round. Through multiple iterations of training, the loss on the training set gradually decreases and tends to converge.
[0041] Furthermore, step 5 is as follows:
[0042] Step 5.1 Denote the two-dimensional feature image obtained in Step 2 as the input image X, and divide it into N non-overlapping image blocks {x1, x2, ..., x...} according to the preset block size. N} and flatten it into a one-dimensional vector. For each image patch x i Input a linear projection layer, using the weight matrix W E Mapping to a D-dimensional patch embedding forms an ordered sequence of patches:
[0043]
[0044] Step 5.2 Introducing Classification and Distillation Labels: A learnable classification label vector is introduced before the above patch label sequence. With distillation marker vector and The extended input sequence is obtained by concatenating the sequences:
[0045]
[0046] Step 5.3 Construct a learnable positional encoding vector with the same dimension as the label, and add it element-wise to each label in the sequence to obtain an input sequence with positional information. Input this sequence into the encoder E of the DeiT student model. The encoder E consists of several cascaded Transformer encoding blocks. Each encoding block includes a multi-head self-attention layer, a multilayer perceptron (MLP) layer, and residual connections. The multi-head self-attention layer calculates the scaled dot product attention based on the query Q, key K, and value V, using the following formula:
[0047]
[0048] Where Attenttion represents the output of the scaled dot product attention, Softmax represents the normalization function of the probability distribution of each class, used to convert the score into attention weights, and d k The dimension representing the key / query vector;
[0049] The output features are then obtained through multi-head parallelism and linear mapping; the MLP layer performs a non-linear transformation on the feature dimensions, and after L coding blocks, the final coding sequence Z is obtained. L The 0th and 1st positions correspond to the high-dimensional feature representations of the classification label and distillation label, respectively.
[0050] Step 5.4 Re-encoder outputs the final encoded sequence Z L Based on this, extract the feature vector h corresponding to the classification label. cls and the feature vector h corresponding to the distillation label dist The fully connected layers are used as the classification head and distillation head, respectively, and mapped to category logits of dimension C, which are used to output the prediction structure of the leakage event and the distillation branch output.
[0051] Furthermore, step 6 is as follows:
[0052] Step 6.1 Read samples from the labeled training and validation sets formed in Step 4 in batches, and input the feature maps from each batch into the DeiT student model constructed in Step 5 and the teacher models obtained in Steps 3 and 4. The input feature map of the i-th training sample is denoted as x. i The teacher model outputs a class logits vector. The student model outputs a class vector and a logits vector.
[0053] Step 6.2 outputs the student model. First, the predicted probability distribution for each class is obtained using the Softmax function, which is then used to calculate the cross-entropy supervision loss. For a sample set with a batch size of M, the supervision loss is:
[0054]
[0055] Among them, y i p is the true label of the i-th training sample. (S) (y i |x i The probability distribution q is the student model's predicted probability for the true class, while also utilizing soft label information provided by the teacher model, employing a distillation loss with a temperature parameter T. The soft probability distribution q is obtained by dividing the teacher's and student's logits by the temperature T and then applying a softmax function. (T) and q (S) Distillation loss L is defined based on the KL divergence between the two. KD :
[0056] L KD =T 2 ·KL(q (T) ||q (S) )
[0057] Step 6.3 Optimize student model parameters using joint loss:
[0058] The supervised loss and distillation loss are weighted by a weighting coefficient α to construct a joint training objective function for the student model:
[0059] L=(1-α)L CE +αL KD
[0060] In each training batch, the parameters of the DeiT student model are backpropagated based on the joint loss L, and the parameters are updated using stochastic gradient descent or AdamW optimization algorithm; training continues until the joint loss converges, and a usable model is obtained.
[0061] The beneficial effects of this invention are as follows: For DAS water pipe leakage scenarios, a distributed optical fiber drainage pipe leakage event identification method based on distillation visual transformer is proposed: By introducing a teacher-student structure of residual network teacher model and distillation visual transformer student model, under a given scale of labeled DAS data, the feature representation quality and classification accuracy can be significantly improved. Compared with directly supervising the training of the visual transformer, it has better convergence and data utilization efficiency, thus achieving high-precision identification of leakage events even in scenarios with limited labeled samples. Attached Figure Description
[0062] Figure 1 This is a schematic diagram of the method flow of the present invention;
[0063] Figure 2 This is a schematic diagram of the DAS system architecture;
[0064] Figure 3 This is a schematic diagram of a water pipe leak scenario. In the diagram, 1 is the host computer, 2 is the DAS demodulator, 3 is the sensing fiber optic cable, 4 is the hammering event, 5 is the leak point, 6 is the plug, 7 is the wrapped fiber optic cable, 8 is the cutting event, 9 is the pump, 10 is the water storage tank, 11 is the leaking branch, and 12 is the main water circulation route.
[0065] Figure 4 The image shows a time-frequency graph of a water pipe leak event, where (a) represents hammering, (b) represents cutting, (c) represents no leak, and (d) represents a leak.
[0066] Figure 5 The structural block diagram of the teacher model (residual network);
[0067] Figure 6 Flowchart for DeiT knowledge distillation training process;
[0068] Figure 7 Test the confusion matrix for DeiT;
[0069] Figure 8 Performance curves for different data volumes / different modes. Detailed Implementation
[0070] The invention will be further described below with reference to the accompanying drawings and embodiments.
[0071] Reference Figures 1 to 8 This paper presents a distributed optical fiber drainage pipe leakage event identification method based on a distillation vision converter. The method classifies leakage events, non-leakage events, intentional pipe cutting events, and intentional pipe knocking events, illustrating its application in DAS drainage pipe leakage pattern recognition scenarios. This example uses four types of labeled data to classify leakage event patterns based on a distillation learning model. The method includes the following steps:
[0072] Step 1: Prepare the DAS system and collect leaked data;
[0073] Building such Figure 2 The experimental setup for the DAS data acquisition system shown integrates DAS components such as a narrow-linewidth laser, an optical amplifier (EDFA), an optical coupler, a local oscillator, an acousto-optic modulator, an optical circulator, an optical filter, a photodetector, and a high-speed data acquisition card into a DFS-2000 series DAS demodulation instrument. This instrument, model DFS-2050, has a detection distance of 50 km, a spatial resolution of 10 m, and a DAS signal sampling rate of 2 kS / s. The instrument connects to a 50 km long G652 standard single-mode optical fiber containing 4999 fiber optic points.
[0074] The laser output from the laser is modulated and amplified to form a probe pulse, which enters the sensing fiber to scan the fiber optic link. Based on changes in the scattered signal at different times, vibration events can be located. Backscattered light in the sensing fiber is collected by a circulator and interferes with the local oscillator light to obtain the phase information of the scattered light. After passing through a photodetector and a digital-to-analog converter chip, the signal is processed by an FPGA, including phase demodulation and fading suppression, ultimately obtaining vibration information at different locations in the fiber. The demodulated vibration signal is transmitted to an industrial control computer via gigabit Ethernet for backend processing such as signal characteristic analysis and event identification.
[0075] Collecting leaked data: This invention establishes a system such as... Figure 3The water pipe leakage simulation device shown uses a 750W pump to draw water from a reservoir, driving the water flow through the main drainage pipe to simulate a water pipe leak. The main drainage pipe, 15m long, serves as the primary water circulation path. After passing through the test pipe, the water flows back to the reservoir via a flexible hose, forming a closed-loop circulation. The pump is located outdoors to isolate operating noise. The test pipe is a galvanized pipe with an outer diameter of 32mm and an inner diameter of 28mm. A 5mm diameter leak hole is drilled at a designated detection point and sealed with a rubber plug to simulate the switching between normal operation and leakage states during the experiment. A leakage branch is set below the leak hole to guide the leaking water back to the reservoir for recycling. The water pressure in the pipeline is measured using a pointer-type pressure gauge installed on the main pipe. The pressure gauge has a range of 0 to 1.6MPa and a resolution of 0.05MPa. The measurement point is located at the leak point, and the measured water pressure is approximately 0.15MPa. The sensing fiber optic cable was wrapped around the surface of the water pipe for about 3 meters and fixed with resin glue and tape. This method of fixing the fiber optic cable can detect the vibration state of the water pipe wall, with a positioning error of about 4 meters. After starting the machine and setting the parameters, data was collected at the fiber optic point 2465. Data was collected by manually tapping, cutting, and switching between non-leaking and leaking states by plugging the leak point. The length of a single event was 2 seconds, containing 4000 data points, for a total of 4×4000×1100 data points were collected.
[0076] Step 2: Data preprocessing. The time-domain signal is converted into a time-frequency graph. In the construction of the time-frequency graph, a one-dimensional time series x for each spatial channel n is processed. n (t) Applying the short-time Fourier transform:
[0077]
[0078] Where STFT represents Short-Time Fourier Transform, t represents time, f represents frequency, and x n (τ) represents the original time-domain signal of the nth channel (or nth segment), τ represents the integral independent variable (local time variable), and w(τ-t) is the Hamming window function; the modulus of the calculated complex result is taken to obtain the spectral amplitude M(t,f), and then this amplitude value is converted to M by logarithmic transformation (dB scaling). dB (t,f)=2·log2(M(t,f)) enhances contrast and normalizes M dB Mapped to the [0,1] interval, the normalized result is finally mapped to an RGB pseudo-color time-frequency graph using a continuous color mapping table. In this example, a "jet" type color mapping table is used. Saved in PNG format, a label training database is established, with the training set containing 500 samples per class and the validation set containing 125 samples per class. The corresponding event signal time-frequency graph is shown below. Figure 4 As shown.
[0079] Step 3: Use the ResNet50 residual network as the backbone structure of the teacher model. For example... Figure 5 As shown, ResNet50 consists of one input convolutional layer, four residual stages, a global average pooling layer, and a fully connected layer. The number of bottleneck blocks in the residual stages is [3, 4, 6, 3]. The input convolutional layer has a 7×7 kernel size, 64 channels, a stride of 2, and padding of 3, followed by batch normalization and ReLU activation. Subsequent connections are max pooling layers with a 3×3 kernel size and a stride of 2. The first residual stage contains three bottleneck residual blocks. Within each bottleneck block, the three convolutional layer channels are configured as follows: 1×1:64 → 3×3:64 → 1×1:256. Each convolutional layer in the main branch is followed by batch normalization and ReLU activation, while the bypass is a 1×1 convolutional matching layer. The first stage has 256 output channels. The second residual stage contains 4 bottleneck residual blocks. The first bottleneck residual block downsamples the input with a stride of 2. The three convolutional layers within each bottleneck block are configured as follows: 1×1: 128 → 3×3: 128 → 1×1: 512. Each convolutional layer in the main branch is followed by batch normalization and ReLU activation. The bypass is a 1×1 convolution matching dimension. The output channel count in this stage is 512. The third residual stage contains 6 bottleneck residuals. The first bottleneck residual block downsamples the input with a stride of 2. Within each of the other bottleneck blocks, the three convolutional layer channels are configured as follows: 1×1: 256 → 3×3: 256 → 1×1: 1024. Each convolutional layer in the main branch is followed by batch normalization and a ReLU activation function, with a 1×1 convolutional matching dimension in the bypass. The output channel count in this stage is 1024. The fourth residual stage contains three bottleneck residual blocks. The first bottleneck residual block downsamples the input with a stride of 2. Within each of the other bottleneck blocks, the three convolutional layers are configured as follows: 1×1: 256 → 3×3: 256 → 1×1: 1024. Each convolutional layer in the main branch is followed by batch normalization and a ReLU activation function, while the bypass is a 1×1 convolutional matching dimension. The bottleneck block has three convolutional layers configured as follows: 1×1: 512 → 3×3: 512 → 1×1: 2048. Each convolutional layer in the main branch is followed by batch normalization and ReLU activation. The bypass is a 1×1 convolutional matching dimension. The output channel count in this stage is 2048. Global average pooling is performed on the feature maps of the last 2048 channels to obtain a 2048-channel vector input to the fully connected layer. The fully connected layer maps the 2048 dimensions to a C-dimensional output, where C is the number of classes (4).
[0080] y = W fc h+b
[0081] Where h is the pooled feature vector, W fc b represents the weights and biases of the fully connected layer.
[0082] Step 4: Input the leaked training set and validation set into the teacher model for training;
[0083] In step 2, the time-frequency graphs of the dataset are first uniformly scaled to 256×256 pixels before being input into the network, and then cropped to 224×224 pixels as the model input size. The batch size is uniformly set to 16. The teacher model is trained under supervision on the complete training set, using cross-entropy loss as the loss function and AdamW as the optimization algorithm, with an initial learning rate of 3×10⁻⁶. -4 The training employs a cosine annealing learning rate scheduling strategy, with a maximum of 50 iterations. An early stopping mechanism is introduced during training, with validation set classification accuracy selected as the validation metric. The early stopping patience parameter is set to 8. Training terminates when the validation set accuracy does not significantly improve within 8 consecutive cycles, and the system automatically rolls back to the weights at which the validation set performance was optimal. These weights are then saved as the parameters for the teacher model trained on the DAS dataset.
[0084] A time-frequency image of size 224×224×3 is input into the teacher model. After passing through the input convolutional layer, a feature map of size 112×112×64 is output. After passing through the max pooling layer, a feature map of size 56×56×64 is output. The first input residual stage outputs a feature map of size 56×56×256, the second input stage outputs a feature map of size 28×28×512, the third input stage outputs a feature map of size 14×14×1024, and the fourth input stage outputs a feature map of size 7×7×2048. Global average pooling is performed on the 7×7×2048 feature map to obtain a vector of size 1×1×2048, which is then input into the fully connected layer to finally map the 2048 dimensions to a 4-dimensional output.
[0085] Step 5: DeiT student model construction;
[0086] In this embodiment, the student model uses a distillation visual transformer, such as Figure 6 The model shown consists of an image patch embedding layer, a location encoding module, a Transformer encoder, a classification head, and a distillation head, and is used to perform global feature modeling and classification of the time-frequency map of leakage events.
[0087] First, the input image is divided into blocks of a fixed 16×16 size. Each image block is straightened and then fed into a linear mapping layer to obtain the corresponding patch label vector. Based on this, the DeiT structure introduces two learnable special labels at the front end of the label sequence: a classification label for final classification and a distillation label to carry teacher information. These, together with the patch label, form the input label sequence. Next, encoding space information is embedded into these input labels and fed into a Transformer encoder. The encoder uses 12 cascaded encoding blocks, each including a multi-head self-attention layer, a multilayer perceptron (MLP) layer, and residual connections. At the output end, corresponding fully connected output layers are set as the classification head and distillation head for the classification label and distillation label, respectively. All weights in the above structure are randomly initialized and updated during subsequent distillation.
[0088] Step 6: Distill the DeiT student model based on the teacher model;
[0089] like Figure 6 As shown, the dataset described in step 2 is input into the student model. The input feature map size is 224×224×3. After image segmentation into 14×14 = 196 non-overlapping image patches, these are mapped to 768 vectors through a linear mapping layer, resulting in 196 patch label vectors. These are then combined with classification and distillation labels to form an input label sequence of length 198. After embedding position encoding, the sequence is input into the encoder, which has 12 self-attention heads and maintains 768 features. Residual connections and layer normalization are used to continuously input the sequence into deeper layers to extract global features. In the final sequence, the 0th position corresponds to the high-dimensional feature of the classification label, and the 1st position corresponds to the high-dimensional feature of the distillation label. In this example, for a training batch with a batch size of 16, the supervised loss L is calculated. CE Simultaneously, the KL divergence at temperature parameter T=3.0, combined with the soft label information provided by the teacher model, was used to calculate its distillation loss L. KD Set α = 0.5 and calculate the joint training objective function L for the student model. On each training batch, backpropagation and gradient updates are performed on all trainable parameters of the DeiT student model, with the joint loss L as the objective. The AdamW optimizer is selected, and the initial learning rate is set to 3 × 10⁻⁶. -4 The training employs a cosine annealing learning rate scheduling strategy, with a maximum of 150 iterations. After each training iteration, the validation set feature map is input into the student model, and the validation set classification accuracy is calculated and used as the model performance metric. An early stopping mechanism is introduced during training, with an early stopping patience parameter set to 8. When the validation set accuracy fails to improve within 8 consecutive training iterations, early stopping is triggered, subsequent training is halted, and the student model weights are restored to the optimal performance iteration. Finally, the weights are saved as the leakage event recognition model.
[0090] Collect 500 time-frequency images for each event as the test set, and input 500 images as the training set to train the distillation model. Plot the confusion matrix based on the model's performance. Figure 7 As shown, its accuracy rate reached 99.40%, and its F1 score reached 0.9940. The F1 score formula is as follows:
[0091]
[0092] Where Precision represents accuracy, Recall represents recall, TP is the number of samples correctly predicted as positive, FP is the number of samples incorrectly predicted as positive, and FN is the number of samples incorrectly predicted as negative.
[0093] As a control, a pattern recognition model with the same structure was trained using the same training parameters, without supervised learning using a teacher model. The training was conducted with 50, 100, 200, 300, 400, and 500 samples per class, and the model was compared with the distilled model on the test set with the corresponding data volume. Figure 8 As shown, it was found that using the distillation model can achieve higher performance with less data and achieve a higher upper limit of recognition performance as the amount of data increases.
[0094] The above provides a detailed description of the distributed optical fiber drainage pipeline leakage event identification method based on distillation vision converter described in this invention. The above examples are only for helping to understand the method and core ideas of this invention and are not intended to limit it. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of this invention should be considered equivalent substitutions and are included within the protection scope of this invention.
Claims
1. A method for identifying leakage events in distributed optical fiber drainage pipes based on a distillation vision converter, characterized in that, The method includes the following steps: Step 1. Prepare the DAS system and collect leak data; Step 2. Signal preprocessing and feature map construction; Step 3. Teacher model network design and initialization; Step 4. Input sufficient labeled data to train and validate the teacher model; Step 5. DeiT student model construction; Step 6. Distill the DeiT student model based on the teacher model.
2. The distributed optical fiber drainage pipeline leakage event identification method based on distillation vision converter as described in claim 1, characterized in that, The process of step 1 is as follows: The DAS system described in step 1.1 uses Φ-OTDR technology to collect optical fiber signals deployed on the pipeline in real time and obtain vibration signals related to leakage in the drainage pipeline. The Φ-OTDR optical system described in step 1.2 includes a linewidth laser, an optical amplifier EDFA, an optical coupler, a local oscillator, an acousto-optic modulator, an optical circulator, an optical filter, a photodetector, a high-speed data acquisition card, and a computer. Step 1.3 Complete the DAS system assembly; Step 1.4 Use a data acquisition card to acquire the backscattered Rayleigh signals returned by N light pulses; Step 1.5 arranges the signals in the computer memory according to their row and column positions to form a two-dimensional spatiotemporal signal matrix, where the row index represents the fiber optic point position and the column index represents the time point of each pulse. Step 1.6 Collect a long-term DAS tag data, and manually create corresponding patterns to obtain DAS vibration signals of different types of drainage pipes at selected locations; Step 1.7 At the fiber optic point where the event occurred, extract the data signal corresponding to the row index of the spatiotemporal two-dimensional signal matrix. The duration of each signal is t seconds.
3. The distributed optical fiber drainage pipe leakage event identification method based on a distillation vision converter as described in claim 1 or 2, characterized in that, In step 2, the time-frequency diagram of each event signal is calculated and plotted. In the construction of the time-frequency diagram, a one-dimensional time series x for each spatial channel n is constructed. n (t) Applying the short-time Fourier transform, the modulus of the calculated complex result is taken to obtain the spectral amplitude M(t,f). This amplitude value is then converted to M(t,f) using a logarithmic transform. dB (t,f)=2·log2(M(t,f)) enhances contrast and normalizes M dB Mapping to the [0,1] interval, and finally using a continuous color mapping table to map the normalized result to an RGB pseudo-color time-frequency image, saving it or sending it in a certain data format to establish a label training database.
4. The distributed optical fiber drainage pipe leakage event identification method based on a distillation vision converter as described in claim 1 or 2, characterized in that, The process of step 3 is as follows: Step 3.1 Determining the Backbone Network of the Teacher Model: A residual network is selected as the backbone structure of the teacher model, preferably a ResNet network containing several residual modules. The basic residual unit is constructed as follows: the input feature map of the l-th layer residual block is denoted as x. l The residual block contains several convolutional layers, batch normalization layers, and nonlinear activation functions, which are used to construct the residual mapping function F(x). l ,{W l }), calculate the output y of the residual block. l ; Step 3.2 Classification Head Design and Output Dimension Setting: Set a global average pooling layer at the back end of the backbone network to aggregate features in the spatial dimension, and then connect it to a fully connected layer as a classification head. Map the aggregated features to the same output dimension as the number of leakage event categories, and output the predicted probability or logits of each category. Step 3.
3. Parameter initialization and hyperparameter setting: The backbone network parameters of the teacher model are initialized using weights pre-trained on a large-scale image dataset, and the fully connected layers in the classification head are initialized using random initialization or Gaussian distribution initialization; at the same time, training hyperparameters such as learning rate, weight decay, and momentum coefficient are set.
5. The distributed optical fiber drainage pipeline leakage event identification method based on distillation vision converter as described in claim 4, characterized in that, The process of step 4 is as follows: Step 4.1 Forward Propagation and Loss Function Calculation: Input the feature maps from the training set into the residual network teacher model designed in Step 3 in batches, and denote the teacher model as f. T (·;θ T ), for the input feature map x of the i-th sample i Output the corresponding class logits vector z i =f T (x i ;θ T The logits are converted into predicted probabilities for each category using the Softmax function; cross-entropy loss is used as the objective function for supervised training, and the loss function is defined for a sample set with a batch size of M. Step 4.2 Backpropagation and parameter update: Based on the L CE For the teacher model parameter θ T Perform backpropagation to calculate the gradient of the loss function with respect to the weights of each layer. The parameters are updated using either the stochastic gradient descent algorithm or the AdamW optimization algorithm with a weight decay term, with a learning rate of η.
6. The distributed optical fiber drainage pipe leakage event identification method based on a distillation vision converter as described in claim 1 or 2, characterized in that, The process of step 5 is as follows: Step 5.1 Denote the two-dimensional feature image obtained in Step 2 as the input image X, and divide it into N non-overlapping image blocks {x1, x2, ..., x...} according to the preset block size. N } and flatten it into a one-dimensional vector, then divide each image patch x i Input a linear projection layer, using the weight matrix W E The labels are mapped to dimension D, forming an ordered sequence of labels. Step 5.2 Introducing Classification and Distillation Labels: A learnable classification label vector is introduced before the above patch label sequence. With distillation marker vector and The extended input sequence is obtained by concatenating the sequences. Step 5.3 Construct a learnable location encoding vector with the same dimension as the label, add it element by element to each label in the sequence to obtain an input sequence with location information, and input it into the encoder E of the DeiT student model. The encoder E consists of several cascaded Transformer encoding blocks. Each encoding block includes a multi-head self-attention layer, a multi-layer perceptron layer, and residual connections. The multi-head self-attention layer calculates scaled dot product attention based on query Q, key K, and value V, and then obtains the output features through multi-head parallelism and linear mapping. The MLP layer performs a non-linear transformation on the feature dimension, and after L coding blocks, the final coding sequence Z is obtained. L The 0th and 1st positions correspond to the high-dimensional feature representations of the classification label and distillation label, respectively. Step 5.4 Re-encoder outputs the final encoded sequence Z L Based on this, extract the feature vector h corresponding to the classification label. cls and the feature vector h corresponding to the distillation label dist The fully connected layers are used as the classification head and distillation head, respectively, and mapped to category logits of dimension C, which are used to output the prediction structure of the leakage event and the distillation branch output.
7. The distributed optical fiber drainage pipe leakage event identification method based on a distillation vision converter as described in claim 1 or 2, characterized in that, The process of step 6 is as follows: Step 6.1 Read samples from the labeled training and validation sets formed in Step 4 in batches, and input the feature maps from each batch into the DeiT student model constructed in Step 5 and the teacher models obtained in Steps 3 and 4. The input feature map of the i-th training sample is denoted as x. i The teacher model outputs a class logits vector. The student model outputs a class vector and a logits vector. Step 6.2 outputs the student model. First, the predicted probability distribution of the student model in each category is obtained through the Softmax function, which is used to calculate the cross-entropy supervised loss. For a sample set with a batch size of M, the supervised loss is calculated. At the same time, using the soft label information provided by the teacher model, a distillation loss with a temperature parameter T is used. The logits of the teacher and students are divided by the temperature T respectively, and then the soft probability distribution q is obtained by Softmax. (T) and q (S) Distillation loss L is defined based on the KL divergence between the two. KD ; Step 6.3 Optimize student model parameters using joint loss: The supervised loss and distillation loss are weighted by a weight coefficient α to construct a joint training objective function for the student model. In each training batch, the parameters of the DeiT student model are backpropagated based on the joint loss L, and the parameters are updated using stochastic gradient descent or AdamW optimization algorithm. Training continues until the joint loss converges to obtain a usable model.
Citation Information
Patent Citations
Optical fiber vibration and temperature measurement diagnosis method and system for drainage pipe leakage
CN120927196A