To improve the energy efficiency and output power of the piston compressed air engine (CAE), a mathematical model of its working process was set up. With the use of the MATLAB/Simulink software for simulation, the influences of the bore-to-stroke ratio, intake pressure and vaive lift on the performance of the engine were obtained for the analysis of the energy efficiency and the output power. Moreover, to optimize the energy efficiency of the engine with the given output power, an improved NSGA-II was introduced, and a series of optimization intake pressures and valve lifts was obtained. When the output power value is about 2 kW, the intake pressure and the intake valve lift can be set to 1.99 MPa and 9.99 mm, the energy efficiency is highest: 31.17%. Finally, that the improved NSGA-II is superior to NSGA-II in proximity and diversity has been proved. This research can be referred in the optimization of the piston CAE and provides a method for the energy efficiency optimization study.