AbstractCognitive radio has been nominated as a key technology for the internet of things (IoT), due to its intelligent functionalities ensuring continuous connectivity for IoT objects. Spectrum prediction, as one of the core CR functions, has emerged as a leading tool to alleviate the spectrum scarcity problem. Spectrum prediction minimizes sensing and decision‐making delays, and thereby it reduces collisions with primary users and guarantees safe access for secondary users (SUs). Thus, it became an inseparable part of many new spectrum allocation and mobility methods. In this work, the proposed cognitive radio IoT model consists of local sensors (LS) that perform sensing instead of SUs, and a cognitive base station that receives sensing results from different LSs to predict the next occupancy information and allocate frequencies for SUs. The predictor is followed by a channel extraction block for efficient spectrum allocation. Then, a low complexity spectrum prediction and preallocation system based on optimized neural network architecture is presented. Two nonlinear neural network models, time delay neural network and nonlinear autoregressive with exogenous input, that are trained on a real spectral occupancy dataset, are optimized using the Bayesian optimization algorithm then compared. The best predictor forecasts the next occupancy rate of multiple channels simultaneously based on three dimensions, area, time, and frequency. Performance evaluation was conducted through accuracy, mean squared error (MSE), and regression fit. The highest prediction accuracy was93.5%, the regression coefficient was0.98, and a reduced MSE of0.0013obtained. Results show that the considered scheme is efficient in forecasting the spectrum availability of different bands within the IoT spectrum resources.