# Federated Few-Shot Learning-Based Machinery Fault Diagnosis in the Industrial Internet of Things
## 3 Preliminary and Problem Definition
### Few-Shot Learning  
The few-shot learning approach primarily leverages auxiliary sets from the source domain to extract knowledge, aiding in model training using a given few-shot support set in the target domain. As illustrated in Figure 2, the source domain (auxiliary set) consists of a substantial amount of labeled data, with a label space that does not intersect with that of the target domain. One approach to utilizing the source domain data involves the random selection of a series of few-shot learning tasks, adhering to the configuration of the target domain training set (support set). Specifically, each task comprises \(N\) categories, and within each category, \(K\) samples are included (referred to as \(N\)-way, \(K\)-shot). Prior knowledge is extracted from the interaction between these tasks and the model to enhance performance in the target domain, establishing an episodic training mechanism. Each few-shot learning task is treated as an episodic scenario, and the overall process can be viewed as meta-learning, as learning takes place at the task level rather than the data level.  
\begin{table}
\begin{tabular}{p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt}} \hline \hline \multicolumn{1}{c}{**Methods**} & \begin{tabular}{c} **Labeled** \\ **Samples** \\ \end{tabular} & \begin{tabular}{c} **Source** \\ **Domain** \\ \end{tabular} & \begin{tabular}{c} **Privacy** \\ **Protection** \\ \end{tabular} & \begin{tabular}{c} **Personalization** \\ \end{tabular} \\ \hline \multirow{2}{*}{Deep Learning} & CNN, DBN, LSTM etc. [16; 17; 18; 19; 20] & Large & Single source & \(\times\) & \(\times\) \\ \hline \multirow{4}{*}{Few-shot Learning} & Data-based [21; 22; 23; 24] & Few & Single source & \(\times\) & \(\times\) \\ \cline{2-5}  & Model-based [25; 26; 27] & Few & Single source & \(\times\) & \(\times\) \\ \cline{2-5}  & Algorithm-based [28; 29; 30; 11; 12] & Few & Single source & \(\times\) & \(\times\) \\ \hline \multirow{2}{*}{\
\begin{tabular}{c} Federated Learning \\ \end{tabular} } & [31; 32; 33; 34; 35] & Some & Multi-source & ✓ & \(\times\) (Same weight to all source domains) \\ \hline \multirow{2}{*}{
\begin{tabular}{c} **Federated Few-Shot Learning** \\ \end{tabular} } & \multirow{2}{*}{**FedCDAE-MN (Ours)**} & \multirow{2}{*}{**Few**} & \multirow{2}{*}{**Multi-source**} & \multirow{2}{*}{✓} & \(\bigvee\) **(Different weight for each source domain)** \\ \cline{1-1} \cline{4-4}  & & & & & \\ \hline \hline \end{tabular}
\end{table}
Table 1: Methods comparison for machinery fault diagnosis.  
In the field of small sample learning, two primary branches currently exist based on the forms of knowledge extracted from auxiliary tasks: metric-based meta-learning and optimization-based meta-learning. The metric-based meta-learning model aims to acquire a unified feature space that is independent of classes, ensuring that the intra-class distance between samples is smaller than the inter-class distance. Classification of a query sample is determined based on its distance from each supporting sample in the learning space. On the other hand, the optimized meta-learning model incorporates additional trainable models (meta models) to perform parameter updates on the primary model. The meta-model can be fine-tuned using the limited support set in the target domain to classify samples within the query set.