In cognitive radio networks (CoR), the performance of cooperative spectrum sensing is improved by reducing the overall error rate or maximizing the detection probability. Several optimization methods are usually used to optimize the number of user-chosen for cooperation and the threshold selection. However, these methods do not take into account the effect of sample size and its effect on improving CoR performance. In general, a large sample size results in more reliable detection, but takes longer sensing time and increases complexity. Thus, the locally sensed sample size is an optimization problem. Therefore, optimizing the local sample size for each cognitive user helps to improve CoR performance. In this study, two new methods are proposed to find the optimum sample size to achieve objective-based improved (single/double) threshold energy detection, these methods are the optimum sample size N* and neural networks (NN) optimization. Through the evaluation, it was found that the proposed methods outperform the traditional sample size selection in terms of the total error rate, detection probability, and throughput.