Hand gesture recognition has many valuable applications in engineering and health care. This study proposes a novel model which can accurately distinguish hand gestures using forearm muscles' surface electromyogram (sEMG) signals. A deep learning algorithm with hyper parameters impacting the final model’s accuracy and a convolutional neural network (CNN) were employed in the recognition stage. The number of convolutional layers, kernels per layer, and neurons in the dense layer were selected for optimization, while the remaining parameters, such as the learning rate, batch size, and number of epochs, were chosen based on trial and error and prior knowledge. The optimal values for the selected hyperparameters were obtained using a genetic algorithm to achieve maximum recognition accuracy. The UC2018 Dual-Myo database was used for training and testing the model based on EMG signals characterizing the activity of eight different hand gestures. The final structure of the model consisted of two convolutional layers with 131 and 28 kernels, a dense layer with 111 neurons, and a softmax layer with eight neurons. Upon optimizing the hyperparameters using the genetic algorithm, the accuracy of the proposed model increased from 91.86% to 96.4% at best and 95.3% on average in real-time applications and 99.6% in an offline mode. Future work is warranted towards improving the architecture and the computational cost.