Local and global based methods are two main trends for face recognition. Local approaches extract salient features by processing different parts of the image whereas global approaches find a general template for face of each person. Unfortunately, most global approaches work under controlled environments and they are sensitive to changes in the illumination. On the other hand, local approaches are more robust but finding their optimal parameters is a challenging task. This work proposes a new local-based approach that automatically tunes its parameters. The proposed method incorporates different techniques. In the first step, convolutional neural network (CNN) is employed as a trainable feature extraction procedure. In the second step, different metaheuristic methods are merged with CNN so that its best structure is found automatically. Finally, in the last step the decision is made by employing proper multi-class support vector machine (SVM). In this fashion a fully automated system is developed that is self-tuned and do not need manual adjustments. Simulation results demonstrate efficacy of the proposed method.