Automatic number plate recognition is a paramount component of development of smart cities. Accuracy and precision is major factors in automatic number plate recognition. For the improvements of accuracy recently several algorithms is proposed. This paper proposed feature optimization based cascaded convolutional neural network. the process of feature optimization employed moth flame optimization (MFO). The proposed cascaded CNN algorithm improves the performance of automatic number plate detection. The lining is based on information obtained from a CNN source. To train the neural network, a question expansion strategy is used to enlarge the training set through synthetic transformations, thereby increasing the recall rate. This method maintains high accuracy under varying light conditions and noise, although it is not adaptable to different environments. Experimental results indicate that while the data sets demonstrate the algorithm's strong generalization capabilities, they do not achieve high classification accuracy. However, the class’s average accuracy surpasses that of other methods, demonstrating that CNN is superior in recognizing vehicle identification, as shown by comparative test results.