This study evaluates the performance of two convolutional neural networks (CNNs) in a brain-machine interface (BMI) based on motor imagery (MI) by using a small dataset collected from five participants wearing a lower-limb exoskeleton. To address the issue of limited data availability, transfer learning was employed by training models on EEG signals from other subjects and subsequently fine-tuning them to specific users. A combination of common spatial patterns (CSP) and linear discriminant analysis (LDA) was used as a benchmark for comparison. The study's primary aim is to examine the potential of CNNs and transfer learning in the development of an automatic neural classification system for a BMI based on MI to command a lower-limb exoskeleton that can be used by individuals without specialized training.Clinical Relevance- BMI can be used in rehabilitation for patients with motor impairment by using mental simulation of movement to activate robotic exoskeletons. This can promote neural plasticity and aid in recovery.