Wirelessly connected devices play a vital role in our daily life, especially with the rapid increase in the number of connected devices and the huge data being generated everyday. However, the open nature of the wireless channels makes them vulnerable to several threats. One of these major threats is jamming attacks in which an adversary side tries to disrupt the reception of useful signals by a legitimate receiver. Physical layer security has recently received a great attention because it employs the cause of this vulnerability, open nature, to counter attach jamming attacks. In this work, we propose a machine learning (ML)-based anti-jamming technique at the physical layer leveraging massive planar antenna arrays. In the proposed solution, beam-forming is implemented to maximize the receiver`s gain towards the transmitter, while simultaneously placing a null in the direction of the jammer; thus, achieving a high signal-to-interference-plus-noise-ratio (SINR). The proposed technique will be tested and validated on simulated datasets, and compared against a baseline technique. The proposed technique is expected to demonstrate robust, cognitive anti-jamming performance that is scalable to combat multiple jammers.