CN114037001A - Mechanical pump small sample fault diagnosis method based on WGAN-GP-C and metric learning - Google Patents

Mechanical pump small sample fault diagnosis method based on WGAN-GP-C and metric learning Download PDF

Info

Publication number
CN114037001A
CN114037001A CN202111183493.3A CN202111183493A CN114037001A CN 114037001 A CN114037001 A CN 114037001A CN 202111183493 A CN202111183493 A CN 202111183493A CN 114037001 A CN114037001 A CN 114037001A
Authority
CN
China
Prior art keywords
data
wgan
sample
model
fault diagnosis
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111183493.3A
Other languages
Chinese (zh)
Inventor
王雪仁
高晟耀
刘瑞杰
苏常伟
管峰
缪旭弘
寻波
张海峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
People's Liberation Army 92578
Original Assignee
People's Liberation Army 92578
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by People's Liberation Army 92578 filed Critical People's Liberation Army 92578
Priority to CN202111183493.3A priority Critical patent/CN114037001A/en
Publication of CN114037001A publication Critical patent/CN114037001A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24147Distances to closest patterns, e.g. nearest neighbour classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Abstract

The invention discloses a fault diagnosis method for a small sample of a mechanical pump based on WGAN-GP-C and metric learning, which is based on one-dimensional convolution and time sequence data design and comprises four parts of data preprocessing, data enhancement, metric learning and model optimization. The data preprocessing realizes the self-adaptive denoising and standardization of data; in the data enhancement part, network and structure modification is carried out based on WGAN-GP to obtain WGAN-GP-C so as to realize data expansion according to categories and further strengthen the edge boundary information of the data; the measurement network combines the residual error idea and the space self-adaptive structure to realize feature mapping, and then combines the KNN algorithm to realize state classification; in the model optimization part, the weight quantization idea is used for optimizing the network, the Ball-tree is used for realizing KNN, and the training data is deleted according to the important factors, so that the algorithm performance is integrally improved. The invention has good performance and high practical value under the condition of rare data, and can provide ideas for related workers for maintaining mechanical pumps.

Description

Mechanical pump small sample fault diagnosis method based on WGAN-GP-C and metric learning
Technical Field
The invention relates to a mechanical pump fault diagnosis method, in particular to a mechanical pump small sample fault diagnosis method based on WGAN-GP-C and metric learning.
Background
With the development of science and technology, the structure of ship equipment is more and more complicated, the function is more and more perfect, degree of automation is more and more high, and the complexity of mechanical equipment is multiplied therewith. Therefore, when a certain component of the mechanical equipment fails, the whole system may fail, and the failure may not only cause serious economic loss, but also even cause casualties. Therefore, the development and improvement of intelligent diagnosis technology capable of effectively diagnosing the fault of the mechanical equipment are urgently needed.
The intelligent diagnosis technology combines a fault diagnosis technology with a network transmission technology, and adopts computer software to intelligentize a diagnosis process, so that the fault diagnosis threshold is reduced, the intelligent diagnosis technology is convenient to use, and meanwhile, the reliability of a diagnosis result is improved, so that the intelligent diagnosis technology gradually receives more and more attention, and becomes a hotspot of current research and application.
With the emergence of detection technologies such as fuzzy set theory, expert system, neural network, wavelet analysis and the like, the intelligent fault diagnosis technology has been developed into a comprehensive technology of multidisciplinary coupling, the efficiency of ship equipment is exponentially improved by understanding and reasonably adopting the technologies, the full-life, full-system and full-cost management of the ship equipment is met, and the intelligent fault diagnosis technology has very important significance for ensuring the reliability and safety of the ship system.
At present, data-driven models are generally adopted in intelligent fault diagnosis systems for mechanical pumps, most of the models input extracted fault features into an algorithm model by means of machine learning algorithms such as gradient lifting trees, support vector machines, logistic regression and the like, model parameters are adjusted, and a diagnosis model is obtained through multiple iterative training.
In recent years, the development of deep learning and neural networks introduces a new idea for fault diagnosis, the method has strong expression capability, overcomes the defects of the traditional machine learning algorithm, has the potential of identifying tiny faults, and has wide attention paid by researchers in the industry to the application of the method in fault diagnosis. The diagnostic models usually have good effects in specific scenes, but most models need more data to be established, the influence of the data scale on part of the models is huge, and particularly, the influence of the data is particularly obvious based on deep learning and a neural network and model structure. However, in reality, fault data of mechanical equipment such as a mechanical pump and the like is rare and may have partial deletion, effective training of a set of common algorithm is difficult to support, the difficulty of data analysis is increased under the condition of small sample data, and an ideal result is difficult to obtain by the algorithm, so that the fault diagnosis faces the problems of low accuracy, missing report, false report and the like.
The design of a mechanical fault diagnosis algorithm aiming at a small sample background is a hot research problem at present, and a plurality of strategies emerge in recent years, but most of the strategies have the problems of single adaptive scene, defects in algorithm performance and the like, which is the significance of continuing research at present.
Disclosure of Invention
In order to solve the defects in the prior art, the invention aims to provide a fault diagnosis method for a mechanical pump small sample based on WGAN-GP-C and metric learning, which is used for designing a fault diagnosis algorithm for the small sample based on WGAN-GP-C and metric learning based on one-dimensional convolution and time sequence data under the background of the small sample with rare fault data of the mechanical pump of a ship, and adopting the fault data of a typical mechanical pump to carry out algorithm verification and realization.
In order to realize the purpose of the invention, the technical scheme adopted by the invention is as follows:
a fault diagnosis method for small samples of a mechanical pump based on WGAN-GP-C and metric learning, the method comprises the following steps:
(1) reading time sequence data and carrying out data preprocessing;
(2) constructing a WGAN-GP-C model, and performing data enhancement based on the WGAN-GP-C model;
(3) constructing a fault diagnosis model based on metric learning and KNN classification algorithm;
(4) carrying out model optimization;
(5) and utilizing the optimized model to carry out fault diagnosis on the data which is preprocessed and subjected to data enhancement.
Further, the step (1) specifically includes:
(1.1) reading time sequence data, intercepting according to a set length, and filtering by using a normalized least mean square adaptive filter (NLMS);
(1.2) removing an abnormal value by using median filtering;
(1.3) counting the mean and variance of each dimension of the data, and carrying out data standardization by adopting a Z-score method. Further, the NLMS filtering algorithm is as follows:
y(k)=wT(k)x(k)
e(k)=d(k)-y(k)
Figure BDA0003298271270000021
where x (k) is an input signal, y (k) is an output signal, d (k) is a reference signal, w (k) is a filter coefficient, α is an adjustment factor for preventing denominator from being zero, | x (k) is a filter coefficient2Is the square of the euclidean norm of x (k),
Figure BDA0003298271270000022
is the step size parameter.
Further, the step (2) specifically includes:
(2.1) constructing a WGAN-GP-C model based on the WGAN-GP and a residual error structure, adding a label for class guidance when random noise is input into a generator, and judging the class of the data at the output end of a discriminator to generate the data according to the class;
(2.2) carrying out WGAN-GP-C model training, sending the generated sample and the real sample into a discriminator, firstly training data distribution, enabling the generated sample and the real sample to be drawn close, and then training and classifying while perfecting the distribution;
(2.3) when the WGAN-GP-C which is trained is used for generating a sample, screening the generated sample data;
(2.4) the quality of the generated sample data is evaluated by adopting the maximum mean difference MMD and the model is adjusted according to the maximum mean difference MMD.
Further, the loss function of the generator G, the loss function of the discriminator D, and the loss function of the data class are as follows:
Figure BDA0003298271270000031
Figure BDA0003298271270000032
Figure BDA0003298271270000033
wherein the content of the first and second substances,
Figure BDA0003298271270000034
denotes f (x) the mathematical expectation for x under the distribution P, xrIs a true sample, xfIs to generate a sample, PrRepresenting the true data distribution, PfThe representation generates a distribution of the data,
Figure BDA0003298271270000035
and
Figure BDA0003298271270000036
respectively represent xrAnd xfIn the category of (a) to (b),
Figure BDA0003298271270000037
to represent
Figure BDA0003298271270000038
Data of (2)The distribution of the water content is carried out,
Figure BDA0003298271270000039
is shown in distribution PrAnd distribution PfThe data points on the connecting line of (a),
Figure BDA00032982712700000310
to represent
Figure BDA00032982712700000311
Data distribution of L2Denotes the L2 regularization penalty, λ1、λ2、λ3、λ4And λ5Is a hyperparameter controlling different parts of the loss function, n represents the number of samples, i.e. the dimension of y, yi、classiRepresenting the net output of the ith sample and the true category.
Further, the data screening step comprises: carrying out category judgment on the generated samples through a discriminator, and reserving the generated samples with the input labels being the same as the output categories of the discriminator; and selecting whether to retain the sample or not according to a certain probability a for each retained sample, wherein the probability a is the accuracy a of the discriminator on the real data test set.
Further, the step (3) specifically includes:
(3.1) constructing a measurement network model, which comprises a convolutional neural network Vector-CNN and a space adaptive structure, wherein sample data obtains a Vector through the convolutional neural network, a space position matrix is constructed in the space adaptive structure, and then different weights are given to the space position according to Vector characteristics so as to realize space measurement mapping;
(3.2) constructing a triplet data set, and training a measurement network model by adopting an Adam optimizer;
and (3.3) constructing a classification algorithm model, searching an optimal k value and corresponding accuracy by using a KNN algorithm, and testing the metric network model obtained by training.
Further, the spatially adaptive structure loss function is as follows:
ltriplet(xa,xp,xn)=max{0,d(Ea,Ep)-d(Ea,En)+μ
loss=ltriplet(xa,xp,xn)+λlE
wherein d (E)a,Ep) Represents EaAnd Epμ is a hyper-parameter, λ is a hyper-parameter controlling the penalty degree; x is the number ofaDenotes anchor, xpAnd xnRespectively representing positive and negative examples, Ea、EpAnd EnRepresenting the measurement network mapping output of the three; lEIndicating an L2 regularization process.
Further, the step (4) specifically includes:
(4.1) quantizing for a metric network; specifically, quantization is carried out on a Vector-CNN of a convolutional neural network, and adjacent network modules are fused; specifically, symmetric quantization is adopted for the weight of convolution, bias is not quantized, and asymmetric quantization is adopted for the active layer;
(4.2) accelerating the KNN algorithm by adopting a tree structure Ball-tree;
(4.3) screening the training set data, proposing important factors IF of the training set data, and sequencing all samples from small to large according to the important factors; and on the premise of ensuring the accuracy of the algorithm, a part of samples with smaller IF are removed.
Further, defining the important factors of the samples as the reciprocal sum of the squares of the Euclidean distances between the samples and the samples of the same type, adding the squared sums of the Euclidean distances between the samples and the samples of different types after the size adjustment, and respectively operating according to the data types when sorting and deleting the data by considering the difference of the size distribution of the important factors of the samples of different types;
Figure BDA0003298271270000041
Figure BDA0003298271270000042
Figure BDA0003298271270000043
wherein x isinN sample representing class i of training samples, NiDenotes the number of class i samples, C denotes the number of sample classes, d (x)in,xim) Denotes xinAnd ximThe Euclidean distance of (a) is,
Figure BDA0003298271270000044
representation collection
Figure BDA0003298271270000045
The maximum value of (a) is,
Figure BDA0003298271270000046
representation collection
Figure BDA0003298271270000047
The minimum value of (a) is determined,
Figure BDA0003298271270000048
and
Figure BDA0003298271270000049
are respectively a set
Figure BDA00032982712700000410
And collections
Figure BDA00032982712700000411
Deleting the set of large values and small values according to a certain proportion, mean () representing the average value of all the values in the set, inf representing the minimum value preventing the denominator from being zero.
Compared with the prior art, the invention has the beneficial effects that:
(1) aiming at rare fault data, the scheme of NLMS + median filtering is adopted to obtain better filtering performance under the condition of smaller time disadvantage; the filtering and data combining are standardized to form a data preprocessing part, which has an obvious effect of improving the performance of the model;
(2) the data enhancement part is a first step scheme aiming at the current situation of a small sample, changes based on WGAN-GP to obtain WGAN-GP-C so as to generate data according to categories, and combines parameter adjustment and an effective data screening strategy to realize data enhancement and strengthen data edge information;
(3) in the model optimization part, quantization processing is carried out on Vector-CNN, the size of the model is reduced by about 4 times, and meanwhile, the operation speed and the classification performance are ensured; the conventional implementation of KNN is changed into Ball-tree, so that the search speed is effectively improved; important factor definition is provided, and data are removed by taking important factors based on the properties of a training set as reference in implementation, so that the tree building time and the searching time of the Ball-tree are further optimized;
(4) the method has better fault identification accuracy rate under complex scenes of high noise interference, insufficient sample quantity and the like; the method has the advantages of scientificity, reasonableness, strong adaptability and high practical value, and can provide reference for related personnel such as mechanical pump research and development, large-scale mechanical operation maintenance and research.
Drawings
FIG. 1 is a general block diagram of a mechanical pump small sample fault diagnosis method based on WGAN-GP and metric learning;
FIG. 2 is a WGAN-GP-C network design diagram;
FIG. 3 is a design drawing of a metric-net structure;
FIG. 4 is a schematic diagram of a KNN classifier;
FIG. 5 is a diagram illustrating the variation of the loss associated with the WGAN-GP-C model training; a is the generator loss and b is the discriminator loss;
FIG. 6 is a schematic diagram of the loss variation during the metric-net training process; a is loss change and b is lE(ii) a change;
FIG. 7 is a two-dimensional visualization diagram of a quantized vector library;
FIG. 8 is a diagram illustrating the variation of accuracy in data screening; a is the optimum accuracy change, b is the search time change, c is the time change for building the tree structure, and d is the accuracy change.
Detailed Description
The technical solution of the present invention is further described below with reference to the accompanying drawings and examples. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present application is not limited thereby.
As shown in figure 1, the fault diagnosis method for the mechanical pump small sample based on WGAN-GP-C and metric learning is composed of four parts, namely data preprocessing, data enhancement based on WGAN-GP-C, a classification algorithm based on metric learning and KNN and model optimization, and accurate diagnosis of the mechanical pump fault with the small sample background is achieved.
The invention relates to a fault diagnosis method for a small sample of a mechanical pump based on WGAN-GP-C and metric learning, which comprises the following specific steps:
(1) designing data preprocessing;
reading original data and intercepting according to the length of 2015, filtering the data by using a Normalized Least Mean Square adaptive filter (NLMS) with the filter order of 16 and the step factor of 0.05, and removing an abnormal value by using median filtering with the kernel of 5. And (5) counting the average value and the variance of each dimension of the data, and performing data standardization by adopting a Z-score method.
(2) The data enhancement design based on WGAN-GP-C;
designing based on the WGAN-GP and residual structure thought when building a WGAN-GP-C model, adding category guide information when a generator inputs random noise, and introducing a part for distinguishing the data category at the output end of a discriminator. In WGAN-GP-C training, the first 50000 epochs train data distribution only, and then train data distribution and data classification simultaneously to realize data generation according to classes. The data generation quality was evaluated using the Maximum Mean variance (MMD) and the network was adjusted accordingly. The data enhancement process follows a data screening strategy.
(3) Designing a classification algorithm based on metric learning and KNN;
and building a measurement network model, based on a residual error thought, and providing a space self-adaptive structure, so that a more appropriate space position is searched for by the sample according to the property of the sample when space mapping is carried out. The data mapping output dimension is 32. Constructing a triplet dataset. Using learning rate lr being 5 × 10-5The Adam optimizer of (a) trains a network model. When a classification algorithm model is constructed, a KNN algorithm is used for setting the parameter k to be 1,100]And traversing within the range, and then testing the performance of the KNN algorithm on the test set to find the optimal k value and the corresponding accuracy.
(4) Constructing a model and optimizing the model;
quantization is performed for the metric network. Symmetric quantization is adopted for the weight of the convolution, bias is not quantized, and asymmetric quantization is adopted for the active layer. The operation of 32 bits to 8 bits is realized. And realizing KNN by adopting a tree structure. And (4) carrying out search time comparison on linear scanning (linear scan), Kd-tree and Ball-tree, and selecting a Ball-tree mode to realize the KNN algorithm. And (2) screening data of the training set, putting forward a concept of Important Factors (IF) of the training data, sequencing all samples from small to large according to the Important factors, and removing a part of samples with small IF on the premise of ensuring the accuracy of the algorithm, thereby realizing data screening, optimizing the speed of building a Ball-tree and improving the searching speed.
(5) And constructing and optimizing a model, and performing fault diagnosis on the preprocessed data.
In the step (1), the step (c),
(1.1) NLMS in data pre-processing is improved by Least Mean Square adaptive filter (LMS). The method is widely applied to the fields of signal processing, channel equalization and the like, an optimal solution is obtained based on random gradient descent, and the arithmetic operation process comprises filtering output calculation (formula 1), error signal calculation (formula 2) and weighting coefficient updating (formula 3).
y(k)=wT(k)x(k) (1)
e(k)=d(k)-y(k) (2)
w(k+1)=w(k)+μe(k)x(k) (3)
Where x (k) is the input signal, y (k) is the output signal, d (k) is the reference signal (x (k) is used as the reference in practice), w (k) is the filter coefficient (the coefficient of the adaptive filter), and μ is the step size parameter.
When the signal is unstable or complex, the LMS often has the problem of unstable convergence or even difficulty in convergence due to a fixed convergence step. A Normalized Least Mean Square adaptive filter (NLMS) normalizes a fixed step size parameter with an input signal to continuously change the step size parameter, so that the NLMS algorithm has higher adaptability and convergence stability than the LMS algorithm.
When the NLMS is operated, the filter coefficient is updated as shown in the formula 4.
Figure BDA0003298271270000071
Wherein α is an adjustment factor for preventing denominator from being zero, | x (k) non-conducting phosphor2Is the square of the euclidean norm of x (k),
Figure BDA0003298271270000072
is the step size parameter.
(1.2) the median filtering is to replace the value of one point in the digital sequence with the median of each point in a neighborhood of the point, thereby eliminating isolated noise points and effectively inhibiting abnormal points.
(1.3) the data standardization is to ensure that the network looks at the same core for each dimension of the data so as to achieve a good convergence effect, the Z-score standardization method is used in the invention, and the calculation mode is as follows.
Figure BDA0003298271270000073
Wherein x isikFor the ith row and kth column parameters of the data set,
Figure BDA0003298271270000081
stdkare the mean and standard deviation of the parameters in column k.
In the step (2), the step (c),
(2.1) WGAN-GP-C based data enhancement is the first step solution of the present invention for mechanical pump failure diagnosis. The WGAN-GP-C is obtained by carrying out structural modification based on the WGAN-GP for generating data according to categories.
The problem that a native generated countermeasure Network (GAN) is difficult to train is solved based on Wasserstein generated countermeasure Network (WGAN), but gradient shearing (weight clipping) of the WGAN still easily causes gradient disappearance or gradient explosion. To solve this problem, a training technique of gradient penalty (gradient penalty) is introduced into the WGAN, i.e. WGAN-GP.
As shown in fig. 2, an important premise of the data generation of the present invention is that the generation is performed according to the data type, so that the network structure design based on WGAN-GP needs to add the type guidance information, which is called WGAN-GP-C (WGAN-GP with category).
The method comprises the steps of adding a label to random noise data input by a generator for class guidance, wherein the label is represented by trainable word templates with the same latitude as random noise, sending a generated sample and a real sample to a discriminator, and outputting Wasserstein Distance (EM Distance, Earth Mover's Distance, EMD) of the generated sample and the real sample and the class of the sample by the discriminator. When a generator and a discriminator of the WGAN-GP-C are constructed, the design is carried out by using a residual error idea based on 1 DCNN. It is worth noting that in the construction of the discriminator, when the residual structure is used, the Batch Normalization is not added. According to the structural design of the invention, the loss function of the generator G (x) can be obtained as shown in formula 6, and the loss function of the discriminator D (x) is obtained as shown in formula 7. Wherein, the loss calculation of the data category adopts a cross entropy function, as shown in formula 8.
Figure BDA0003298271270000082
Figure BDA0003298271270000083
Figure BDA0003298271270000084
Wherein the content of the first and second substances,
Figure BDA0003298271270000085
denotes f (x) the mathematical expectation for x under the distribution P, xrIs a true sample, xfIs to generate a sample, PrRepresenting the true data distribution, PfThe representation generates a distribution of the data,
Figure BDA0003298271270000086
and
Figure BDA0003298271270000087
respectively represent xrAnd xfIn the category of (a) to (b),
Figure BDA0003298271270000088
to represent
Figure BDA0003298271270000089
The distribution of the data of (a) is,
Figure BDA00032982712700000810
is shown in distribution PrAnd distribution PfThe data points on the connecting line of (a),
Figure BDA00032982712700000811
to represent
Figure BDA00032982712700000812
Data distribution of L2Denotes the L2 regularization penalty, λ1、λ2、λ3、λ4And λ5Is a hyperparameter controlling different parts of the loss function, n represents the number of samples, i.e. the dimension of y, yi、classiRepresenting the net output of the ith sample and the true category.
The training mode of WGAN-GP-C is to better meet the requirement of generating data according to categories, firstly train data distribution, enable the generated data to be close to real data, train classification while perfecting distribution, and search boundary information of the generated data. I.e. setting the parameters of equations 6 and 7, in front of 5Ten thousand epochs, set to λ2=10,λ1=λ3=λ4=λ5When the value is 0, data training is imported. In training after 5 keep, λ is set1=1、λ2=10、λ3=0、λ4=10、λ5Training was continued at 0.004.
When a trained WGAN-GP-C is used for generating a sample, the design is used for screening the generated sample data, in the process, the discriminator is considered to have better performance, so that the data screening process is associated with the discriminator, and the data screening step is as follows: (1) and performing category judgment on the generated samples through a discriminator, and reserving the generated samples with input label same as the output category of the discriminator. (2) And (3) selecting whether to retain the sample or not according to a certain probability a for each sample retained in the step (1), wherein the probability a is the accuracy a of the discriminator on the real data test set.
(2.2) the quality of the generated samples is evaluated using the MMD (Maximum Mean discrimination, MMD) method, which measures the distance between the training data set distribution and the generated data set in Hilbert space. The smaller the value, the closer the two sets of data are distributed.
In the step (3), the step (c),
(3.1) the metrology network model designed based on metrology learning and classification algorithms of KNN is the second step solution of the present invention to the problem of small samples of mechanical pumps. Metric Learning (Metric Learning) is a space mapping method, and can learn a feature space (embedding space) with higher discriminant, so that the effect is more effective than that of feature extraction, and the effect is obvious on the problem of small samples.
As shown in fig. 3, the Network model design based on metric learning of the present invention is designed based on 1DCNN and a residual structure, and a spatial adaptive structure is proposed with reference to a Similarity Condition Embedding Network, so that a sample automatically selects a more suitable spatial position according to its own data property when performing spatial mapping. It was named as metric-net. The metric-net is mainly composed of a convolutional neural network named Vector-CNN and a spatial adaptive structure. The Vector-CNN is realized based on 1DCNN, a plurality of residual error structures and pooling structures are used for achieving a better convergence effect, and one-dimensional data passes through the residual error structures and pooling structures to obtain a Vector, namely a Vector.
In a space adaptive structure, Vector is used for processing, and a network uses a learnable matrix mask in the part, wherein the matrix mask comprises n arrays with the same dimension as that of the Vector, namely M1, M2, … and Mn, and the function of the matrix mask is to automatically learn n space positions which can effectively represent the vibration data characteristics of the mechanical pump; in addition, the Vector outputs n data, namely W1, W2, … and Wn, through a small network, and aims to give different weights to the n spatial positions according to Vector features so as to reasonably recombine to realize better spatial metric mapping.
In the calculation of the space adaptive structure part, Mi (i ═ 1,2, …, n) is normalized by an L2 norm, then is subjected to hadamard product operation with Vector to realize the mapping of the sample to different space positions, then is subjected to product operation with Wi (i ═ 1,2, …, n), and n obtained vectors are accumulated according to dimensions to obtain the final Embedding. The metric-net adopts a learnable mask and does not seek the sparsity of the mask when being realized, thereby realizing the self-adaptive search of the spatial position.
(3.2) to train the metric network, the invention defines a triplet { x }a,xp,xnIn which xaDenotes anchor, xpAnd xnRespectively representing positive and negative examples, Ea、EpAnd EnRepresenting the output of the metric network mapping of the three, the final triplet loss can be expressed as equation 9. The invention carries out L2 regularization treatment on the last Embedding, namely LEThen the loss function of the network is shown as equation 10.
ltriplet(xa,xp,xn)=max{0,d(Ea,Ep)-d(Ea,En)+μ} (9)
loss=ltriplet(xa,xp,xn)+λlE (10)
Wherein d (E)a,Ep) Represents EaAnd EpIs a hyper-parameter, mu. λ is a hyper-parameter that controls the degree of penalty.
When a triplet data set is constructed, the method is carried out according to the principle that 2 groups of data in the same category are matched with 9 groups of data in different categories. In order to make the network obtain good convergence, a smaller learning rate is adopted during training. Learning by adopting an Adma optimizer, wherein the learning rate is lr being 5 multiplied by 10-5The batch size is set to 512. The parameters of formula 9 and formula 10 are set, where μ is 0.6 and λ is 5 e-3.
And (3.3) for the data to be diagnosed, the data can be mapped into a vector by using the network after being subjected to data preprocessing, and then the vector is searched for in the surrounding space, and the data is judged according to the category of the surrounding vector.
As shown in FIG. 4, the present invention uses the KNN algorithm to perform a close-proximity search, traverses the parameter k within the range of [1,100], and then tests the performance of the KNN algorithm on the test set to find the optimal k value and the corresponding accuracy.
In the step (4), the step of (C),
(4.1) the main purpose of model optimization is to reduce the occupied memory of the model and improve the operation speed under the condition of ensuring the performance. Quantization is an important way in which the present invention handles the measurement network. When the quantization processing is performed on the measurement network, 32-bit operation is converted into 8-bit operation, so that the volume is reduced, the operation speed is increased, and certain errors are brought. The invention adopts a scheme of combining module fusion and Static Quantization (Post tracking Static Quantization). Aiming at a trained network model, after a quantization position is specified, parameters of a convolutional layer, a bn layer (Batch Normalization) and an activation layer in the model are fused, a quantization mode is determined, reasoning is carried out on a training set, and reasonable quantization parameters are obtained through channel-by-channel observation.
And (4.2) realizing the KNN by adopting a tree structure so as to improve the searching speed of the KNN. The linear scanning mode of the KNN algorithm has a low operation speed, and in order to improve the real-time performance of the algorithm, the tree structure is adopted for operation acceleration. The Kd-tree is commonly used, which can save online search time, but the Kd-tree uses a hyper-rectangle to divide data, and the search speed is not good when the data dimension is high. To improve this situation, Ball-tree arises by dividing data on a series of nested hyper-spheres and making a determination based on the sum of the two sides and the size of the third side during searching, thereby improving the computational efficiency.
And (4.3) screening the training set data to further improve the search speed of the Ball-tree and achieve the effects of reducing tree building time of the Ball-tree and reducing memory occupation. Although the tree structure has high search efficiency, the tree building process is complex and time-consuming, so that the tree building efficiency and the search efficiency can be further improved if the training data can be reduced without affecting the performance. The method uses a weighted voting mode in a KNN algorithm to obtain a final classification result. Training samples which can effectively realize classification are close to the same class and far from different classes, so that the classification has better distinguishability.
Therefore, the significant Factor (IF) of a sample is defined as the reciprocal sum of the squared euclidean distances from the same class of samples and the squared euclidean distances from the different class of samples after being adjusted in size, and the size adjustment refers to the mean of the squared euclidean distances, as shown in equation 11. And considering that the size distribution of the important factors of the samples of different classes has difference, the operation is respectively carried out according to the data classes when the data are sorted and the data deletion is realized.
Figure BDA0003298271270000111
Figure BDA0003298271270000112
Figure BDA0003298271270000113
Wherein x isinN sample representing class i of training samples, NiDenotes the number of class i samples, C denotes the number of sample classes, d (x)in,xim) Denotes xinAnd ximThe Euclidean distance of (a) is,
Figure BDA0003298271270000114
representation collection
Figure BDA0003298271270000115
The maximum value of (a) is,
Figure BDA0003298271270000116
representation collection
Figure BDA0003298271270000117
The minimum value of (a) is determined,
Figure BDA0003298271270000118
and
Figure BDA0003298271270000119
are respectively a set
Figure BDA00032982712700001110
And collections
Figure BDA00032982712700001111
Deleting the set of large values and small values according to a certain proportion, mean () representing the average value of all the values in the set, inf representing the minimum value preventing the denominator from being zero.
The invention carries out a plurality of experimental comparisons on different parameter settings of algorithm design so as to achieve better parameter selection and further expand the practicability and universality of the whole algorithm.
The invention relates to a fault diagnosis method for a small sample of a mechanical pump based on WGAN-GP-C and metric learning, which comprises the following specific steps:
s1, designing data preprocessing;
reading original data and intercepting according to the length of 2015, filtering the data by using a Normalized Least Mean Square adaptive filter (NLMS) with the filter order of 16 and the step factor of 0.05, and removing an abnormal value by using median filtering with the kernel of 5. And (5) counting the average value and the variance of each dimension of the data, and performing data standardization by adopting a Z-score method.
The invention distributes the vibration sensor on the mechanical pump test bed, transmits the time sequence data to PC software through conversion, extracts partial data and verifies the algorithm. The data comprises 10 types of data, wherein 0 type is normal, and 1-9 types are faults. By processing, 150 data per class, 90 of which were used for model building and 60 were used for testing. The experimental computer is configured as an 8-core CPU (i7-6700), the RAM is 8GB, and the GTX 1080 video card, and it should be noted that the calculation of the model running time is performed on the CPU.
The parameters and experimental settings of this step are as follows: (1) and counting the data volume of all the category samples and unifying the format. (2) Setting the number of sampling points of NLMS to be 2015, the order of a filter to be 16 and a step factor
Figure BDA0003298271270000121
All data were processed with NLMS with a scaling factor α of 0.0001. (3) And setting the kernel of the median filtering to be 5, and processing the sample data. (4) Data were processed with Z-score normalization while data set means and standard deviations were recorded.
The complex signal dn is 0.6sin (5x) +0.3cos (10x) +0.1sin (20x), gaussian noise with the Mean value of 0 and the standard deviation of 0.3 is added to form a mixed signal, the mixed signal is processed by a filtering mode combining LMS, NLMS and median filtering respectively, the processing effect is evaluated by Root Mean Square Error (RMSE) and operation time, and the performances of different filtering modes are shown in the table 1.
TABLE 1
Figure BDA0003298271270000122
In order to show the influence of a filtering scheme and a data processing mode of data standardization on the model performance, four kinds of data which are not processed, only subjected to data standardization, only subjected to filtering processing, and simultaneously subjected to filtering and data standardization are used for training a BP neural Network (Back propagation neural Network) with 4 hidden layers and hidden neurons of 1000, 500, 100 and 50 to train 1500 epochs, and the accuracy of a test set is shown in Table 2.
TABLE 2
Figure BDA0003298271270000131
As can be seen from Table 2, in the data background of the mechanical pump set, the filtering scheme designed by the invention has an obvious effect of improving the data expression capacity by combining with a data preprocessing mode of data standardization, and is beneficial to model establishment.
S2, enhancing design based on WGAN-GP-C data;
designing based on the WGAN-GP and residual structure thought when building a WGAN-GP-C model, adding category guide information when a generator inputs random noise, and introducing a part for distinguishing the data category at the output end of a discriminator. In WGAN-GP-C training, the first 50000 epochs train data distribution only, and then train data distribution and data classification simultaneously to realize data generation according to classes. The data generation quality was evaluated using the Maximum Mean variance (MMD) and the network was adjusted accordingly. The data enhancement process follows a data screening strategy.
The experimental procedure was as follows: (1) and processing the sample to make the sample more suitable for network training. (2) Setting the dimensionality of random noise to be 128, learning by adopting an adam optimizer, and setting the initial learning rate to be lr equal to 1 × 10-4And the learning rate is reduced by 10 times at 10 ten thousand epochs and 15 ten thousand epochs, the generator is updated every 6 steps, and the batch size is set to 128. (3) Setting parameters for settings 6 and 7, setting λ at the first 5 ten thousand epochs2=10,λ1=λ3=λ4=λ5When the value is 0, data training is imported. (4) In training after 5 keep, λ is set1=1、λ2=10、λ3=0、λ4=10、λ5Training was continued at 0.004. (5) And selecting a well-behaved model according to the EM distance, performing data evaluation by using the MMD, properly adjusting parameters, and screening generated data to obtain an enhanced data set.
As shown in fig. 5, forλ of formula 73、λ4The invention carries out two experiments comparing different settings, and meanwhile, in order to prove the effect of WGAN-GP-C, an Auxiliary Classifier GAN (ACGAN) is used for carrying out a comparison experiment. And generating two groups of data by adopting two processing modes of not carrying out data screening (no filter) and carrying out data screening (filter) on the generated sample for displaying the effect of the data screening scheme, and evaluating the finally generated sample by using MMD. The data evaluation results under different models and different data processing modes are shown in Table 3, the quality of the generated data of the WGAN-GP-C is far higher than that of ACGAN, the model has better performance due to the parameter setting mode of the invention, and meanwhile, the data screening scheme can realize further data quality improvement.
TABLE 3
Figure BDA0003298271270000141
Experiments show that the classification accuracy of the discriminator in a test set is 83.33%, the model is based on the model to enhance data, for the effect of enhancing test data, a BP Neuron Network which comprises 4 hidden layers and hidden neurons of 1000, 500, 100 and 50 is trained by enhancing data sets with different multiples, the accuracy of the model on the test set is tested, when the data enhancement multiple is 1, the accuracy of the BP Neuron Network is improved fastest, so that under the condition that the data characteristics which do not belong to real data per se are not introduced as much as possible, the model selects the data enhancement multiple to be 1, and the enhanced data set is generated for subsequent algorithm design.
S3, designing a classification algorithm based on metric learning and KNN;
and building a measurement network model, based on a residual error thought, and providing a space self-adaptive structure, so that a more appropriate space position is searched for by the sample according to the property of the sample when space mapping is carried out. The data mapping output dimension is 32. A triplet dataset is constructed. Using learning rate lr being 5 × 10-5The Adam optimizer of (a) trains a network model. When a classification algorithm model is constructed, a KNN algorithm is used for setting the parameter k to be 1,100]Go through range and then testAnd (3) the performance of the KNN algorithm on the test set to search an optimal k value and corresponding accuracy.
The specific experimental steps are as follows: (1) the data set in the triplet format is constructed with the training set to facilitate metric-net training. (2) Learning by adopting an adma optimizer, wherein the learning rate is lr being 5 multiplied by 10-5The batch size is set to 512. (3) The parameters of formula 10 and formula 11 are set, where μ is 0.6 and λ is 5 e-3. (4) Converting the data set into a vector library by using a trained network, and setting the parameter k at [1,100] by using a KNN algorithm]And traversing within the range to find the optimal k value and the corresponding accuracy. (5) And (4) testing the plurality of trained models by adopting the mode of (4), so as to select a better measurement network model.
As shown in FIG. 6, the present invention performed comparative experiments on different parameter settings to achieve better model design. Where the settings of equation 10 are set for 0.2, 0.6, 1 comparisons while performing validation on the original dataset and the enhanced dataset. Setting data dimensions of Embedding output by the model as 16 and 32 respectively, and verifying on the original data set. The spatial adaptive structure introduces a structure with smaller calculation amount for the algorithm model, and in order to verify the function of the algorithm model, the experiment based on the metric learning is respectively verified on the metric-net and the Vector-CNN without the spatial adaptive structure, and the accuracy results of the experiments are shown in (1) to (14) of the table 4. In order to prove that metric learning is more suitable for a small sample background, Vector-CNN is changed into a classification network, multi-classification cross entropy is used for training on an original data set enhanced data set, and the results are shown in (15) and (16) of table 4.
TABLE 4
Figure BDA0003298271270000151
As can be seen from (1), (3), (8) and (10) of table 4, in the data set of the present invention, the data dimension of Embedding output by the model is set to 32, so that the model can achieve better performance. Theoretically, when the output dimension is 32, more data information can be reserved, the expressiveness of the data is stronger, and the classification task is more facilitated.
As can be seen from the accuracy of μ with different parameter settings, the effect of 0.6 μ is better under the same conditions. In this case, the degree of the data of different categories being pulled apart is greater than 0.2, so that the data boundary is more obvious, and the method is more suitable for the complicated task of diagnosing the fault of the mechanical equipment. Meanwhile, compared with the value of mu being 1, the network has the advantage that the degree of separating different types of data is smaller and the method is easier to achieve in training. Although the model accuracy was 99.33% in both cases (13) and (14), the model performed more consistently and superiorly in case (13) from the combined training and final model selection scenarios. Therefore, the invention finally selects mu as 0.6.
As can be seen from comparison of (1) - (7) and (8) - (14) in table 4, under the idea based on metric learning, in combination with the spatial adaptive structure, the data can find a more suitable spatial location according to its own performance, thereby improving the performance of the algorithm. Meanwhile, in order to eliminate the possibility that the spatial adaptation result is due to high performance of large calculation amount and large space occupation, Vector-CNN and the spatial adaptation structure are compared from three aspects of model size, calculation amount (FLOPs) and cpu time consumption, and the result is shown in table 5. As can be seen from the table, the size ratio of the Vector-CNN model to the spatial adaptive structure model is 75:1, the MFLOPs ratio is 6663:1, and the operation time ratio is 3:1, so that the spatial adaptive structure can obtain larger performance improvement at a smaller cost under the background of the invention, and the rationality of the design is proved.
As can be seen from comparison of (1) to (14) and (15) and (16) in table 4, the scheme design based on metric learning is more suitable for the fault diagnosis of the mechanical pump in a small sample background, thereby proving the reasonableness and effectiveness of the scheme design.
It can be known from the comparison of the model performances on the original data set and the enhanced data set that the data enhancement enables the model effect to be improved from 98.16% to 99.33% of (10) in table 4, and the data enhancement scheme has obvious performance improvement effect, and the two-step solution designed for the small sample problem, namely the data enhancement based on WGAN-GP-C and the classification algorithm design based on metric learning and KNN, of the invention is also proved to show better performance in the face of the fault diagnosis task of the small sample of the mechanical pump, and the Vector-CNN and the model pair of the space adaptive structure are shown in table 5.
TABLE 5
Figure BDA0003298271270000161
S4, optimizing the model;
quantization is performed for the metric network. Symmetric quantization is adopted for the weight of the convolution, bias is not quantized, and asymmetric quantization is adopted for the active layer. The operation of 32 bits to 8 bits is realized. And realizing KNN by adopting a tree structure. And comparing the search time of the linear scanning, the Kd-tree and the Ball-tree, and selecting the Ball-tree mode to realize the KNN algorithm. And (2) screening data of the training set, putting forward a concept of Important Factors (IF) of the training data, sequencing all samples from small to large according to the Important factors, and removing a part of samples with small IF on the premise of ensuring the accuracy of the algorithm, thereby realizing data screening, optimizing the speed of building a Ball-tree and improving the searching speed.
The model optimization part is divided into 3 steps, and the steps are as follows:
quantification of metric-net: (1) and analyzing the network characteristics. The cpu time consumption of Vector-CNN and spatial adaptive structure is about 3:1, the size of the model is about 75:1, and the calculated amount (FLOPs) is about 6663:1, so the quantization of the invention is carried out on the Vector-CNN part. (2) Some adjacent modules of the network are merged. (3) Symmetric quantization is adopted for the weight of the convolution, bias is not quantized, and asymmetric quantization is adopted for the active layer. (4) And inserting a model of the observation tensor into the network, and sending the training set into network operation to realize calibration. (5) And carrying out quantitative conversion on the network model, and testing the performance of the new model by combining a KNN algorithm. As shown in fig. 7.
Accelerating KNN operation by adopting a tree structure: (1) algorithm substitution for linear scanning was achieved using Kd-tree and Ball-tree. (2) Search time comparisons were made for linear scans, Kd-tree, Ball-tree. (3) Tree building time analysis was performed for Kd-tree, Ball-tree. As shown in fig. 8.
And (3) screening the data of the vector library according to important factors: (1) determining a set
Figure BDA0003298271270000171
And collections
Figure BDA0003298271270000172
Delete the larger value and the smaller value with a ratio of 0.15, resulting in a set
Figure BDA0003298271270000173
And
Figure BDA0003298271270000174
an Importance Factor (IF) calculation is performed for each sample in the vector library and sorted by category from small to large. (2) The ratio of the removed data is taken to be 0,0.99]With 0.01 as the interval between them. (3) And removing data from each type of data according to a proportion, testing the algorithm accuracy, the searching time and the tree building time, and selecting a larger proportion of removed data under the condition of ensuring the accuracy.
And (3) carrying out quantification processing on Vector-CNN of the metric-net according to the content, and measuring the optimization effect of the model by calculating the size of the model, the calculated quantities (MFLOPs), the operation time and the classification accuracy of the final model. For comparison, the present invention processes Vector-CNN using Group Convolution and depth Separable Convolution, and the results are shown in Table 6, wherein GC represents Group Convolution, DPC represents depth Separable Convolution, and the model size, MFLOPs and time in the table are for Vector-CNN.
TABLE 6
Figure BDA0003298271270000181
Quantization has the advantage of reducing the volume of the model over packet convolution and depth separable convolution with less impact on model accuracy. A lightweight network structure such as packet convolution and deep separable convolution is not well supported on a CPU, and therefore the operation time thereof is increased. The quantization process effectively reduces the size of the model, and the operation time is basically kept unchanged.
The invention establishes a classification model by using the steps, and compares the operation time and the accuracy with other common algorithms on the preprocessed data set. The algorithm participating in comparison comprises Naive Bayes classifiers (Naive Bayes classifiers), Decision trees (Decision trees), support Vector machines, Ball-trees, 3-layer BP neural networks (hidden neurons are respectively 1000, 500, 100 and 50), Vector-CNN-implemented classification and the like. The classifier performance comparison table is shown in table 7.
TABLE 7
Figure BDA0003298271270000182
The comparison results in table 7 show that the mechanical pump fault data used in the invention has a relatively obvious small sample characteristic, and although the scheme designed according to the small sample characteristic of the invention is relatively complex in training, the accuracy rate of the invention has an obvious advantage compared with that of a common classification model, and the operation speed after model optimization is relatively considerable, and the overall performance is relatively good.
In order to better verify the effect of the method of the invention under different training data volumes, the sample data volume of each type of the training set is respectively set as 10, 20, 30 and 60, the model performance is tested and compared with the classification realized by the SVM and Vector-CNN which have better performance in Table 7, and the accuracy result is shown in Table 8.
TABLE 8
Figure BDA0003298271270000191
It can be seen that the algorithm scheme proposed against the background of small samples of mechanical pumps has good performance on the data set of the invention, and has higher accuracy than the common method under different training data volumes. Thereby proving the validity of the scheme.
The present applicant has described and illustrated embodiments of the present invention in detail with reference to the accompanying drawings, but it should be understood by those skilled in the art that the above embodiments are merely preferred embodiments of the present invention, and the detailed description is only for the purpose of helping the reader to better understand the spirit of the present invention, and not for limiting the scope of the present invention, and on the contrary, any improvement or modification made based on the spirit of the present invention should fall within the scope of the present invention.

Claims (10)

1. A fault diagnosis method for small samples of a mechanical pump based on WGAN-GP-C and metric learning is characterized by comprising the following steps:
(1) reading time sequence data and carrying out data preprocessing;
(2) constructing a WGAN-GP-C model, and performing data enhancement based on the WGAN-GP-C model;
(3) constructing a fault diagnosis model based on metric learning and KNN classification algorithm;
(4) carrying out model optimization;
(5) and utilizing the optimized model to carry out fault diagnosis on the data which is preprocessed and subjected to data enhancement.
2. The WGAN-GP-C and metric learning based mechanical pump small sample fault diagnosis method according to claim 1, wherein the step (1) specifically comprises:
(1.1) reading time sequence data, intercepting according to a set length, and filtering by using a normalized least mean square adaptive filter (NLMS);
(1.2) removing an abnormal value by using median filtering;
(1.3) counting the mean and variance of each dimension of the data, and carrying out data standardization by adopting a Z-score method.
3. The WGAN-GP-C and metric learning based mechanical pump small sample fault diagnosis method of claim 2, wherein an NLMS filtering algorithm is as follows:
y(k)=wT(k)x(k)
e(k)=d(k)-y(k)
Figure FDA0003298271260000011
where x (k) is an input signal, y (k) is an output signal, d (k) is a reference signal, w (k) is a filter coefficient, α is an adjustment factor for preventing denominator from being zero, | x (k) is a filter coefficient2Is the square of the euclidean norm of x (k),
Figure FDA0003298271260000012
is the step size parameter.
4. The WGAN-GP-C and metric learning based mechanical pump small sample fault diagnosis method according to claim 1, wherein the step (2) specifically comprises:
(2.1) constructing a WGAN-GP-C model based on the WGAN-GP and a residual error structure, adding a label for class guidance when random noise is input into a generator, and judging the class of the data at the output end of a discriminator to generate the data according to the class;
(2.2) carrying out WGAN-GP-C model training, sending the generated sample and the real sample into a discriminator, firstly training data distribution, enabling the generated sample and the real sample to be drawn close, and then training and classifying while perfecting the distribution;
(2.3) when the WGAN-GP-C which is trained is used for generating a sample, screening the generated sample data;
(2.4) the quality of the generated sample data is evaluated by adopting the maximum mean difference MMD and the model is adjusted according to the maximum mean difference MMD.
5. The WGAN-GP-C and metric learning based mechanical pump small sample fault diagnosis method according to claim 4, wherein the loss function of the generator G, the loss function of the discriminator D and the loss function of the data category are as follows:
Figure FDA0003298271260000021
Figure FDA0003298271260000022
Figure FDA0003298271260000023
wherein the content of the first and second substances,
Figure FDA0003298271260000024
denotes f (x) the mathematical expectation for x under the distribution P, xrIs a true sample, xfIs to generate a sample, PrRepresenting the true data distribution, PfThe representation generates a distribution of the data,
Figure FDA0003298271260000025
and
Figure FDA0003298271260000026
respectively represent xrAnd xfIn the category of (a) to (b),
Figure FDA0003298271260000027
to represent
Figure FDA0003298271260000028
The distribution of the data of (a) is,
Figure FDA0003298271260000029
is shown in distribution PrAnd distribution PfThe data points on the connecting line of (a),
Figure FDA00032982712600000210
to represent
Figure FDA00032982712600000211
Data distribution of L2Denotes the L2 regularization penalty, λ1、λ2、λ3、λ4And λ5Is a hyperparameter controlling different parts of the loss function, n represents the number of samples, i.e. the dimension of y, yi、classiRepresenting the net output of the ith sample and the true category.
6. The WGAN-GP-C and metric learning based mechanical pump small sample fault diagnosis method according to claim 4, wherein the data screening step comprises: carrying out category judgment on the generated samples through a discriminator, and reserving the generated samples with the input labels being the same as the output categories of the discriminator; and selecting whether to retain the sample or not according to a certain probability a for each retained sample, wherein the probability a is the accuracy a of the discriminator on the real data test set.
7. The WGAN-GP-C and metric learning based mechanical pump small sample fault diagnosis method according to claim 1, wherein the step (3) specifically comprises:
(3.1) constructing a measurement network model, which comprises a convolutional neural network Vector-CNN and a space adaptive structure, wherein sample data obtains a Vector through the convolutional neural network, a space position matrix is constructed in the space adaptive structure, and then different weights are given to the space position according to Vector characteristics so as to realize space measurement mapping;
(3.2) constructing a triplet data set, and training a measurement network model by adopting an Adam optimizer;
and (3.3) constructing a classification algorithm model, searching an optimal k value and corresponding accuracy by using a KNN algorithm, and testing the metric network model obtained by training.
8. The WGAN-GP-C and metric learning based mechanical pump small sample fault diagnosis method of claim 8, wherein the spatially adaptive structure loss function is as follows:
ltriplet(xa,xp,xn)=max{0,d(Ea,Ep)-d(Ea,En)+μ}
loss=ltriplet(xa,xp,xn)+λlE
wherein d (E)a,Ep) Represents EaAnd Epμ is a hyper-parameter, λ is a hyper-parameter controlling the penalty degree; x is the number ofaDenotes anchor, xpAnd xnRespectively representing positive and negative examples, Ea、EpAnd EnRepresenting the measurement network mapping output of the three; lEIndicating an L2 regularization process.
9. The WGAN-GP-C and metric learning based mechanical pump small sample fault diagnosis method according to claim 1, wherein the step (4) specifically comprises:
(4.1) quantizing for a metric network; specifically, quantization is carried out on a Vector-CNN of a convolutional neural network, and adjacent network modules are fused; specifically, symmetric quantization is adopted for the weight of convolution, bias is not quantized, and asymmetric quantization is adopted for the active layer;
(4.2) accelerating the KNN algorithm by adopting a tree structure Ball-tree;
(4.3) screening the training set data, proposing important factors IF of the training set data, and sequencing all samples from small to large according to the important factors; and on the premise of ensuring the accuracy of the algorithm, a part of samples with smaller IF are removed.
10. The WGAN-GP-C and metric learning based mechanical pump small sample fault diagnosis method of claim 9, wherein the importance factor of a sample is defined as the reciprocal sum of the square of the Euclidean distance between the importance factor and the same type of sample, and the squared sum of the Euclidean distance between the importance factor and different types of samples after being adjusted in size is added, and the operation is respectively carried out according to the data category when the sorting and the data deletion are realized by considering the difference of the size distribution of the importance factors of different types of samples;
Figure FDA0003298271260000031
Figure FDA0003298271260000032
Figure FDA0003298271260000033
wherein x isinN sample representing class i of training samples, NiDenotes the number of class i samples, C denotes the number of sample classes, d (x)in,xim) Denotes xinAnd ximThe Euclidean distance of (a) is,
Figure FDA0003298271260000034
representation collection
Figure FDA0003298271260000035
The maximum value of (a) is,
Figure FDA0003298271260000036
representation collection
Figure FDA0003298271260000037
The minimum value of (a) is determined,
Figure FDA0003298271260000038
and
Figure FDA0003298271260000039
are respectively a set
Figure FDA00032982712600000310
And collections
Figure FDA00032982712600000311
Deleting the set of large values and small values according to a certain proportion, mean () representing the average value of all the values in the set, inf representing the minimum value preventing the denominator from being zero.
CN202111183493.3A 2021-10-11 2021-10-11 Mechanical pump small sample fault diagnosis method based on WGAN-GP-C and metric learning Pending CN114037001A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111183493.3A CN114037001A (en) 2021-10-11 2021-10-11 Mechanical pump small sample fault diagnosis method based on WGAN-GP-C and metric learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111183493.3A CN114037001A (en) 2021-10-11 2021-10-11 Mechanical pump small sample fault diagnosis method based on WGAN-GP-C and metric learning

Publications (1)

Publication Number Publication Date
CN114037001A true CN114037001A (en) 2022-02-11

Family

ID=80134816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111183493.3A Pending CN114037001A (en) 2021-10-11 2021-10-11 Mechanical pump small sample fault diagnosis method based on WGAN-GP-C and metric learning

Country Status (1)

Country Link
CN (1) CN114037001A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115204031A (en) * 2022-05-13 2022-10-18 哈尔滨工业大学 Vibration value prediction method for aircraft engine assembly process
CN116047427A (en) * 2023-03-29 2023-05-02 西安电子科技大学 Small sample radar active interference identification method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115204031A (en) * 2022-05-13 2022-10-18 哈尔滨工业大学 Vibration value prediction method for aircraft engine assembly process
CN116047427A (en) * 2023-03-29 2023-05-02 西安电子科技大学 Small sample radar active interference identification method

Similar Documents

Publication Publication Date Title
CN112784881B (en) Network abnormal flow detection method, model and system
CN111181939B (en) Network intrusion detection method and device based on ensemble learning
CN111832608B (en) Iron spectrum image multi-abrasive particle identification method based on single-stage detection model yolov3
CN112039903B (en) Network security situation assessment method based on deep self-coding neural network model
CN109581339B (en) Sonar identification method based on automatic adjustment self-coding network of brainstorming storm
CN114037001A (en) Mechanical pump small sample fault diagnosis method based on WGAN-GP-C and metric learning
CN113240201B (en) Method for predicting ship host power based on GMM-DNN hybrid model
CN111353373A (en) Correlation alignment domain adaptive fault diagnosis method
CN112560596B (en) Radar interference category identification method and system
CN109949200B (en) Filter subset selection and CNN-based steganalysis framework construction method
CN115051864B (en) PCA-MF-WNN-based network security situation element extraction method and system
CN115147341A (en) Fabric surface defect classification depth network method based on biological vision inspiration
CN112528554A (en) Data fusion method and system suitable for multi-launch multi-source rocket test data
Lassouaoui et al. Genetic algorithms and multifractal segmentation of cervical cell images
CN114782761B (en) Intelligent storage material identification method and system based on deep learning
CN111275109A (en) Power equipment state data characteristic optimization method and system based on self-encoder
CN114882007A (en) Image anomaly detection method based on memory network
CN115643153A (en) Alarm correlation analysis method based on graph neural network
CN114330650A (en) Small sample characteristic analysis method and device based on evolutionary element learning model training
CN111340111B (en) Method for recognizing face image set based on wavelet kernel extreme learning machine
CN112364892B (en) Image identification method and device based on dynamic model
CN114510715B (en) Method and device for testing functional safety of model, storage medium and equipment
CN117197591B (en) Data classification method based on machine learning
CN112633399B (en) Sparse collaborative joint representation pattern recognition method
CN116405368B (en) Network fault diagnosis method and system under high-dimensional unbalanced data condition

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination