Designing Convolutional Neural Networks from scratch is a time-consuming process that requires specialist expertise. While automated architecture generation algorithms have been proposed, the underlying search strategies generally are computationally expensive. The existing methods also do not explore the search space efficiently, and often lead to sub-optimal solutions. In this research, we propose a novel Particle Swarm Optimization (PSO)-based model for deep architecture generation to address the above challenges. Our proposed solution incorporates three new components. Firstly, a group-based encoding strategy is devised, which enforces the candidate networks to always follow the best practices. Specifically, it ensures that the number of groups can be adjusted in accordance with the input image size. By restricting the number of groups, we can adapt the frequency of the pooling operations toward the input image size. As such, it ascertains the position and maximum frequency of the pooling operations always result in a valid network architecture without the need for additional complex governing rules. Secondly, a new velocity updating mechanism is devised, which creates new network architectures by identifying the key network configuration differences. Thirdly, a new position updating mechanism using weighted velocity strengths is devised. Both the velocity and position updating mechanisms facilitate the proposed PSO-based model to search the intermediate positions of the particles’ trajectories, allowing a better trade-off between diversification and intensification to be achieved. We employ eight well-known data sets, including Convex, Rectangles, MNIST and its variants, for model evaluation. The proposed PSO-based model achieves up to 7.58% improvement in accuracy and up to 63% reduction in computational cost, in comparison with those from the current state-of-the-art methods.