Laser is widely used in various fields such as laser processing, optical imaging, and optical trapping due to its high monochromaticity, directionality, and high energy density. However, the beam generated by the laser is a Gaussian beam with non-uniform distribution of optical energy, and this non-uniform distribution affects the interaction between the laser and the matter. Therefore, it is necessary to reshape the Gaussian beam into homogenized light spots with uniform distribution of optical energy. Laser beam homogenization method aims to alter the spatial distribution of the Gaussian beam, precisely controlling the shape and intensity of the laser beam to achieve homogenized light spots. However, the existing laser beam homogenization methods suffer from issues such as complicated component preparation and poor flexibility. They also fail to address experimental errors caused by stray light and zero-order light interference, leading to discrepancies between the experimental results and the expected results. These limitations seriously restrict the widespread application of laser technology across various fields. A laser homogenization method based on machine learning is proposed for spatial light modulator (SLM) laser homogenization. The preliminary approach in laser homogenization is to generate a phase hologram using the Gerchberg-Saxton (G-S) algorithm and modulate the incident light beam into homogenized light spots using a SLM. However, the inherent homogenization error of the SLM prevents laser homogenization from improving uniformity. The machine learning method is proposed as a means of compensating for homogenization errors, thereby improving the uniformity of the light spot. The corresponding supervised learning regression task on the experimental dataset establishes mapping relationships between the homogenization target images and the experimental detection images. The results of homogenization error compensation are validated through experiments. Compared to traditional SLM laser homogenization methods, the proposed method reduces the non-uniformity of the light spot by a relative 13%. The laser homogenization method based on machine learning is an efficient way to achieve laser beam homogenization. The proposed laser beam homogenization method can serve as a reference for machine learning-based methods. This method holds significant technical value for laser applications such as laser processing, optical imaging, and optical manipulation. Furthermore, it can provide guidance and a reference point for the utilization of artificial intelligence in addressing optical problems.