Internet of Things (IoT) and Artificial Intelligent (AI) are considered the key technologies for emerging 5G. The IoT empowers things to exchange data together using the internet towards a human beneficiary. The rapid growth of the IoT smart city influences diversified sources of data, a growing data sphere, and a massive number of sent packets, which are leading to a collision probability problem. AI technology coexists with IoT smart city networks to solve the collision problem. The paper starts to analyze the collision probability in the RAW and PRAW access channels of IEEE 802.11ah, compared to legacy IEEE 802.11 protocols. The paper derives two collision probability formulas in IEEE 802.11ah. Machine Learning (ML) algorithms as a subset of AI technology were proposed to classify and allocate each traffic pattern in the IoT smart city use case onto an appropriate IEEE 802.11ah access channel, denoted as adaptive IEEE 802.11ah MAC protocol. It is anticipated that the proposed adaptive IEEE 802.11ah protocol reduces the collision probability in the crowded IoT smart city networks for a percentage performance of 80% ο½ 90% and it was obtained by the Decision Tree (DT) algorithm of supervised ML with 99.45% accuracy and 1.066 sec processing time.