The last two decades have seen Cognitive Radio (CR) technology as an efficient mechanism to combat spectrum scarcity. Cooperative spectrum sensing (CSS) further enhances its efficiency. However, primary user emulation attack (PUEA) can affect the key purpose of CSS, by changing its fundamental model. This necessitates optimization of the CSS system facing a PUEA. In this paper, such optimization has been performed with the help of Deep Q- Network (DQN) learning. A smart-PUEA strategy, where the attack are made intelligently during the absence of the primary user (PU) signal, has been considered for investigation. First, the presence of a PUEA is modelled with the Markov chain. Then, the suppression of the damages done by the PUEA on the SU throughput has been performed in two CSS architectures: the decision fusion CSS and the data fusion CSS. In both the CSS architectures, the application of DQN learning is carried out by finding an optimal policy with the help of an action-value function. The optimal policy gives the optimal decision threshold and the optimal sensing time. As the data sets for the considered system are large, a multi-layered network is used for approximating the action-value function estimator. The reward is received in terms of maximized SU throughput. The performance assessment is done with an exhaustive search mechanism and beamforming based CSS. It is shown that the proposed algorithms outperform the existing algorithms in the achievable sum-rate and number of iterations for convergence respectively.