Currently, solenoids are extensively utilized in various research fields due to their flexibility of fabrication and high magnetic field strength. However, the internal magnetic field of the solenoid itself exhibits some non-uniformity defects, which limits its application in some domains. This article proposes a novel single winding tightly wound solenoid structure with an improved magnetic field uniformity. To optimize the magnetic field near the aperture of the conventional solenoid, an auxiliary solenoid with a gradually changing diameter is included at each end of the solenoid. By adjusting different parameters of the auxiliary solenoid, the edge effect of the solenoid was reduced, and its overall magnetic field uniformity was improved. The optimization of the auxiliary solenoids is achieved through GA-KAN network techniques. Finite element simulation results with the optimized parameters show that the proportion of uniform areas can be improved by more than five times. The research results are a reference for high-precision electromagnetic sensing applications based on solenoids.