Optimizing the combustor geometry of micro thermophotovoltaic system can improve combustion conditions of the fuel and performance of the system. To accelerate the optimization process, a novel technique is proposed in this work by combining numerical simulation and machine learning. The influences of combustor geometric parameters on flame shape, wall temperature and combustor performance are investigated via numerical simulations which have been validated by experiment. Results show the length and diameter of inlet passage are important factors in affecting the flame shape. Also, all geometric parameters have great impacts on the performance of combustor. The data from simulations are then used to train the artificial neural network and the output of the network is compared with the simulations to determine whether the optimization is successful. Finally, the radiation power of combustor is optimized to 34.51 W from its initial value of 24.8 W using only 197 data samples.