Wireless sensor networks (WSNs) play a crucial role in data collection across various fields like environmental monitoring and industrial automation. The energy efficiency of these networks, powered by limited-capacity batteries, is key to their performance. Clustering protocols such as low- energy adaptive clustering hierarchy (LEACH) are widely used to optimize energy consumption. To enhance LEACH’s performance, MG-LEACH was introduced, improving cluster head selection to extend network lifespan. This study compares MG-LEACH with AI-MG-LEACH, which incorporates artificial intelligence (AI) to further improve energy efficiency by selecting cluster heads based on factors like residual energy. Simulations show AI-MG-LEACH reduces energy consumption, extends network life, and enhances data reliability, outperforming MG-LEACH.