Small Sample Fiber Full State Diagnosis Based on Fuzzy Clustering and Improved ResNet Network

,


Introduction
With the advancement of science, technology, and power communication, they have transitioned from power transmission lines to fiber optic communication.Fiber optic communication offers advantages such as high communication capacity and compact size [1][2][3][4], and its stability plays a critical role in ensuring the reliable operation of power systems.However, in practical applications, some optical cables are deployed in areas with frequent human activities, which makes them prone to various faults.These faults can result in data loss [5], decreased operational stability of the cable lines [6], and overall cable failures.Therefore, it is crucial to implement a comprehensive state monitoring approach that includes prefault warnings, fault alarms, and regular inspections to detect and address potential cable failures on time.Such full-cycle state monitoring is of paramount importance.
The optical time domain reflectometer (OTDR), as a device for evaluating fiber optic performance, has found widespread applications in various aspects of communication fiber, including construction, maintenance, and operation [7][8][9].The OTDR curve provides a comprehensive depiction of the fiber optic's full-cycle state, enabling effective assessment of its performance throughout its operational lifespan.Elsayed et al. [10] and Lalam et al. [11] have employed the analysis of the power-distance relationship in OTDR curves to identify various faults occurring in fiber optic lines and locate them accurately.In literature [12], the application of wavelet analysis in OTDR analysis is discussed.Experimental results demonstrate a significant improvement in the performance of OTDR under strong noise conditions, in which model analysis is limited, and the algorithm is excessively complex.The aforementioned methods involve decomposing and extracting features from OTDR curves to identify fault locations, which are suitable for cases where the fault features are relatively distinct.However, in practical scenarios, some OTDR curves exhibit subtle differences between fault and nonfault curves, especially subhealthy curves.The aforementioned methods fail to differentiate these subtle differences due to insufficient feature extraction.Furthermore, optical fibers are easily affected by external environmental factors, and interference is unavoidable.If there is insufficient feature extraction, it may result in certain errors and misdiagnoses.
In recent years, deep learning has made significant advancements in the field of fault detection, with deep convolutional neural networks (CNNs) demonstrating powerful capabilities in feature extraction and classification.The literature [13] investigated the application of data-driven fiber modeling methods based on deep neural networks in optical communication systems, providing flexibility and generality to fiber modeling while reducing computational complexity.The literature [14] utilized fiber sensing technology and deep learning algorithms for fault detection, demonstrating excellent performance in automatic feature extraction of faults.The residual network (ResNet) is a kind of deep CNN, due to the introduction of residual blocks, which overcomes the problem of gradient disappearance during training.The literature [15,16] applies the powerful feature extraction ability of ResNets for feature extraction.The literature [17] applied the ResNet for fault diagnosis of turnouts, but the pooling layer could not adapt to the input data size.Therefore, in this paper, we propose to select the improved ResNet for feature extraction.However, the aforementioned fault diagnosis methods for optical fibers utilizing models often include fully connected layers.These fully connected layers, together with softmax, act as "classifiers" within the entire neural network.However, during Net training, a majority of the data is used to train the parameters of the fully connected layers.If the classification layer can be implemented using a method that does not require training, it would significantly reduce the training data and simplify the structure of the CNN.
To enable the usage of deep ResNets in scenarios with limited data samples, it is necessary to introduce improvements.Our research has revealed that the fully connected layers and softmax layers in ResNet consist of a substantial number of parameters, accounting for approximately 90% of the total parameters.By reducing the number of parameters in the fully connected layers and adopting a nontrainingbased classification algorithm, a significant reduction in training data can be achieved.Fuzzy clustering, as an unsupervised classification method, leverages fuzzy mathematical principles for classification without the need for training.It has already demonstrated successful applications in diverse domains, including shipbuilding [18,19] and power systems [20,21].
Based on the aforementioned insights, this paper proposes an improved deep ResNet using adaptive global mean pooling and fuzzy clustering to address the challenges associated with limited data samples in the context of a comprehensive diagnosis of optical fiber's full cycle status.The main contributions of this paper can be summarized as follows: (1) ResNet is used as a migration learning framework in this study, and it is used as a feature extractor by finetuning the network parameters with a small sample of fiber optic OTDR curves collected in the field.The convolution operation can be regarded as a "filter operation," and its convolution form is as follows: In Equation (1), x l j is the Jth feature graph in layer l; f is the activation function; k l i j is the convolution kernel; M j is the feature set; b l j is the jth offset of layer l.After undergoing convolutional operations and entering the pooling layer, the matrix size is reduced.With reduced parameters of the neural network, the resulting feature vectors are then fed into the classification layer for classification.In this study, we adopted the ResNet [13], which has excellent feature extraction capabilities.Compared to other network architectures, the ResNet's residual structure (shortcut connection) allows direct transmission of input data information to the output, addressing the problems of gradient vanishing and accuracy degradation that arise with increasing network depth.The ResNet-18 residual block structure is illustrated in Figure 1.It consists of four residual blocks, with two layers in each block.Each layer contains two 3 × 3 convolutional layers, in addition to a fully connected classification layer, resulting in a total of 18 layers.The ResNet residual block structure, as shown in Figure 2, consists of two layers.The input, denoted as x, undergoes residual 2 IET Signal Processing learning to form a residual function, as expressed in Equation ( 2) in Figure 2.
In Equation ( 2), σ is the activation function ReLU.After shortcut and ReLU on the second layer, the output y is obtained.There are two output expressions for y, when the number of channels is constant as follows: When the output channel is changed, and the number of channels is changed from 64 to 128, as the dashed line connection shown in Figure 1, the shortcut makes a linear change W s to x at this time as follows: In Equation ( 4), x is the input, y is the output of the neural network, W is the convolution adjusting the dimension of the channel.
The ResNet-18 network has been trained on millions of images and possesses rich feature representation capabilities.From the structure of the ResNet, it can be observed that the first 17 layers serve as feature extraction layers, while the 18th layer functions as the classification layer.In this study, we adopt the ResNet-18 model and utilize the first 17 layers as a feature extractor to extract features from OTDR curves.This study combines migration learning with fault data feature extraction, uses a small number of samples to fine-tune the existing trained model, adapts to the current situation where communication fiber fault data is not easy to obtain, and can provide scientific guidance for the full state diagnosis of communication fibers.

Global Average Pooling (GAP).
The parameters in the last full connection (FC) layer of ResNet-18 account for 80%-90% of the whole network, which reduces the training speed and is prone to an overfitting phenomenon.This paper proposes to replace FC with the GAP layer and reduce parameters.After the feature extraction of the convolutional layer, the features are expanded and classified by the FC layer in the traditional method.The GAP to replace the FC can be arbitrary dimension features in 1D output, which enhances the feature extraction ability of the convolutional layer while retaining the spatial information extracted by the convolutional layer and pooling layer, reducing the number of parameters in the model.The amount of data training is reduced, and the overfitting is also prevented.Figure 3 shows the GAP and FC structure comparison.In this paper, we propose to design a dimensionally adaptive GAP layer to replace the end of the network FC layer.The GAP layer designs an adaptive tensor matrix ½ x; w out ; n : , in which x is the number of feature graph channels output by the previous residual block, w out represents the size of the feature graph inputted by the residual block to the GAP layer, and n represents the number of fault types output.The calculation of w out is shown in Equation ( 5): where the convolution layer w in is the size of the feature graph, F is the size of the convolution kernel, and stride is the step size.For the feature map input from the previous convolution layer to GAP, the pooling kernel of GAP automatically matches the number and dimension of the convolutional kernel output.In this paper, when the OTDR curve image goes through the operation in the convolutional layer and residual block and outputs a 7 × 7 × 512 feature map into the GAP layer, the GAP layer can match the number and dimension of the pooling kernel by itself, and use the pooling operation to calculate a global average equivalent to FC as the GAP output feature value for the subsequent classification.Finally, the activations function is used to output 512 features in the GAP layer.The operation mode of GAP is as follows: In Equation ( 6), S l avg-pooiing represents the mean value obtained by applying GAP to the lth layer convolution.∑ c i¼1 X l 1:h; 1:w:i refers to the range of pixel points in the output feature map corresponding to the mean pooling kernel, spanning from the first row to the hth row horizontally and from the first column to the wth column vertically.The adoption of GAP reduces the number of parameters of the model to a certain extent.Compared with the traditional structure of ResNet, such usage of the model fine-tuning of the data demand is smaller, for only a small amount of communication fiber fault data are needed to obtain a good performance of the feature extractor, which is better adapted to the object of the study.

Fuzzy Clustering Algorithm (FCA).
Fuzzy clustering is an unsupervised learning method.With the principle of fuzzy mathematics and the similarity index r ij ¼ Rðx i ; x j Þ: introduced into clustering analysis, the fuzzy equivalence matrix is obtained by using the transitive closure method after calibration.When λ changes from 0 to 1, the dynamic clustering graph is obtained.The specific process is as follows: Step 1: Data standardization The data includes N types.Let the domain of the classified object be X ¼ ½x 1 ; x 2 ; …; x n : , and each object has n indices

4
IET Signal Processing representing its properties, that is, X i ¼ ½x i1 ; x i2 ; …; x in : , i ¼ ð1; 2; …; nÞ: .The corresponding data matrix is obtained as follows: x ¼ To solve the problem of different dimensions caused by different data, the data x is usually transformed by translation standard deviation and translation range as follows: In this equation, i ¼ 1; 2; …; n; k ¼ 1; 2; …; m; x k ¼ After the translation standard deviation transformation, the influence of the dimension between the data is solved, but there are x 0 ik ∉ ð0; 1Þ: , so it is necessary to translate the x 0 ik by the line as follows: Till now, the effect of the magnitude is eliminated for all x 0 ik 2 ð0; 1Þ: .
Step 2: Establishing fuzzy similarity matrix (calibration) The fuzzy matrix is obtained from Step 1, and the degree of similarity r ij between samples needs to be calculated to establish the fuzzy similarity matrix, which operation is also known as calibration.The main distance method to determine r ij is shown below, and this paper uses the Euclidean distance method to determine r ij .
The Euclidean distance is defined as shown in Equation ( 10): Step 3: Establish a fuzzy equivalent matrix.
The matrix R obtained through calibration in Step 2, needs to be transformed into an equivalent matrix R * , that is, R starts from the starting point, and finds the quadratic Step 4: Cluster analysis After applying the aforementioned steps, the fuzzy equivalence matrix R * is obtained.For any given λ 2 ½0; 1: ; R λ ¼ r ij ðλÞ: is referred to as the λ-cut matrix of the fuzzy equivalence matrix as follows: When r ij ≥ λ exists, the two samples are classified into one class.For different confidence levels λ 2 ½0; 1: , different clustering results can be obtained, thus forming a dynamic clustering graph.When in practice, the OTDR curve data in the case of fiber failure is usually insufficient, so this study chooses the FCA, an unsupervised clustering method, to realize the full state diagnosis of communication fibers, which has a number of advantages such as no need for training, adapting to small samples, and so on.

Fiber OTDR State Curve Analysis
The analysis of measurement curves using OTDR is facilitated by the backscattering generated by Rayleigh scattering and Fresnel reflection during the transmission of light in optical fibers.In optical fiber communication systems, cable faults are a significant cause of communication failures.OTDR technology enables the detection of the operational status of optical fibers, providing characterization of their healthy, subhealthy, and fault conditions.Therefore, it plays a crucial role in the maintenance of optical fibers.
3.1.Normal OTDR Rate Curve. Figure 4 illustrates the normal curve graph obtained from testing fiber optic cable lines using an OTDR instrument.The distance between markers A and B represents the length of the tested fiber optic cable line, with AB indicating the Fresnel reflection edge.

OTDR Fault Curve.
Based on the field results, the operational states corresponding to the OTDR curves of fiber optics can be categorized as healthy, subhealthy, and faulty  IET Signal Processing status.The corresponding reflection curves are depicted Figure 5, and the analysis of typical curves for each state is presented in Table 1.By compiling various representative OTDR curves into a fault database, when a specific fault occurs in the field, the type of it can be identified by comparing it with the curves in the fault database, knowing what state of fiber optic it is.If a new type of operational state curve emerges in the field, it can be incorporated into the fault database for expansion.

Build Fiber Optic Condition Diagnostic Model
A fiber optic state diagnosis model is established based on the content described in the previous section.

Transfer Learning (TF).
The so-called TF is to pretrain the ResNet in the source domain and then transfer the parameters in the source domain to the target domain.In this study, the network parameters of layers 1-16 are frozen, and a new convolutional layer is introduced to replace the last trainable layer of the ResNet.This is done to align with the new dataset in the target domain, and subsequently, the deep network is fine-tuned using small sample data in the target domain; at this point, the TL-ResNet model is established.

GAP Layer
Replace Fully Connected Layer.Due to the large number of parameters in the fully connected layer, overfitting is easy to occur in the case of small samples, which reduces the classification accuracy of the network.In this regard, the TL-ResNet-GAP model is constructed based on the ResNet-18 network by replacing the average pooling layer in the ResNet with the GAP layer, as described in Section 2.2.The fine-tuned model is used as a feature extractor to extract 512-dimensional feature vectors from the curve data.(3) The FCA is used to divide the feature vectors, and a dynamic clustering map is generated by calculating the fuzzy equivalence matrix, while the confidence factor is then varied from 0 to 1 to generate a dynamic clustering map, and finally, the classification results of the fiber optic state are obtained.With the improved TL-ResNet-GAP ResNet employed as the feature extractor, the OTDR curve images from Figure 5 are input into the ResNet-GAP network, and the feature vectors of the OTDR curves are extracted at the GAP layer and establish the corresponding set of feature vectors.The results of the feature vector collection are presented in Table 2.The feature vector matrix, composed of the feature vectors from multiple curves, serves as the repository of typical sample curves for constructing the fault curve library.If a test curve is not recorded in the fault curve library, it is added as a sample curve to expand the library.By clustering the test curves obtained in the field and the curves in the sample library using fuzzy clustering, the purpose of fault classification can be achieved based on their consistent features.

State Diagnosis Experiment on Improved ResNet Network.
To validate the feasibility of the proposed model, a field OTDR state curve was collected, as shown in Figure 7.The curves labeled as d 0 and d 1 represent the test curves.Through field inspection and maintenance, two faults were identified, which were consistent with the subhealthy curves f 1 and fault curves f 3 , respectively.The improved ResNet was employed to extract features from the OTDR curves, as presented in Table 3.
Based on the information presented in Table 2 and the current Table 3, a feature vector matrix was constructed.The feature vector matrix was subjected to standardization,

Subhealthy
The cable is overbent There are "small steps" in the middle f 2 The bending radius of the cable is rather small The curve fluctuates in the intermediate stage The breakpoint is too close to the test point or in a blind spot The curve has no middle flat stage and no end peak To assess the similarity among samples, the Euclidean distance method, as described in Equation (10), was employed to calibrate the matrix X and obtain the fuzzy equivalence matrix R. Subsequently, the method in Step 3 was utilized to transform matrix R into a fuzzy similarity matrix R * : R * ¼ In the fuzzy similarity matrix R * , as the confidence factor λ getting bigger, a dynamic clustering graph is formed, as illustrated in Figure 8.When λ = 0.655, the tested curve d 1 is similar to curve f 1 , and they are classified into the same cluster.Similarly, when λ = 0.482, the tested curve d 0 is similar to curve f 3 in terms of faults, and they are classified into the same cluster.These results are consistent with the findings from the on-site detection.
A total of 60 sets of OTDR curves were collected from the field.The improved pretrained ResNet-GAP model and the original ResNet model were employed for fault diagnosis of the curves.Overall, 80% of the dataset was employed as the training set and 20% as the testing set for fault diagnosis.
The unmodified ResNet model was selected and trained with the dataset of 60 OTDR curves.The training accuracy curve is depicted in Figure 9. Furthermore, the diagnostic results were compared with the actual field results.The diagnostic accuracy achieved by combining the proposed ResNet-GAP model with fuzzy clustering was 96.7%, while the unmodified ResNet achieved an accuracy of only 75%.These results demonstrate the practical value of the improved algorithm.

Comparison Analysis with
Other Algorithms.To verify the superiority of the TL-ResNet-GAP-FCA fault diagnosis algorithm compared to the current mainstream fault diagnosis methods, a time-frequency domain feature extraction method was applied to the OTDR curves.The extracted features, including absolute mean, root mean square, variance, peak factor, etc., are presented in Table 4.
In this study, four algorithms, LSTM, CNN, SVM, and SAE, are selected for experimental comparison and validation, and the accuracy rate is used as the model evaluation index.The FCA alone requires that the dimension of the input data cannot be too large, so it is supplemented with the time-frequency domain extraction algorithm for fault diagnosis, and the experimental results are shown in Table 5.
From Table 5, it can be seen that the accuracy rates of LSTM, CNN, SAE, SVM, and fuzzy clustering are 58.3%, 66.7%, 83.3%, 75%, and 86.7%, respectively.In contrast, the accuracy of the improved ResNet-GAP model is 96.7%.These results indicate that the improved ResNet outperforms other intelligent fault diagnosis algorithms with significantly higher accuracy.In addition, the improved ResNet does not require manual feature extraction of the target under test, which results in better fault diagnosis performance.Standard error μ 3 μ 3 ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi Peak factor μ 5 μ 5 ¼ min i¼1 n ðx i Þ ffiffiffiffiffiffiffiffiffiffiffi The margin factor μ 6 μ 6 IET Signal Processing

Conclusions
In this paper, the TL-ResNet-GAP-FCA network is applied to the full-cycle status diagnosis of optical fibers, addressing the challenge of small sample diagnosis in deep networks.First, the OTDR curves are input into the feature extractor, where they undergo multiple convolutional and residual operations.The features are then extracted at the GAP layer of the improved ResNet-GAP network.Fuzzy clustering is employed in the classification layer to group similar samples together.Experimental results demonstrate that the improved ResNet exhibits fast processing speed and excellent diagnostic performance, achieving an intelligent diagnosis of optical fibers in the context of small sample sizes.This approach effectively addresses the challenges associated with deep network diagnosis of small samples in the full-cycle diagnosis of optical fibers.

FIGURE 3 :
FIGURE 3: Comparison of FC and GAP structures.

4. 3 . 4 . 4 .( 1 )
FCA Instead of Softmax Layer Classification.The TL-ResNet-GAP-FCA model is established by incorporating the FCA in place of the classification layer in the TL-ResNet-GAP network.The activations = (net, x, layer) function was used to output the features extracted by the GAP layer, and the extracted features were used to construct the corresponding feature vector matrix for subsequent fault diagnosis.Fiber Full State Diagnosis Experimental Procedure.The specific diagnostic workflow model of the improved model is shown in Figure 6, which can be divided into the following three diagnostic steps: Use the OTDR to collect the communication fiber and get the fiber OTDR curve data.(2) Use the ResNet framework to build a migration learning model, replacing the original model softmax layer with the GAP layer.With a small sample of fiber data, the model is fine-tuned for training to improve the feature extraction ability of the model.

f 4 Fault
Fiber breakA large peak appeared in the middle flat stage of the curvef 5Dirty on the end of the cable or poor quality on the end of the surface There is no reflection spike at the end of the curve
ensuring that the data distribution ranged from 0 to 1.The resulting matrix X was denoted as follows:

TABLE 1 :
Classification and analysis of OTDR curves for different status of fibers.

TABLE 3 :
Characteristic vector of the curves to be tested.

TABLE 4 :
Time-domain feature extraction methods.