Pattern Recognition Using Hybrid Optimization for a Robot Controlled by Human Thoughts