Rare-earth magnesium alloys exhibit higher comprehensive mechanical properties compared to other series of magnesium alloys, effectively expanding their applications in aerospace, weapons, and other fields. In this work, the tensile strength, yield strength, and elongation of a Mg-Gd-Y-Zn-Zr rare-earth magnesium alloy under different process conditions were determined, and a large number of microstructure observations and analyses were carried out for the tensile specimens; a prediction model of the corresponding mechanical properties was established by using a convolutional neural network (CNN), in which the metallographic diagram of the rare-earth magnesium alloy was taken as the input, and the corresponding tensile strength, yield strength, elongation, and three mechanical properties were taken as the output. The stochastic gradient descent (SGD) algorithm was used for parameter optimization and experimental validation, and the results showed that the average relative errors of the tensile strength and yield strength prediction results were 1.90% and 3.14%, respectively, which were smaller than the expected error of 5%.