Abstract: Garbage classification and recycling can improve environmental pollution， protect residents’ living environment and ensure sustainable ecological development. However， traditional artificial garbage classification methods are inefficient and subjective. This paper proposes a garbage classification and detection method based on improved YOLOX to improve the efficiency and accuracy of garbage classification. By training YOLOX network on self-made garbage classification dataset， garbage detection and classification have been realized. In order to achieve better detection effect， ECA attention mechanism is introduced into the network to improve the information transmission ability between features. Improving the up sampling and down sampling times of the feature extraction network to improve the feature extraction ability of small targets. The classification and regression loss functions are improved to improve the learning ability of the network. The experimental results show that the mAP@0.75
of the improved YOLOX algorithm is 89.9%， which is 4 percentage points higher than that of the original algorithm， and the number of detected frames per second only decreases by 0.3. The detection accuracy is significantly improved without loss of performance.