IoT network-connected devices will be kept on increasing and will cross million, but it is impossible to allocate spectrum for those million and million of the devices. This spectrum scarcity can be handled by incorporating cognitive radio-based dynamic spectrum sharing, which is referred to as Cognitive Radio Internet of Things (CRIoT). But CRIoT sufferers from the Physical layer attack in cognitive radio, which affects the spectrum sensing accuracy and reduces the spectrum utilization. There are various attacks at the physical layer of cognitive radio among jamming attacks resulting in a denial of cognitive radio services and make spectrum underutilization. Continuous jamming can be detected quickly based on time delay on spectrum access, but discrete random jamming detection is challenging. This article proposes an autoencoder deep learning architecture-based jamming attack detection in cognitive radio. The jamming detection problem is modeled as anomaly detection. The autoencoder architecture is used to detect the jammer anomaly of the jammer. The proposed system involves the simulation of a random jamming attack and detecting it at a particular time instant information that may help mitigate the jammer attack .the proposed mechanism able to detect the jammer with 89% of accuracy.