In recent years, detecting defects in materials has become an important element in many industries, such as automotive, construction, textile manufacturing, and many others. Material defects, such as stains, cracks, dents, and others, can affect the quality and durability of the product, which can have serious consequences for safety, performance, and product quality. Therefore, it is important to detect and remove material defects as quickly and accurately as possible. Traditional methods of detecting material defects, such as manual inspections or simple visual algorithms, can be unreliable and, above all, time-consuming. In recent years, however, new tools based on intelligent algorithms (Liu et al., 2023) or structures (Neethu et al., 2015), such as neural networks, have emerged that enable automation and significantly increase the precision of defect detection. One of the most popular tools for object detection is the YOLOv5 (Redmon et al., 2016) (You Only Look Once version 5) model, which is based on neural networks and designed for fast and accurate object detection in images. The YOLOv5 model can be trained to detect specific types of material defects, such as stains, cracks, dents, etc. To use the YOLOv5 model for defect detection in materials, images of the material with specified objects of interest are needed, which will be used as input data for the model training. The YOLOv5 model analyses the images and determines rectangular frames around each defect indicating its location, and then assigns a selected label (in this case, the name of the defect). As a result, the YOLOv5 model is able to detect defects in new material images, regardless of their location, colour, and size. As the work progresses, it is also possible to prepare new images and retrain the model for new defects or to improve the performance of existing ones. As a result of the research, the obtained results at a 95% level of recognized defects certainly qualify the applied technology for professional use after appropriate workstation preparation and a sufficiently large amount of data (preferably 1000 or more).