The ammonia synthesis reactor is the core unit in the whole ammonia synthesis production. The ammonia concentration at the ammonia converter outlet is a significant process variable, which reflects directly the production efficiency. However, it is hard to be measured reliably online in real applications. In this paper, a soft sensor based on BP neural network (BPNN) is applied to estimate the ammonia concentration. A modified group search optimization with nearest neighborhood (GSO-NH) is proposed to optimize the weights and thresholds of BPNN. GSO-NH is integrated with BPNN to build a soft sensor model. Finally, the soft sensor model based on BPNN and GSO-NH (GSO-NH-NN) is used to infer the outlet ammonia concentration in a real-world application. Three other modeling methods are applied for comparison with GSO-NH-NN. The results show that the soft sensor based on GSO-NH-NN has a good prediction performance with high accuracy. Moreover, the GSO-NH-NN also provides good generalization ability to other modeling problems in ammonia synthesis production.