# A Few-Shot Learning-Based Material Recognition Scheme Using Smartphones
## 4 Few-Shot Learning-Based Material Recognition
### Data Augmentation
 } & \multirow{3}{*}{Average} & \(X\)-axis & \(-0.008882\) & \(0.000184\) & \(-0.001446\) & \(-0.008727\) & \(0.000613\) \\  & & \(Y\)-axis & \(0.004422\) & \(0.001439\) & \(0.004802\) & \(0.001380\) & \(0.004385\) \\  & & \(Z\)-axis & \(0.000602\) & \(0.000845\) & \(0.002273\) & \(-0.000859\) & \(0.000838\) \\ \cline{2-8}  & \multirow{3}{*}{Max} & \(X\)-axis & \(0.025790\) & \(0.059895\) & \(0.036289\) & \(0.085450\) & \(0.028937\) \\  & & \(Y\)-axis & \(0.048728\) & \(0.034102\) & \(0.040494\) & \(0.051139\) & \(0.047338\) \\  & & \(Z\)-axis & \(0.113164\) & \(0.151749\) & \(0.135862\) & \(0.180153\) & \(0.119132\) \\ \cline{2-8}  & \multirow{3}{*}{Min} & \(X\)-axis & \(-0.041900\) & \(-0.057658\) & \(-0.038760\) & \(-0.095913\) & \(-0.034055\) \\  & & \(Y\)-axis & \(-0.034162\) & \(-0.032984\) & \(-0.031085\) & \(-0.029767\) & \(-0.038931\) \\  & & \(Z\)-axis & \(-0.103663\) & \(-0.143733\) & \(-0.134073\) & \(-0.153780\) & \(-0.116957\) \\Figure 4 illustrates portions of vibration data collected when the smartphone's position was changed on the same object. While the overall waveforms remained largely unchanged, slight variations in amplitude were observed. Generally, the amplitude of the \(Y\)-axis was the smallest, while the \(Z\)-axis amplitude was the largest. The \(Z\)-axis amplitude showed relatively consistent behavior, whereas the \(X\)-axis amplitude exhibited more significant variations in some cases. Based on these observations, data augmentation was implemented through scaling, where the amplitudes of the \(X\)-, \(Y\)-, and \(Z\)-axes were adjusted within random ranges as follows. For the \(X\)-axis, which exhibited larger amplitude variations with position changes, the amplitude was scaled by a factor randomly chosen between 0.5 and 1.5. For the \(Y\)- and \(Z\)-axes, which showed smaller variations, the amplitude was scaled by a factor randomly chosen between 0.8 and 1.2. All adjustments were made with uniform probabilities within the specified ranges. The results of the augmented data after applying scaling are shown in Figure 5.  
In the FSMR system, data augmentation plays a crucial role in enhancing the performance and practicality of the few-shot learning model. The process is based on the observation that vibration signals generated when a smartphone contacts the same material exhibit similar waveforms with slight variations in amplitude. This behavior is influenced by whether the material vibrates along with the smartphone (e.g., desks or drawers) or remains stationary (e.g., sofas or blankets), as well as the position of the smartphone on the  
Figure 4: Accelerometer data collected with the smartphone placed on a blanket. (**a**) Data collected on the blanket. (**b**) Data collected at a different position on the same blanket. Figure 5: Accelerometer data collected with a smartphone placed on a blanket. (**a**) Original data. (**b**) Augmented data by applying scaling to the original data. material. To leverage these characteristics, data augmentation is performed by adjusting the amplitude of the vibration signals collected through the smartphone's accelerometer. The amplitude scaling process is mathematically defined as follows:  
\[A^{\prime}_{X}=A_{X}\cdot r_{X},\ \ \ A^{\prime}_{Y}=A_{Y}\cdot r_{Y},\ \ \ A^{\prime}_{Z}=A_{Z}\cdot r_{Z} \tag{3}\]  
where \(A_{X},A_{Y},A_{Z}\) represent the original amplitudes of the vibration signals, and \(r_{X},r_{Y},r_{Z}\) are scaling factors randomly sampled from the following ranges:  
\[r_{X}\sim U(0.5,\ 1.5),\ \ \ r_{Y}\sim U(0.8,\ 1.2),\ \ \ r_{Z}\sim U(0.8,\ 1.2) \tag{4}\]  
As a result, \(A^{\prime}_{X}\), \(A^{\prime}_{Y}\), \(A^{\prime}_{Z}\) are the augmented amplitudes. This data augmentation process is utilized during both the training and testing phases to enhance the few-shot learning model's performance. During training, it prevents overfitting by generating diverse tasks using both the raw data collected via smartphones and the augmented data. This process improves the model's ability to generalize effectively.