In this study, a deep-learning-based intelligent detection model was designed and implemented to rapidly detect cotton pests and diseases. The model integrates cutting-edge Transformer technology and knowledge graphs, effectively enhancing pest and disease feature recognition precision. With the application of edge computing technology, efficient data processing and inference analysis on mobile platforms are facilitated. Experimental results indicate that the proposed method achieved an accuracy rate of 0.94, a mean average precision (mAP) of 0.95, and frames per second (FPS) of 49.7. Compared with existing advanced models such as YOLOv8 and RetinaNet, improvements in accuracy range from 3% to 13% and in mAP from 4% to 14%, and a significant increase in processing speed was noted, ensuring rapid response capability in practical applications. Future research directions are committed to expanding the diversity and scale of datasets, optimizing the efficiency of computing resource utilization and enhancing the inference speed of the model across various devices. Furthermore, integrating environmental sensor data, such as temperature and humidity, is being considered to construct a more comprehensive and precise intelligent pest and disease detection system.