Advances in machine learning algorithms have allowed object detection and classification to become booming areas. The detection of objects, such as rocks, in mining operations is affected by fog, snow, suspended particles, and high lighting. These environmental conditions can stop the development of mining work, which entails a considerable increase in operating costs. It is vital to select a machine learning algorithm that is accurate, fast, and contributes to lower operational costs because of the aforementioned environmental situations. In this study, the Viola-Jones algorithm, Aggregate Channel Features (ACF), Faster Regions with Convolutional Neural Networks (Faster R-CNN), Single-Shot Detector (SSD), and You Only Look Once (YOLO) version 4 were analyzed, considering the precision metrics, recall, AP50, and average detection time. In our preliminary tests, we have observed that the differences between YOLO v4 and the latest versions are not substantial for the specific problem of rock detection addressed in our article. Therefore, YOLO v4 is an appropriate and representative choice for evaluating the effectiveness of existing methods in our study. The YOLO v4 algorithm performed the best overall, whereas the SSD algorithm performed the fastest. The results indicate that the YOLO v4 algorithm is a promising candidate for detecting rocks with visual contamination in mining operations.