In this study, we address the design challenges related to hyperparameters, such as the number of layers and nodes in deep neural networks, by introducing an Improved Genetic Algorithm-based method for optimizing neural network structures (IGA-DNN). We apply this method to the practical problem of β function correction in particle accelerators and develop a storage ring β function correction scheme based on IGA-DNN. We compare our approach with traditional genetic algorithm-optimized neural networks to evaluate its performance.
Our results reveal that the neural network optimized by the improved genetic algorithm reduces the number of layers by three and decreases training time by a factor of three, leading to a more efficient model. Moreover, the accuracy of β function simulation correction is enhanced using the IGA-DNN method. This approach can also be extended to optimize other optical parameters and tackle multi-parameter optimization problems, showcasing its versatility and potential for broader applications across various fields.