With the popularity of wearable devices, human behavior recognition technology is becoming increasingly important in social surveillance, health monitoring, smart home, and traffic management. However, traditional human behavior recognition methods rely too much on the subjective experience of managers in hyperparameter selection, resulting in an inefficient parameter optimization process. To address this problem, this paper proposes a long short–term memory (LSTM) neural network model based on a subtraction‐average–based optimizer (SABO) for human behavior recognition in wearable devices. Compared to the traditional method, the SABO–LSTM model significantly improves the recognition accuracy by automatically finding the optimal hyperparameters, which proves its innovation and superiority in practical applications. To demonstrate the effectiveness of the method, four evaluation metrics, including F1 score, precision, recall, and accuracy, are used to validate it on the UCI‐HAR dataset and the WISDM dataset, and control groups are introduced for comparison. The experimental results show that SABO–LSTM can accurately perform the human behavior recognition task with an accuracy of 98.84% and 96.37% on the UCI‐HAR dataset and the WISDM dataset, respectively. In addition, the experimental model outperforms the control model on all four evaluation metrics and outperforms existing recognition methods in terms of accuracy.