A Real-Time Pile Length Detection Method Based on Self-Attention Mechanism Deep Learning
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2026-08-11
AI Technical Summary
但该方法只可用于沉桩完成后的后验证环节,无法在施工过程中实时检测桩长变化
[0021] The present invention has the following advantages: Compared with traditional manual measurement, the present invention installs several cameras on the construction site to collect on-site pictures and videos, and uses a target recognition model to identify the precast piles and a target tracking model to detect and track the precast piles in real time. This allows for real-time detection of pile length after video acquisition, which simplifies the operation, reduces the complexity of the construction site, minimizes environmental interference, and thus improves accuracy.
Smart Images

Figure CN117626965B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pile foundation engineering technology, and in particular to a real-time pile length detection method based on deep learning with a self-attention mechanism. Background Technology
[0002] As a crucial part of building construction, pile foundation engineering plays an indispensable role. Its function is to transfer the load of the superstructure to the pile body through the pile cap or cap beam, and then to the deeper soil (rock) layer with stronger bearing capacity, or to compact the weak soil layer to improve the bearing capacity and density of the foundation soil. The bearing capacity of the pile is mainly borne by the pile side friction and pile end resistance within the pile driving depth. Therefore, the pile driving depth is one of the important factors affecting the bearing capacity of the foundation.
[0003] Due to the crucial role of pile length in pile foundation engineering, the driving depth of precast piles is one of the important evaluation indicators for the construction quality of pile foundation projects. Currently, pile length detection in engineering practice consists of two parts. One is to observe the changes in the pile's marking line before and after driving using a level instrument. This method has high accuracy and is one of the main means of elevation control during pile foundation construction. However, this method requires manual measurement by professional operators, and subjective human factors have a significant impact on the measurement results. Furthermore, it cannot achieve real-time pile length detection. Another method is to use ultrasonic waves for automatic pile length identification. In his article "Application of Ground Penetrating Radar in Pile Detection," Pan Shihai introduced the process of determining the effective length of existing piles using ground penetrating radar through an engineering example. Based on the different propagation characteristics of radar waves in the pile body and soil, Pan Shihai used ground penetrating radar to detect the pile-soil interface and the pile bottom interface. The pile bottom depth was determined based on the wave train number and wave velocity corresponding to the two closest depth time markers at the pile bottom. This method achieved an error of 0.2–1.8 m in detecting driven cast-in-place piles with a length of approximately 13.4–13.6 m. Chen Longzhu et al. drilled detection holes near the pile foundation to be inspected and used a three-component geophone in the holes to detect the longitudinal waves generated by the existing structure at the pile top propagating along the pile body towards the pile bottom. During the propagation process, in addition to encountering wave impedance and reflection at the pile bottom, some seismic waves are also transmitted to the soil beside the pile. Utilizing the characteristics and anomalies of seismic wave propagation and transmission within the pile, sensors in the side wells are used to detect the timing of the first wave of the transmitted wave to determine the pile length. This method, when testing piles with a diameter of 1m, only shows a deviation of about 1% from the actual pile length. Kong Deyong, leveraging the advantages of the low-strain reflection wave method in detecting pile integrity—fast, inexpensive, and reliable—added concrete wave velocity detection to achieve pile length detection. In testing C50 bored piles with a diameter of 0.8m and a length of approximately 30m, this method completes the pile length detection in just 30 minutes with an error of ±0.5m. However, this method can only be used for post-implementation verification after pile driving and cannot detect real-time pile length changes during construction.
[0004] Therefore, during pile driving construction, a significant amount of manpower is typically required to monitor pile length changes in real time. Construction technicians calculate the pile driving depth before driving, which is then reviewed and approved by the supervisor before being handed over to the operators. However, due to varying skill levels among construction workers, pile driving depths often fail to meet design requirements, seriously threatening building quality and safety. Existing research focuses on pile length detection after the piles have been embedded, failing to achieve real-time pile length detection during the driving process. Through long-term research, the inventors have developed a real-time pile length detection method based on a self-attention mechanism deep learning. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a real-time pile length detection method based on deep learning with a self-attention mechanism.
[0006] The objective of this invention is achieved through the following technical solution: a real-time pile length detection method based on deep learning with a self-attention mechanism, comprising the following steps:
[0007] S1: Install several cameras at the construction site and collect on-site photos and videos;
[0008] S2: Construct a target recognition model to identify precast piles;
[0009] S3: Construct a target tracking model to perform real-time detection and tracking of precast piles;
[0010] S4: Measure the length of the precast piles.
[0011] Preferably, in step S1, the camera's shooting angle is 90° to the object being photographed.
[0012] Preferably, in step S2, the target recognition model includes an image encoder, a cue encoder, and an image decoder. The image encoder and cue encoder introduce a self-attention mechanism, first multiplying the video frame information matrix X by the corresponding deep learning model weight matrix W to obtain three high-dimensional matrices Q, K, and V, where Q is the query vector, K is the key vector, and V is the value vector. Then, the cosine similarity is calculated to obtain the attention scores of different objects within the video frame. The image encoder is composed of a deep convolutional neural network model. The image encoder is used to reduce the dimensionality of the high-dimensional attention encoding to a label matrix with the same dimension as the video frame information matrix, indicating the position of the target precast stake within the video frame.
[0013] Preferably, in step S3, the target tracking model includes an ID encoder and an ID decoder. The ID encoder is used to embed the video frame label matrix output in step S2 into a high-dimensional space through a convolutional neural network. The ID decoder is used to propagate the target information in past frames to the current frame through a long short-term self-attention mechanism.
[0014] Preferably, the ID decoder includes a tracker and a reconstructor. The tracker uses a long short-term self-attention mechanism to match the attention scores of the input long-term historical frames, short-term neighboring frames, and high-dimensional information of the current video frame with cosine similarity. The reconstructor uses a convolutional neural network to reduce the high-dimensional ID encoding of the current frame to a low-dimensional ID encoding.
[0015] Preferably, step S4 further includes the following step:
[0016] S41: Set the standard scale and convert the selected image to grayscale;
[0017] S42: Perform Gaussian blur and edge detection;
[0018] S43: Calculate the number of pixels per unit length;
[0019] S44: Calculate the minimum bounding rectangle of the object's outline and obtain the coordinates of its four vertices;
[0020] S45: Calculate the width and height of the measured object based on the four vertices and the number of pixels per unit length.
[0021] The present invention has the following advantages: Compared with traditional manual measurement, the present invention installs several cameras on the construction site to collect on-site pictures and videos, and uses a target recognition model to identify the precast piles and a target tracking model to detect and track the precast piles in real time. This allows for real-time detection of pile length after video acquisition, which simplifies the operation, reduces the complexity of the construction site, minimizes environmental interference, and thus improves accuracy. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of the process for real-time pile length detection;
[0023] Figure 2 This is a schematic diagram of the SAM model;
[0024] Figure 3 A schematic diagram of the target recognition model;
[0025] Figure 4 This is a schematic diagram of the LSTT structure;
[0026] Figure 5 A schematic diagram illustrating the connection relationship between the target recognition model and the target tracking model;
[0027] Figure 6 This is a schematic diagram of the process for measuring the length of precast piles. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0029] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0030] It should be noted that, unless otherwise specified, the embodiments and features described in this invention can be combined with each other.
[0031] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0032] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0033] In this embodiment, as Figure 1 As shown, a real-time pile length detection method based on deep learning with a self-attention mechanism includes the following steps:
[0034] S1: Install several cameras at the construction site and collect on-site photos and videos;
[0035] S2: Construct a target recognition model to identify precast piles;
[0036] S3: Construct a target tracking model to perform real-time detection and tracking of precast piles;
[0037] S4: Measure the length of precast piles. Compared to traditional manual measurement, this invention uses several cameras installed at the construction site to collect images and videos. A target recognition model identifies the precast piles, and a target tracking model tracks and detects them in real time. This allows for real-time pile length detection after video acquisition, simplifying the operation, reducing the complexity of the construction site, minimizing environmental interference, and thus improving accuracy.
[0038] Furthermore, in step S1, the camera's shooting angle is 90° to the object being photographed. Specifically, the camera's installation position should meet the following requirements: First, the field of view should cover the precast pile to be detected and tracked; second, the camera position should be fixed and not frequently moved; third, the precast piles within the camera's field of view should avoid overlap and obstruction by debris to reduce errors; and fourth, the camera should be in sufficient light when recording video.
[0039] In this embodiment, as Figure 2 and Figure 3 As shown, in step S2, the target recognition model includes an image encoder, a cue encoder, and an image decoder. The image encoder and cue encoder introduce a self-attention mechanism, first multiplying the video frame information matrix X by the corresponding deep learning model weight matrix W to obtain three high-dimensional matrices Q, K, and V, where Q is the query vector, K is the key vector, and V is the value vector. Then, cosine similarity is calculated to obtain attention scores for different objects within the video frame. The image encoder consists of a deep convolutional neural network model. The image encoder is used to reduce the dimensionality of the high-dimensional attention encoding to a label matrix with the same dimension as the video frame information matrix, indicating the position of the precast pile target within the video frame. Specifically, through deep learning model training and changing the weight matrix, the model assigns a higher attention score to the precast pile target, thereby reducing the impact of on-site construction complexity on target recognition.
[0040] In this embodiment, as Figure 4 and Figure 5As shown, in step S3, the target tracking model includes an ID encoder and an ID decoder. The ID encoder embeds the video frame label matrix output in step S2 into a high-dimensional space using a convolutional neural network. The ID decoder propagates target information from past frames to the current frame through a long short-term self-attention mechanism, achieving target tracking. Further, the ID encoder includes a feature extractor, a target detector, a target embedder, and a target segmenter. The feature extractor is electrically connected to the input of the target detector and converts the input image frame into a visual embedding, which includes spatial and semantic information of the image. Both the target embedder and the target segmenter are electrically connected to the output of the target detector. The target detector performs target detection on the visual embedding, generating candidate boxes and classification probabilities. The target embedder converts the visual embedding within each candidate box into a high-dimensional ID embedding. The target segmenter generates a segmentation mask for the target within the candidate box, thereby achieving accurate target segmentation. Specifically, the ID embedding can represent the target's identity information. Furthermore, the ID decoder includes a tracker and a reconstructor. The tracker uses a long short-term self-attention mechanism to match the attention scores of the high-dimensional information of the input long-term historical frames, short-term neighboring frames, and the current video frame with cosine similarity. The reconstructor uses a convolutional neural network to reduce the dimensionality of the high-dimensional ID encoding of the current frame to a low-dimensional ID encoding, thereby achieving target recalibration in the current frame. Specifically, the target tracking model is based on the AOT model and the SiamRPN network structure. The AOT model has two main functions: first, it uses an identity recognition mechanism to convert multi-target masks into identity-recognition embeddings containing multiple IDs. That is, these embeddings come from a predefined ID bank, and each target is assigned a unique ID vector, so that any number of targets can be represented in the same feature space without processing each target individually; second, it provides a hierarchical matching propagation structure, that is, it introduces a long short-term self-attention mechanism. In other words, the long short-term attention mechanism consists of multiple LSTT layers. Each LSTT layer contains two attention mechanisms: long-term attention, which is used to propagate target information from reference frames and past memory frames to the current frame; and short-term attention, which is used to propagate target information from the previous frame to the current frame. Before target matching, a coefficient 'a' is set to weight the short-term and long-term attention scores. The coefficient can be selected according to the actual situation, which will not be elaborated here.The self-attention mechanism introduces three information matrices: Q, K, and V. Q (query vector) represents the information features that the input needs to match; K (key vector) represents the important features of the input; and V (value vector) represents all information features of the input. The dot product between each query vector and all key vectors is calculated to obtain an attention score vector, which represents the relevance between any two input elements. The attention score vector is then normalized using a softmax function to ensure the sum of all scores is 1, resulting in an attention weight vector. This vector represents the degree of attention each input element pays to each value vector. Finally, the attention weight vector is weighted and summed with all value vectors to obtain an output vector. This output vector contains the contextual information of each input element, representing the relevance between the current frame and the memory frame in a video. In this embodiment, by setting different weight values, the contributions of long-term and short-term information to the high-dimensional ID encoding of the current frame are adjusted, thereby improving the model's adaptability to unexpected situations at the construction site.
[0041] In this embodiment, as Figure 6 As shown, step S4 also includes the following steps:
[0042] S41: Set the standard scale and convert the selected image to grayscale;
[0043] S42: Perform Gaussian blur and edge detection;
[0044] S43: Calculate the number of pixels per unit length;
[0045] S44: Calculate the minimum bounding rectangle of the object's outline and obtain the coordinates of its four vertices;
[0046] S45: Calculate the width and height of the object being measured based on the four vertices and the number of pixels per unit length. In other words, use functions from the OpenCV library to measure the dimensions of different prefabricated stakes in the image.
[0047] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A real-time pile length detection method based on deep learning with self-attention mechanism, characterized in that: Includes the following steps: S1: Install several cameras at the construction site and collect on-site photos and videos; S2: Construct a target recognition model to identify precast piles; S3: Construct a target tracking model to perform real-time detection and tracking of precast piles; S4: Measure the length of the precast piles; In step S2, the target recognition model includes an image encoder, a cue encoder, and an image decoder. The image encoder and the cue encoder introduce a self-attention mechanism to first process the video frame information matrix. Multiply by the corresponding deep learning model weight matrix get , and Three high-dimensional matrices, among which For query vector, For key vectors, The image encoder is composed of a deep convolutional neural network model. The image encoder is used to reduce the high-dimensional attention encoding to a label matrix with the same dimension as the information matrix of the video frame, indicating the position of the target precast pile in the video frame. In step S3, the target tracking model includes an ID encoder and an ID decoder. The ID encoder is used to embed the video frame label matrix output in step S2 into a high-dimensional space through a convolutional neural network. The ID decoder is used to propagate target information from past frames to the current frame through a long short-term self-attention mechanism. The ID decoder includes a tracker and a reconstructor. The tracker uses a long short-term self-attention mechanism to match the attention scores of the input long-term historical frames, short-term neighboring frames, and high-dimensional information of the current video frame with cosine similarity. The reconstructor uses a convolutional neural network to reduce the high-dimensional ID encoding of the current frame to a low-dimensional ID encoding.
2. The real-time pile length detection method based on self-attention mechanism deep learning according to claim 1, characterized in that: In step S1, the camera's shooting angle is 90° to the object being photographed.
3. The real-time pile length detection method based on self-attention mechanism deep learning according to claim 1, characterized in that: Step S4 also includes the following steps: S41: Set the standard scale and convert the selected image to grayscale; S42: Perform Gaussian blur and edge detection; S43: Calculate the number of pixels per unit length; S44: Calculate the minimum bounding rectangle of the object's outline and obtain the coordinates of its four vertices; S45: Calculate the width and height of the measured object based on the four vertices and the number of pixels per unit length.
Citation Information
Patent Citations
Event camera target recognition method based on self-attention mechanism
CN113378917A
Method for monitoring dynamic compaction settlement in real time based on binocular vision and neural network model
CN116399302A