Activity Recognition in MATLAB Using KNN

Main Article Content

Sneha B. Paymal, Mahadev S. Patil

Abstract

Activity recognition is a crucial task in machine learning, widely used in healthcare, sports analytics, and human-computer interaction. This study explores the implementation of K-Nearest Neighbors (KNN), a simple yet effective machine learning algorithm, to classify different human activities based on sensor data. The classification is performed using features extracted from accelerometer and gyroscope readings, which capture motion patterns associated with various activities. MATLAB is utilized as the development platform due to its powerful built-in functions for data preprocessing, feature extraction, model training, and evaluation. The workflow includes data normalization, feature selection, and applying the KNN algorithm to recognize activities such as walking, running, sitting, and standing. Performance evaluation is conducted using accuracy metrics and confusion matrices to assess the effectiveness of the model. The results demonstrate that KNN provides reliable classification performance with minimal computational complexity, making it suitable for real-time applications. Furthermore, tuning KNN parameters such as the number of neighbors and distance metrics enhances classification accuracy.

Article Details

Section
Articles