he tomato is one of the most popular and well-liked veggies among Asians. It is interesting to note that in Bangladesh, it is the second most significant vegetable consumed. Moreover, tomato is served not only as a vegetable, but it is also served as sauce, jam, etc., and used in making different types of cuisines. But the fact is due to the pests, thousands of tons of tomatoes are harmed every year in Bangladesh. The production of tomatoes in Bangladesh is harmed by a number of dangerous pests. We develop a solution to recognize pests at an early stage. Five different pest types, including aphids, red spider mites, whiteflies, looper caterpillars, and thrips, have been studied in this research. To identify tomato pests, we curated image datasets from online and offline repositories and processed them using a convolutional neural network (CNN) model. We used features from CNN layers for three machine learning algorithms: Random Forest (RF), support vector machine (SVM), and K-Nearest Neighbors (K-NN). This comprehensive approach allowed a thorough comparison of these algorithms in tomato pest recognition. For recognizing tomato pests, our methods generate excellent results. The accuracy of our experiment is 95.49% which indicates the successful completion of the experiment.