Through machine learning, this paper changes the fundamental assumption of the traditional medium access control (MAC) layer design. It obtains the capability of retrieving the information even the packets collide by training a deep neural network offline with the historical radio frequency (RF) traces and inferring the STAs involved collisions online in near-real-time. Specifically, we propose a MAC protocol based on intelligent spectrum learning for the future wireless local area networks (WLANs), called SL-MAC. In the proposed MAC, an access point (AP) is installed with a pre-trained convolutional neural network (CNN) model to identify the stations (STAs) involved in the collisions. In contrast to the conventional contention-based random medium access methods, e.g., IEEE 802.11 distributed coordination function (DCF), the proposed SL-MAC protocol seeks to schedule data transmissions from the STAs suffering from the collisions. To achieve this goal, we develop a two-step offline training algorithm enabling the AP to sense the spectrum with the aid of the CNN. In particular, on receiving the overlapped signal(s), the AP firstly predicts the number of STAs involving collisions and then further identifies the STAs' ID. Furthermore, we analyze the upper bound of throughput gain brought by the CNN predictor and investigate the impact of the inference error on the achieved throughput. Extensive simulations show the superiority of the proposed SL-MAC and allow us to gain insights on the trade-off between performance gain and the inference accuracy. INDEX TERMS Medium access control (MAC), spectrum sensing, deep learning, convolutional neural network (CNN).