A simulation circuit fault diagnosis method and system based on CPVAE-SE-LSTM
Patent Information
- Application Number
- CN202611092494.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-10-30
AI Technical Summary
在复杂模拟电路场景下,由于故障样本分布不均衡、弱故障特征不明显、时序波形变化规律复杂,诊断过程容易出现特征提取不充分、不同故障状态区分度不足以及诊断结果稳定性不高等问题
本发明通过构建包含正常状态、软故障状态和硬故障状态的原始故障样本集,并利用类别先验变分自编码器对时序波形数据进行低维表征,使不同故障类别的样本在隐空间中形成更清晰的分布边界,降低容差、噪声和弱故障特征对诊断结果的影响。
Smart Images

Figure CN123012696A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of analog circuit fault diagnosis and deep learning signal processing technology, and in particular to an analog circuit fault diagnosis method and system based on CPVAE-SE-LSTM. Background Technology
[0002] Analog circuits are a crucial component of electronic systems, typically performing functions such as signal acquisition, amplification, filtering, modulation, and interface conversion. They are widely used in aerospace, communication equipment, industrial control, and instrumentation. Because the output characteristics of analog circuits are easily affected by component parameters, operating environment, manufacturing tolerances, and aging factors, their operating status directly impacts the stability and reliability of electronic systems. Therefore, timely and accurate fault diagnosis of analog circuits is of paramount importance.
[0003] As the integration and complexity of electronic systems continue to increase, the number of components in analog circuits is growing, and the coupling relationships between circuit nodes are becoming more complex. When components experience anomalies such as parameter drift, performance degradation, open circuits, or short circuits, the timing waveforms exhibited at the observation nodes for different fault states may show small differences and are easily affected by noise, tolerance, and nonlinear responses, leading to overlapping or confusion between fault characteristics. Especially when soft and hard faults coexist, the boundaries between different fault types are not clear enough, posing significant challenges to fault state identification.
[0004] Current analog circuit fault diagnosis typically requires combining circuit models, test data, and manual analysis experience for judgment. In complex analog circuit scenarios, due to uneven distribution of fault samples, indistinct weak fault characteristics, and complex timing waveform variations, the diagnostic process is prone to problems such as insufficient feature extraction, inadequate differentiation between different fault states, and low stability of diagnostic results. Furthermore, as application scenarios demand higher diagnostic efficiency and automation, traditional methods relying on manual analysis or single-feature discrimination are insufficient to meet the needs of complex analog circuit fault diagnosis.
[0005] Therefore, how to obtain well-distinguishing fault characterizations from timing waveform data of analog circuits under the presence of tolerance, noise, and multiple fault states, and how to improve the accuracy and automation of analog circuit fault diagnosis, has become a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0006] To address the shortcomings of existing technologies, the present invention aims to provide a method and system for diagnosing analog circuit faults based on CPVAE-SE-LSTM, which improves the separability, diagnostic accuracy, and automation of timing waveform fault characteristics in analog circuits under conditions where tolerance, noise, and both soft and hard faults coexist.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a fault diagnosis method for analog circuits based on CPVAE-SE-LSTM, comprising: Step S1: Construct a simulation model of the target analog circuit, set the normal state, soft fault state and hard fault state; configure the circuit parameters according to each state and perform transient simulation, collect the time-series waveform data of the target observation node, associate it with the corresponding state, and obtain the original fault sample set; Step S2: Preprocess the original fault sample set to obtain training time-series waveform data and corresponding training category labels; Step S3: Construct a category prior variational autoencoder, which generates encoded posterior distribution parameters based on the training time-series waveform data, generates category prior distribution parameters based on the training category labels, and generates reconstructed time-series waveform data based on the latent vectors sampled from the latent space. Step S4: Based on the encoded posterior distribution parameters and the class prior distribution parameters, calculate the class prior constraint term used to constrain the encoded posterior distribution to converge to the corresponding class prior distribution; calculate the reconstruction error term based on the reconstructed time-series waveform data and the training time-series waveform data; and dynamically adjust the weight of the class prior constraint term according to the comparison result between the reconstruction error term and the preset reconstruction conditions to train the class prior variational autoencoder. Step S5: Input the training time-series waveform data into the trained category prior variational autoencoder to obtain the training low-dimensional latent feature vector, and use the training low-dimensional latent feature vector and training category labels to train an SE-LSTM classification model including an SE module, an LSTM network and a classifier. Step S6: Collect the timing waveform data of the analog circuit to be diagnosed, which is of the same type as the target analog circuit, at the target observation node. Input the data into the trained class prior variational autoencoder to obtain the low-dimensional latent feature vector to be diagnosed. Then input the data into the trained SE-LSTM classification model. After channel recalibration, timing dependency extraction and classification, output the fault diagnosis result.
[0008] Further, in step S1, the target simulation circuit simulation model includes several components. The parameters of each component are changed and the time-series waveform change of the target observation node relative to the normal state is obtained. The components whose time-series waveform change satisfies the preset sensitivity condition are identified as key components, and the soft fault state and hard fault state are set based on the key components.
[0009] Further, in step S1, the soft fault state is obtained by setting the parameters of the key component to parameter values that deviate from the nominal value and meet the preset offset conditions, and the hard fault state is obtained by setting the key component to an open circuit state or a short circuit state. The normal state, as well as each soft fault state and each hard fault state formed based on the key components, are respectively determined as the categories represented by the training category labels. Monte Carlo transient simulation is performed on the circuit parameter configuration corresponding to each category to obtain the time-series waveform data of the target observation node.
[0010] Further, in step S2, the preprocessing includes aligning sampling points and normalizing amplitudes of the time-series waveform data in the original fault sample set, determining training samples from the processed time-series waveform data, using the time-series waveform data in the training samples as the training time-series waveform data, and generating training category labels corresponding to the training samples according to the category to which the training samples belong.
[0011] Furthermore, in step S3, the category prior variational autoencoder includes an encoder, a category embedding layer, a latent space, and a decoder; The encoder outputs the mean and variance of the encoded posterior distribution based on the training time-series waveform data, the category embedding layer outputs the mean and variance of the category prior distribution based on the training category labels, and the decoder outputs the reconstructed time-series waveform data based on the latent vectors obtained by sampling from the latent space.
[0012] Furthermore, the category embedding layer generates corresponding category prior distribution parameters for different training category labels, so that the category represented by each training category label corresponds to a category prior Gaussian distribution in the latent space; The category prior constraint term is the KL divergence term between the encoded posterior distribution and the corresponding category prior Gaussian distribution.
[0013] Further, in step S4, the dynamic adjustment includes: The reconstruction error term is compared with a preset reconstruction error threshold. When the reconstruction error term is greater than the preset reconstruction error threshold, the weight of the category prior constraint term is reduced or maintained. When the reconstruction error term is not greater than the preset reconstruction error threshold, the weight of the category prior constraint term is increased so that the category prior variational autoencoder first maintains the temporal waveform reconstruction capability and then enhances the separability of samples representing different training category labels in the latent space.
[0014] Furthermore, during the training of the SE-LSTM classification model, the training low-dimensional latent feature vector is input into the convolutional layer for feature mapping to obtain the training multi-channel temporal features. During the diagnosis process using the SE-LSTM classification model, the low-dimensional latent feature vector to be diagnosed is input into the convolutional layer for feature mapping to obtain the multi-channel temporal features to be diagnosed. The SE module performs global average pooling on the training multi-channel temporal features and the multi-channel temporal features to be diagnosed, respectively, to obtain channel-level global features, and generates corresponding channel attention weights based on the channel-level global features.
[0015] Further, in step S6, the SE module recalibrates the multi-channel temporal features to be diagnosed according to the channel attention weights corresponding to the multi-channel temporal features to be diagnosed, to obtain recalibrated temporal features; The LSTM network generates temporal dependency features based on the recalibrated timing features; the classifier includes a fully connected layer and a softmax classifier, which output the classification probability of the analog circuit to be diagnosed belonging to the category represented by each of the training category labels based on the temporal dependency features, and takes the category corresponding to the maximum classification probability as the fault diagnosis result.
[0016] A fault diagnosis system for analog circuits based on CPVAE-SE-LSTM, used to implement the aforementioned fault diagnosis method for analog circuits based on CPVAE-SE-LSTM, includes: The sample module is used to construct a simulation model of the target analog circuit, set the normal state, soft fault state and hard fault state; configure the circuit parameters according to each state and perform transient simulation; collect the time-series waveform data of the target observation node, associate it with the corresponding state, and obtain the original fault sample set. The preprocessing module, connected to the sample module, is used to preprocess the original fault sample set to obtain training time-series waveform data and corresponding training category labels. The CPVAE module, connected to the preprocessing module, is used to construct a category prior variational autoencoder, generate encoded posterior distribution parameters based on the training time-series waveform data, generate category prior distribution parameters based on the training category labels, and generate reconstructed time-series waveform data based on the latent vectors obtained from latent space sampling. The optimization module, connected to the CPVAE module, is used to calculate a class prior constraint term to constrain the posterior distribution of the encoding to converge to the corresponding class prior distribution based on the encoding posterior distribution parameters and the class prior distribution parameters. It also calculates a reconstruction error term based on the reconstructed temporal waveform data and the training temporal waveform data, and dynamically adjusts the weight of the class prior constraint term according to the comparison result between the reconstruction error term and the preset reconstruction conditions, thereby training a class prior variational autoencoder. The classification training module, which connects the optimization module and the preprocessing module, is used to input the training time-series waveform data into the trained category prior variational autoencoder to obtain the training low-dimensional latent feature vector, and use the training low-dimensional latent feature vector and the training category label to train an SE-LSTM classification model including an SE module, an LSTM network and a classifier. The diagnostic module, connected to the optimization module and the classification training module, is used to collect the timing waveform data of the analog circuit to be diagnosed, which is of the same type as the target analog circuit, at the target observation node. The data is then input into the trained class prior variational autoencoder to obtain the low-dimensional latent feature vector to be diagnosed, and then input into the trained SE-LSTM classification model. After channel recalibration, timing dependency extraction and classification, the fault diagnosis result is output.
[0017] The beneficial effects of this invention are: This invention constructs an original fault sample set containing normal state, soft fault state, and hard fault state, and uses a category prior variational autoencoder to perform low-dimensional representation of time-series waveform data, so that samples of different fault categories form clearer distribution boundaries in the latent space, reducing the impact of tolerance, noise, and weak fault features on the diagnostic results.
[0018] This invention dynamically adjusts the weight of the category prior constraint term based on the comparison result between the reconstruction error term and the preset reconstruction conditions, so that the model can take into account both the temporal waveform reconstruction capability and category separability during the training process. This helps to avoid the aliasing of latent space features and improve the recognition stability of soft fault states and hard fault states.
[0019] This invention inputs the low-dimensional latent feature vector output by the category prior variational autoencoder into the SE-LSTM classification model, enhances key fault features through channel recalibration, and obtains waveform change patterns through time-series dependency extraction, thereby improving the accuracy and automation of analog circuit fault diagnosis. Attached Figure Description
[0020] Figure 1 This is a flowchart of the steps of the analog circuit fault diagnosis method based on CPVAE-SE-LSTM in this invention; Figure 2 This is the schematic diagram of the simulation circuit in this invention; Figure 3 This is a graph showing the results of PSpice sensitivity analysis in this invention; Figure 4 This is a framework diagram of the overall diagnostic model in this invention; Figure 5 This is a comparison diagram of the amplitudes of the reconstructed signal generated by the CPVAE decoder and the original signal in this invention; Figure 6This is an iterative curve diagram of the SE-LSTM model in this invention; Figure 7 This is a classification result diagram of the test set in this invention; Figure 8 This is a schematic diagram of the structure of the analog circuit fault diagnosis system based on CPVAE-SE-LSTM in this invention.
[0021] Figure labels: 1. Sample module; 2. Preprocessing module; 3. CPVAE module; 4. Optimization module; 5. Classification training module; 6. Diagnosis module. Detailed Implementation
[0022] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0023] Example 1, in conjunction with the following Figure 1 The flowchart shown below provides a detailed explanation of the analog circuit fault diagnosis method based on CPVAE-SE-LSTM of the present invention.
[0024] This embodiment uses a video amplifier circuit as the target analog circuit, and the circuit schematic is shown below. Figure 2 As shown in the diagram, in the video amplifier circuit, Q1 is the preamplifier transistor, and the amplification characteristics of Q1 determine the input of Q2; R4 provides DC negative feedback to stabilize the quiescent operating point of Q1; fluctuations in the base current of Q1 can be fed back to Q1 through the emitter of Q2 to increase loop stability. In this embodiment, the collector current Iout of Q2 is determined as the observation signal of the target observation node, and the timing waveform data formed by the change of Iout over time is collected.
[0025] To facilitate understanding of the characters, symbols, and parameters in this embodiment, the following explanation is provided: CPVAE stands for Category Prior Variational Autoencoder, VAE for Variational Autoencoder, SE for Squeeze-and-Excitation Channel Attention Module, LSTM for Long Short-Term Memory Network, ReLU for Rectified Linear Activation Function, softmax for Normalized Exponential Classification Function, Adam for Adaptive Moment Estimation, t-SNE for Dimensionality Reduction Method for Feature Visualization, Min-Max Scaler for Min-Max Normalization, and DEV for Independent Sampling, indicating that the tolerances of each component are sampled independently during the simulation. ms represents milliseconds, us represents microseconds, Ω represents ohms, kΩ represents kiloohms, and nF represents nanofarads.
[0026] Q1 and Q2 both represent transistors in the target analog circuit; Q1 is the pre-amplifier transistor, and Q2 is the post-amplifier transistor. b represents the base of the transistor, c represents the collector, and e represents the emitter. Q1b open indicates that the base of Q1 is open; Q2ce short indicates that the collector and emitter of Q2 are short-circuited; Q2be short indicates that the base and emitter of Q2 are short-circuited. R2, R3, R4, and R6 all represent resistors, and C1, C4, and C5 all represent capacitors. Iout represents the collector current of Q2 and serves as the observation signal for the target observation node. The symbol "↑" indicates that the component parameter increases relative to its nominal value. "" indicates that the component parameter is reduced relative to the nominal value, "open" indicates an open circuit, and "short" indicates a short circuit.
[0027] In a category-prior variational autoencoder, x represents the input training time-series waveform data, y represents the training category label, z represents the latent vector in the latent space; P(z) represents the global prior distribution in a normal variational autoencoder, P(z|y) represents the category prior distribution determined by the training category label, and Q(z|x) represents the encoded posterior distribution obtained by the encoder based on the input data. σ represents the mean of the encoded posterior distribution. 2 This represents the variance of the encoded posterior distribution. This represents the standard deviation of the encoded posterior distribution; The class mean represents the prior distribution of the categories. The class variance parameter represents the prior distribution of the class. This represents standard Gaussian noise with the same dimension as the latent vector. The distribution follows N(0,I), where N(0,I) represents a standard normal distribution with a mean of 0 and a covariance matrix of identity matrix I, where I represents the identity matrix. X* represents the reconstructed sample output by the decoder.
[0028] D KL Let represent the KL divergence term, which serves as the category prior constraint term; RE represents the reconstruction error term. REpre represents the current reconstruction error term corresponding to the t-th iteration, REpre represents the reconstruction error term corresponding to the previous monitoring period, and τ represents the preset reconstruction error threshold. In this embodiment, every 200 iterations constitute a monitoring period, and τ is updated based on the reconstruction error term REpre of the previous monitoring period. The weights of the category prior constraints are indicated. This represents the minimum value of β. express The maximum value, express The adjustment step size; t represents the current iteration round, and t+1 represents the next iteration round.
[0029] Step S1: Construct a simulation model of the target analog circuit, set the normal state, soft fault state and hard fault state; configure the circuit parameters according to each state and perform transient simulation, collect the time-series waveform data of the target observation node, associate it with the corresponding state, and obtain the original fault sample set.
[0030] Specifically, a video amplification circuit simulation model is constructed in PSpice software. The target simulation circuit model includes several components. The parameters of each component are changed, and the time-series waveform changes of the target observation node relative to the normal state are obtained. The time-series waveform changes are represented by the root mean square relative rate of change, that is, with the same number of sampling points, the root mean square difference between the Iout waveform after parameter perturbation and the normal state Iout waveform is calculated and divided by the root mean square value of the normal state Iout waveform.
[0031] In this embodiment, the preset sensitivity condition is: after the component parameters are perturbed positively or negatively according to their nominal values, the root mean square relative change rate of the Iout waveform is not less than 10%, or it ranks in the top 30% among all components involved in the analysis according to the root mean square relative change rate. Components that meet the preset sensitivity condition are identified as key components, and soft fault states and hard fault states are set based on the key components. The sensitivity analysis results are as follows: Figure 3 As shown.
[0032] Based on the sensitivity analysis results of circuit components, this embodiment sets 13 training category labels to represent 1 normal state, 4 soft fault states, and 8 hard fault states. Soft fault states are obtained by setting the parameters of key components to parameter values that deviate from their nominal values and meet preset offset conditions. The preset offset conditions are: The resistance value of R4 deviates from its nominal value by ±50%, the resistance value of R2 deviates from its nominal value by +50%, and the capacitance value of C1 deviates from its nominal value by +50%. In analog circuit fault diagnosis, sensitive components and their parameter deviations that significantly affect circuit transmission characteristics are typically prioritized as fault modes. Based on circuit sensitivity analysis, a 50% reduction in the capacitance value of C1 relative to its nominal value has a relatively limited impact on the response at the test node (or highly overlaps with other fault responses), therefore it was not set as an independent fault mode. Component tolerances were set to 5% for resistance and 10% for capacitance. In PSpice software, a uniform tolerance distribution was used, all components were sampled independently using DEV, and component parameters were added to their nominal values along with manufacturing tolerances, without adding other non-target fault parameters.
[0033] Hard fault conditions are obtained by setting critical components or critical connection locations to open circuit or short circuit states. The open circuit of R3, Q1 base, R2, C4, C5, and R6 is simulated by a 1MΩ series resistor; the collector-emitter short circuit of Q2 and the base-emitter short circuit of Q2 are simulated by a 0.001Ω parallel resistor.
[0034] The specific fault codes, fault types, nominal values, and fault values are shown in Table 1.
[0035] Table 1: Fault Labels and Fault Modes Display Table Table 1 shows that the fault categories in this embodiment cover normal states, parameter offset soft fault states, and open-circuit and short-circuit hard fault states. Specifically, F1 to F4 correspond to parameter offset soft fault states, where the fault value deviates from the nominal value by a certain margin, used to simulate performance degradation caused by component aging, manufacturing deviations, or changes in the working environment. F5 to F12 correspond to hard fault states, where open-circuit faults are simulated using a large resistance equivalent, and short-circuit faults are simulated using a small resistance equivalent, used to characterize common connection breaks or node short-circuit anomalies in simulated circuits. As shown in Table 1, the categories represented by each training category label include both hard fault states with significant waveform differences and soft fault states with relatively weak waveform differences, thus enabling the model to verify its ability to identify multiple fault categories in scenarios where soft and hard faults coexist. In particular, the parameter offsets of components such as R4, R2, and C1 can cause subtle changes in the Iout waveform of the target observation node, which is easily affected by component tolerance and noise. By incorporating this type of soft fault state into the category represented by the training category label, the category prior variational autoencoder can learn the weak fault features during training and provide a more discriminative low-dimensional latent feature vector for the subsequent SE-LSTM classification model.
[0036] The normal state, as well as the soft and hard fault states based on key components, were defined as categories represented by training category labels. Monte Carlo transient simulations were performed on the circuit parameter configurations corresponding to each category. The simulation duration was 1 ms, the sampling interval was 1 μs, and each set of timing current waveforms included 1000 sampling points. 300 sets of timing current waveforms were generated for each category, resulting in a total of 3900 sets of original fault samples. The collected timing waveform data were associated with the corresponding categories to obtain the original fault sample set.
[0037] Step S2: Preprocess the original fault sample set to obtain training time-series waveform data and corresponding training category labels.
[0038] Specifically, sampling point alignment and amplitude normalization are performed on the time-series waveform data in the original fault sample set. Sampling point alignment is used to ensure that each group of time-series waveform data has the same time length and the same sampling position; amplitude normalization adopts the Min-Max Scaler normalization method to scale the amplitude of each group of time-series waveform data to a uniform numerical range, so as to reduce the impact of the difference in amplitude scale between different samples on model training.
[0039] During sample set partitioning, 100 samples were randomly selected from each category as the test set, resulting in 1300 test samples. The remaining 200 samples from each category were used for training and validation, resulting in 2600 training and validation samples. The training and validation samples were divided into training and validation sets in a 7:3 ratio, with the training set containing 1820 samples and the validation set containing 780 samples. After preprocessing, training samples were determined from the processed time-series waveform data. The time-series waveform data from these training samples was used as the training time-series waveform data, and corresponding training category labels were generated based on the category to which the training samples belonged. This step ensures that the subsequent category prior variational autoencoder simultaneously obtains both training time-series waveform data and training category labels, guaranteeing that the category prior distribution parameters have a clear data source.
[0040] Step S3: Construct a category prior variational autoencoder, which generates encoded posterior distribution parameters based on the training time-series waveform data, generates category prior distribution parameters based on the training category labels, and generates reconstructed time-series waveform data based on the latent vectors sampled from the latent space.
[0041] Specifically, the category prior variational autoencoder includes an encoder, a category embedding layer, a latent space, and a decoder. The encoder outputs the mean and variance of the encoded posterior distribution based on the training time-series waveform data; the category embedding layer outputs the mean and variance parameters of the category prior distribution based on the training category labels; and the decoder outputs the reconstructed time-series waveform data based on the latent vectors sampled from the latent space.
[0042] The encoder progressively reduces the dimensionality of a 1000-dimensional time-series waveform to a 50-dimensional latent vector through three linear layers. Specifically, the encoding process is as follows: the 1000-dimensional input is reduced to 350 dimensions by the first linear layer and then activated by ReLU; the 350-dimensional features are reduced to 120 dimensions by the second linear layer and then activated by ReLU; the 120-dimensional features are reduced to 50 dimensions by the third linear layer and then activated by ReLU; finally, the mean of the encoded posterior distribution is mapped based on the 50-dimensional features. and variance The decoder adopts an up-dimensional structure opposite to that of the encoder, namely 50-dimensional, 120-dimensional, 350-dimensional, and 1000-dimensional, and finally generates a reconstructed sample X*, which is the reconstructed time-series waveform data.
[0043] The difference between a category-prior variational autoencoder and a regular variational autoencoder is: Ordinary variational autoencoders use a global prior P(z) in the latent space, while category-prior variational autoencoders use a category prior P(z|y) in the latent space. The category embedding layer generates corresponding category prior distribution parameters for different training category labels, ensuring that the category represented by each training category label corresponds to a category prior Gaussian distribution in the latent space. The category prior distribution parameters include the category mean. and categorical variance parameter By using the prior distribution parameters of the categories, the training samples form structured clusters in the latent space. Samples of the same category converge to the prior Gaussian distribution of the corresponding category, while samples of different categories are distributed in the prior Gaussian distribution regions of different categories.
[0044] During the latent vector sampling process, a reparameterization technique is used to generate standard Gaussian noise with the same dimension as the latent vector. , It follows a standard normal distribution N(0,I) and passes through... Generate a latent vector z obtained by sampling from the encoded posterior distribution, where, The variance of the encoded posterior distribution The square root is used to obtain the result. This method keeps the random sampling process differentiable, facilitating the updating of encoder parameters, class embedding layer parameters, and decoder parameters via backpropagation.
[0045] Furthermore, to illustrate the improvement mechanism of category-prior variational autoencoders compared to ordinary variational autoencoders, this embodiment describes the latent space construction process of VAEs and CPVAEs as follows. The improvement measure of this embodiment for VAEs lies in using category priors during latent space construction. replace This allows the categories represented by different training category labels to correspond to different category prior distributions in the latent space.
[0046] For dataset ,in N The total number of samples, i Indicates the sample number. VAE assumes the observation data x i Latent vectors in the latent space The generation process consists of two steps: The first step is to start from the prior distribution. Sample latent vectors The second step is to determine the likelihood distribution. Generate observation data .in, The prior probability of z follows a standard Gaussian distribution. ; These are the parameters of the generated model; It is a probabilistic decoder, representing the generation of a function given a latent vector. The mechanism. X The marginal likelihood can be written as: ; Due to generative models P(x|z) The parameters are initially random; only prior information can be used. Mapped to meaningless noise, in order to... P(x|z) Can learn from effective Generate real The mapping, according to Bayes' theorem, introduces the posterior distribution: ; In the above formula, These are the parameters of the recognition model. Because It is a high-dimensional integral and cannot be calculated directly. Numerical solutions are not available, therefore VAE uses variational inference to obtain the posterior. Approximate probability distribution . Also known as a recognition model, if a meaningful one exists. This makes it possible to obtain data x i The mapped latent vector distribution contains If the potential features are identified, then the identification model is considered effective.
[0047] In VAEs, for continuous raw data, the generative and recognition models can generally be described as following a multivariate normal distribution: ; ; In the above formula, I It is a unit covariance matrix, indicating that each dimension is independent; and These are the mean function and variance function of the generative model, respectively; and These are the mean function and variance function of the identification model, respectively. For ease of calculation, and Generally, the same type of Gaussian distribution is chosen.
[0048] right Take the logarithm, introduce an approximate posterior, and then... To find the expected value, we can know that: ; ; ELBO is called the variational lower bound, denoted as . KL divergence is used to measure and The differences between them; E It is the expectation operator. According to Bayes' theorem and the definition of KL divergence, it can be... Break it down into regular expression terms and refactoring terms: ; ; ; The reconstruction term measures the accuracy of reconstructing the original data from the latent vectors. A higher reconstruction term value indicates a more accurate reconstruction. generated The more similar it is to the original input, the better; the regularization term approximates the posterior through KL divergence constraints. Approximate prior distribution Combining the two formulas above, we can conclude that: ; Since KL divergences are all non-negative, that is At this point, maximizing ELBO is equivalent to maximizing .
[0049] The core of regularization is minimizing the approximate posterior. with prior The KL divergence for two multivariate Gaussian distributions , The analytical solution for the regularization term can be written as: ; in, It is the dimension of the latent vector. and They are the first Mean and variance in each dimension.
[0050] The core of the reconstruction term is to maximize the log-likelihood of reconstructing the original data from the latent vectors. If directly from... Medium sampling ,but and Tiny changes cannot be propagated through random sampling. In the gradient, leading to Unable to update. Therefore, VAE employs a reparameterization technique for approximate posterior. Introduce a differentiable function and a with An irrelevant standard normal distribution such that: ; in, Is with Irrelevant noise. For the same , The randomness makes each time from Mid-sampling These are distinct points within the distribution, allowing the decoder to learn a robust mapping across the entire distribution region; when multiple x When the distribution areas overlap, the samples within the overlapping area will contain multiple x The mixed features, the samples generated by the decoder based on the mixed features correspond to x Meaningful changes.
[0051] Reparameterization z Substituting the refactoring item, the original dependency The expectation can be transformed into the noise variable Expectation of a fixed prior distribution : ; At this point, the Montto Carlo approximation of the reconstructed term becomes: ; In the formula, L yes The number of sampling times required With latent vectors The dimensions are consistent; It is the first Standard Gaussian noise samples obtained from multiple independent samplings. Due to and Irrelevant, refactoring item and The gradient can be directly obtained through The derivative is obtained. At this point, the variational lower bound ELBO can finally be written as: ; ELBO as marginal likelihood Maximizing the lower bound of ELBO can drive the generative model to fit the true data distribution. In VAE, the encoder uses parameters... The neural network will observe the data. Mapped to latent feature space, output Mean in the latent space and variance Then through reparameterization The decoder is forced to learn a robust mapping across the entire distribution region, shaping a continuous and smooth latent space. The VAE encoder's fitting process is constrained by the KL divergence term of ELBO, while the decoder's optimization is constrained by the reconstruction term.
[0052] In each module of a VAE, the latent space is constructed according to a priori distribution. , representing the assumptions about the latent space before any samples are observed; the encoder is the posterior distribution. , representing the correction to the latent space after observing samples; the decoder is the likelihood distribution. This represents the mechanism for generating reconstructed signals from latent space sampling.
[0053] For analog circuit fault signals with only minor differences in fault characteristics, the encoder of VAE maps all categories of high-dimensional input data to a latent space that follows a global prior Gaussian distribution. The features of samples from different categories in the latent space exhibit an indiscriminate fusion, so VAE is not directly applicable to multi-category analog circuit fault classification tasks.
[0054] The improvement of CPVAE over VAE lies in the fact that CPVAE maps high-dimensional raw time series data to the mean of the latent space through an embedding layer. With variance Construct an approximate posterior distribution, denoted as . ,in This represents the sample category. CPVAE constructs a unique prior Gaussian distribution for each fault type through an embedding layer and incorporates it into the calculation of the KL divergence, driving similar samples to cluster in the latent space. The KL term is calculated as follows: ; in, As the cluster center anchor point for each category in the latent space, each category uniquely corresponds to one. vector; Define the degree of dispersion of this category cluster.
[0055] The improvement of CPVAE over VAE also lies in the introduction of a dynamic temperature coefficient. By adjusting the weights of the reconstruction loss and KL divergence, both structured clustering and reconstruction accuracy in the latent space are optimized. In this embodiment, the dynamic temperature coefficient satisfies: ; in, Let be the reconstruction error in round t. To reconstruct the error threshold, , Let be the minimum and maximum values of β, respectively. The step size is dynamically updated during the iteration process.
[0056] Through the aforementioned formulas and training mechanisms, CPVAE, while retaining its reconstruction capabilities, introduces training class labels into the latent space prior construction process. This allows samples representing the same class with the same training class label to converge to the corresponding class's prior Gaussian distribution, resulting in a distinguishable structured distribution of samples representing different classes with different training class labels in the latent space. This process alleviates the problems of small differences in soft fault features, significant tolerance disturbances, and aliasing of fault features in analog circuits, providing lower-dimensional latent feature vectors with higher class separability for subsequent SE-LSTM classification models.
[0057] Step S4: Based on the encoding posterior distribution parameters and the category prior distribution parameters, calculate the category prior constraint term used to constrain the encoding posterior distribution to converge to the corresponding category prior distribution. Calculate the reconstruction error term based on the reconstructed time-series waveform data and the training time-series waveform data. Dynamically adjust the weight of the category prior constraint term according to the comparison result between the reconstruction error term and the preset reconstruction conditions to train the category prior variational autoencoder.
[0058] Specifically, the category prior constraint term is the KL divergence term between the encoded posterior distribution and the corresponding category prior Gaussian distribution. This KL divergence term is used to constrain the encoded posterior distribution. Q(z|x) Proximity to class prior distribution P(z|y) This allows samples representing the same training class label to cluster in the latent space towards the corresponding class prior Gaussian distribution. The reconstruction error term is calculated using the mean square error between the reconstructed sample X* and the training time-series waveform data, and is used to measure the difference between the reconstructed time-series waveform data and the input waveform.
[0059] In this embodiment, the initial learning rate during CPVAE iteration is set to 0.0002. The loss function is LOSS = β·D. KL +RE, where D KL Let RE be the category prior constraint, β be the reconstruction error term, and β be the weight of the category prior constraint. The minimum value of the dynamic temperature coefficient β. Set to 0.02, maximum value. Set the step size to 0.05. Set to 0.002. Preset reconstruction error threshold. The updates are dynamically performed according to the training process. Every 200 iterations, the updates are based on the reconstruction error term REpre from the previous monitoring period. The update method is The preset reconstruction condition is: the current reconstruction error term. Not greater than the preset reconstruction error threshold .
[0060] The dynamic adjustment process includes: adjusting the current reconstruction error term Compared with the preset reconstruction error threshold Compare. When REt is greater than If the model's reconstruction capability has not yet met the requirements, then the weights of the class prior constraint terms should be reduced or maintained to prioritize the model's ability to reconstruct time-series waveforms. Specifically: When REt is not greater than τ, it indicates that the model meets the preset reconstruction conditions. In this case, the weight of the class prior constraint term is increased to enhance the separability of samples representing different training class labels in the latent space. Specifically: .
[0061] During CPVAE training, the encoded posterior distribution parameters in each iteration are... and Based on category prior distribution parameters Constrained by the class variance parameter. Generated from the latent space during each training round. As a recognition model The latent vectors obtained through sampling. From each training round. The class variance parameter corrects the shape of the latent space of the previous model and affects the shape of the next model. The generation of latent space gradually transforms it from a mixed distribution to a structured distribution that can be classified.
[0062] The CPVAE training process repeatedly performs class prior distribution parameter updates, latent vector sampling, reconstructed sample generation, and loss function optimization. In this embodiment, the maximum number of iterations is set to 15,000, and training is completed within 5 consecutive monitoring periods. All values must be greater than 0.9, or the number of iterations must reach 15,000. After training, the trained class prior variational autoencoder is used to output low-dimensional latent feature vectors.
[0063] Based on the 13 fault types in Table 1, the amplitude comparison between the reconstructed signal generated by the CPVAE model decoder and the original signal can be referenced. Figure 5 Based on the trained CPVAE model, the latent vectors of the 13 classes in the latent space of the training set were reduced to one dimension using t-SNE. The mean and class variance parameters of each class are shown in Table 2.
[0064] Table 2: Mean values for each of the 13 categories and categorical variance parameter Display table Table 2 shows that after training with the categorical prior variational autoencoder, the categories represented by different training category labels have different cluster center positions in the latent space. The differences between the means of each category indicate that the categorical prior distribution parameters can form discriminative constraints on samples of different categories, causing the encoded posterior distribution to converge to the corresponding categorical prior Gaussian distribution. For categories with significantly different means, their separation in the latent space is higher; for categories with similar means, it indicates that the corresponding original time-series waveform data have similar variation characteristics, requiring further enhancement of classification and discrimination capabilities through channel recalibration in the subsequent SE module and temporal dependency extraction by the LSTM network. The category variance parameters in Table 2... The overall order of magnitude is similar, indicating that samples of each category have a relatively stable degree of clustering within their corresponding latent space regions, without significant dispersion or collapse. This demonstrates that, through the combination of category prior distribution parameters and category prior constraints, the category prior variational autoencoder can improve the latent space category separability while maintaining waveform reconstruction capabilities, thereby reducing the impact of weak features of soft faults, tolerance disturbances, and multi-fault coupling on fault diagnosis results.
[0065] Step S5: Input the training time-series waveform data into the trained category prior variational autoencoder to obtain the training low-dimensional latent feature vector, and use the training low-dimensional latent feature vector and training category labels to train the SE-LSTM classification model including the SE module, LSTM network and classifier.
[0066] Specifically, the training time-series waveform data is input into the category prior variational autoencoder trained in step S4 to obtain a 50-dimensional training low-dimensional latent feature vector. This training low-dimensional latent feature vector originates from a category-separable structured latent space, and compared to the original 1000-dimensional time-series waveform data, it has the characteristics of low dimensionality, less redundancy, and clearer category boundaries.
[0067] During the training of the SE-LSTM classification model, the training low-dimensional latent feature vector is input into a convolutional layer for feature mapping to obtain training multi-channel temporal features. In this embodiment, the 50-dimensional training low-dimensional latent feature vector is passed through a convolutional layer and output as 32 channels, with each channel representing an observation path for compressing features of the original sample. The SE module performs global average pooling on the training multi-channel temporal features to obtain channel-level global features, and generates corresponding channel attention weights based on the channel-level global features.
[0068] The SE module's excitation process employs a bottleneck structure, reducing the 32 channels to 16 channels and then restoring them to 32 channels. The dimensionality-reduced result is the channel fusion feature, used to learn the non-linear relationships between channels; the restored result is the channel attention output. Subsequently, the channel attention weights are element-wise multiplied with the training multi-channel temporal features output from the convolutional layer, completing the recalibration of the training multi-channel temporal features in the 32-channel dimension, resulting in the recalibrated training temporal features.
[0069] The time-series features from the training re-labeling are input into the LSTM network, which extracts the temporal dependency features from these features. The classifier consists of fully connected layers and a softmax classifier. These layers and classifiers output training class labels representing the classification probabilities of each class based on the temporal dependency features, and the SE-LSTM classification model is trained under supervision using these training class labels.
[0070] During training, Adam was chosen as the optimizer, with a learning rate of 0.001, a hidden state dimension of 64, a maximum training epoch of 100, a batch size of 130, and 20 iterations per training epoch. The model iteration curve during training is shown below. Figure 6 As shown in Table 3, the parameters of the SE-LSTM network are as follows.
[0071] Table 3: SE-LSTM Parameter Analysis Table Table 3 shows that the SE-LSTM classification model processes the 50-dimensional low-dimensional latent feature vector output by the category prior variational autoencoder stepwise. The convolutional layer maps the input features to 25×1×32 multi-channel temporal features, transforming the low-dimensional latent feature vector into a feature representation with channel dimensions, providing a data foundation for the SE module to learn channel weights. The global average pooling layer compresses the global information of each channel into 1×1×32 channel-level global features, the fc squeeze layer compresses 32 channels to 16 channels, and the fc excit layer restores 16 channels to 32 channels, enabling the model to learn nonlinear relationships between channels with lower computational cost. The sigmoid se layer outputs the attention weights corresponding to each channel, and the multiplication layer multiplies the channel attention weights element-wise with the multi-channel temporal features output by the convolutional layer to obtain the recalibrated multi-channel temporal features. This structure enhances the key channel features related to the fault category and suppresses the influence of redundant or noisy channels. Subsequently, the flatten layer transforms the recalibrated multi-channel temporal features into 800-dimensional features, which are then input into the LSTM network. The LSTM network extracts temporal dependency features through 64 hidden units, and the fully connected layer and softmax classifier output 13 training class labels representing the classification probability of each class. As shown in Table 3, the SE-LSTM classification model forms a continuous processing chain from channel feature enhancement to temporal dependency extraction and then to classification probability output. This chain can be combined with the low-dimensional latent feature vector output by the class prior variational autoencoder to improve the classification accuracy of soft and hard fault states in analog circuits.
[0072] Step S6: Collect the timing waveform data of the analog circuit to be diagnosed, which is similar to the target analog circuit, at the target observation node. Input the data into the trained class prior variational autoencoder to obtain the low-dimensional latent feature vector to be diagnosed. Then input the data into the trained SE-LSTM classification model. After channel recalibration, timing dependency extraction and classification, the fault diagnosis result is output.
[0073] Specifically, the timing waveform data of the analog circuit to be diagnosed, which is similar to the target analog circuit, at the collector current Iout of Q2 is obtained. After the timing waveform data to be diagnosed undergoes sampling point alignment and amplitude normalization processing consistent with step S2, it is input into the category prior variational autoencoder trained in step S4 to obtain the low-dimensional latent feature vector to be diagnosed.
[0074] In the diagnostic process using the SE-LSTM classification model, the low-dimensional latent feature vector to be diagnosed is input into the same convolutional layer as in step S5 for feature mapping, resulting in multi-channel temporal features to be diagnosed. The SE module performs global average pooling on the multi-channel temporal features to be diagnosed, obtaining channel-level global features, and generates channel attention weights corresponding to the multi-channel temporal features to be diagnosed based on the channel-level global features. The SE module then recalibrates the multi-channel temporal features to be diagnosed based on these channel attention weights, obtaining recalibrated temporal features.
[0075] The LSTM network generates temporal dependency features based on the re-calibrated time-series features. The fully connected layer and softmax classifier output the classification probability of the analog circuit to be diagnosed belonging to each training category label based on the temporal dependency features, and the category corresponding to the highest classification probability is taken as the fault diagnosis result. Based on the CPVAE-SE-LSTM model, the final classification accuracy is verified using a test set, and a confusion matrix is generated from the classification results, such as... Figure 7 As shown.
[0076] The working principle of this embodiment is as follows: When a target analog circuit experiences a soft or hard fault, the Iout timing waveform at the target observation node changes. However, analog circuits suffer from component tolerances, noise, nonlinear responses, and multi-component coupling. The waveform differences between different fault categories may be small, and direct classification based on the original timing waveform can easily lead to feature aliasing. This embodiment first obtains an original fault sample set containing normal, soft, and hard fault states through Monte Carlo transient simulation. Then, it reduces the impact of sampling differences and amplitude scale differences through sampling point alignment and amplitude normalization.
[0077] In steps S3 and S4, the CPVAE encoder maps the 1000-dimensional time-series waveform to a 50-dimensional latent vector and generates encoded posterior distribution parameters. The class embedding layer generates class prior distribution parameters based on the training class labels, ensuring that each training class label represents a class prior Gaussian distribution. The class prior constraint term promotes the convergence of the encoded posterior distribution to the corresponding class prior distribution, while the reconstruction error term ensures that the latent vector retains the original waveform details. The dynamic temperature coefficient β is adjusted based on the comparison between the reconstruction error term and the preset reconstruction error threshold, allowing the model to focus on learning waveform reconstruction in the early stages of training and on enhancing class separability in the later stages. Thus, CPVAE can form structured class clusters in the latent space, mitigating the feature aliasing problem when weak features from soft faults and strong perturbations from hard faults coexist.
[0078] In steps S5 and S6, the low-dimensional latent feature vectors are mapped to 32-channel temporal features via convolutional layers. The SE module assigns attention weights to different channels through global average pooling, channel compression, nonlinear activation, channel recovery, and element-wise multiplication, enhancing key channels that are more effective for fault diagnosis and suppressing redundant or noisy channels. Subsequently, the LSTM network models the temporal dependencies of the recalibrated temporal features to capture the changing patterns in the latent feature sequence; the fully connected layer and softmax classifier output classification probabilities for 13 categories, and the category corresponding to the highest classification probability is used as the fault diagnosis result.
[0079] Through the above process, CPVAE, the SE module, and the LSTM network form a continuous data processing link from raw waveform data to structured latent space features, then to channel enhancement and temporal classification. This method can directly input raw waveform data and automatically complete feature extraction, latent space structured clustering, channel feature enhancement, temporal dependency extraction, and fault classification, without requiring manual fault dictionary creation or manual selection of fault features. CPVAE improves the latent space separability of samples from different categories through category-specific latent spaces and dynamic temperature coefficients; the SE module adaptively learns the weights of each feature channel, strengthening key fault features and suppressing noise and redundant interference; the LSTM network captures the temporal dependencies in the recalibrated temporal features, thereby improving the integrated diagnostic accuracy of parameter-offset soft faults, open-circuit hard faults, and short-circuit hard faults.
[0080] Example 2, as Figure 8 As shown, this embodiment provides an analog circuit fault diagnosis system based on CPVAE-SE-LSTM, used to implement the analog circuit fault diagnosis method based on CPVAE-SE-LSTM in Embodiment 1. The target analog circuit, state settings, sample acquisition methods, model training parameters, and threshold settings are the same as in Embodiment 1 and will not be repeated in this embodiment. This embodiment focuses on explaining the data connection relationships between various functional modules, the data processing destination, and the system working principle.
[0081] This analog circuit fault diagnosis system can be deployed in computing devices with data processing capabilities, or in a processing platform consisting of a simulation calculation unit, a model training unit, and a fault diagnosis unit. Each functional module can be implemented through software programs, hardware circuits, or a combination of both. The system includes a sample module 1, a preprocessing module 2, a CPVAE module 3, an optimization module 4, a classification training module 5, and a diagnosis module 6.
[0082] Sample module 1 is used to construct a simulation model of the target analog circuit, setting normal state, soft fault state, and hard fault state. Circuit parameters are configured according to each state, and transient simulation is performed. Timing waveform data from the target observation nodes is collected, and the timing waveform data is associated with the corresponding state to obtain the original fault sample set. Each sample in the original fault sample set includes at least one set of timing waveform data and the corresponding state information. The original fault sample set output by sample module 1 is transmitted to preprocessing module 2 as the basis data for the formation of subsequent training samples.
[0083] Preprocessing module 2, connected to sample module 1, preprocesses the original fault sample set to obtain training time-series waveform data and corresponding training category labels. Specifically, preprocessing module 2 aligns sampling points and normalizes amplitudes of the time-series waveform data in the original fault sample set, and generates training category labels based on the category represented by the training category label to which the sample belongs. The output of preprocessing module 2 includes training time-series waveform data and training category labels. The training time-series waveform data is transmitted to CPVAE module 3 and classification training module 5, and the training category labels are also transmitted to CPVAE module 3 and classification training module 5. Through this setup, a one-to-one correspondence is established between the training time-series waveform data and the training category labels within the system, avoiding problems such as unclear data sources or unknown label destinations during model training.
[0084] CPVAE module 3 connects to preprocessing module 2 and is used to construct a class-prior variational autoencoder. It generates encoded posterior distribution parameters based on the training time-series waveform data, class-prior distribution parameters based on the training class labels, and reconstructed time-series waveform data based on the latent vectors sampled from the latent space. The encoded posterior distribution parameters include the mean and variance of the encoded posterior distribution, and the class-prior distribution parameters include the mean and variance of the class-prior distribution. CPVAE module 3 transmits the encoded posterior distribution parameters, class-prior distribution parameters, and reconstructed time-series waveform data to optimization module 4, enabling optimization module 4 to perform model training constraints and parameter updates based on the aforementioned data.
[0085] The optimization module 4 is connected to the CPVAE module 3. It is used to calculate the class prior constraint term to constrain the convergence of the encoding posterior distribution to the corresponding class prior distribution based on the encoding posterior distribution parameter and the class prior distribution parameter; calculate the reconstruction error term based on the reconstructed time-series waveform data and the training time-series waveform data; and dynamically adjust the weight of the class prior constraint term according to the comparison result between the reconstruction error term and the preset reconstruction conditions to obtain the trained class prior variational autoencoder.
[0086] In this embodiment, the category prior constraint term is the KL divergence term between the encoded posterior distribution and the corresponding category prior distribution, and the reconstruction error term is the mean square error between the reconstructed time-series waveform data and the training time-series waveform data. The preset reconstruction condition is specifically: the current reconstruction error term is not greater than a preset reconstruction error threshold. The preset reconstruction error threshold is updated every 200 iterations, and the update method is as follows: Where τ is the preset reconstruction error threshold, and REpre is the reconstruction error term corresponding to the previous monitoring period. The weight of the category prior constraint term is represented by the dynamic temperature coefficient β, and the minimum value of β is... It is 0.02, the maximum value. The threshold value is 0.05, and the adjustment step size is 0.002. When the current reconstruction error term is greater than the preset reconstruction error threshold, the optimization module reduces or maintains β; when the current reconstruction error term is not greater than the preset reconstruction error threshold, the optimization module increases β. In this way, the category prior variational autoencoder can first maintain the temporal waveform reconstruction capability, and then enhance the separability of samples representing different training category labels in the latent space.
[0087] The classification training module 5 connects the optimization module 4 and the preprocessing module 2. It is used to input the training time-series waveform data into the trained class prior variational autoencoder to obtain the training low-dimensional latent feature vector. Based on the training low-dimensional latent feature vector and the training class labels, the SE-LSTM classification model is trained, resulting in the trained SE-LSTM classification model. The SE-LSTM classification model includes the SE module, the LSTM network, the fully connected layer, and the softmax classifier.
[0088] In classification training module 5, the low-dimensional latent feature vectors are first convolved to form training multi-channel temporal features; the SE module performs channel relabeling on the training multi-channel temporal features to obtain training relabeled temporal features; the LSTM network extracts temporal dependencies from the training relabeled temporal features to obtain training temporal dependency features; the fully connected layer and softmax classifier output each training category label representing the classification probability of the category based on the training temporal dependency features, and combine the training category labels to supervise the training of the SE-LSTM classification model. After classification training module 5 completes training, the trained SE-LSTM classification model is transferred to diagnostic module 6.
[0089] The diagnostic module 6 connects the optimization module 4 and the classification training module 5. It is used to acquire the timing waveform data of the analog circuit to be diagnosed at the target observation node, which is of the same type as the target analog circuit. The timing waveform data to be diagnosed is input into the trained category prior variational autoencoder to obtain the low-dimensional latent feature vector to be diagnosed. The low-dimensional latent feature vector to be diagnosed is then input into the trained SE-LSTM classification model. After channel recalibration of the SE module, timing dependency extraction of the LSTM network, mapping of the fully connected layer, and classification by the softmax classifier, the fault diagnosis result is output to characterize the state of the analog circuit to be diagnosed.
[0090] During diagnosis, the diagnostic module 6 processes the time-series waveform data to be diagnosed using the same preprocessing method as in the training phase, and then inputs it into the trained class-prior variational autoencoder. The trained class-prior variational autoencoder maps the time-series waveform data to be diagnosed into a low-dimensional latent feature vector, allowing the sample to be diagnosed to enter a latent space with a class-separable structure. Subsequently, the trained SE-LSTM classification model further processes the low-dimensional latent feature vector to be diagnosed. Specifically, the SE module generates corresponding channel attention weights based on the multi-channel time-series features to be diagnosed and uses these weights to recalibrate the multi-channel time-series features. The LSTM network generates time-dependent features based on the recalibrated features. The fully connected layer and softmax classifier output the classification probability of the analog circuit to be diagnosed belonging to each training class label, and the class corresponding to the highest classification probability is used as the fault diagnosis result.
[0091] The working principle of this embodiment is as follows: Sample module 1 first generates a raw fault sample set with state correlations, enabling the system to obtain time-series waveform data under normal, soft, and hard fault states. Preprocessing module 2 performs uniform scaling and sampling location processing on the raw fault sample set and generates training class labels, allowing subsequent models to utilize both waveform data and class information. CPVAE module 3 generates encoded posterior distribution parameters based on the training time-series waveform data and generates class prior distribution parameters based on the training class labels, ensuring that different classes have corresponding class prior distribution foundations in the latent space.
[0092] Optimization module 4 further utilizes class prior constraints and reconstruction error terms to train the class prior variational autoencoder. In the initial training phase, when the reconstruction error term does not meet the preset reconstruction conditions, the system reduces or maintains the weight of the class prior constraints, allowing the model to prioritize preserving the reconstruction details of the temporal waveform. When the reconstruction error term meets the preset reconstruction conditions, the system increases the weight of the class prior constraints, causing the encoded posterior distribution to converge to the corresponding class prior distribution. Thus, the latent space gradually forms a structured distribution where similar samples cluster and dissimilar samples separate, reducing the impact of weak features from soft faults, strong disturbances from hard faults, component tolerances, and noise on feature boundaries.
[0093] The classification training module 5 trains an SE-LSTM classification model based on class-separable low-dimensional latent features. The SE module enhances key fault features and suppresses redundant features through channel recalibration. The LSTM network extracts temporal dependencies from the recalibrated features, and the fully connected layer and softmax classifier output classification probabilities. The diagnosis module 6 calls the trained class prior variational autoencoder and the trained SE-LSTM classification model during actual diagnosis, enabling the time-series waveform data to be diagnosed to sequentially complete low-dimensional latent feature extraction, channel feature enhancement, temporal dependency modeling, and fault category output.
[0094] Through the above system structure, a continuous data processing link is formed between the modules: the original fault sample set is output from sample module 1 to preprocessing module 2; the training time-series waveform data and training class labels are output from preprocessing module 2 to CPVAE module 3 and classification training module 5; the encoded posterior distribution parameters, class prior distribution parameters, and reconstructed time-series waveform data are output from CPVAE module 3 to optimization module 4; the trained class prior variational autoencoder is output from optimization module 4 to classification training module 5 and diagnosis module 6; the trained SE-LSTM classification model is output from classification training module 5 to diagnosis module 6; and the fault diagnosis results are output from diagnosis module 6. This data flow ensures that each module has a source for input and a destination for output, and keeps the data processing rules consistent between the training and diagnosis phases, facilitating system engineering implementation.
[0095] This embodiment has the following technical effects: By establishing a unified time-series waveform data foundation through sample module 1 and preprocessing module 2, the consistency between training and diagnostic data is improved. A category prior latent space is formed through CPVAE module 3 and optimization module 4, and a specific preset reconstruction error threshold and dynamic temperature coefficient adjustment mechanism are used to balance reconstruction capability and category separability. The SE-LSTM classification model in classification training module 5 enhances key channel features and extracts temporal dependencies. The diagnostic module 6 enables automatic identification of the state of the analog circuit to be diagnosed. Therefore, this system can improve the accuracy, stability, and automation of analog circuit fault diagnosis under conditions of coexisting soft and hard fault states.
[0096] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principle of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A fault diagnosis method for analog circuits based on CPVAE-SE-LSTM, characterized in that, include: Step S1: Construct a simulation model of the target analog circuit and set the normal state, soft fault state, and hard fault state. Configure circuit parameters according to each state and perform transient simulation. Collect time-series waveform data of the target observation node, associate it with the corresponding state, and obtain the original fault sample set. Step S2: Preprocess the original fault sample set to obtain training time-series waveform data and corresponding training category labels; Step S3: Construct a category prior variational autoencoder, which generates encoded posterior distribution parameters based on the training time-series waveform data, generates category prior distribution parameters based on the training category labels, and generates reconstructed time-series waveform data based on the latent vectors sampled from the latent space. Step S4: Based on the encoded posterior distribution parameters and the class prior distribution parameters, calculate the class prior constraint term used to constrain the encoded posterior distribution to converge to the corresponding class prior distribution; calculate the reconstruction error term based on the reconstructed time-series waveform data and the training time-series waveform data; and dynamically adjust the weight of the class prior constraint term according to the comparison result between the reconstruction error term and the preset reconstruction conditions to train the class prior variational autoencoder. Step S5: Input the training time-series waveform data into the trained category prior variational autoencoder to obtain the training low-dimensional latent feature vector, and use the training low-dimensional latent feature vector and training category labels to train an SE-LSTM classification model including an SE module, an LSTM network and a classifier. Step S6: Collect the timing waveform data of the analog circuit to be diagnosed, which is of the same type as the target analog circuit, at the target observation node. Input the data into the trained class prior variational autoencoder to obtain the low-dimensional latent feature vector to be diagnosed. Then input the data into the trained SE-LSTM classification model. After channel recalibration, timing dependency extraction and classification, output the fault diagnosis result.
2. The analog circuit fault diagnosis method based on CPVAE-SE-LSTM according to claim 1, characterized in that, In step S1, the target simulation circuit model includes several components. The parameters of each component are changed and the time-series waveform change of the target observation node relative to the normal state is obtained. The components whose time-series waveform change satisfies the preset sensitivity condition are identified as key components. The soft fault state and hard fault state are set based on the key components.
3. The analog circuit fault diagnosis method based on CPVAE-SE-LSTM according to claim 2, characterized in that, In step S1, the soft fault state is obtained by setting the parameters of the key component to parameter values that deviate from the nominal value and meet the preset offset conditions, and the hard fault state is obtained by setting the key component to an open circuit state or a short circuit state. The normal state, as well as each soft fault state and each hard fault state formed based on the key components, are respectively determined as the categories represented by the training category labels. Monte Carlo transient simulation is performed on the circuit parameter configuration corresponding to each category to obtain the time-series waveform data of the target observation node.
4. The analog circuit fault diagnosis method based on CPVAE-SE-LSTM according to claim 3, characterized in that, In step S2, the preprocessing includes aligning sampling points and normalizing amplitudes of the time-series waveform data in the original fault sample set, determining training samples from the processed time-series waveform data, using the time-series waveform data in the training samples as the training time-series waveform data, and generating training category labels corresponding to the training samples according to the category to which the training samples belong.
5. The analog circuit fault diagnosis method based on CPVAE-SE-LSTM according to claim 1, characterized in that, In step S3, the category prior variational autoencoder includes an encoder, a category embedding layer, a latent space, and a decoder; The encoder outputs the mean and variance of the encoded posterior distribution based on the training time-series waveform data, the category embedding layer outputs the mean and variance of the category prior distribution based on the training category labels, and the decoder outputs the reconstructed time-series waveform data based on the latent vectors obtained by sampling from the latent space.
6. The analog circuit fault diagnosis method based on CPVAE-SE-LSTM according to claim 5, characterized in that, The category embedding layer generates corresponding category prior distribution parameters for different training category labels, so that the category represented by each training category label corresponds to a category prior Gaussian distribution in the latent space; The category prior constraint term is the KL divergence term between the encoded posterior distribution and the corresponding category prior Gaussian distribution.
7. The analog circuit fault diagnosis method based on CPVAE-SE-LSTM according to claim 6, characterized in that, In step S4, the dynamic adjustment includes: The reconstruction error term is compared with a preset reconstruction error threshold. When the reconstruction error term is greater than the preset reconstruction error threshold, the weight of the category prior constraint term is reduced or maintained. When the reconstruction error term is not greater than the preset reconstruction error threshold, the weight of the category prior constraint term is increased so that the category prior variational autoencoder first maintains the temporal waveform reconstruction capability and then enhances the separability of samples representing different training category labels in the latent space.
8. The analog circuit fault diagnosis method based on CPVAE-SE-LSTM according to claim 1, characterized in that, During the training of the SE-LSTM classification model, the training low-dimensional latent feature vector is input into the convolutional layer for feature mapping to obtain the training multi-channel temporal features. During the diagnosis process using the SE-LSTM classification model, the low-dimensional latent feature vector to be diagnosed is input into the convolutional layer for feature mapping to obtain the multi-channel temporal features to be diagnosed. The SE module performs global average pooling on the training multi-channel temporal features and the multi-channel temporal features to be diagnosed, respectively, to obtain channel-level global features, and generates corresponding channel attention weights based on the channel-level global features.
9. The analog circuit fault diagnosis method based on CPVAE-SE-LSTM according to claim 8, characterized in that, In step S6, the SE module recalibrates the multi-channel temporal features to be diagnosed according to the channel attention weights corresponding to the multi-channel temporal features to be diagnosed, and obtains the recalibrated temporal features. The LSTM network generates temporal dependency features based on the recalibrated timing features; the classifier includes a fully connected layer and a softmax classifier, which output the classification probability of the analog circuit to be diagnosed belonging to the category represented by each of the training category labels based on the temporal dependency features, and takes the category corresponding to the maximum classification probability as the fault diagnosis result.
10. A fault diagnosis system for analog circuits based on CPVAE-SE-LSTM, used to implement the fault diagnosis method for analog circuits based on CPVAE-SE-LSTM as described in any one of claims 1-9, characterized in that, include: The sample module is used to build a simulation model of the target analog circuit and set the normal state, soft fault state and hard fault state. Configure circuit parameters according to each state and perform transient simulation. Collect time-series waveform data of the target observation node, associate it with the corresponding state, and obtain the original fault sample set. The preprocessing module, connected to the sample module, is used to preprocess the original fault sample set to obtain training time-series waveform data and corresponding training category labels. The CPVAE module, connected to the preprocessing module, is used to construct a category prior variational autoencoder, generate encoded posterior distribution parameters based on the training time-series waveform data, generate category prior distribution parameters based on the training category labels, and generate reconstructed time-series waveform data based on the latent vectors obtained from latent space sampling. The optimization module, connected to the CPVAE module, is used to calculate a class prior constraint term to constrain the posterior distribution of the encoding to converge to the corresponding class prior distribution based on the encoding posterior distribution parameters and the class prior distribution parameters. It also calculates a reconstruction error term based on the reconstructed temporal waveform data and the training temporal waveform data, and dynamically adjusts the weight of the class prior constraint term according to the comparison result between the reconstruction error term and the preset reconstruction conditions, thereby training a class prior variational autoencoder. The classification training module, which connects the optimization module and the preprocessing module, is used to input the training time-series waveform data into the trained category prior variational autoencoder to obtain the training low-dimensional latent feature vector, and use the training low-dimensional latent feature vector and the training category label to train an SE-LSTM classification model including an SE module, an LSTM network and a classifier. The diagnostic module, connected to the optimization module and the classification training module, is used to collect the timing waveform data of the analog circuit to be diagnosed, which is of the same type as the target analog circuit, at the target observation node. The data is then input into the trained class prior variational autoencoder to obtain the low-dimensional latent feature vector to be diagnosed, and then input into the trained SE-LSTM classification model. After channel recalibration, timing dependency extraction and classification, the fault diagnosis result is output.
