
Machine Learning-Based Knock Localization Using Piezoelectric Array Signals for Human-to-Things Interfaces
ⓒ The Korean Sensors Society
This is an Open Access article distributed under the terms of the Creative Commons Attribution Non-Commercial License(https://creativecommons.org/licenses/by-nc/3.0/) which permits unrestricted non-commercial use, distribution, and reproduction in any medium, provided the original work is properly cited.
Abstract
This study proposes a machine learning-based knock localization system for human-to-thing interfaces employing elastic wave signals captured by a piezoelectric array. Eight sensors were symmetrically arranged on a plastic plate, and the relative arrival-time differences of the elastic waves were extracted as the primary features for classification. Unlike conventional approaches, which rely on prior knowledge of elastic wave propagation speed and assume material homogeneity, the proposed method overcomes these limitations and enables real-time applicability through a simplified pipeline. Knock data were collected from nine spatial zones under both intra-subject and inter-subject conditions. In the intra-subject evaluation, where training and testing were conducted on data from the same subject, the ensemble classifier achieved perfect performance across all metrics (accuracy, precision, recall, and F1 score = 1). When evaluated on data from three previously unseen subjects, the model maintained high accuracy (accuracy = 0.957), demonstrating strong generalization to user variability. These findings confirm the robustness and practicality of the proposed system, particularly in application domains where conventional touch sensors are unsuitable, such as in smart windows and automotive panels.
Keywords:
Knock localization, Piezoelectric array, Elastic wave, Machine learning, Human-to-Things interface1. INTRODUCTION
The increasing demand for more intuitive and efficient human-to-things (H2T) interaction has accelerated the advancement of advanced user input methods. Touchscreen technologies, including capacitive, resistive, surface acoustic wave (SAW), and infrared-based sensing, are extensively employed across various sectors, such as consumer electronics, automotive, and healthcare [1,2].
Concurrently, significant research has been devoted to impact localization and structural health monitoring by leveraging the physical response of materials, particularly through elastic wave propagation [3-6]. More recently, studies have explored the use of elastic waves generated by everyday structural interactions, such as knocks, to detect impact locations on flat panels for interactive interfaces [7,8].
Among the various sensing technologies employed for touch and knock interfaces, including capacitive, resistive, and infrared, piezoelectric sensors offer key advantages, such as high sensitivity to mechanical impact, low power consumption, and the capability to detect subtle elastic wave propagation across solid materials. These characteristics make piezoelectric arrays particularly well-suited for knock-based interaction on non-conventional surfaces such as plastic or glass panels, motivating their adoption in this study.
Conventional elastic wave-based localization techniques, however, generally require precise prior knowledge of wave propagation speed, which is determined by material properties such as Young’s modulus and density, and are valid only under the assumption of material homogeneity. Such constraints, combined with computationally demanding operations such as beamforming, limit the scalability of real-time applications. In addition, variations in user behavior, including knock strength, angle, and contact duration, introduce signal inconsistencies, necessitating user-specific calibration and thereby undermining system robustness.
To overcome these limitations, this study introduces a machine learning-driven approach to knock localization, which eliminates the need for prior knowledge of the medium's mechanical properties. The method leverages elastic wave signals captured by a piezoelectric sensor array and extracts relative arrival-time differences as input features for classification.
The proposed system was evaluated under both intra-subject (training and testing on the same subject) and inter-subject (training on one subject and testing on different subjects) conditions to assess its generalization performance. The experimental results demonstrate the effectiveness of machine learning techniques for enabling robust knock-based input systems in smart interface applications, particularly in scenarios where conventional touch sensors are unsuitable.
2. METHODOLOGY
Fig. 1 illustrates the overall architecture of the proposed knock localization system, which integrates a piezoelectric sensor array with a machine learning-based classification pipeline. The following subsections describe the experimental setup, data acquisition, signal preprocessing, classification methods, and model evaluation procedures.
Schematic of the knock localization system utilizing a piezoelectric array and machine learning pipeline.
2.1 Experimental Setup
The experimental system consisted of a 400 mm × 400 mm × 5 mm plastic plate serving as the medium for elastic wave propagation (see Fig. 2). Eight piezoelectric sensors (Murata 7BB-20-6L0) were symmetrically arranged in a regular octagonal formation to capture the elastic waves generated by knock impacts. The interaction region was defined as a 150 mm × 150 mm square centered within the sensor arrangement. This region was divided into a 3 × 3 grid, yielding nine uniquely labeled zones.
Experimental setup: (a) Photograph of the hardware configuration, including the plastic panel and DAQ connection, and (b) sensor layout illustrating the octagonal piezoelectric array and 3 × 3 knock zones.
Sensor signals were collected using a data acquisition device (Keysight U2331A) operating at a sampling rate of 50 kSa/s. Each knock event was recorded within a 0.1 s window, yielding 5,000 samples per sensor and 40,000 data points per event.
2.2 Data Collection
To construct the training dataset, a single participant performed 20 knock actions within each of the nine predefined zones, yielding 180 labeled knock samples. For performance evaluation, two distinct testing datasets were prepared. The first consisted of an additional 180 samples collected under identical conditions from the same participant, enabling intrasubject validation. The second dataset, designed for inter-subject evaluation, comprised 540 samples obtained from three different participants, each contributing 180 samples while following the same knock protocol.
2.3 Preprocessing
To extract meaningful features from the raw time-domain signals and reduce computational complexity, a signal preprocessing step was applied. For each recorded knock, the system identified the first major peak in the waveform captured by each sensor. Using the signal from Sensor 1 (S1) as a temporal reference, the arrival-time differences (Δti) for the remaining sensors (i = 2,..., 8) were computed as:
This procedure yielded an eight-dimensional feature vector for each knock event, representing the relative timing of elastic wave arrivals across the sensor array. Fig. 3 presents example waveforms obtained from a knock on Zone 1. As expected, the results show that sensors located farther from the impact site registered the elastic wave later, reflecting the distance-dependent propagation delay.
2.4 Classification Models
To classify knock locations from the extracted time-difference features, four supervised machine learning algorithms were evaluated using MATLAB's Classification Learner Toolbox [9]. The models considered included: (a) k-nearest neighbors (KNN), (b) decision tree, (c) support vector machine (SVM), and (d) an ensemble method based on subspace discriminant learning.
For the KNN model [10], the fine KNN variant was employed with k set to 1, using Euclidean distance and uniform weighting. As a non-parametric, instance-based learning algorithm, KNN classifies a new sample by comparing it with its nearest neighbors in the feature space. This property makes it particularly effective for sensor data exhibiting clear local patterns.
The decision tree model [11,12] was implemented as a fine tree with a maximum of 100 splits, using the Gini diversity index as the splitting criterion. This rule-based approach recursively partitions the feature space through simple decision rules derived from the input features. As a result, it produces interpretable and hierarchical decision paths, with each terminal node assigned to a single class.
The SVM classifier [13-15] employed a polynomial kernel of degree 3 to accommodate potential non-linear decision boundaries. SVM operates by maximizing the margin between classes, relying exclusively on support vectors, i.e., critical data points located near the boundary. This characteristic makes it particularly suitable for high-dimensional or limited datasets.
The ensemble classifier [16,17] was constructed using 30 learners, each trained on a randomly selected subset of four features from the total of eight features. Final predictions were obtained by aggregating the outputs from all learners. This ensemble approach, based on the subspace discriminant ensemble method, enhances robustness by leveraging model diversity, thereby reducing overfitting and improving generalization in the presence of noise or user variability.
2.5 Evaluation
To evaluate the classification performance of the proposed system, a five-fold cross-validation procedure was implemented. In this process, the dataset was randomly partitioned into five equally sized folds, with careful consideration to ensure that each fold contained a balanced representation of all nine knock zones. During each iteration of the procedure, one fold was designated as the validation set, whereas the remaining four folds were utilized for training the model. This process was repeated across all five folds, and the results obtained from each iteration were averaged to produce robust and reliable performance estimates. For evaluation, four widely adopted metrics, namely, accuracy, precision, recall, and F1 score, were employed, thereby providing a comprehensive comparison of performance across different classifiers.
3. RESULTS AND DISCUSSIONS
This section presents the classification results under both intra-subject and inter-subject conditions, followed by an analysis of the performance of each classifier.
3.1 Intra-subject Evaluation
When the system was trained and tested using knock data from the same individual, all four classifiers demonstrated strong performance. Notably, the ensemble model achieved perfect classification results, with accuracy, precision, recall, and F1 score all reaching 1. This result indicates that knock behavior within a single user is highly consistent and that the extracted time-difference features possess sufficient discriminative capability for reliable zone classification.
Fig. 4 presents the confusion matrices for each classifier in the intra-subject evaluation, demonstrating strong diagonal dominance, which is indicative of highly accurate predictions. Table 1 summarizes the corresponding performance metrics, confirming that even relatively simple classifiers such as KNN and decision trees can achieve near-perfect accuracy under these controlled conditions.
Confusion matrices of intra-subject classification results using KNN, decision tree, SVM, and ensemble classifiers.
3.2 Inter-subject Evaluation
In the inter-subject evaluation, the classifiers were tested on knock data collected from three participants who were not included in the training phase. As anticipated, overall classification accuracy declined across all methods owing to variations in knock characteristics such as strength, finger angle, and contact duration. These behavioral differences introduce shifts in the time-difference features extracted from the sensor signals.
Despite this variability, the ensemble model maintained strong performance, achieving an accuracy of 0.957 and outperforming all other classifiers. The decision tree classifier also produced competitive results, likely owing to its capacity to model non-linear feature partitions and adapt to user-level variability. Similarly, the SVM model with a third-degree polynomial kernel performed comparably well.
In contrast, the KNN classifier demonstrated the lowest robustness under inter-subject conditions. Its dependence on proximity within the feature space makes it particularly sensitive to inter-user variability, leading to less stable classification boundaries [18,19].
The confusion matrices for the inter-subject classification results are presented in Fig. 5, and the corresponding performance metrics are summarized in Table 2.
Confusion matrices of inter-subject classification results using KNN, decision tree, SVM, and ensemble classifiers.
4. CONCLUSIONS
This study proposed a knock localization method that exploits arrival-time differences of elastic wave signals measured by a piezoelectric sensor array. By incorporating machine learning, the approach eliminates the need for prior knowledge of the medium's mechanical properties and significantly reduces computational complexity compared to conventional techniques such as FFT and beamforming.
Experimental results revealed that the system achieved perfect classification performance in intra-subject evaluations, confirming the high consistency of knock signal patterns within the same user. Moreover, the model maintained strong performance under inter-subject conditions, with the ensemble classifier exhibiting the most robust generalization performance across different users.
These findings highlight the practical potential of the proposed knock-based interface, particularly in scenarios where conventional touch sensors, such as capacitive or optical systems, are challenging to implement—for example, in smart windows and automotive panels. Future research will aim to extend this work by exploring more complex conditions, such as multiple simultaneous knocks, increased environmental noise, and deployment on non-flat or non-uniform surfaces, to further evaluate its real-world applicability.
Acknowledgments
This research was supported by the MSIT (Ministry of Science and ICT), Korea, under the ICAN (ICT Challenge and Advanced Network of HRD) program (IITP-2025-RS-2024-00436500) supervised by the IITP (Institute for Information & Communications Technology Planning & Evaluation), and by the 2025 Sabbatical Year Program of Soonchunhyang University.
References
-
A. Nathan, S. Gao, Interactive Displays: The Next Omnipresent Technology, Proc. IEEE 104 (2016) 1503–1507.
[https://doi.org/10.1109/JPROC.2016.2582578]
-
G. Walker, A review of technologies for sensing contact location on the surface of a display, J. Soc. Inf. Disp. 20 (2012) 413–440.
[https://doi.org/10.1002/jsid.100]
-
V. Giurgiutiu, A. Cuc, Embedded non-destructive evaluation for structural health monitoring, damage detection, and failure prevention, Shock Vib. Dig. 37 (2005) 83–105.
[https://doi.org/10.1177/0583102405052561]
-
M. Demetgul, V.Y. Senyurek, R. Uyandik, I.N. Tansel, O. Yazicioglu, Evaluation of the health of rivet-d joints with active and passive structural health monitoring techniques, Measurement 69 (2015) 42–51.
[https://doi.org/10.1016/j.measurement.2015.03.032]
-
B. Soltannia, P. Mertiny, F. Taheri, Static and dynamic characteristics of nano-reinforced 3D-fiber metal laminates using non-destructive techniques, J. Sandw. Struct. Mater. 23 (2021) 3081–3112.
[https://doi.org/10.1177/1099636220924585]
-
P. Bonello, P.M. Hai, A receptance harmonic balance technique for the computation of the vibration of a whole aeroengine model with nonlinear bearings, J. Sound Vib. 324 (2009) 221–242.
[https://doi.org/10.1016/j.jsv.2009.01.039]
-
J.A. Paradiso, C.K. Leo, N. Checka, K. Hsiao, Passive acoustic knock tracking for interactive windows, Proceedings of the CHI '02 Extended Abstracts on Human Factors in Computing Systems, Minneapolis, USA, 2002, pp. 732–733.
[https://doi.org/10.1145/506443.506570]
-
S. Ha, A. Jang, K. Lee, S.-H. Son, Knock sensing and imaging from structural bending waves, ICT Express 8 (2022) 494–498.
[https://doi.org/10.1016/j.icte.2022.01.007]
- MathWorks, Statistics and Machine Learning Toolbox™ User's Guide, R2025a ed., The MathWorks, Natick, MA, 2025.
-
R.K. Halder, M.N. Uddin, M.A. Uddin, S. Aryal, A. Khraisat, Enhancing K-nearest neighbor algorithm: a comprehensive review and performance analysis of modifications, J. Big Data 11 (2024) 113.
[https://doi.org/10.1186/s40537-024-00973-y]
-
P.H. Swain, H. Hauska, The Decision Tree Classifier: Design and Potential, IEEE Trans. Geosci. Electron. 15 (1977) 142–147.
[https://doi.org/10.1109/TGE.1977.6498972]
-
M. Bramer, Principles of Data Mining, 3rd ed., Springer, London, U.K., 2016.
[https://doi.org/10.1007/978-1-4471-7307-6]
-
J. Cervantes, F. Garcia-Lamont, L. Rodríguez-Mazahua, A. Lopez, A comprehensive survey on support vector machine classification: Applications, challenges and trends, Neurocomputing 408 (2020) 189–215.
[https://doi.org/10.1016/j.neucom.2019.10.118]
-
A. Mathur, G.M. Foody, Multiclass and binary SVM classification: Implications for training and classification users, IEEE Geosci. Remote Sens. Lett. 5 (2008) 241–245.
[https://doi.org/10.1109/LGRS.2008.915597]
-
J.M. Moguerza, A. Muñoz, Support vector machines with applications, Stat. Sci. 21 (2006) 322–336.
[https://doi.org/10.1214/088342306000000493]
-
Y. Cao, T.A. Geddes, J.Y.H. Yang, P. Yang, Ensemble deep learning in bioinformatics, Nat. Mach. Intell. 2 (2020) 500–508.
[https://doi.org/10.1038/s42256-020-0217-y]
-
T.K. Ho, The random subspace method for constructing decision forests, IEEE Trans. Pattern Anal. Mach. Intell. 20 (1998) 832–844.
[https://doi.org/10.1109/34.709601]
-
N.S. Altman, An introduction to kernel and nearest-neighbor nonparametric regression, Am. Stat. 46 (1992) 175–185.
[https://doi.org/10.1080/00031305.1992.10475879]
-
Y. Zhang, G. Cao, B. Wang, X. Li, A novel ensemble method for k-nearest neighbor, Pattern Recognit. 85 (2019) 13–29.
[https://doi.org/10.1016/j.patcog.2018.08.003]


