A crack image training detection method based on feature pyramid network
The crack image training and detection method through the feature pyramid network solves the problem of time-consuming manual detection and high computing resources in traditional methods, achieves fast and accurate detection of cracks in large-size images, and improves detection efficiency and reliability.
Patent Information
- Application Number
- CN202411029373.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-30
AI Technical Summary
Traditional crack detection methods rely on manual visual inspection, which is time-consuming and highly subjective. It is difficult to effectively handle the diverse cracks in large-size images and requires high computing and memory.
A crack image training and detection method based on feature pyramid network is used to construct a complete data set through data preprocessing, edge filling, sliding window operation and sub-image screening, and the feature pyramid network is used for crack detection.
It achieves fast and accurate detection of cracks in large-size images, improves detection efficiency and reliability, and reduces the subjectivity and computing resource consumption of traditional methods.
Smart Images

Figure CN118552547B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of structural inspection, and in particular to a crack image training detection method based on a feature pyramid network. Background Art
[0002] In the field of structural inspection, cracks refer to small or large cracks that appear in structures such as buildings, bridges, and roads. The presence of cracks may lead to weakening, damage, or even collapse of the structure, so early detection and accurate detection of cracks are crucial for the safety and maintenance of the structure. Traditional crack detection methods usually rely on manual visual inspection, which is time-consuming and subjective, and prone to missed detection or false detection. In recent years, with the development of deep learning and computer vision, automatic crack detection methods based on image processing and machine learning have gradually attracted attention. Convolutional neural networks have achieved excellent performance in tasks such as image classification, object detection, and segmentation. However, the processing of large-scale images remains a challenge because they usually have high resolution and complex structures, resulting in high computational and memory requirements. Cracks may have diverse sizes and shapes in large-scale images, and a method that can effectively handle cracks is needed. Summary of the invention
[0003] In view of the above problems, the present invention is proposed to provide a crack image training detection method based on a feature pyramid network that overcomes the above problems or at least partially solves the above problems.
[0004] According to one aspect of the present invention, a crack image training detection method based on a feature pyramid network is provided, and the image training detection method comprises: collecting a crack image data set; performing data preprocessing and adjustment on the crack image data set to obtain a preprocessed image; determining a split size according to a splitting principle; performing edge filling on the preprocessed image to obtain an edge filling image; performing a sliding window operation on the edge filling image to generate a sub-image; performing a screening operation on the sub-image; processing each crack image data to construct a complete data set, and completing crack detection using a feature pyramid network.
[0005] Optionally, the collecting of the crack image dataset specifically includes: collecting the crack image dataset by photographing with a high-definition camera or acquiring from a relevant database.
[0006] Optionally, the preprocessing and adjusting the crack image dataset to obtain the preprocessed image specifically includes: if the original image size is larger than a size threshold, reducing the original image to a size within the size threshold range; and using bilinear interpolation to adjust the image size.
[0007] Optionally, determining the splitting size according to the splitting principle specifically includes: selecting the splitting size will balance the consumption of computing resources and the retention of crack detail information; retaining overlapping parts between adjacent split images, providing more complete crack information, and reducing errors introduced at the boundaries.
[0008] Optionally, the edge-filling the preprocessed image to obtain the edge-filled image specifically includes: before image splitting, edge-filling the crack image to ensure that the image size is a multiple of the splitting size; adding appropriate pixel values to expand the image to a suitable size.
[0009] Optionally, performing a sliding window operation on the edge-filled image to generate a sub-image specifically includes: using a sliding window method to move a fixed window on the edge-filled image to generate a sub-image.
[0010] Optionally, the size of the fixed window is: the step lengths of rows and columns are 16m and 16n, respectively, so as to ensure that there are overlapping parts between sub-images.
[0011] Optionally, the screening operation of the sub-images specifically includes: for each sub-image, determining whether it contains cracks; if the sub-image contains crack pixels, it will be used as a positive sample; randomly selecting an equal number of sub-images containing only background as negative samples to ensure that the number of crack and background samples in the training set is balanced.
[0012] Optionally, the processing of each crack image data, constructing a complete data set, and using a feature pyramid network to complete crack detection specifically includes: using the constructed training set to train the feature pyramid network; through the training process, optimizing the parameters and weights of the network for detecting crack images; after the training is completed, applying the trained network to new crack images to detect and identify cracks.
[0013] The present invention provides a crack image training detection method based on a feature pyramid network, the image training detection method comprising: collecting crack image data sets; preprocessing and adjusting the crack image data sets to obtain preprocessed images; determining the split size according to the splitting principle; edge filling the preprocessed images to obtain edge filling images; performing a sliding window operation on the edge filling images and generating sub-images; performing a screening operation on the sub-images; processing each crack image data to construct a complete data set, and completing crack detection using a feature pyramid network. The method can quickly and accurately detect cracks in large-size images, thereby improving the efficiency and reliability of crack detection.
[0014] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0016] Figure 1 A flow chart of a crack image training detection method based on a feature pyramid network provided in an embodiment of the present invention.
[0017] Figure 2 It is a schematic diagram of the process of edge filling and sliding window operation in the present invention.
[0018] Figure 3 It is a schematic diagram of neutron image screening in the present invention.
[0019] Figure 4 It is a schematic diagram of the feature pyramid network structure described in the present invention.
[0020] Figure 5 It is a schematic diagram of the crack detection result described in the present invention. DETAILED DESCRIPTION
[0021] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0022] The terms "comprises" and "having" and any variations thereof in the description embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.
[0023] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0024] The surface cracks of a steel box girder are taken as an example to illustrate the crack image training and detection method based on a feature pyramid network for large-size images proposed in the present invention.
[0025] like Figure 1 As shown, the present invention comprises the steps of:
[0026] Data acquisition: Collect large-scale crack image datasets, captured by high-definition cameras or obtained from relevant databases. Ensure that the images have sufficient resolution and clarity.
[0027] Choose a suitable method to obtain the surface crack image data of the steel box girder. Use a high-definition camera to shoot, and ensure that the camera has sufficient pixels and resolution. In addition, obtain existing crack image data from relevant databases, which may contain annotated images for training and evaluating models. Determine the standards and requirements for data collection. Ensure that the image acquisition fully displays the crack conditions on the surface of the steel box girder, including cracks of different shapes, sizes and directions. At the same time, the image is required to be clear enough to accurately capture and represent the details of the cracks.
[0028] Data preprocessing and resizing: If the original image size is too large, reduce it to a suitable size to reduce the consumption of computing resources. Use bilinear interpolation or other interpolation methods to resize the image.
[0029] Determine the target size: Determine the target image size required based on specific needs and computing resource limitations. This size is a fixed value and is also adjusted dynamically based on specific circumstances. Image resizing: Use an appropriate interpolation method to resize the original image. Common interpolation methods include bilinear interpolation, nearest neighbor interpolation, and bicubic interpolation. These methods maintain image detail and clarity, minimizing information loss while changing size. Adjust proportions and aspect ratios: When resizing, pay attention to maintaining the proportions and aspect ratios of the image. Adjust the width and height of the image according to the target size ratio to avoid image deformation or stretching.
[0030] Determination of split size: Select an appropriate split size, such as 32m×32n, where m and n are integers greater than 1. This size should be able to meet the requirements of computing resources while retaining the detailed information of the cracks.
[0031] Determine the split size: Select an appropriate split size based on the requirements of computing resources and the retention of crack detail information. For example, select a size of 32m×32n, where m and n are integers greater than 1. This size should be small enough to meet the limitations of computing resources, while being large enough to retain the detail information of the crack. Consider the size of the crack: When selecting the split size, the size of the crack needs to be considered. Make sure that the selected split size is large enough to cover the entire area of the crack without splitting the crack into multiple small fragments. This ensures the integrity and accuracy of the crack. Consider the overlapping area: In order to ensure that the crack is not missed by the split size limit, it is necessary to introduce an appropriate overlapping area between adjacent split images. The overlapping area refers to retaining a certain overlap on the boundary of adjacent images. In this way, more complete crack information is provided and the error introduced at the boundary is reduced. Determine the size of the overlapping area: The size of the overlapping area is determined according to the specific situation. Usually, the size of the overlapping area is selected as a part of the split size, such as 20% to 30% of the split size. Make sure that there is enough overlap between adjacent images to capture the continuity and details of the crack.
[0032] Edge padding: Pad the image to ensure that the image size is a multiple of the split size. The image is expanded to the appropriate size by adding appropriate pixel values.
[0033] Calculate the padding size: Calculate the number of pixels that need to be padded in the width and height of the image. The required padding size is obtained by subtracting the size of the original image from the target size. Figure 2 As shown in the figure, edge padding operation: the image is extended to the target size using appropriate pixel values (such as 0). Use various image processing libraries or functions to perform edge padding operations. During the padding process, pixel values are added to the edges of the image to ensure that the image size reaches the desired target size. After completing the edge padding, the image is split according to the previously selected split size. The splitting process can be operated according to specific needs and the tools used.
[0034] Sliding window operation: Use the sliding window method to move a fixed-size window on the edge-filled image to generate sub-images. Set the row and column step sizes to 16m and 16n to ensure that there is a certain overlap between the sub-images;
[0035] Determine the step size: Set the row and column step sizes to 16m and 16n. The step size determines the distance the sliding window moves on the image. By using a larger step size, the sliding window operation is accelerated. At the same time, to ensure that there is a certain overlap between sub-images, this step size should be smaller than the size of the sliding window. Sliding window operation: Starting from the upper left corner of the edge-filled image, move the sliding window on the image with a specified step size. At each position, intercept a sub-image of the size of the sliding window. Use an image processing library or function to perform the sliding window operation. Overlap: Ensure that there is a certain overlap between sub-images. By using a step size smaller than the sliding window size, overlap between sub-images is achieved. Ensure the continuity of the cracks and reduce the errors introduced at the boundaries. Sub-image saving: Save each intercepted sub-image for subsequent processing and analysis. Store the sub-images as separate image files or use other data structures for storage, depending on the requirements.
[0036] Sub-image screening: For each sub-image, determine whether it contains cracks. If the sub-image contains crack pixels, use it as a positive sample. At the same time, randomly select an equal number of sub-images containing only background as negative samples. Ensure that the number of crack and background samples in the training set is balanced.
[0037] For each generated sub-image, use manual or image processing algorithms to analyze it to determine whether there are crack pixels. If there are crack pixels in the sub-image, mark it as a positive example. Background selection: Randomly select an equal number of sub-images from the remaining sub-images as negative samples, which only contain background pixels. Make sure that the number of crack and background samples in the training set is balanced to avoid the impact of class imbalance on model training.
[0038] Sample balance: Ensure that the number of crack and background samples is balanced. If the number of positive samples (containing cracks) is small, randomly select the corresponding number of negative samples (containing only background) from the generated sub-images to supplement them. Figure 3 As shown, this ensures that the number of samples of different categories in the training set is similar, allowing the model to better learn the distinction between cracks and background.
[0039] Repeat steps: Each large-size crack image is processed according to the above steps to build a complete training set and complete crack detection using the feature pyramid network.
[0040] Using the constructed training set, the feature pyramid network is used for crack detection. The feature pyramid network is a model based on deep learning (such as Figure 4As shown in the figure), it is used to extract multi-scale features of the image and perform crack detection. The feature pyramid network obtains feature representations of different scales by introducing multiple parallel convolutional layers or pooling layers in the network, thereby better capturing the details and contextual information in the image. Multi-scale feature extraction: The feature pyramid network processes input images at different scales by introducing multiple parallel convolutional layers or pooling layers in the network. These layers can have different receptive field sizes or downsampling rates to obtain multi-scale feature representations. Generally, deeper layers correspond to smaller receptive fields, while shallower layers correspond to larger receptive fields. The final crack detection result of the network is shown in Figure 5 shown.
[0041] Beneficial effects: The present invention performs crack detection on large-size images, overcoming the problem of high computational and memory requirements of traditional methods when processing large-size images. Through the design and optimization of the feature pyramid network, the present invention can efficiently process large-size images and improve processing efficiency. The present invention adopts the feature pyramid network as the core deep learning architecture, and realizes accurate detection and segmentation of cracks through multi-level feature pyramids. Compared with the traditional single-scale method, the feature pyramid network has the ability to process cracks of different scales, and improves the detection ability of multi-scale cracks. The present invention realizes automated crack detection and reduces the subjectivity and time-consuming problems of traditional manual visual inspection. Through the trained feature pyramid network, the present invention can quickly and accurately detect cracks in large-size images, improving the efficiency and reliability of crack detection. Through the method of the present invention, the advantages of large-size images and feature pyramid networks can be fully utilized to achieve efficient and accurate detection and positioning of cracks. The method has broad application prospects and can be applied to fields such as structural safety monitoring, building maintenance and road management to improve the safety and sustainability of structures.
[0042] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A crack image training detection method based on feature pyramid network, characterized in that: The image training detection method comprises: Collect crack image datasets; The crack image data set is preprocessed and adjusted to obtain a preprocessed image, including: If the size of the original image is larger than the size threshold, reducing the original image to a size within the size threshold range; Use bilinear interpolation for image resizing; Determine the split size based on the splitting principle, including: The choice of split size will balance the consumption of computing resources and the retention of fracture detail information; Preserving the overlap between adjacent split images provides more complete crack information and reduces the error introduced at the boundary; Filling the edge of the preprocessed image to obtain an edge-filled image includes: Before image splitting, the crack image will be edge-filled to ensure that the image size is a multiple of the split size; Add appropriate pixel values to expand the image to the appropriate size; Performing a sliding window operation on the edge-filled image and generating a sub-image includes: Using the sliding window method, a fixed window is moved on the edge-filled image to generate a sub-image; The sub-image is subjected to a screening operation, including: For each sub-image, determine whether it contains a crack; If the sub-image contains crack pixels, it will be considered as a positive sample; Randomly select an equal number of sub-images containing only background as negative samples to ensure that the number of crack and background samples in the training set is balanced; Each crack image data is processed to construct a complete data set, and the feature pyramid network is used to complete crack detection.
2. A crack image training detection method based on feature pyramid network according to claim 1, characterized in that: The collecting of the crack image data set specifically includes: The crack image dataset is collected by taking pictures with a high-definition camera or obtaining them from relevant databases.
3. The crack image training detection method based on feature pyramid network according to claim 1 is characterized in that: The size of the fixed window is: the step lengths of rows and columns are 16m and 16n, respectively, for ensuring that there are overlapping parts between sub-images, wherein m and n are both integers greater than 1.
4. The crack image training detection method based on feature pyramid network according to claim 1 is characterized in that: The processing of each crack image data, constructing a complete data set, and completing crack detection using a feature pyramid network specifically includes: The constructed training set will be used to train the feature pyramid network; Through the training process, the parameters and weights of the network are optimized for detecting crack images; After the training is completed, the trained network is applied to new crack images for crack detection and identification.
