###### Abstract  
In recent years, visual automatic non-destructive testing using machine vision algorithms has been widely used in industry. This approach for detecting, classifying, and segmenting defects in building materials and structures can be effectively implemented using convolutional neural networks. Using 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 article, the solution to the problem of building elements flaw detection using the computer vision method was considered. Using the YOLOv5s convolutional neural network for the detection and classification of various defects of the structure, the appearance of finished products of facing bricks that take place at the production stage is shown during technological processing, packaging, transportation, or storage. The algorithm allows for the detection of foreign inclusions, broken corners, cracks, and color unevenness, including the presence of rust spots. To train the detector, our own empirical database of images of facing brick samples was obtained. The set of training data for the neural network algorithm for discovering defects and classifying images was expanded by using our own augmentation algorithm. The results show that the developed YOLOv5s model has a high accuracy in solving the problems of defect detection: mAP0.50 = 87% and mAP0.50:0.95 = 72%. It should be noted that the use of synthetic data obtained by augmentation makes it possible to achieve a good generalizing ability from the algorithm, it has the potential to expand visual variability and practical applicability in various shooting conditions. computer vision; convolutional neural network; detection; classification; data augmentation; facing bricks +
Footnote †: journal: _Sci._  
Footnote †: journal: _Sci. of production and eliminate most defective products [1; 2]. Modern methods of artificial intelligence (AI) play a significant role in increasing the level of automation of the construction industry. AI algorithms make it possible to implement a model that imitates the cognitive functions of an expert, whose \"eyes\" are computer vision algorithms [3]. Due to computing power, this technology is able to store, process, systematize, visualize, and analyze unstructured information, including in real time [4; 5; 6]. The implemented flaw detection technologies based on computer vision algorithms show a high level of reliability and stability, which corresponds to, and in some cases even exceeds, the expert one. Intelligent algorithms prevent the spread of defective products, help determine the cause of a particular damage, and give a timely management response based on the analytical findings of the expert system [5; 7]. To detect defects in building materials, structures, and buildings made of innovative supplies, many different methods are used, including artificial intelligence [8]. At the same time, the types of materials, structures, as well as the results obtained are quite diverse. A fairly common method for detecting damage and destruction of various building materials and structures is the acoustic emission method [9]. It is used in scenarios heavily polluted by residual noise and helps to predict and characterize the type of failure. Rolled steel defects were detected using advanced models YOLOv5s-GCE [10], adaptive bounding box annotation and lightweight MobilenetV2 [11], MSFT-YOLO based on a single-stage detector [12], and ACA-Net (adaptive convolution and anchor) [13]. All models showed an improvement in accuracy over the original model. In addition, a random forest and artificial neural network with an error of less than 0.6% was used to detect cracks and determine their severity in steel beams [14]. A comparison of different time-of-flight (ToF) algorithms and a ToF self-diagnostic approach based on a Defect Peak Tracking Model (DPTM) has been successfully applied in [15] to detect and analyze pipeline defects.