The thermal reflow process is widely used in microlens array fabrication. However, the resulting arrays are commonly criticized for their low fill factor. In this work, caulking is applied to fill the gaps between adjacent lenses. The experimental results prove that a gapless microlens array with a 100% fill factor could be successfully produced and the caulking time precisely controlled. Furthermore, an artificial neural network and genetic algorithm are used to achieve high quality using the thermal reflow and caulking. The L18 orthogonal array is used as the learning data for the artificial neural network to construct a system model that could predict the results (e.g., S/N, focal length, and roughness) for arbitrary parameter settings. The genetic algorithm is then applied to obtain the optimal parameter settings. The major objectives in using the optimal design are to reduce the variation in the focal length and the surface roughness for a microlens array. This allows improved focus and enhanced illumination brightness. The results show that microlens array quality could be significantly improved in comparison with the original design.