In order to solve the problem that the traditional detection technology can not meet the requirements of online detection, a visual detection device for bearing inner ring defects based on image processing and pattern recognition is proposed in this paper. The device systematically designs an image acquisition device of bearing inner ring based on CCD. In the hardware scheme, the appropriate lens, camera, light source, and other related hardware are selected according to the actual needs, a complete image acquisition platform of bearing inner ring is built, and the software function design is completed. The simulation results show that the qualified rate of machine detection is 98.6%, the missed detection rate is 0, and the false detection rate is 1.4%, which are better than manual detection. Conclusion. The test results show that the bearing inner ring defect detection system can detect the surface defects of bearing inner ring quickly, stably, and reliably, and the detection efficiency and accuracy are higher than the original manual detection method, so it has a good application prospect.