In order to improve the performance of a transonic centrifugal compressor stage, non-axisymmetric endwall profiling optimization was conducted for the diffuser under design condition, Artificial Neural Network (ANN) and Genetic Algorithm (GA) were used to execute the optimization with the objective of maximizing the isentropic efficiency of the compressor stage. The influence mechanism of non-axisymmetric endwall profiling on flow field and performance was discussed. Results show non-axisymmetric endwall profiling is an effective way to significantly reduce the flow loss in the diffuser. The total pressure loss of the diffuser decreases by 9.31% and 20.29% for NA0.70 and NA1.40 respectively. The profiled endwall suppresses the flow separation through accelerating the low-energy flow and reducing lateral pressure gradient. The corresponding high vorticity within the flow separation zone is reduced, which delays the formation and development of the flow separation. The diffuser becomes more fore-loaded, the overall blade loading is not affected, and the pressure ratio of the compressor stage is improved as well. At the outlet of the diffuser, the more uniform flow angle and much lower total pressure loss along spanwise are obtained. However, the backflow with high velocity gathering near the shroud of the diffuser makes the mass flow rate decrease and easily induce the stall, which results in the smaller operating range for both profiled endwall.