This article proposed an angle measurement method based on second harmonic generation (SHG) using an artificial neural network (ANN). The method comprises three sequential parts: SHG spectrum collection, data preprocessing, and neural network training. First, the referenced angles and SHG spectrums are collected by the autocollimator and SHG-based angle sensor, respectively, for training. The mapping is learned by the trained ANN after completing the training process, which solves the inverse problem of obtaining the angle from the SHG spectrum. Then, the feasibility of the proposed method is verified in multiple-peak Maker fringe and single-peak phase-matching areas, with an overall angle measurement range exceeding 20,000 arcseconds. The predicted angles by ANN are compared with the autocollimator to evaluate the measurement performance in all the angular ranges. Particularly, a sub-arcsecond level of accuracy and resolution is achieved in the phase-matching area.