## 4 Proposed Model  
Few-shot learning operates with training datasets where each class contains only a handful of samples, unlike the extensive labeled datasets typically used in deep learning. This enables few-shot learning to effectively accomplish classification tasks with limited training data, leveraging the unique characteristics of its model architecture. The training data for the few-shot learning model comprise multiple classification tasks; each task involves a combination of samples that belong to the same class or different classes [37]. Unlike traditional supervised learning methods, which categorize individual samples, the  
Figure 2: CWT transformation process.  
model in few-shot learning gains proficiency by classifying pairs of samples, and distinguishing whether they belong to the same or different classes. This approach facilitates the model's ability to generalize from minimal data.  
The few-shot learning dataset is divided into three parts: training dataset, support set, and query set. The training dataset is the dataset for model training, each pair of samples in this set is composed of data from the same or different categories, and it does not intersect with the support set and the query set, as shown in Equation (3) [38].  
\[T=\{(X_{\text{u}},X_{\text{v}}),P(X_{\text{u}},X_{\text{v}})\}\text{ and }u,v=1\dots h \tag{3}\]  
where \((X_{\text{u}},X_{\text{v}})\) are the sample pairs in the training dataset and \(P(X_{\text{u}},X_{\text{v}})\) is the sample pair's similarity probability. The similarity probability for samples of the same category is 1, while the similarity probability for samples of different categories is 0. \(h\) is the number of training samples.  
The support set is used to compare the test sample. This set typically consists of samples from various classes, each with only a minimal number of samples. These samples primarily assist the model in predicting classes, as shown in Equation (4) [38].  
\[S_{N-shot\ K-way}=\{(I_{\text{m}},L_{\text{k}})\},m=1\dots M,k=1\dots K \tag{4}\]  
where in \(N\)-shot \(K\)-way testing, the support set consists of \(M=N\times K\) number of samples, \(N\) is the shot representing the number of samples per category, and \(K\) is the way that denotes the number of categories in this set.  
The query set refers to the collection of test data samples for the model, as shown in Equation (5).  
\[Q_{test}=\left\{I_{q},q\in\mathbb{R}\right\} \tag{5}\]  
where \(I_{q}\) are test data samples from classes in the support set and \(q\) is the number of image samples.  
The fault diagnosis process using the residual VGG-based Siamese network proposed in this study is structured into three main stages: dataset preparation, model training, and model testing. The dataset preparation stage encompasses two steps. Initially, time-domain signals are converted into time-frequency images through CWT transformation. Subsequently, pairs of samples are randomly selected as model input; these samples are labeled as belonging to the same or different classes based on their actual labels. During the model training stage, the model learns to distinguish between samples of the same class and different classes. The specific model architecture and loss function enable effective learning even with a minimal number of training samples. The details of the model architecture and the training algorithm are extensively discussed in Sections 4.1-4.4. During the model testing stage, N samples are randomly selected from the training dataset, encompassing both healthy state data and four fault types. These samples are tested against each other to assess the model's performance. The classification of the test samples is determined based on the probabilities predicted by the model. The classification results for different shots are then analyzed in the experimental cases.