 Recently, visual automatic non-destructive testing using machine vision algorithms has become widely used in industry. Convolutional neural networks, CNNs, are effective for detecting, classifying, and segmenting defects in building materials and structures. Intelligent systems in the initial stages of manufacturing can eliminate defective building materials, prevent the spread of defective products, and detect the cause of specific damage. In this paper, the solution to the problem of building elements flaw detection using the computer vision method was considered. The YOLOv5s CNN was trained on an augmented dataset of images of facing brick samples to detect defects such as foreign inclusions, broken corners, cracks, and color unevenness, including the presence of rust spots. The results showed that the developed YOLOv5s model had a high accuracy in solving the problems of defect detection, map 0.50 equals 87%, map 0.50 colon 0.95 equals 72%. Additionally, the use of synthetic data obtained by augmentation made it possible to achieve a good generalizing ability from the algorithm, which has the potential to expand visual variability and practical applicability in various shooting conditions. This article was authored by Alexei N. Beskapilny, Yevgeny M. Sherbin, Sergei A. Stelmok, and others. We are article.tv, links in the description below.