To address the current of avalanche photodiodes (APD) with large differences in orders of magnitude before and after the avalanche and drastic changes in I-V characteristic curves, a shallow neural network is used to complete the I-V function fitting based on logarithmic and normalized pre-processing of I-V characteristic data, and the neural network structure is further optimized to improve the model accuracy. On this basis, the SPICE model of APD is implemented in Verilog-A hardware description language, the validity and accuracy of the model are verified by designing the circuit in Cadence, and the relative error is introduced to evaluate the model accuracy. The results show that the mean square error loss of the I-V characteristic function learned by the optimized neural network and the TCAD simulation data is 2.544×10-7, the maximum relative error of the SPICE model verification circuit and the TCAD simulation data is 3.448%, the average relative error is 0.630%, and the time spent to construct the SPICE model is about 50 hours. High-precision and high-efficiency device SPICE model construction are realized, which has important guiding significance for the design and application of new APDs.