Figure 1.
Overall architecture of the proposed framework for analog circuit fault diagnosis. (a) The setup, where component tolerances and fault variations are injected into the Device Under Test (DUT). (b) Acquisition of the 401-point frequency response signals, which exhibit severe feature overlapping due to tolerances. (c) The proposed TCSN framework serving as the core, featuring a 1D-CNN encoder optimized by the Tolerance-Aware Contrastive Loss (TACL) to decouple fault signatures into a 32-dimensional hypersphere. (d) The dual-branch inference output, capable of classifying known component faults via prototype matching while reliably rejecting unknown anomalies using an energy score threshold.
Figure 1.
Overall architecture of the proposed framework for analog circuit fault diagnosis. (a) The setup, where component tolerances and fault variations are injected into the Device Under Test (DUT). (b) Acquisition of the 401-point frequency response signals, which exhibit severe feature overlapping due to tolerances. (c) The proposed TCSN framework serving as the core, featuring a 1D-CNN encoder optimized by the Tolerance-Aware Contrastive Loss (TACL) to decouple fault signatures into a 32-dimensional hypersphere. (d) The dual-branch inference output, capable of classifying known component faults via prototype matching while reliably rejecting unknown anomalies using an energy score threshold.
Figure 2.
Sallen-Key second-order Butterworth low-pass filter. Nominal parameters: , , .
Figure 2.
Sallen-Key second-order Butterworth low-pass filter. Nominal parameters: , , .
Figure 3.
Simulated Bode plot of the nominal Sallen-Key circuit and residual error relative to the theoretical transfer function (max residual: 0.0012 dB, RMS: 0.0003 dB).
Figure 3.
Simulated Bode plot of the nominal Sallen-Key circuit and residual error relative to the theoretical transfer function (max residual: 0.0012 dB, RMS: 0.0003 dB).
Figure 4.
Voltage gain frequency responses of all ten fault classes of the Sallen-Key circuit. F9 ( open circuit) suffers severe attenuation due to the loss of the forward input signal path. Furthermore, F5 () and F6 () explicitly alter the passband gain in opposite directions owing to their inverse effects on the amplifier gain .
Figure 4.
Voltage gain frequency responses of all ten fault classes of the Sallen-Key circuit. F9 ( open circuit) suffers severe attenuation due to the loss of the forward input signal path. Furthermore, F5 () and F6 () explicitly alter the passband gain in opposite directions owing to their inverse effects on the amplifier gain .
Figure 5.
Pairwise cosine similarity matrix of the nominal frequency-response vectors for all ten fault classes, computed in the original dB-domain. Values close to 1.000 indicate nearly identical responses. F1–F3 and F3–F8 exhibit the highest inter-class similarities (0.999976 and 0.999939, respectively), strongly motivating the design of the fine-grained loss term . F9 ( open circuit) is well-separated from all other classes (similarity 0.922–0.941).
Figure 5.
Pairwise cosine similarity matrix of the nominal frequency-response vectors for all ten fault classes, computed in the original dB-domain. Values close to 1.000 indicate nearly identical responses. F1–F3 and F3–F8 exhibit the highest inter-class similarities (0.999976 and 0.999939, respectively), strongly motivating the design of the fine-grained loss term . F9 ( open circuit) is well-separated from all other classes (similarity 0.922–0.941).
Figure 6.
Monte Carlo tolerance simulation results (N=50 runs, component tolerance ±5%). (a) Frequency-response envelope of the nominal class F0 (5th–95th percentile band), with F1 (+20%) and F9 ( open circuit) overlaid for comparison. (b) Distribution of estimated cutoff frequency under tolerance variation. The F1 fault lies at approximately from the nominal mean, indicating that small parametric deviations are profoundly embedded within the nominal tolerance band and are challenging to isolate using scalar frequency features alone.
Figure 6.
Monte Carlo tolerance simulation results (N=50 runs, component tolerance ±5%). (a) Frequency-response envelope of the nominal class F0 (5th–95th percentile band), with F1 (+20%) and F9 ( open circuit) overlaid for comparison. (b) Distribution of estimated cutoff frequency under tolerance variation. The F1 fault lies at approximately from the nominal mean, indicating that small parametric deviations are profoundly embedded within the nominal tolerance band and are challenging to isolate using scalar frequency features alone.
Figure 7.
Detailed processing pipeline of the proposed TCSN framework, comprising three primary stages. (Left) Input representation utilizing z-score normalization on the 401-point input vector. (Middle) The 1D-CNN encoder that progressively extracts robust features from the raw frequency response, mapping it to a 32-dimensional unit-norm embedding . (Right) The Tolerance-Aware Contrastive Loss (TACL) for metric-space calibration during training, and the prototype-based classifier equipped with an energy score detector for open-set inference. Solid arrows denote forward data flow; the dashed arrow denotes backpropagation.
Figure 7.
Detailed processing pipeline of the proposed TCSN framework, comprising three primary stages. (Left) Input representation utilizing z-score normalization on the 401-point input vector. (Middle) The 1D-CNN encoder that progressively extracts robust features from the raw frequency response, mapping it to a 32-dimensional unit-norm embedding . (Right) The Tolerance-Aware Contrastive Loss (TACL) for metric-space calibration during training, and the prototype-based classifier equipped with an energy score detector for open-set inference. Solid arrows denote forward data flow; the dashed arrow denotes backpropagation.
Figure 8.
Evolution of training metrics over 500 epochs. (Left) Total training loss trajectory. (Middle) Evolution of the tolerance compactness loss, highlighting the active optimization of the tolerance term particularly emphasized during Phase 2. (Right) Validation accuracy, demonstrating the effectiveness of the two-phase optimization schedule (Phase 1: epochs 1–200 with only; Phase 2: epochs 201–500 with full TACL), achieving a stable peak accuracy of 94%.
Figure 8.
Evolution of training metrics over 500 epochs. (Left) Total training loss trajectory. (Middle) Evolution of the tolerance compactness loss, highlighting the active optimization of the tolerance term particularly emphasized during Phase 2. (Right) Validation accuracy, demonstrating the effectiveness of the two-phase optimization schedule (Phase 1: epochs 1–200 with only; Phase 2: epochs 201–500 with full TACL), achieving a stable peak accuracy of 94%.
Figure 9.
t-SNE visualization of the latent representations produced by the trained TCSN encoder on the test set. Known fault classes (F0–F9) naturally form compact, topologically separated clusters. In contrast, the OOD unknown samples (U1, U2) occupy interstitial regions structurally distant from the known prototypes, validating the geometric premise of the energy score open-set detector.
Figure 9.
t-SNE visualization of the latent representations produced by the trained TCSN encoder on the test set. Known fault classes (F0–F9) naturally form compact, topologically separated clusters. In contrast, the OOD unknown samples (U1, U2) occupy interstitial regions structurally distant from the known prototypes, validating the geometric premise of the energy score open-set detector.
Figure 10.
Confusion matrix detailing the closed-set fault isolation performance (100 test samples, 10 fault classes). Diagonal elements denote correct diagnosis. As theoretically predicted, F3 () exhibits the highest misclassification rate due to its nearly identical frequency response to F1 and F8. Notably, while the proposed method prevents major confusion towards F1, F3 still suffers from a 20% misclassification rate into F8 and receives 10% false positives from F1.
Figure 10.
Confusion matrix detailing the closed-set fault isolation performance (100 test samples, 10 fault classes). Diagonal elements denote correct diagnosis. As theoretically predicted, F3 () exhibits the highest misclassification rate due to its nearly identical frequency response to F1 and F8. Notably, while the proposed method prevents major confusion towards F1, F3 still suffers from a 20% misclassification rate into F8 and receives 10% false positives from F1.
Figure 11.
Evolution of few-shot diagnostic accuracy as a function of the number of support samples per class (n). Results are averaged over five independent trials. TCSN demonstrates a commanding advantage in the extreme few-shot regime (), significantly outperforming all baselines. As n increases beyond 10, data-hungry models (e.g., RF and MLP) gradually surpass TCSN, capitalizing on the abundant labeled data to optimize their larger parameter spaces.
Figure 11.
Evolution of few-shot diagnostic accuracy as a function of the number of support samples per class (n). Results are averaged over five independent trials. TCSN demonstrates a commanding advantage in the extreme few-shot regime (), significantly outperforming all baselines. As n increases beyond 10, data-hungry models (e.g., RF and MLP) gradually surpass TCSN, capitalizing on the abundant labeled data to optimize their larger parameter spaces.
Figure 12.
Receiver Operating Characteristic (ROC) curve for open-set unknown fault detection utilizing the proposed energy score (T=1.0). The high AUROC (0.9309) demonstrates the strong discriminative thresholding capability in separating in-distribution known faults from out-of-distribution unforeseen anomalies.
Figure 12.
Receiver Operating Characteristic (ROC) curve for open-set unknown fault detection utilizing the proposed energy score (T=1.0). The high AUROC (0.9309) demonstrates the strong discriminative thresholding capability in separating in-distribution known faults from out-of-distribution unforeseen anomalies.
Figure 13.
Frequency histograms detailing the distribution of energy scores for known (F0–F9, blue) and unknown (U1, U2, orange) test samples at T=1.0. Following energy-based theoretical models, known samples map to states of lower energy (mean: , indicating high prototype affinity), whereas unknown samples inherently exhibit higher energy (mean: ), furnishing a statistically robust separation boundary for the threshold .
Figure 13.
Frequency histograms detailing the distribution of energy scores for known (F0–F9, blue) and unknown (U1, U2, orange) test samples at T=1.0. Following energy-based theoretical models, known samples map to states of lower energy (mean: , indicating high prototype affinity), whereas unknown samples inherently exhibit higher energy (mean: ), furnishing a statistically robust separation boundary for the threshold .
Figure 14.
Model robustness under additive white Gaussian noise (AWGN). (a) Closed-set accuracy trajectories vs. SNR. Standard classifiers (MLP, SVM, KNN) suffer catastrophic collapse at 30 dB. RF shows excellent resilience at mild/moderate noise levels (30 dB, 20 dB) due to ensemble voting, but collapses at extreme noise (10 dB). TCSN demonstrates the most graceful degradation, ultimately outperforming all baselines at the most severe 10 dB level. (b) Open-set AUROC of TCSN vs. SNR, exhibiting a non-monotonic trend due to extreme noise-induced topological embedding drift.
Figure 14.
Model robustness under additive white Gaussian noise (AWGN). (a) Closed-set accuracy trajectories vs. SNR. Standard classifiers (MLP, SVM, KNN) suffer catastrophic collapse at 30 dB. RF shows excellent resilience at mild/moderate noise levels (30 dB, 20 dB) due to ensemble voting, but collapses at extreme noise (10 dB). TCSN demonstrates the most graceful degradation, ultimately outperforming all baselines at the most severe 10 dB level. (b) Open-set AUROC of TCSN vs. SNR, exhibiting a non-monotonic trend due to extreme noise-induced topological embedding drift.
Figure 15.
Performance profiling across ablation variants. Note that the FPR metric is plotted as FPR@95%TPR to ensure a consistent “higher-is-better” visual representation. The Full TCSN (blue) achieves the optimal equilibrium. Removing devastates open-set detection (AUROC drop: 0.3793). Removing severely harms fine-grained closed-set accuracy (: %). Replacing the energy score strictly penalizes OOD separability without affecting closed-set metrics.
Figure 15.
Performance profiling across ablation variants. Note that the FPR metric is plotted as FPR@95%TPR to ensure a consistent “higher-is-better” visual representation. The Full TCSN (blue) achieves the optimal equilibrium. Removing devastates open-set detection (AUROC drop: 0.3793). Removing severely harms fine-grained closed-set accuracy (: %). Replacing the energy score strictly penalizes OOD separability without affecting closed-set metrics.
Table 1.
Nominal Component Values and Filter Parameters.
Table 1.
Nominal Component Values and Filter Parameters.
| Parameter |
Value |
Parameter |
Value |
|
|
|
|
|
|
Q |
|
|
|
K |
|
|
|
Sim. residual |
|
Table 2.
Fault Class Catalog.
Table 2.
Fault Class Catalog.
| ID |
Component |
Deviation |
Split |
| F0 |
— |
Nominal |
Train/Val/Test |
| F1 |
|
|
Train/Val/Test |
| F2 |
|
|
Train/Val/Test |
| F3 |
|
|
Train/Val/Test |
| F4 |
|
|
Train/Val/Test |
| F5 |
|
|
Train/Val/Test |
| F6 |
|
|
Train/Val/Test |
| F7 |
|
|
Train/Val/Test |
| F8 |
|
|
Train/Val/Test |
| F9 |
|
Open () |
Train/Val/Test |
| U1 |
|
(compound) |
Open-set only |
| U2 |
|
|
Open-set only |
Table 3.
Dataset Split Configuration.
Table 3.
Dataset Split Configuration.
| Split |
Classes |
Samples/class |
Total |
Purpose |
| Train |
F0–F9 (10) |
30 |
300 |
Metric learning |
| Val |
F0–F9 (10) |
10 |
100 |
Hyperparameter selection |
| Test |
F0–F9 (10) |
10 |
100 |
Closed-set evaluation |
| Unknown |
U1, U2 (2) |
50 |
100 |
Open-set evaluation |
| Total |
1,100 |
(Unknown excluded from training) |
Table 4.
Encoder Architecture.
Table 4.
Encoder Architecture.
| Layer |
Output Shape |
Normalization |
| Conv1d (1→16, k=15, s=2) |
|
LayerNorm + ReLU |
| Conv1d (16→32, k=9, s=2) |
|
LayerNorm + ReLU |
| Conv1d (32→64, k=5, s=2) |
|
LayerNorm + ReLU |
| AdaptiveAvgPool1d (8) |
|
— |
| Flatten |
|
— |
| FC (512→128) |
|
LayerNorm + ReLU |
| FC (128→32) + L2-Norm |
|
L2 normalization |
Table 5.
Per-Class F1-Scores for Closed-Set Fault Diagnosis on the Test Set.
Table 5.
Per-Class F1-Scores for Closed-Set Fault Diagnosis on the Test Set.
| Fault Class |
F1 Score |
| F0 (Nominal) |
0.80 |
| F1 () |
0.82 |
| F2 () |
0.87 |
| F3 () |
0.62 |
| F4 () |
0.91 |
| F5 () |
0.95 |
| F6 () |
1.00 |
| F7 () |
1.00 |
| F8 () |
0.86 |
| F9 ( open circuit) |
1.00 |
| Macro-F1 |
0.88 |
| Weighted-F1 |
0.88 |
Table 6.
Closed-Set Test Accuracy Under Full-Data Regime.
Table 6.
Closed-Set Test Accuracy Under Full-Data Regime.
| |
SVM |
KNN |
RF |
MLP |
TCSN (ours) |
| Accuracy |
91.2% |
90.2% |
94.4% |
99.0% |
90.0% |
Table 7.
Few-Shot Diagnostic Accuracy (%) vs. Number of Support Samples per Class.
Table 7.
Few-Shot Diagnostic Accuracy (%) vs. Number of Support Samples per Class.
|
n/class |
SVM |
KNN |
RF |
MLP |
TCSN (ours) |
| 1 |
75.0 |
13.4 |
78.0 |
71.2 |
83.0 |
| 2 |
76.0 |
42.4 |
88.6 |
83.6 |
90.4 |
| 5 |
78.0 |
76.2 |
93.6 |
91.0 |
92.4 |
| 10 |
82.4 |
87.4 |
95.2 |
97.8 |
92.8 |
| 20 |
80.0 |
88.6 |
95.8 |
99.6 |
94.2 |
| 50 |
91.2 |
90.2 |
94.4 |
99.0 |
95.4 |
Table 8.
Open-Set Detection Performance vs. Temperature Scale (T).
Table 8.
Open-Set Detection Performance vs. Temperature Scale (T).
| Method / T
|
AUROC |
FPR@95%TPR |
Note |
| TCSN,
|
— |
— |
Degenerate |
| TCSN,
|
— |
— |
Suboptimal |
| TCSN,
|
0.9309 |
0.2500 |
Optimal |
| Known energy:
|
| Unknown energy:
|
Table 9.
Robustness to AWGN Noise (Closed-Set Accuracy / Open-Set AUROC).
Table 9.
Robustness to AWGN Noise (Closed-Set Accuracy / Open-Set AUROC).
| SNR |
SVM |
KNN |
RF |
MLP |
TCSN (ours) |
|
∞ (clean) |
91.2% |
90.2% |
94.4% |
99.0% |
90.0% / 0.9309 |
| 30 dB |
31.4% |
11.2% |
93.8% |
38.6% |
85.0% / 0.7598 |
| 20 dB |
29.0% |
10.6% |
54.4% |
37.0% |
52.0% / 0.6083 |
| 10 dB |
18.2% |
4.4% |
10.6% |
29.0% |
36.0% / 0.6847 |
Table 10.
Ablation Study Results.
Table 10.
Ablation Study Results.
| Variant |
Acc. |
AUROC |
FPR@95% |
|
|
| Full TCSN |
90% |
0.9309 |
0.2500 |
0.830 |
0.906 |
|
w/o TACL |
87% |
0.5516 |
0.7700 |
0.862 |
0.868 |
|
w/o
|
79% |
0.8193 |
0.4100 |
0.694 |
0.670 |
| Vanilla |
78% |
0.8226 |
0.5100 |
0.776 |
0.758 |
|
w/o Energy |
90% |
0.6626 |
0.4600 |
0.830 |
0.906 |