An anti-counterfeiting method for concrete specimens based on AI image recognition
By using AI image recognition technology on concrete specimens, combined with the dual-branch ViT structure and YOLOv8 model, the problem of possible replacement of specimens by the construction unit is solved, the accuracy and safety of concrete detection are improved, and the quality of the construction project is ensured. and safety.
Patent Information
- Application Number
- CN202410742697.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-06-11
AI Technical Summary
During the concrete witness sampling process, the construction unit may exchange test pieces through illegal means, resulting in inaccurate test results and threatening the quality and safety of the construction project.
Using an AI-based image recognition method, by inserting a label with a QR code on the surface of the concrete specimen, photos of dry and wet conditions were taken, and the dual-branch ViT structure and YOLOv8 model were used for feature extraction and matching, combined with multi-head Cross attention module and relationship network to determine whether the test object has been switched.
It effectively improves the accuracy and safety of concrete specimen detection, reduces the possibility of misdetection and missed detection, and ensures the authenticity and integrity of the specimen.
Smart Images

Figure CN118570501B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of concrete witness sampling, and in particular to an anti-counterfeiting method for concrete specimens based on image recognition based on AI. Background Art
[0002] Concrete witness sampling means that under the supervision of the supervision unit or the construction unit, the relevant personnel of the construction unit take samples on site and send them to the testing unit with corresponding qualifications for testing. This process ensures the integrity and authenticity of the test pieces from the construction site to the laboratory, thereby ensuring the accuracy and reliability of the concrete test results.
[0003] The purpose of witness sampling is to ensure that the quality of concrete meets the design requirements and relevant standards. Through witness sampling, the supervision unit or construction unit can supervise the quality of concrete used by the construction unit to avoid the use of unqualified materials, thereby ensuring the quality and safety of the construction project.
[0004] However, in actual witnessed concrete sampling, some construction units may use illegal means to replace concrete specimens in order to evade inspection, so that the concrete inspection results are qualified. This not only seriously violates the norms and standards of the construction industry, but also poses a potential threat to the quality and safety of construction projects.
[0005] Therefore, it is urgent to improve this shortcoming. The present invention studies and improves the existing technical deficiencies and provides an anti-counterfeiting method for concrete specimens based on AI image recognition. Summary of the invention
[0006] The purpose of the present invention is to provide an AI-based image recognition concrete specimen anti-counterfeiting method to solve the problems raised in the above background technology.
[0007] To achieve the above object, the present invention provides the following technical solution: an anti-counterfeiting method for concrete specimens based on AI image recognition, comprising the following steps:
[0008] S1. When sampling, insert a label with a QR code on the surface of the concrete specimen and take a photo to obtain a wet concrete photo, i.e., a wet photo;
[0009] S2. After the curing is completed, the builder sends the test piece to the testing agency. After receiving the test piece, the testing agency takes a photo of the test piece and obtains a photo of the solidified concrete, i.e., the solidified photo;
[0010] S3, using a dual-branch ViT structure to extract features from photos in dry and wet states respectively, and the solidified photos and wet photos are processed by independent ViT branches respectively;
[0011] S3. By integrating BiFPN into the YOLOv8 model, an AI model is constructed, and the AI model is used to identify solidified photos to find the contours and relative position information of the label and the specimen;
[0012] S4. Matching based on digital image processing: scale the labels in the solidified photo and the wet photo to the same size, adjust the directions of the two photos so that the label marking points completely overlap, and then determine whether the contours of the dry and wet concrete photos can be aligned. If they cannot be completely aligned, it can be considered a fake specimen and the discrimination task is completed. Because the wet photo contains the thickness of the mold frame, the contour side length of the wet photo is greater than that of the solidified photo. To determine whether it is completely aligned, the following three conditions must be met at the same time: the corresponding edges are parallel lines and the spacing between the corresponding edges is the same, or the four intersection points of the diagonals are on the same straight line and the straight line passes through the center point of the image. If the contours of the wet concrete photos can be aligned, the contours of the wet concrete photos are cropped according to the contour size of the solidified photos to remove the mold frame thickness in the wet concrete test photo. Processing similarity scores based on deep learning: A dual-branch ViT structure is used to extract features from photos in dry and wet states. The features that can be extracted include but are not limited to the QR code on the label, the marking points, the random graphics generated by the hollow part of the label embedded in the concrete surface, and the concave and convex points randomly generated in other areas of the concrete surface. The solidified photos and wet photos are processed by independent ViT branches, and then the global context dependency is learned through the self-attention mechanism to generate their own high-level semantic feature representations. Then, a multi-head cross-attention module is used to enable the model to focus on the relevant parts between the features of the dry and wet photos, explore and infer the correspondence and consistency between the two in local areas, and finally, the relationship measure between each feature pair is calculated by integrating the relationship network to generate a comprehensive similarity score;
[0013] S5. Combine the alignment results of the solidified state photo and the wet state photo to determine the replacement of the specimen. If the label position and angle in the two images and the four corner vertices of the specimen can be aligned, and the two similarity scores described in step S4 reach the set value, the specimen is considered to be a real specimen, otherwise the specimen is considered to be replaced. Due to the different angles, scenes and equipment used to take photos of dry and wet concrete, the photos will be distorted during the shooting process. At this time, the digital image method cannot achieve pixel position alignment. At this time, deep learning can be used to measure feature similarity.
[0014] Furthermore, in step S4, the AI model uses the YOLOv8 model as the basic framework, including a backbone part, a neck part and a head part, wherein the backbone part is the main network of the model, which consists of five convolution modules, four C2f modules and one SPPF module. The functions of each module are as follows:
[0015] Convolution module: responsible for feature extraction. Through convolution operation, useful feature information is extracted from the input data to provide a basis for subsequent target detection tasks.
[0016] C2f module: responsible for fusing feature maps of different scales to improve the accuracy of target detection. Through feature fusion, feature information at different levels is combined to better capture the details and contextual information of the target.
[0017] SPPF module: responsible for fusing feature maps of different receptive fields to enrich the expressive power of feature maps. It performs maximum pooling operations by cascading multiple small-sized pooling kernels to replace traditional large-sized pooling operations and improve the running speed.
[0018] Furthermore, the neck part uses BiFPN to process the multi-scale feature map from Backbone. The BiFPN is based on the construction of feature pyramid and bidirectional feature fusion to improve the accuracy and efficiency of the target detection task through multi-scale feature fusion. Specifically, the logic includes the following:
[0019] Feature pyramid generation: Multi-scale features are extracted from the input image through a convolutional neural network to form a feature pyramid. The feature pyramid has multiple levels, each corresponding to a different scale;
[0020] Bidirectional connection: Bidirectional connection is introduced between adjacent levels of the feature pyramid. Information flows from higher-level features to lower-level features through a top-down path. Top-down feature propagation enables semantic information in high-level feature maps to be passed down to lower levels, enhancing the recognition ability of low-level features for targets. Or it flows from lower-level features to higher-level features through a bottom-up path. Bottom-up feature propagation enables detailed information in low-level feature maps to be passed up to higher levels, supplementing the lack of details in high-level features.
[0021] Feature integration: Bidirectional connections allow the integration of information from different levels of the feature pyramid in both directions, which helps to effectively capture multi-scale features;
[0022] Weighted feature fusion: Using the weighted feature fusion mechanism, each input feature is given a learnable weight when fused, so that the network can automatically learn the importance of different features and adjust the fusion ratio as needed.
[0023] Furthermore, in step S3, the model is trained after the AI model is built, specifically including: improving the convergence speed and accuracy of the model by adjusting the learning rate, loss function and optimizer parameters, and using integrated learning methods such as AdaGrad, Adam, etc. to improve model performance.
[0024] Furthermore, in step S3, the original image is preprocessed before using the AI model, and the preprocessing specifically includes the following operations:
[0025] Image scaling: The original image is resized to the fixed size required by the model through interpolation methods, including direct scaling and scaling while maintaining the aspect ratio of the image;
[0026] Image rotation: Rotate the image by a certain angle with the center point of the image as the rotation center to eliminate the model's dependence on a specific direction or angle and improve the robustness of the model;
[0027] Image flipping: Flip the image horizontally or vertically, with horizontal flipping being performed along the vertical center axis of the image and vertical flipping being performed along the horizontal center axis of the image to increase data diversity and reduce the model’s reliance on directional features;
[0028] Cropping: Cropping the background part of the image to help the model better process the target;
[0029] Color transformation: adjust the image’s brightness, contrast, saturation and other color attributes to increase the model’s color invariance;
[0030] Normalization: Scale the pixel values of an image to a specific range.
[0031] Furthermore, in step S3, the dual-branch ViT structure combines the convolution branch and the transformer branch to process information in parallel to maximize the retention of features at two different levels, and fuses the features of dry and wet state photos through a multi-head cross-attention module to discover their intrinsic correlation.
[0032] Furthermore, the transformer branch is based on the Transformer model and is responsible for capturing long-distance dependencies and global context information. The processing operations of the transformer branch include: dividing the original pixel-level image into several patches of fixed size, each patch is converted into a token, and then learning the global context dependencies through the self-attention mechanism to generate their own high-level semantic feature representations. In addition, the Transformer branch also gradually extracts higher-level feature representations through multi-layer stacked Transformer layers.
[0033] Furthermore, in the multi-head cross-attention module, tokens from solidified photos act as queries, while tokens from wet photos act as keys and values. Through the cross-attention mechanism, the relevant parts between the features of dry and wet concrete photos are focused on to explore and infer the correspondence and consistency between the two in local areas.
[0034] Furthermore, the multi-head cross-attention module introduces a deep neural network to deeply understand and aggregate the features after the cross-attention mechanism interacts, and generates a comprehensive similarity score by introducing a relational network to calculate the relationship metrics between each feature pair, so as to strengthen the mining of these corresponding relationships and quantify the degree of match between the two photos.
[0035] The present invention provides an AI-based image recognition concrete specimen anti-counterfeiting method, which has the following beneficial effects:
[0036] 1. The present invention adopts a dual-branch ViT structure to extract features from photos in two different states respectively, and the solidified photos and wet photos are processed by independent ViT branches respectively, which effectively improves the performance and accuracy of feature extraction. A multi-head cross-attention module is designed so that the model can focus on the relevant parts between the features of dry and wet photos, explore and infer the correspondence and consistency between the two in local areas, and further introduces a relational network to deeply understand and aggregate the features after the interaction of the cross-attention mechanism, combined with calculation to strengthen the mining of corresponding relationships and quantify the degree of matching between the two photos.
[0037] 2. The present invention integrates BiFPN into the YOLOv8 model to construct an AI model, so that the model can give full play to its advanced feature fusion advantages when identifying solidified photos, and accurately find the location information of labels and specimens in the image, which specifically includes the following advantages:
[0038] Accurate multi-scale detection: BiFPN's bidirectional fusion capability enables the YOLOv8 model to effectively process solidified specimens of different sizes, achieving high-accuracy detection regardless of the size of the specimen;
[0039] Context awareness: By integrating rich context information, the YOLOv8 model combined with BiFPN can better understand the image content and accurately identify the target specimen in a complex background;
[0040] Reduce false detection and missed detection: BiFPN's bidirectional information transmission mechanism enhances the model's sensitivity to small targets while maintaining stable detection of large targets, reducing the possibility of false detection and missed detection;
[0041] Robustness: Even in the case of poor image quality or occlusion, the YOLOv8 model combined with BiFPN can still maintain a high recognition accuracy, showing good robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1A schematic diagram of a process of an anti-counterfeiting method for concrete specimens based on AI image recognition according to the present invention;
[0043] Figure 2 A schematic diagram of the backbone part of an anti-counterfeiting method for concrete specimens based on AI image recognition according to the present invention;
[0044] Figure 3 A schematic diagram of a convolution module of an AI-based image recognition concrete specimen anti-counterfeiting method of the present invention;
[0045] Figure 4 This is a schematic diagram of the C2f module of an AI-based image recognition concrete specimen anti-counterfeiting method of the present invention. DETAILED DESCRIPTION
[0046] The following embodiments of the present invention are described in further detail in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0047] like Figure 1-Figure 4 As shown, an anti-counterfeiting method for concrete specimens based on AI image recognition includes the following steps:
[0048] S1. When sampling, insert a hollow label with a QR code on the surface of the concrete specimen and take a photo to obtain a wet concrete photo, i.e., a wet photo. The label actively creates image features to provide a reference point for subsequent image comparison;
[0049] S2. After the curing is completed, the builder sends the test piece to the testing agency. After receiving the test piece, the testing agency takes a photo of the test piece and obtains a photo of the solidified concrete, i.e., the solidified photo;
[0050] S3. By integrating BiFPN into the YOLOv8 model, an AI model is constructed, and the AI model is used to recognize solidified photos, find the outline and relative position information of the label and the specimen, and recognize the frame of the dry specimen. The AI model recognition includes AI recognition of the material of the specimen, including but not limited to recognition of wet specimens, dry specimens, plastics, paper, labels, etc.
[0051] In step S3, the AI model uses the YOLOv8 model as the basic framework, including the backbone part, the neck part and the head part. The backbone part is the main network of the model, which consists of five convolution modules, four C2f modules and one SPPF module. The functions of each module are as follows:
[0052] Convolution module: responsible for feature extraction. Through convolution operation, useful feature information is extracted from the input data to provide a basis for subsequent target detection tasks.
[0053] C2f module: responsible for fusing feature maps of different scales to improve the accuracy of target detection. Through feature fusion, feature information at different levels is combined to better capture the details and contextual information of the target.
[0054] SPPF module: responsible for fusing feature maps of different receptive fields to enrich the expressiveness of feature maps. It performs maximum pooling operations by cascading multiple small-sized pooling kernels to replace traditional large-sized pooling operations and improve the running speed.
[0055] The neck part uses BiFPN to process the multi-scale feature map from Backbone. The BiFPN is based on the construction of feature pyramid and bidirectional feature fusion. It improves the accuracy and efficiency of the target detection task through multi-scale feature fusion. The specific logic includes the following:
[0056] Feature pyramid generation: Multi-scale features are extracted from the input image through a convolutional neural network to form a feature pyramid. The feature pyramid has multiple levels, each corresponding to a different scale;
[0057] Bidirectional connection: Bidirectional connection is introduced between adjacent levels of the feature pyramid. Information flows from higher-level features to lower-level features through a top-down path. Top-down feature propagation enables semantic information in high-level feature maps to be passed down to lower levels, enhancing the recognition ability of low-level features for targets. Or it flows from lower-level features to higher-level features through a bottom-up path. Bottom-up feature propagation enables detailed information in low-level feature maps to be passed up to higher levels, supplementing the lack of details in high-level features.
[0058] Feature integration: Bidirectional connections allow the integration of information from different levels of the feature pyramid in both directions, which helps to effectively capture multi-scale features;
[0059] Weighted feature fusion: Using the weighted feature fusion mechanism, each input feature is given a learnable weight when fused, so that the network can automatically learn the importance of different features and adjust the fusion ratio as needed;
[0060] In step S3, after the AI model is built, the model is trained, specifically including: adjusting the learning rate, loss function, and optimizer parameters to improve the convergence speed and accuracy of the model, and using ensemble learning methods such as AdaGrad, Adam, etc. to improve model performance;
[0061] In step S3, before using the AI model, the original image is preprocessed, and the preprocessing specifically includes the following operations:
[0062] Image scaling: The original image is resized to the fixed size required by the model through interpolation methods, including direct scaling and scaling while maintaining the aspect ratio of the image;
[0063] Image rotation: Rotate the image by a certain angle with the center point of the image as the rotation center to eliminate the model's dependence on a specific direction or angle and improve the robustness of the model;
[0064] Image flipping: Flip the image horizontally or vertically, with horizontal flipping being performed along the vertical center axis of the image and vertical flipping being performed along the horizontal center axis of the image to increase data diversity and reduce the model’s reliance on directional features;
[0065] Cropping: Cropping the background part of the image to help the model better process the target;
[0066] Color transformation: adjust the image’s brightness, contrast, saturation and other color attributes to increase the model’s color invariance;
[0067] Normalization: scaling the pixel values of an image to a specific range;
[0068] S4. Matching based on digital image processing: scale the labels in the solidified photo and the wet photo to the same size, adjust the directions of the two photos so that the label marking points completely overlap, and then determine whether the contours of the dry and wet concrete photos can be aligned. If they cannot be completely aligned, it can be considered a fake specimen and the discrimination task is completed. Because the wet photo contains the thickness of the mold frame, the contour side length of the wet photo is greater than that of the solidified photo. To determine whether it is completely aligned, the following three conditions must be met at the same time: the corresponding edges are parallel lines and the spacing between the corresponding edges is the same, or the four intersection points of the diagonals are on the same straight line and the straight line passes through the center point of the image. If the contours of the wet concrete photos can be aligned, the contours of the wet concrete photos are cropped according to the contour size of the solidified photos to remove the mold frame thickness in the wet concrete test photo. Similarity score processing based on deep learning: A dual-branch ViT structure is used to extract features from photos in dry and wet states respectively. The features that can be extracted include but are not limited to the QR code on the label, marking points, random graphics generated by the hollow part of the label embedded in the concrete surface, and concave and convex points randomly generated in other areas of the concrete surface. The solidified photos and wet photos are each processed by an independent ViT branch, and then the global contextual dependencies are learned through the self-attention mechanism to generate their own high-level semantic feature representations. Then, a multi-head cross-attention module is used to enable the model to focus on the relevant parts between the features of the dry and wet photos, explore and infer the correspondence and consistency between the two in local areas, and finally, the relationship metrics between each feature pair are calculated by integrating the relationship network to generate a comprehensive similarity score.
[0069] In step S4, a dual-branch ViT structure is used to process the solidified photos and wet photos through independent ViT branches, and the global context dependency is learned through the self-attention mechanism to generate their respective high-level semantic feature representations. The features of the dry and wet photos are fused through the multi-head cross attention module, and their internal connections are discovered through the relationship network;
[0070] The ViT structure branch is based on the Transformer model and is responsible for capturing long-distance dependencies and global context information. The processing operations of the transformer branch include: dividing the original pixel-level image into several patches of fixed size, each patch is converted into a token, and then learning the global context dependencies through the self-attention mechanism to generate their own high-level semantic feature representations. In addition, the Transformer branch also gradually extracts higher-level feature representations through multiple stacked Transformer layers;
[0071] In the multi-head cross-attention module, tokens from solidified photos serve as queries, while tokens from wet photos serve as keys and values. Through the cross-attention mechanism, the module focuses on the relevant parts between the features of dry and wet concrete photos, and explores and infers the correspondence and consistency between the two in local areas. The multi-head cross-attention module introduces a deep neural network to deeply understand and aggregate the features after the cross-attention mechanism interacts, and generates a comprehensive similarity score by calculating the relationship metrics between each feature pair to strengthen the mining of these correspondences and quantify the matching degree between the two photos.
[0072] S5. Combine the alignment results of the solidified state photo and the wet state photo to determine the replacement of the specimen. If the label position and angle in the two images and the four corner vertices of the specimen can be aligned, and the two similarity scores described in step S4 reach the set value, the specimen is considered to be a real specimen, otherwise the specimen is considered to be replaced. Due to the different angles, scenes and equipment used to take photos of dry and wet concrete, the photos will be distorted during the shooting process. At this time, the digital image method cannot achieve pixel position alignment. At this time, deep learning can be used to measure feature similarity.
[0073] In summary, combined Figure 1-Figure 4 As shown, the working principle of the AI-based image recognition concrete specimen anti-counterfeiting method is as follows:
[0074] S1. When sampling, insert a label with a QR code on the surface of the concrete specimen and take a photo to obtain a wet concrete photo, i.e., a wet photo;
[0075] S2. After the curing is completed, the builder sends the test piece to the testing agency. After receiving the test piece, the testing agency takes a photo of the test piece and obtains a photo of the solidified concrete, i.e., the solidified photo;
[0076] S3. By integrating BiFPN into the YOLOv8 model, an AI model is constructed. The AI model uses the YOLOv8 model as the basic framework, including the backbone part, the neck part and the head part. The backbone part is the main network of the model, which consists of five convolution modules, four C2f modules and one SPPF module. The neck part uses BiFPN to process the multi-scale feature map from the backbone. After the AI model is constructed, the model is trained. Before using the AI model, the original image is preprocessed, including image scaling, image rotation, image flipping, cropping, color transformation and normalization operations. Then, the AI model is used to identify the solidified photos and find the outline and relative position information of the label and the specimen.
[0077] S4. Scale the solidified photos and wet photos to the same size, and determine the alignment direction based on the relative position of the label on the specimen surface. After considering the width of the mold frame of the wet concrete specimen, use the label of the solidified photo and the specimen outline to align with the wet photo; use the dual-branch ViT structure to extract features from the dry and wet concrete photos respectively. The solidified photos and wet photos are processed by independent ViT branches, and then the global context dependencies are learned through the self-attention mechanism to generate their own high-level semantic feature representations. Then use a multi-head cross-attention module. Allow the model to focus on the relevant parts between the features of dry and wet concrete photos, explore and infer the correspondence and consistency between the two in local areas. Finally, the relationship measure between each feature pair is calculated by integrating the relationship network to generate a comprehensive similarity score;
[0078] S5. Combine the alignment results of the solidified state photo and the wet state photo to determine the replacement of the specimen. If the label position and angle in the two images and the four corner vertices of the specimen can be aligned, and the two similarity scores described in step S4 reach the set value, the specimen is considered to be a real specimen, otherwise the specimen is considered to be replaced. Due to the different angles, scenes and equipment used to take photos of dry and wet concrete, the photos will be distorted during the shooting process. At this time, the digital image method cannot achieve pixel position alignment. At this time, deep learning can be used to measure feature similarity.
[0079] The embodiments of the present invention are given for the purpose of illustration and description, and are not intended to be exhaustive or to limit the invention to the disclosed forms. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present invention and to enable those of ordinary skill in the art to understand the present invention and thereby design various embodiments with various modifications suitable for specific uses.
Claims
1. An AI-based image recognition concrete specimen anti-counterfeiting method, characterized in that: The following steps are involved: S1. When sampling, insert a label with a QR code on the surface of the concrete specimen and take a photo to obtain a wet concrete photo, i.e., a wet photo; S2. After the curing is completed, the builder sends the test piece to the testing agency. After receiving the test piece, the testing agency takes a photo of the test piece and obtains a photo of the solidified concrete, i.e., the solidified photo; S3. By integrating BiFPN into the YOLOv8 model, an AI model is constructed, and the AI model is used to identify solidified photos to find the contours and relative position information of the label and the specimen; S4, matching based on digital image processing: scale the labels in the solidified photo and the wet photo to the same size, adjust the directions of the two photos so that the label marks completely overlap, and then determine whether the contours of the dry and wet concrete photos are aligned; if they cannot be completely aligned, it is considered to be a fake specimen and the identification task is completed; because the wet photo contains the thickness of the mold frame, the contour side length of the wet photo is greater than that of the solidified photo. To determine whether they are aligned, the following conditions must be met: the corresponding sides are parallel lines and the spacing between the corresponding sides is the same or the four intersection points of the diagonals are located on the same straight line and the straight line passes through the center point of the image; The contours of several wet concrete photos are aligned, and the contours of the wet concrete photos are cropped according to the contour size of the solidified photos to remove the mold frame thickness in the wet concrete test photos; similarity score processing based on deep learning: a dual-branch ViT structure is used to extract features from photos in two different states, dry and wet, respectively. The extracted features include but are not limited to the QR code on the label, the marking points, the random graphics generated by the hollow part of the label implanted into the concrete surface, and the concave and convex points randomly generated in other areas of the concrete surface. The solidified photos and wet photos are processed by independent ViT branches, and then the global context dependency is learned through the self-attention mechanism to generate their own high-level semantic feature representations. Then, a multi-head cross-attention module is used to enable the model to focus on the relevant parts between the features of the dry and wet photos, explore and infer the correspondence and consistency between the two in the local area, and finally, the relationship measure between each feature pair is calculated by integrating the relationship network to generate a comprehensive similarity score; S5. Combine the alignment results of the solidified state photo and the wet state photo to determine the replacement of the specimen. If the label position and angle in the two images and the four corner vertices of the specimen are aligned, and the two similarity scores in step S4 reach the set value, the specimen is considered to be a real specimen, otherwise it is considered that the specimen is replaced; in addition, for interference in the photo during shooting, the feature similarity is measured by deep learning; In step S3, the AI model uses the YOLOv8 model as the basic framework, including a backbone part, a neck part and a head part. The backbone part is the main network of the model, which consists of five convolution modules, four C2f modules and one SPPF module. The functions of each module are as follows: Convolution module: responsible for feature extraction, extracting useful feature information from input data through convolution operation; C2f module: responsible for fusing feature maps of different scales and combining feature information at different levels through feature fusion; SPPF module: responsible for fusing feature maps of different receptive fields to enrich the expressiveness of feature maps. It performs maximum pooling operation by cascading multiple small-sized pooling kernels to replace the traditional large-sized pooling operation. The neck part uses BiFPN to process the multi-scale feature map from Backbone. The BiFPN is based on the construction of feature pyramid and bidirectional feature fusion. It improves the accuracy and efficiency of the target detection task through multi-scale feature fusion. The specific logic includes the following: Feature pyramid generation: Multi-scale features are extracted from the input image through a convolutional neural network to form a feature pyramid. The feature pyramid has multiple levels, each corresponding to a different scale; Bidirectional connections: Bidirectional connections are introduced between adjacent levels of the feature pyramid, and information flows from higher-level features to lower-level features through a top-down path, or from lower-level features to higher-level features through a bottom-up path; Feature integration: Bidirectional connections allow integrating information from different levels of the feature pyramid in both directions; Weighted feature fusion: Using the weighted feature fusion mechanism, each input feature is given a learnable weight when fused, so that the network automatically learns the importance of different features and adjusts the fusion ratio as needed.
2. The method for anti-counterfeiting concrete specimens based on AI image recognition according to claim 1 is characterized in that: In step S4, the dual-branch ViT structure combines the convolution branch and the transformer branch to process information in parallel to maximize the retention of features at two different levels, and fuses the features of dry and wet photos through a multi-head cross-attention module to discover their intrinsic connections.
3. The method for anti-counterfeiting concrete specimens based on AI image recognition according to claim 2 is characterized in that: The convolution branch is responsible for extracting local features and detail information. It inherits the characteristics of CNN and includes several convolution layers. Each convolution layer extracts features in the image through a series of learnable convolution kernels. The convolution layer is also accompanied by an activation function to increase the nonlinearity of the model, and a pooling layer to reduce the spatial dimension of the data while retaining important feature information.
4. The method for anti-counterfeiting concrete specimens based on AI image recognition according to claim 2 is characterized in that: The transformer branch is based on the Transformer model and is responsible for capturing long-distance dependencies and global context information. The processing operations of the transformer branch include: dividing the original pixel-level image into several patches of fixed size, each patch is converted into a token, and then learning the global context dependencies through the self-attention mechanism to generate respective high-level semantic feature representations.
5. The method for anti-counterfeiting concrete specimens based on AI image recognition according to claim 2 is characterized in that: In the multi-head cross-attention module, tokens from solidified photos act as queries, while tokens from wet photos act as keys and values. Through the cross-attention mechanism, the module focuses on the relevant parts between the features of dry and wet concrete photos, exploring and inferring the correspondence and consistency between the two in local areas.
6. The method for anti-counterfeiting concrete specimens based on AI image recognition according to claim 5 is characterized in that: The multi-head cross-attention module introduces a deep neural network to deeply understand and aggregate the features after the cross-attention mechanism interacts, and generates a comprehensive similarity score by calculating the relationship metrics between each feature pair to strengthen the mining of these corresponding relationships and quantify the degree of match between two photos.
7. The method for anti-counterfeiting concrete specimens based on AI image recognition according to claim 1, characterized in that: In step S3, the model is trained after the AI model is built, specifically including: improving the convergence speed and accuracy of the model by adjusting the learning rate, loss function and optimizer parameters, and using an integrated learning method to improve the model performance.
8. The method for anti-counterfeiting concrete specimens based on AI image recognition according to claim 1, characterized in that: In step S3, the original image is preprocessed before using the AI model, and the preprocessing specifically includes the following operations: Image scaling: The original image is resized to the fixed size required by the model through interpolation methods, including direct scaling and scaling while maintaining the aspect ratio of the image; Image rotation: Rotate the image by a certain angle with the center point of the image as the rotation center to eliminate the model's dependence on a specific direction or angle; Image flip: flip the image horizontally or vertically. Horizontal flipping is performed along the vertical center axis of the image, and vertical flipping is performed along the horizontal center axis of the image. Cropping: Cropping the background part of the image to help the model better process the target; Color transformation: adjust the color properties of the image to increase the color invariance of the model; Normalization: Scale the pixel values of an image to a specific range.
Citation Information
Patent Citations
Method and equipment for sampling concrete test block
CN111553896A
Lightweight flame detection method fused with BiFPN
CN117409358A
