Nowadays, artificial intelligence and sensor technology play a vital role in the agriculture field. The use of excess insecticides and fertilizers in farming poses a risk to human health. It is necessary to control them to ensure healthy crop production. Many techniques are used to identify the pest, suggest medications, and do soil nutrient analysis techniques separately. This paper applies the dual operator, Transition Probability Function (TPF), and Convolution Neural Network (CNN) to process the pest's image discretely and continuously for applying the recommended insecticide. The mathematical model with the objective function is derived in this paper. The proposed system combines two major aspects in farming: pest identification and insecticide recommendation using machine vision and CNN. Secondly, the soil nutrient analysis uses a soil NPK sensor with the recommendation of fertilizers according to the obtained nutrient values. On-spot results are obtained, and the time required for insecticide recommendation is within 10 s, and for fertilizer recommendation, it is within 80 s. Successful identification of five pests, namely aphids, bollworms, leaf folder, leaf miner, and green stink bug, was done with more than 90% accuracy. The proposed approach is also compared with the other intelligent approaches, such as Artificial Neural Network (ANN), K-Nearest Neighbour (KNN), and Support Vector Machine (SVM), and it is observed that the proposed TPF-CNN approach gives higher accuracy in the shortest time.