A crack identification method and device based on partitioned convolution
By using a partitioned convolution method to split and stitch large images, the problem of low efficiency in identifying short cracks in large images is solved, achieving efficient and accurate crack identification, which is suitable for health monitoring of building structures.
Patent Information
- Application Number
- CN202411073744.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-08-06
AI Technical Summary
Existing technologies suffer from high computational costs, high processing complexity, and low recognition accuracy when identifying short cracks in large images. They also struggle to effectively utilize the receptive field of convolutional neural network models, resulting in low recognition efficiency and false positives and false negatives.
The partitioned convolution method is used to split a large image into multiple tensors of the same size, which are then input into a pre-trained convolutional neural network model for crack prediction. The results are then stitched together to reduce the number of image format conversions, expand the segmentation region, and ensure that crack features are not segmented into too small parts.
It improves the efficiency and accuracy of crack identification, reduces computation time, and ensures the integrity and reliability of crack features, making it suitable for health monitoring of building structures.
Smart Images

Figure CN118941923B_ABST
Abstract
Description
Technical Field
[0001] This article relates to the field of image recognition, and in particular to a crack recognition method and device based on partitioned convolution. Background Technology
[0002] With the development of deep learning technology, crack image recognition based on convolutional neural network technology has brought progress to the health monitoring of building structures. However, there are still challenges in identifying short cracks in large images. This is because the processing of large images increases the computational cost, processing complexity, and image recognition time. Moreover, the recognition of short cracks is limited by the resolution and receptive field of the network. Taking a certain aqueduct as an example, crack recognition based on high-resolution aqueduct images taken by drones results in large pixel sizes for a single image, and the crack prediction time exceeds 60 seconds. At the same time, since the width of aqueduct cracks is mostly a few millimeters and the length is mostly tens of centimeters, the crack area accounts for a very small percentage of pixels in a single image. Various convolutional neural network models, such as VGGNet (Visual Geometry Group Network), ResNet (Residual Network), U-Net, and YOLO (You Only Look Once), have not yielded ideal prediction results.
[0003] To address the aforementioned issues, two main methods are currently employed for identifying short cracks in large images. The first method enhances the generalization ability of convolutional neural network (CNN) models by introducing large-sized image training samples during model training to improve the model's ability to handle images of different sizes. This is achieved by increasing the depth of convolutional layers or the size of convolutional kernels to capture a wider range of crack feature information. Furthermore, multi-scale image processing techniques are applied, running the neural network to consider multiple different image sizes to improve adaptability to complex scenes. However, this method has drawbacks: training the model requires labeling a large number of large images, significantly increasing the time required to create the training dataset, necessitating model retraining, further increasing time costs, and requiring modifications to the model structure, which can easily lead to excessive computation and overfitting. The main steps of the second method are: converting the large image into a tensor for segmentation, converting the segmented tensor into a small image, and inputting each small image into a convolutional neural network for recognition. During recognition, the small image needs to be read into a small tensor before crack recognition. Finally, the small crack prediction binary images obtained from the small image recognition are stitched together. The drawback of this method is that there are multiple conversions between the image and the tensor, resulting in long detection time and low efficiency. Moreover, during segmentation, it is impossible to perform non-integer division of the image, which limits the selectable segmentation size. At the same time, it will divide the crack into multiple parts, causing the model to be unable to recognize the complete crack, which may lead to false detection or false negative detection, resulting in low crack recognition accuracy. Summary of the Invention
[0004] This application provides a crack recognition method and apparatus based on partitioned convolution, which directly splits the tensor of the image and concatenates the gray-level matrix, reducing the number of image format conversions and improving crack recognition efficiency. When splitting the tensor, it is easy to expand the segmentation area, ensuring that features such as cracks are not segmented into too small parts, and the crack recognition accuracy is high.
[0005] On the one hand, embodiments of this application provide a crack recognition method based on partitioned convolution, including: Input the original image containing the crack into the image segmentation module, perform tensor segmentation according to the tensor segmentation size, and output Q segmentation tensors of the same size, where Q>1; Each of the split tensors is input into a pre-trained convolutional neural network model, and each of the split tensors is calculated independently to output a grayscale matrix corresponding to each of the split tensors. The convolutional neural network model is used to predict cracks in the original image. All the output grayscale matrices are concatenated to obtain the crack prediction grayscale matrix corresponding to the original image; The original image is fused with the crack prediction grayscale matrix and then visualized to obtain a crack distribution map.
[0006] On the other hand, embodiments of this application also provide a crack detection device based on partitioned convolution, including a processor and a memory: The memory is used to store the crack detection program based on partitioned convolution; The processor is used to read the crack recognition program based on partitioned convolution and perform the crack recognition method based on partitioned convolution as described in the above embodiments.
[0007] Compared with related technologies, the crack recognition method and apparatus based on partitioned convolution in this application directly performs intelligent segmentation of the image tensor and stitches together the grayscale matrix, reducing the number of image format conversions and improving crack recognition efficiency. Partitioned convolution of the segmented tensor further overcomes the problem of slow processing speed in large image processing, further improving crack recognition efficiency. When performing tensor segmentation, the receptive field of the convolutional neural network model can be taken into account, ensuring that each segmented region is fully extracted and analyzed, while expanding the segmentation area to ensure that features such as cracks are not segmented into too small parts. The crack recognition accuracy is high and the reliability is strong, overcoming the difficulty of recognizing short cracks based on large-size images, and providing an effective tool for building engineering monitoring.
[0008] Other features and advantages of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the application. Other advantages of this application can be realized and obtained by means of the solutions described in the description and the accompanying drawings. Attached Figure Description
[0009] The accompanying drawings are used to provide an understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0010] Figure 1 This is a flowchart of the crack recognition method based on partitioned convolution according to an embodiment of this application; Figure 2 This is a schematic diagram of the tensor decomposition result as a specific example of this application; Figure 3 This is a schematic diagram of a crack recognition device based on partitioned convolution according to an embodiment of this application. Detailed Implementation
[0011] This application describes several embodiments, but these descriptions are exemplary and not restrictive, and it will be apparent to those skilled in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with, or may replace, any feature or element of any other embodiment.
[0012] This application includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features, and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive scheme as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive schemes to form another unique inventive scheme as defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in this application may be implemented individually or in any suitable combination. Therefore, the embodiments are not limited except by the limitations imposed by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.
[0013] Furthermore, in describing representative embodiments, the specification may have presented methods and / or processes as a specific sequence of steps. However, the method or process should not be limited to the specific order of steps described herein, to the extent that it does not depend on such a specific order. As will be understood by those skilled in the art, other sequences of steps are also possible. Therefore, the specific order of steps set forth in the specification should not be construed as a limitation of the claims. Moreover, the claims concerning the method and / or process should not be limited to the steps performed in the written order, and those skilled in the art will readily understand that these orders can be varied and still remain within the spirit and scope of the embodiments of this application.
[0014] Convolutional neural networks (CNNs) rely on their internal convolutional kernels to extract image features when processing images. To improve both the efficiency and effectiveness of feature extraction, multiple layers of convolutional kernels with smaller receptive fields are generally chosen. However, the receptive field of each convolutional kernel is limited, and increasing the number of convolutional kernel layers does not guarantee the effectiveness of feature extraction. Moreover, during the training of CNN models, in order to improve training efficiency, the training images used are generally small, resulting in weak generalization ability for large images. Therefore, when processing large images, it is not easy to extract small crack features. Training CNN models with large images is very time-consuming. There is an urgent need for a method that can use existing CNN models to identify short cracks in large images.
[0015] This application provides a crack identification method based on partitioned convolution, including steps S1000-S4000, such as... Figure 1 As shown, S1000: Input the original image containing the crack into the image segmentation module, perform tensor segmentation according to the tensor segmentation size, and output Q segmentation tensors of the same size, Q>1; S2000: Input each of the split tensors into a pre-trained convolutional neural network model, calculate each of the split tensors independently, and output the gray-level matrix corresponding to each of the split tensors. The convolutional neural network model is used to predict cracks in the original image. S3000: Concatenate all the output grayscale matrices to obtain the crack prediction grayscale matrix corresponding to the original image; S4000: The original image is fused with the crack prediction grayscale matrix and then visualized to obtain a crack distribution map.
[0016] In this embodiment, the image segmentation module can be implemented using the open-source machine learning library PyTorch based on Python. When executing step S1000, the image segmentation module needs to convert the original image into a large-size tensor before performing tensor splitting. For example, the original image can be an RGB image, and the image segmentation module can convert the original image into a third-order tensor before performing tensor splitting. L 0 , W 0 ,3), third-order tensor ( L 0 , W 0 ,3) is a large-size tensor, in which, L 0 Represents the pixel length of the original image. W 0 The pixel width represents the original image, and 3 represents the number of color channels in the original image, namely red, green, and blue channels. When performing tensor splitting, tensor splitting needs to be performed according to the tensor splitting size. Adjacent split tensors can overlap or not, as long as Q split tensors of the same size can cover the large-size tensor to ensure that no tensor information is missed.
[0017] In this embodiment, the original image can be a building structure image obtained by an airborne imaging device mounted on a drone, a vehicle-mounted imaging device, manual shooting, or a building monitoring camera. The building structure can be any of the following: brick structure, concrete structure, steel structure, foundation, wall coating, floor, ceiling, etc. The building structure is affected by factors such as temperature changes, humidity changes, material shrinkage, aging, uneven settlement, or prestressing, which can cause short cracks to form on its surface. Although these short cracks are very small, they need to be regularly assessed and monitored to ensure that they do not expand over time and affect the safety of the building structure.
[0018] In this embodiment, the selection of the tensor splitting size needs to be carefully designed. The tensor splitting size needs to be as close as possible to the size of the training image of the convolutional neural network model in order to match the receptive field of the convolutional neural network model. At the same time, it is necessary to ensure that each splitting tensor is not too small and contains enough information to ensure that the crack features in the original image are not segmented into too small parts and are difficult to be recognized by the convolutional neural network model.
[0019] In this embodiment, the convolutional neural network model performs crack prediction and grayscale calculation on each input split tensor to generate a grayscale matrix, thereby realizing crack identification through partitioned convolution. The convolutional neural network model can be any one of VGGNet, ResNet, U-Net, DenseNet, GoogLeNet, and YOLO. The above convolutional neural network models are all exemplary descriptions and are not intended to limit this application. They will not be described in detail here.
[0020] In this embodiment, each element in the grayscale matrix corresponding to each split tensor not only represents a pixel, but also contains a grayscale value. The grayscale value ranges from 0 to 255. Based on the size of the grayscale value of each pixel, it can be determined whether the pixel is a crack. The grayscale value of each element in the crack prediction grayscale matrix obtained after stitching in step S3000 also ranges from 0 to 255.
[0021] In this embodiment, when performing step S4000, steps S4100-S4400 may be included: S4100: Set grayscale threshold G T ; S4200: In the crack prediction grayscale matrix, the grayscale values less than or equal to... G T The pixels with values greater than 0 in the crack prediction grayscale matrix are set to 0. G T The pixel is set to 1 to obtain the crack prediction binary matrix, where 1 represents that the pixel is a crack and 0 represents that the pixel is not a crack. S4300: Convert the crack prediction binary matrix into a crack prediction binary map; S4400: Align the crack prediction binary map with the original image using the same pixels to obtain the crack distribution map.
[0022] In this embodiment, when executing steps S4100-S4300, the open-source machine learning library matplotlib based on Python can be used, and a grayscale threshold can be set. G T The value is 127. Elements with gray values of 0-127 in the crack prediction grayscale matrix are set to 0, indicating that there is no crack. Elements with gray values of 128-255 in the crack prediction grayscale matrix are set to 1, indicating that there is a crack.
[0023] The crack recognition method based on partitioned convolution in this embodiment directly splits the image tensor and concatenates the grayscale matrix, reducing the number of image format conversions and improving crack recognition efficiency. When splitting the tensor, it can take into account the receptive field of the convolutional neural network model and expand the segmentation area, ensuring that features such as cracks are not segmented into too small parts, resulting in high crack recognition accuracy.
[0024] In one exemplary embodiment, the original image includes a short crack, wherein the short crack satisfies at least one of the following conditions: the crack pixel width is less than one pixel, the crack pixel length is less than ten pixels, the crack pixel width is less than 1 / 100 of the pixel width of the original image, and the crack pixel length is less than 1 / 100 of the pixel length of the original image.
[0025] In this embodiment, the original image can be an image of an aqueduct taken by an airborne imaging device carried by a drone. An aqueduct is a hydraulic engineering structure mainly used to transport water. Aqueducts cross rivers, valleys or other obstacles. Cracks on the aqueduct are usually a few millimeters wide and tens of centimeters long. The existence of these cracks will affect the durability of the aqueduct and they need to be monitored to prevent short cracks from developing into larger cracks that affect the structural safety of the aqueduct.
[0026] In one exemplary embodiment, step S0000 may be included before step S1000: S0000: Obtain the training image size of the convolutional neural network model, and perform tensor splitting test on the original image based on the training image size to determine the tensor splitting size, wherein the size of the original image is larger than the training image size.
[0027] In this embodiment, before performing tensor splitting on the original image, the tensor splitting size can be determined through tensor splitting test. The determined tensor splitting size can ensure that the segmentation range is expanded when performing tensor splitting, ensuring that features such as cracks are not segmented into too small parts, which would increase the difficulty of crack recognition. This ensures that each split tensor retains enough crack information and avoids the loss of crack information.
[0028] In this embodiment, when performing tensor splitting tests, several original images can be selected as test images. For each test image, several different tensor splitting test sizes are used to perform tensor splitting tests. The split test small tensors are input into the convolutional neural network model to obtain test small grayscale matrices. Then, the test small grayscale matrices are concatenated to obtain test grayscale matrices. The test grayscale matrices corresponding to each tensor splitting test size are evaluated to select a suitable tensor splitting size.
[0029] In one exemplary embodiment, step S0000 may include steps S0100-S0400, wherein step S0400 may include steps S0410-S0420: S0100: Obtain the pixel length corresponding to the training image size of the convolutional neural network model. l and pixel width w ; S0200: Acquire multiple original images of the target area, and select a test image from the multiple original images according to a predetermined ratio; S0300: Split dimensions according to the first tensor set. Bl Bw For each of the test images, tensor splitting and grayscale calculation are performed to obtain the first grayscale matrix. M1 i ,in, i =1…… I , I This represents the number of test images. B ≥3; S0400: Repeat steps S0410-S0420 for one or more rounds of testing until the current average similarity is reached. S Greater than the preset similarity threshold S T Then set the tensor split size to the second tensor split size of the current round. Al Aw ,1≤ A < B Or, until A = B hour, S Still not greater than S T Then set the tensor split size to Bl Bw : S0410: Split size according to the set second tensor of the current round. Al Aw For each of the test images, tensor splitting and grayscale calculation are performed to obtain the current second grayscale matrix. M2 i ,calculate M2 i and M1 i Current similarity S i During the first round of testing A =1; S0420: Calculate the current average similarity. S = ,judge S and S T If the relationship, S ≤ S T ,Will A Set to A + d To proceed to the next round of testing, in which... d The step size is a number that is greater than 0.
[0030] In this embodiment, both the first tensor splitting size and the second tensor splitting size are pixel sizes. When executing step S0200, the predetermined ratio can be set to 2%. For example, if there are 500 original images, 10 images can be selected as test images.
[0031] In this embodiment, the tensor splitting size determined after tensor splitting testing satisfies the following relationship: training image size l w ≤Tensor split size≤First tensor split size Bl Bw , A and B It can take both decimals and integers. A The initial value is 1. B The minimum value is 3, which can be used for A Set step size d To achieve numerical values during the testing process A Gradually towards numerical B The proximity.
[0032] In this embodiment, when performing step S0300, when setting the first tensor splitting size... B The value of should not be too large or too small. B If the value is too large, meaning the size of the first tensor split is too large compared to the size of the training image, it will lead to feature extraction challenges and overfitting risks during the prediction process of the convolutional neural network model; if B If the value is too small, meaning the first tensor split size is close to the training image size, the final tensor split size may be too small, resulting in the crack features being cut into excessively small parts that are difficult to identify. Consequently, cutting the crack features into excessively small parts will lead to problems with the grayscale matrix predicted by the convolutional neural network. M2 i The grayscale matrix obtained at the first tensor split size M1 i In comparison, the similarity is very low, which leads to an increase in the number of tests and the testing time.
[0033] In this embodiment, when performing step S0410, the current similarity is calculated. S i The method can employ similarity calculation methods such as cosine similarity, Euclidean distance similarity, and Manhattan distance similarity. The above similarity calculation methods are merely illustrative descriptions and are not intended to limit this application. They will not be elaborated upon further in this document.
[0034] In one exemplary embodiment, the "performing tensor splitting and grayscale calculation for each of the test images" in steps S0300 and S0410 may include: Perform the following steps S0310-S0340 on each of the test images: S0310: Input the test image into the image segmentation module and convert it into a third-order tensor. L , W , C ); S0320: According to the tensor splitting size set for the test image, split the third-order tensor ( L , W , C Perform tensor splitting to obtain multiple tensors; S0330: Input each of the tensors into the convolutional neural network model and output the grayscale matrix corresponding to each tensor; S0340: Concatenate all the output grayscale matrices to obtain the grayscale matrix corresponding to the test image; In this embodiment, L , W, C These represent the pixel length, pixel width, and number of color channels of the test image, respectively.
[0035] In one exemplary embodiment, step S2000 may include: performing the following steps S2100-S2200 on each of the split tensors: S2100: Input the split tensor into the convolutional neural network model; S2200: Perform convolution, activation, and pooling calculations based on the convolutional neural network model, extract crack features, and calculate grayscale values, outputting the grayscale matrix corresponding to the split tensor.
[0036] In this embodiment, performing convolution, activation, and pooling calculations on each split tensor separately helps reduce the computational burden and improves the ability to identify subtle features and short crack features.
[0037] In one exemplary embodiment, "concatenating all the output grayscale matrices" in steps S3000 and S0340 may include steps S3100-S3300: S3100: Perform edge processing on each of the grayscale matrices: multiply the grayscale values of the first preset number of pixels located at the leftmost and rightmost edges of the grayscale matrix by an amplification factor, and multiply the grayscale values of the second preset number of pixels located at the top and bottom edges of the grayscale matrix by the amplification factor. S3200: Arrange all grayscale matrices after the edge processing according to their positional relationship to obtain a first concatenation matrix, wherein the positional relationship is the positional relationship between the split tensor and the original image; S3300: Perform splicing processing on the overlapping areas of the first splicing matrix, wherein each overlapping pixel in the overlapping area includes gray values corresponding to multiple gray-scale matrices. G j ; In this embodiment, j =1…… J , J Represents each overlapping pixel point G j The quantity, 2≤J≤4.
[0038] In this embodiment, by executing step S3100, the calculation weight of the edge region is increased. Even if a crack is split into two adjacent split tensors during splitting, the crack located at the splitting edge can be effectively detected, reducing the edge effect. The first preset number and the second preset number can be set proportionally according to the number of pixels in the width and length directions of the grayscale matrix, respectively.
[0039] In this embodiment, by executing step S3200, all grayscale matrices are stitched together according to their positional relationships. The first stitched matrix corresponds to the original image size. After executing step S3200 and obtaining the first stitched matrix, it is necessary to traverse each pixel in the first stitched matrix, extract all overlapping pixels, and perform stitching processing on each overlapping pixel.
[0040] In an exemplary embodiment, step S3300, "performing splicing processing on the overlapping areas of the first splicing matrix," may include: performing steps S3310-S3330 on each overlapping pixel at the overlapping area. S3310: Calculate the average gray level of the overlapping pixels. G = ; S3320: According to G j andG Calculate the variance value of the overlapping pixels. ; S3330: Determine the variance value With variance threshold If the relationship, < Then the average grayscale value is used. G As the gray value of the overlapping pixel, if ≥ Then delete the grayscale value corresponding to the overlapping pixel. G j The grayscale value of the overlapping pixel is obtained by using cubic spline interpolation.
[0041] In this embodiment, when the variance value Less than the variance threshold When, it indicates the overlapping pixel point J grayscale value G j It exhibits low dispersion, and its grayscale values demonstrate good stability, consistency, and consistency. J grayscale value G j The grayscale value that can represent the overlapping pixels is achieved by using J grayscale value G j average G As the gray level of the overlapping pixel; when the variance Greater than or equal to the variance threshold When, it indicates the overlapping pixel point J grayscale value G j High dispersion, with extreme values, poses a significant risk of inaccurate grayscale values. Therefore, the corresponding overlapping pixel should be deleted. J grayscale value G j The grayscale of the overlapping pixel was obtained by using cubic spline interpolation, which reduced the possibility of anomalies in the crack prediction results.
[0042] In one exemplary embodiment, step S3330, "using cubic spline interpolation to interpolate and obtain the grayscale value of the overlapping pixel," may include steps S3331-S3332: S3331: Select an extension direction centered on the overlapping pixel, and select the nearest pixel at one end of the extension direction. N grayscale value of each pixel G -n Select the nearest [location] at the other end of the extension direction. N grayscale value of each pixelG +n ,in, n =1…… N ; S3332: Based on G -n and G +n Perform cubic spline interpolation to obtain the grayscale value of the overlapping pixel; In this embodiment, the extension direction includes either the vertical direction or the horizontal direction along the overlapping pixel.
[0043] In this embodiment, the gray values of overlapping pixels are obtained by cubic spline interpolation. Information is exchanged between different split blocks, and global features are integrated to achieve a smooth transition between the gray values of overlapping pixels and the gray values of pixels in the vertical or horizontal directions. This ensures a natural transition and effectively reduces discontinuities and visual breaks that may occur during the splicing process.
[0044] To illustrate the crack recognition method based on partitioned convolution of this application, a specific example is described in detail below.
[0045] The UAV's onboard imaging equipment acquires the original images of the aqueduct. The original images are in RGB format and there are 1,000 images. Based on steps S1-S9, cracks in the aqueduct are identified. The cracks on the aqueduct are all short cracks, generally a few millimeters wide and tens of centimeters long.
[0046] S1: Obtain the training image size of the pre-trained convolutional neural network model. The pixel size of the training image is (400, 300). Select 2% of the original image as test images, that is, use 20 test images to perform tensor splitting test. After the test, determine the tensor splitting size as (800, 600). S2: Input an original image of the aqueduct into the image segmentation module, convert it into a third-order tensor (5080, 3960, 3), where 3 represents the three channels: red, green, and blue. That is, the original image is converted into three large tensors with a pixel size of (5080, 3960). The three large tensors are split into tensors of the same size according to (800, 600), and the positional relationship between each split tensor and the large tensor is saved. Each split tensor corresponds to the three channels. The splitting results are as follows Figure 2 As shown, the tensor is split into 7 rows and 7 columns, resulting in a total of 49 split tensors. The diagonal padding represents the overlapping portion. The horizontal numbers indicate the X-axis pixel range of the split tensor, and the vertical numbers indicate the Y-axis pixel range. Figure 2This is just one example of tensor splitting. In actual tensor splitting, there can be overlaps between adjacent rows, between adjacent columns, between any two adjacent columns, and between any two adjacent rows, as long as all the split tensors obtained can fully cover the large tensor converted from the original image.
[0047] S3: Input the data of the three channels corresponding to each split tensor into the convolutional neural network model for independent calculation, and output the gray-level matrix corresponding to each split tensor, with a total of 49 gray-level matrices. S4: Perform the following edge processing on each grayscale matrix: multiply the grayscale values of the top and bottom 8 pixels of the grayscale matrix by a magnification factor of 1.05, and multiply the grayscale values of the left and rightmost 8 pixels of the grayscale matrix by a magnification factor of 1.05. S5: The 49 grayscale matrices after edge processing are spliced together according to the positional relationship saved in step S2 to obtain the first spliced matrix; S6: Traverse the pixels in the first concatenation matrix and extract all overlapping pixels; S7: For each overlapping pixel, calculate the variance value based on multiple grayscale values. and variance threshold Compare; if < Then the average of the multiple gray values is used as the gray value of the overlapping pixel; if ≥ If the gray values of the overlapping pixels are deleted, the gray values of the overlapping pixels are obtained by interpolation using cubic spline interpolation. After processing all overlapping pixels, the crack prediction gray matrix is finally obtained. S8: In the crack prediction grayscale matrix, set pixels with grayscale values of 0-127 to 0, representing that they are not cracks; set pixels with grayscale values of 128-255 to 1, representing that the pixel is a crack, and obtain the crack prediction binary matrix. S9: Convert the crack prediction binary matrix into a crack prediction binary map; S10: Align the crack prediction binary map with the original image using the same pixels to obtain the crack distribution map.
[0048] In this specific example, the time consumption of the crack recognition method based on partitioned convolution of this application was statistically analyzed. The average time for crack recognition of an original aqueduct image was 5 seconds per image. In addition, the second method mentioned in the background art of this application (i.e., image stitching method) was tested, and the average time for crack recognition of an original aqueduct image was 8.2 seconds per image. Furthermore, the original aqueduct image was not split in any way, and the overall image recognition was performed directly, with a time consumption of 62.4 seconds per image. As shown in Table 1, it can be seen that the crack recognition method based on partitioned convolution of this application has a shorter time consumption and a faster speed, which improves the efficiency of recognizing short cracks based on large images.
[0049] Table 1. Time consumed for crack identification in the original image of the aqueduct This application also provides a crack recognition device based on partitioned convolution, such as... Figure 3 As shown, it includes a processor and memory. The memory is used to store the crack detection program based on partitioned convolution; The processor is used to read the crack recognition program based on partitioned convolution and perform the crack recognition method based on partitioned convolution as described in the above embodiments.
[0050] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
Claims
1. A crack detection method based on partitioned convolution, characterized in that, include: Input the original image containing the crack into the image segmentation module, perform tensor segmentation according to the tensor segmentation size, and output Q segmentation tensors of the same size, where Q>1; Each of the split tensors is input into a pre-trained convolutional neural network model, and each of the split tensors is calculated independently to output a grayscale matrix corresponding to each of the split tensors. The convolutional neural network model is used to predict cracks in the original image. All the output grayscale matrices are concatenated to obtain the crack prediction grayscale matrix corresponding to the original image; The original image is fused with the crack prediction grayscale matrix and then visualized to obtain a crack distribution map; The method further includes, before inputting the original image containing the crack into the image segmentation module and performing tensor splitting according to the tensor splitting size: The training image size of the convolutional neural network model is obtained, and the original image is subjected to tensor splitting test based on the training image size to determine the tensor splitting size, wherein the size of the original image is larger than the training image size; The step of obtaining the training image size of the convolutional neural network model and performing tensor splitting tests on the original image based on the training image size to determine the tensor splitting size includes: Obtain the pixel length corresponding to the training image size of the convolutional neural network model. l and pixel width w ; Acquire multiple original images of the target area, and select a test image from the multiple original images according to a predetermined ratio; Split the size according to the first tensor set. Bl Bw For each of the test images, tensor splitting and grayscale calculation are performed to obtain the first grayscale matrix. M1 i ,in, i =1…… I , I This represents the number of test images. B ≥3; Repeat the following steps for one or more rounds of testing until the current average similarity is achieved. S Greater than the preset similarity threshold S T Then set the tensor split size to the second tensor split size of the current round. Al Aw ,1≤ A < B Or, until A = B hour, S Still not greater than S T Then set the tensor split size to Bl Bw : Split size according to the current round's second tensor. Al Aw For each of the test images, tensor splitting and grayscale calculation are performed to obtain the current second grayscale matrix. M2 i ,calculate M2 i and M1 i Current similarity S i During the first round of testing A =1; Calculate the current average similarity S = ,judge S and S T If the relationship, S ≤ S T ,Will A Set to A + d To proceed to the next round of testing, in which... d The step size is a number that is greater than 0.
2. The crack identification method based on partitioned convolution as described in claim 1, characterized in that: The original image contains short cracks; The short crack must satisfy at least one of the following conditions: the crack pixel width is less than one pixel, the crack pixel length is less than ten pixels, the crack pixel width is less than 1 / 100 of the original image pixel width, and the crack pixel length is less than 1 / 100 of the original image pixel length.
3. The crack identification method based on partitioned convolution as described in claim 1, characterized in that, The tensor splitting and grayscale calculation for each of the test images includes: Perform the following steps for each of the test images: The test image is input into the image segmentation module and converted into a third-order tensor. L , W , C ); According to the tensor splitting size set for the test image, the third-order tensor ( L , W , C Perform tensor splitting to obtain multiple tensors; Each tensor is input into the convolutional neural network model, and the grayscale matrix corresponding to each tensor is output. Concatenate all the output grayscale matrices to obtain the grayscale matrix corresponding to the test image; in, L , W, C These represent the pixel length, pixel width, and number of color channels of the test image, respectively.
4. The crack identification method based on partitioned convolution as described in claim 1, characterized in that, The step of inputting each of the split tensors into a pre-trained convolutional neural network model, independently calculating each of the split tensors, and outputting the grayscale matrix corresponding to each of the split tensors includes: For each of the split tensors, perform the following steps: Input the split tensor into the convolutional neural network model; Convolution, activation, and pooling calculations are performed based on the convolutional neural network model, and crack feature extraction and grayscale calculation are performed to output the grayscale matrix corresponding to the split tensor.
5. The crack identification method based on partitioned convolution as described in claim 1 or 3, characterized in that, The process of concatenating all the output grayscale matrices includes: Edge processing is performed on each of the grayscale matrices: the grayscale values of the first preset number of pixels located at the leftmost and rightmost edges of the grayscale matrix are multiplied by an amplification factor, and the grayscale values of the second preset number of pixels located at the top and bottom edges of the grayscale matrix are multiplied by the amplification factor. All grayscale matrices after edge processing are arranged according to their positional relationship to obtain a first concatenation matrix, wherein the positional relationship is the positional relationship between the split tensor and the original image; The overlapping areas of the first stitching matrix are stitched together, and each overlapping pixel in the overlapping area includes gray values corresponding to multiple gray-scale matrices. G j ; in, j =1…… J , J Represents each overlapping pixel point G j The quantity, 2≤J≤4.
6. The crack identification method based on partitioned convolution as described in claim 5, characterized in that, The process of splicing the overlapping parts of the first splicing matrix includes: For each overlapping pixel in the overlapping area, perform the following steps: Calculate the average grayscale value of the overlapping pixels. G = ; According to G j Calculate the variance of the overlapping pixels using G. ; Determine the variance value With variance threshold If the relationship, < Then the average grayscale value is used. G As the gray value of the overlapping pixel, if ≥ Then delete the grayscale value corresponding to the overlapping pixel. G j The grayscale value of the overlapping pixel is obtained by using cubic spline interpolation.
7. The crack identification method based on partitioned convolution as described in claim 6, characterized in that, The step of using cubic spline interpolation to obtain the grayscale value of the overlapping pixel includes: Select an extension direction centered on the overlapping pixel, and select the nearest pixel at one end of the extension direction. N grayscale value of each pixel G -n Select the nearest [location] at the other end of the extension direction. N grayscale value of each pixel G +n ,in, n =1…… N ; based on G -n and G +n Perform cubic spline interpolation to obtain the grayscale value of the overlapping pixel; The extension direction includes either the vertical direction or the horizontal direction along the overlapping pixel.
8. A crack detection device based on partitioned convolution, comprising a processor and a memory, characterized in that: The memory is used to store the crack detection program based on partitioned convolution; The processor is configured to read the partitioned convolution-based crack identification program and perform the partitioned convolution-based crack identification method as described in any one of claims 1-7.
Citation Information
Patent Citations
Convolutional neural network training method based on tensor singular value delimitation
CN111967574A
Fusing FBIS & DVS data streams using a neural network
US20220156532A1
