Experimental Setup
To minimize environmental noise interference, four terrain types were constructed in a sealed indoor environment: concrete, gravel, sand, and carpet, as shown in
Figure 7. The robot traversed each terrain using a consistent diagonal walking gait. IMU and joint encoder data were recorded via remote connection to the perception host, while audio data was captured by microphones attached at the foot end.
For each terrain, 400 s of sensor data were collected, with IMU and joint encoder signals sampled at 50 Hz, yielding 20,000 data points per terrain. To avoid data leakage from future information during model training, we adopted a strict time-series partitioning scheme. The data were manually split into training and test sets in an 8:2 ratio according to temporal order, such that the training set contained only earlier samples and the test set contained only later samples. This strategy effectively prevents test data from leaking into the training process and ensures that the evaluation results reflect the true generalization performance of the model.
As shown in
Figure 8 and
Table 2, the overall classification accuracy across the four terrain types is 78.28%. The highest accuracy is achieved on concrete surfaces, whereas misclassifications are particularly pronounced for gravel and sand. In addition, substantial confusion occurs between gravel and carpet. These errors likely arise from the predominantly flat experimental sites and from data being collected with the robot executing the same gait across terrains. Under such conditions, distinctive acoustic signal characteristics can provide complementary cues for terrain identification. We observe that during robot locomotion, foot–ground interactions generate markedly different vibration and sound patterns on different terrains: gravel surfaces produce strong high-frequency vibration noise, whereas sandy surfaces yield a softer, more muffled response.
As shown in
Figure 9, the four terrain types exhibit distinct differences in their sound-frequency responses. For concrete, most spectral energy is concentrated below 1000 Hz, with the maximum amplitude occurring in the 0–50 Hz band. This indicates a strong interaction with low-frequency signals. The spectral energy gradually decreases as frequency increases, leading to a relatively smooth ground-vibration response. The spectrum for gravel also shows high energy at low frequencies, but its overall energy distribution is more uniform than that of concrete. Unlike concrete, which exhibits a pronounced dip followed by a rise in the mid-frequency range and thus maintains a secondary peak around 500 Hz, gravel does not show this resonance-like characteristic. Instead, its porous and irregular structure leads to rapid absorption and scattering-induced attenuation of the signal, together with weaker reflection at higher frequencies. Similarly to gravel, sand has an irregular surface, but its particles are much smaller and its very high porosity causes stronger absorption of incident sound. Around 0 Hz, the spectral amplitude for sand is markedly lower than that for gravel. For carpet, the spectrum reflects its superior sound-absorbing capability compared with the other three terrains: the energy of the sound waves remains relatively low over all frequencies, and the strong damping causes progressive energy loss during propagation. The waves are continuously scattered and absorbed by the soft, irregular carpet surface, resulting in a generally low-amplitude spectrum in which the portion above a given magnitude threshold occupies only a narrow frequency band.
To improve the performance of the SVM-based terrain classification model, we incorporate acoustic features as additional input signals. Although the original WAV recordings preserve the full waveform information, directly using the 8 kHz time-domain samples may introduce substantial redundancy and increase sensitivity to noise and minor temporal misalignments. Moreover, while the waveforms from different terrains can appear visually similar, their spectral characteristics differ more distinctly. Therefore, we employ the short-time Fourier transform (STFT) to obtain a time–frequency representation and extract spectral features.
We then compute Mel-frequency cepstral coefficients (MFCCs) from the spectra. The use of the Mel filter bank is perceptually motivated. However, in our setting its main benefit is that it performs a non-uniform frequency aggregation that emphasizes low-frequency structures and yields a smoother approximation of the spectral envelope. This reduces sensitivity to small frequency shifts and high-frequency fluctuations that may arise from environmental disturbances or sensor noise. In addition, the logarithmic compression of Mel-band energies mitigates amplitude variability caused by changes in contact intensity and microphone gain, and the subsequent discrete cosine transform (DCT) decorrelates the log-Mel features and provides a compact representation. Overall, this MFCC pipeline reduces feature redundancy while preserving terrain-discriminative contact patterns, which contributes to improved robustness and generalization for robotic audio-based terrain classification. The extraction process is expressed as follows:
where
is the
-th MFCC,
is the number of Mel filters,
is the
-th Mel-band energy, and
denotes the cosine basis function of the DCT. The first 13 MFCCs are used as audio features. To obtain a suitable spectrum for analysis and ensure signal continuity, the audio signal is segmented into overlapping frames using a Hamming window. Each frame has a duration of 25 ms with a 10 ms frame shift, resulting in MFCC features at 100 Hz. To match the 50 Hz sampling rate of the IMU and joint encoder signals, every two consecutive MFCC frames are averaged, yielding audio MFCC features at 50 Hz. Following the same model-training procedure as described above, the entire dataset is split into training and test sets in an 8:2 ratio. The split is performed manually in temporal order to prevent temporal data leakage between the training and test sets. The resulting confusion matrix is shown below in
Figure 10.
The confusion matrix illustrates the class-wise prediction results of the proposed multimodal model, showing the distribution of correct and incorrect classifications across terrain types. However, the model still struggles to distinguish between gravel (Class 1) and sand (Class 2). The detailed performance metrics are summarized in
Table 3.
Both the figure and the table show that, although incorporating audio signals increases the overall classification accuracy from 78.28% to 82.52%, there is still considerable room for improvement in distinguishing gravel, sand, and carpet surfaces.
To optimize the model’s classification performance, we next evaluate multiple combinations of the two key SVM hyperparameters,
and
. The SVM classifier is initially configured with
and
. Following the exponential grid-search strategy for
and
proposed by Hsu et al. [
21]., we explore two exponential levels above and below these initial values. The resulting search range is defined as follows:
Additionally, we observed that the spectral differences among the four terrain types primarily appear in the low-to-mid frequency range. In our current SVM classification model, the Hamming window width is set to
, whereas the robot’s step cycle during data acquisition is approximately
. We hypothesize that a 0.04 s audio window may be too short to capture complete frequency-domain characteristics. Therefore, for the Hamming window width
, we designed ten experimental settings ranging from 0.1 s to 1 s. This configuration allows us to capture at least five frames and at most one full gait cycle of signal features, enabling us to examine their effect on the final classification accuracy. The window width settings are as follows:
After training the SVM terrain classification model with the above parameter combinations, we obtained the corresponding classification accuracy comparison figure, as shown below in
Figure 11.
A comparison of the five plots shows that when the penalty factor is small, the model is subject to stronger regularization constraints. The decision boundary becomes relatively smooth, but underfitting is more pronounced, leading to lower overall accuracy. As increases, the model’s tolerance for training errors decreases. When or , the classification accuracy improves. However, when reaches 100, especially for , the model exhibits clear overfitting tendencies, and the accuracy decreases, as reflected by large fluctuations in the histogram heights.
For the parameter , when or , the kernel function induces a relatively smooth mapping, forming a wide decision boundary in the feature space. This yields high overall accuracy and a stable distribution trend. Under these values, the accuracy differences among various combinations of and window length are small, indicating strong model generalization. When exceeds 1, however, the histograms exhibit severe fluctuations, and the accuracy drops sharply for certain parameter combinations—particularly for short window lengths (0.1–0.3 s) and large —revealing pronounced overfitting. This reduces generalization capability and can cause a pronounced performance drop. Therefore, under our experimental setting, smaller values of are generally preferred to obtain smoother and more robust classification results.
With respect to the time window , as the window length increases from 0.1 s to 1.0 s, the model accuracy shows an overall increasing trend. Shorter windows (0.1–0.3 s) fail to adequately capture feature variations within a single gait cycle, resulting in insufficient temporal information in each input segment and reduced stability of the classification decisions. The specific accuracy values are listed in the following tables.
Table 4,
Table 5,
Table 6,
Table 7 and
Table 8 indicate that the system achieves its highest accuracy of 99.53% when the hyperparameters are set to
,
, and a window length
.