This study introduces a novel approach for road accident classification using a Capsule Recurrent Neural Network (CapRNN) combined with an Improved Reptile Search Algorithm (IRSA) for feature selection. Unlike traditional recurrent neural networks that struggle with long-term dependencies, the CapRNN architecture integrates capsules to better capture spatial hierarchies and relationships in the accident data. The IRSA improves the feature selection process through its meta-learning capabilities, allowing for more efficient identification of relevant predictors compared to standard optimization techniques. An extensive preparation method, including the management of missing values, data normalization, and one-hot encoding of categorical variables, ensures a robust dataset for modeling. Model assessment is performed using essential performance metrics: accuracy, precision, recall, and F1-score. The findings indicate that CapsNet, especially when integrated with feature selection, significantly improved then other models, with an accuracy of 96% and an area under the curve (AUC) of 0.97, underscoring its capacity to reduce misclassifications and improve predictive efficacy. In comparison, the LSTM and Bi-LSTM models, albeit successful, do not attain the improved classification capabilities of CapsNet. The results highlight the essential role of feature selection in improving the model performance and provide significant insights for traffic safety and management techniques. This study advances the growing field of machine learning applications in the analysis and prevention of traffic accidents.