Mango production is a prominent tropical fruit industry worldwide. However, outdoor mango cultivation is susceptible to crop damage caused by insect pests and harsh environmental conditions. Integrated pest management (IPM) has emerged as a proposed solution to this problem. IPM utilizes data-driven and environmentally-friendly methods to suppress insect pest populations. Nevertheless, the collection of insect pest population data remains a laborious process, necessitating automation. This paper presents an image-based monitoring system to automatically record insect pest populations and environmental conditions in mango orchards. The system comprises solar-powered sensor nodes capable of periodically acquiring and analyzing sticky paper trap images. A modular deep learning-based algorithm was developed to detect and classify insect pests into seven classes, including major insect pests of mango such as thrips, mango leafhopper, and oriental fruit fly, with an average classification F1-score of 0.96. Unlike other insect counting algorithms, the algorithm reliably classifies insect pests according to different taxonomic levels even in non-laboratory environments. The monitoring system was tested and deployed in a remote mango orchard for over two years. The collected spatiotemporal information was analyzed to demonstrate the benefits of using the proposed system and recommend new IPM strategies. Temporal data analysis revealed a significant decrease in the count of selected insect pests after using the system, enabling identification of insect hotspots through statistical methods. This work presents a breakthrough in hardware and software solutions for developing smarter insect pest monitoring systems, leading to better IPM strategies.