Artificial neural networks (ANNs) in conjugation with genetic algorithms (GAs) have been demonstrated to be an effective tool for system modelling and optimization in a variety of applications. The current communique is about assessing the capacity of ANN to predict investment on cattle till age at first calving (AFC) and milk production based on the data of 340 Vrindavani crossbreed cattle developed at the ICAR-Indian Veterinary Research Institute in Izatnagar, India. Three distinct artificial neural network (ANN) algorithms, namely, Levenberg–Marquardt (LM), Bayesian regularization (BR), and gradient descent momentum with adaptive learning rate backpropagation (GDX) were used to train the ANN infrastructure for determining milk production and investment based on body weight and AFC as input variables. The results showed that BR with 2 hidden layer neurons showed excellent prediction ability (R2 = 0.999, MSE < 10−6) and was therefore used as an objective function by GA for optimization. The optimized results revealed that higher milk production is achievable at lower investment if the age at first calving is 768 days with a body weight of ∼281 kg. The information generated by this investigation will aid in ensuring food security in terms of higher milk production while making the dairy business more sustainable and profitable for the farmers.