Several motor imagery classification methods have been developed and achieve higher accuracy. Machine learning (ML) based algorithms utilizing manually designed features often encounter robustness issues, leading to diminished accuracy. While deep learning (DL) based algorithms exhibit promising accuracy, their extensive computational requirements present challenges in implementing them on portable devices, thereby restricting their practical applications. In this paper, we improve the ML-based algorithm's feature robustness problems by combining common spatial patterns with Riemannian tangent space mapping, enhancing the algorithm's feature quality. Furthermore, we introduce a method that utilizes the distance between data points and the SVM hyperplane to compute category scores, thereby enhancing classifier performance. Our experiment uses the BCI Competition IV 2A, BCI Competition III 3A, and a selfrecorded dataset for subject-specific experiments to validate the algorithm's classification performance. Experimental results show that the proposed algorithm achieves the best classification performance, with an accuracy of 78.55%, 83.33%, and 57.44% for BCI Competition IV 2A, BCI Competition III 3A, and the selfrecorded dataset. Additionally, to assess the practicality of a real-time portable application, we implemented the proposed algorithm on Raspberry Pi and Jetson Nano, measuring their computation time and peak memory usage. The results demonstrate that our algorithm necessitates only 0.08 to 0.3 seconds of computation time and employs a mere 15MB of memory.INDEX TERMS Electroencephalograph, motor imagery, common spatial pattern, Riemannian tangent space, filter banks, support vector machine.