A novel unilaterally excited electromagnetic acoustic transducer (EMAT) is proposed as a solution to address the challenge of weak electromagnetic ultrasonic detection signals being susceptible to interference from clutter noise signals. EMAT employs Halbach permanent magnet array (HPMA) structure and a coil designed based on Huygens superposition principle. This design enables the generation and reception of highly directive Rayleigh surface waves in aluminum plates. To enhance the operational efficiency of EMAT while maintaining a high level of directivity for surface waves, a penalty function is implemented in COMSOL Multiphysics for the topological optimization of EMAT. The objective function in this optimization process is based on covariance (COV) of the magnetic induction intensity. The research results suggest that the homogeneity of the magnetic induction intensity within the coil region is enhanced by 50 % following topological optimization compared to the original design. The energy conversion efficiency of EMAT is enhanced by 5 times compared to traditional designs. The surface wave speed was determined to be 2631 m/s when measured at a frequency of 400 kHz. The value indicates a relative error of 6.37 % in comparison to the theoretical speed. The results indicate that EMAT has the capability to generate high-directional and pure Rayleigh waves.