Cognitive radio network (CRN) is the next generation wireless network that allows unlicensed users [secondary users (SUs)] to explore and use the underutilised licensed channels (white spaces) owned by licensed users (primary users). The purpose is to increase the spectrum utilization for enhanced network performance. Clustering segregates SUs in a CRN into logical groups (clusters) with each consisting of a leader (cluster head) and member nodes. A budget-based cluster size adjustment scheme is applied to enable each cluster to adjust its number of member nodes in its cluster based on the availability of white spaces in order to improve network scalability. However, cluster size adjustment is prone to attacks by malicious SUs that launch random and intelligent attacks. Hence, we incorporate an artificial intelligence approach called reinforcement learning (RL) into a trust model to countermeasure the random and intelligent attacks. The simulation results show that RL-based trust model increases the utilization of white spaces and cluster size to improve network scalability and enhance network performance despite the presence of RL-based intelligent attacks. INDEX TERMS Artificial intelligence, reinforcement learning, attacks, trust model, cognitive radio.