This paper develops a novel method for designing templates for discretetime cellular neural networks (DTCNN) via an adaptive particle-swarm optimization (APSO) for gray image noise cancelation. Proper selection of the inertia weight for the APSO gives a balance between global and local searching. The research results show that a larger weight helps to increase the convergence speed while a smaller one benefits the convergence accuracy. This APSO-based method can automatically update template parameters of a discrete-time cellular neural network and optimize them to remove noise interference in polluted images. Finally, examples are given to illustrate the effectiveness of the proposed APSO-CNN methodology.