Smile recognition is a very important topic in image processing and deep learning, and has a certain practical significance. At present, existing datasets tend to have simple backgrounds or imbalanced ethnicities. And researchers need to build convolutional neural networks empirically. To address these problems, we first construct a comprehensive dataset which contains 10,392 images of four major races (i.e., White, Asian, American Native or Pacific Islander, and Black or African American) in complex backgrounds. Our dataset exhibits larger variations in background, illumination, and ethnicity. And then, we apply Bayesian neural architecture search algorithm to automatically build the optimal convolutional network architecture and perform model training. The network architecture can be repeatedly searched and optimized through Bayesian optimizer in the specified time. Through the comparisons of experimental data, the performance of our network is better than those of the classical networks.