The control of active prostheses and orthoses requires the precise classification of instantaneous human activity and the detection of specific events within each activity. Furthermore, such classification helps physiotherapists, orthopedists, and neurologists in kinetic/kinematic analyses of patients’ gaits. To address this need, we propose an innovative deep neural network (DNN)-based approach with a two-step hyperparameter optimization scheme for classifying human activity and gait events, specific for different motor activities, by using the ENABL3S dataset. The proposed architecture sets the baseline accuracy to 93% with a single hidden layer and offers further improvement by adding more layers; however, the corresponding number of input neurons remains a crucial hyperparameter. Our two-step hyperparameter-tuning strategy is employed which first searches for an appropriate number of hidden layers and then carefully modulates the number of neurons within these layers using 10-fold cross-validation. This multi-class classifier significantly outperforms prior machine learning algorithms for both activity and gait event recognition. Notably, our proposed scheme achieves impressive accuracy rates of 98.1% and 99.96% for human activity and gait events per activity, respectively, potentially leading to significant advancements in prosthetic/orthotic controls, patient care, and rehabilitation programs’ definition.