KNet-based steel support and stand column number identification method and device
Through the KNet-based steel support and column quantity identification method, the problems of low efficiency and poor accuracy of traditional manual inspection are solved, and efficient, accurate identification and real-time monitoring of the construction site support structure are achieved.
Patent Information
- Application Number
- CN202411990498.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The traditional manual inspection and regular maintenance modes are difficult to meet the stability and distribution rationality requirements of steel structure support and columns, resulting in low identification efficiency, poor accuracy, and easy to miss inspections and misjudgment.
The number, location and distribution density of steel support and column quantity identification method based on KNet is used to obtain construction site image data, preprocessing, semantic segmentation model segmentation, morphological operation and connection domain analysis, and a statistical report on the number of steel support and columns is calculated to generate a structural quantity statistics report.
It improves the identification efficiency and accuracy of steel support and columns, reduces false inspections and missed inspections, and realizes real-time monitoring and analysis of the support structure on the construction site.
Smart Images

Figure CN119904641A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of target recognition, and in particular to a method and device for recognizing the number of steel supports and columns based on KNet. Background Art
[0002] As the requirements for automation and safety management of construction projects gradually increase, the traditional mode of manual inspection and regular maintenance is gradually unable to meet the actual construction needs. As key load-bearing components in building construction, the stability and reasonable distribution of steel structure supports and columns have an important impact on construction quality and safety. However, the quantity identification and distribution analysis of steel structures mainly rely on manual statistics and monitoring, which is inefficient, costly, and prone to omissions and misjudgments. In order to improve construction efficiency and ensure the reliability of the support system, it is urgent to develop an intelligent identification device that can monitor and analyze the quantity and layout of steel supports and columns in real time.
[0003] In this context, data-driven methods such as computer vision and machine learning are gradually being applied to the field of automated identification of construction projects. By analyzing image data with deep learning models, the distribution of steel supports and columns can be automatically identified, improving recognition efficiency and reducing labor costs. However, such methods still face multiple challenges in their application. On the one hand, complex environments such as lighting, noise, and occlusion at the construction site affect the accuracy of model recognition. On the other hand, the shapes and sizes of steel supports and columns often vary, and how to effectively distinguish and count their numbers is a key difficulty.
[0004] In recent years, instance segmentation methods based on convolutional neural networks (CNNs) have made significant progress, providing new ideas for the quantitative recognition of steel supports and columns. For example, the KNet (Kernel-based Network) model performs well in image segmentation tasks, can refine the edges of targets in images, and accurately locate individual objects, providing technical support for steel structure recognition and statistics. However, traditional segmentation methods are mostly used in scenes with clear target boundaries, and it is difficult to cope with the complex environment of construction sites. In particular, the dense distribution of steel supports and columns can easily lead to a decrease in the recognition accuracy of the model, and the existing model lacks pertinence in the analysis of mask areas, making it difficult to further output structural feature data such as position and density. Summary of the invention
[0005] In order to solve the above problems, the present invention proposes a method and device for identifying the number of steel supports and columns based on KNet, which solves the problems of low efficiency and poor accuracy in identifying steel structures at construction sites in the prior art, and realizes the demand for real-time monitoring of support structures in modern construction.
[0006] The specific plan is as follows:
[0007] On the one hand, the KNet-based steel support and column quantity identification method includes:
[0008] S1, acquiring image data of a construction site; the image data covers an area including steel supports, columns, and background information that interferes with identification;
[0009] S2, preprocessing the image data of the construction site;
[0010] S3, input the preprocessed image data into the trained KNet-based semantic segmentation model to perform segmentation;
[0011] S4, obtaining a high-confidence binary mask image of the steel supports and columns from the image data after model segmentation, performing morphological operations on the binary mask image to optimize the quality of the mask image, performing connected domain analysis on the optimized mask image, calculating the area of each region and screening the valid region according to the minimum area threshold, determining the precise position of the steel supports and columns in the valid region by centroid calculation, calculating the average Euclidean distance and distribution density between the steel supports and columns based on the precise position to evaluate the distribution uniformity, performing quantitative statistics and geometric feature analysis on the valid region based on the distribution uniformity, and obtaining the structural stability and quantity of the steel supports and columns;
[0012] S5, taking the obtained number of steel supports and columns as the final recognition results, generating a structural quantity statistical report, and visually displaying it on the interface; the statistical report includes the specific location, quantity and distribution density of the steel supports and columns.
[0013] Further, in S2, the preprocessing includes resizing, normalizing and enhancing the image data of the construction site;
[0014] The size adjustment is used to adjust the image data of the construction site to a standard size that meets the input requirements of the KNet model to ensure the consistency of the input image size;
[0015] The image normalization is used to perform a normalization operation on the resized image data, scaling the pixel value from the range of [0,255] to [0,1]. The calculation formula is as follows:
[0016]
[0017] Among them, X is the image pixel value of the construction site, X min and X max are the minimum and maximum values of the image pixel values respectively; X′ is the pixel value of the normalized image data, and its range is [0,1];
[0018] The data enhancement includes random cropping, rotation, color perturbation, and blur and noise addition;
[0019] The random cropping is used to randomly select the normalized image area. The normalized image is cropped to adapt to the target samples at different observation angles and distances. The cropping area is determined by randomly generating a center point and scale. The formula is as follows:
[0020] R c =X′[x0:x0+h c ,y0:y0+w c ];
[0021] Among them, h c and w c are the height and width of the cropped area, (x0, y0) are the coordinates of the randomly selected starting point, and R c is the normalized image area after random cropping;
[0022] The rotation is used to randomly rotate the resized image within the angle range of [-θ, θ], and the angle θ∈[-15, 15°] is selected to simulate the multi-angle observation effect in the real construction site. The formula is as follows:
[0023] X′ rotated =X′·cos(θ)-Y′·sin(θ);
[0024] Among them, X′ rotated represents the pixel position of the rotated image, θ is the rotation angle, X′ and Y′ are the horizontal and vertical coordinates of the image respectively;
[0025] The color perturbation is used to randomly perturb the normalized image to simulate scenes under different lighting conditions. The basic calculation formula of the color perturbation is:
[0026] X′ adjusted =α·X′+β;
[0027] Among them, X′ adjusted is the image after color perturbation, α is used to control the contrast of the normalized image, and β is used to control the brightness of the normalized image;
[0028] The blur and noise addition is used to add Gaussian blur or random noise to the normalized image. The calculation formula is as follows:
[0029] X′ noisy =X′+N(0,σ 2 );
[0030] Among them, N(0,σ 2 ) is the added Gaussian noise, σ is the standard deviation, X′ noisy is the image after noise.
[0031] Furthermore, in S3, the KNet-based semantic segmentation model includes a backbone network part, a decoding head part, an auxiliary head part, a loss function part, a cost-sensitive learning strategy part and an optimizer part:
[0032] The backbone network extracts global features of the input image to obtain basic feature representations; the decoding head performs sampling and semantic refinement on the basic features to generate accurate segmentation results; the auxiliary head provides additional supervision to the backbone network and the decoding head to help improve feature extraction capabilities and convergence speed; the loss function compares the segmentation results with the actual annotations, calculates the error and provides optimization targets; the cost-sensitive learning strategy improves the recognition of steel supports and columns through a weighted loss function; the optimizer updates the model parameters based on the loss to ensure effective network training;
[0033] Backbone network: Swin Transformer is used as the backbone network, and basic features are gradually extracted through the hierarchical self-attention mechanism. The self-attention calculation formula is:
[0034]
[0035] Among them, Q, K and V are query matrix, key matrix and value matrix respectively, d k is the scaling factor;
[0036] Decoding head part: It consists of Kernel Update Head and Unified Perceptron UPerHead. Kernel Update Head is used to dynamically adjust the segmentation features; Unified Perceptron UPerHead is used to aggregate context information.
[0037] Auxiliary head part: By combining the fully convolutional network head FCNHead to provide additional supervision signals, the auxiliary segmentation results are output by the fully convolutional network head FCNHead to realize the gradient transfer between the backbone network and the decoding head;
[0038] Loss function part: The cross entropy loss function is used to optimize the model. The cross entropy loss function is defined as:
[0039]
[0040] Among them, y i represents the true label, that is, the classification label corresponding to the steel support or column in the sample; p i It represents the probability predicted by the model, that is, the model's prediction probability for the steel support or column category; N is the number of samples, which represents the total number of samples involved in model training or testing;
[0041] Cost-sensitive learning strategy: Introduce cost-sensitive learning strategy and set different weight coefficients w for steel support, columns and background areas i , so that the model pays more attention to the target area of steel support and column during training. The loss function after weight correction is expressed as:
[0042]
[0043] Optimizer part: Use AdamW optimizer to update model parameters. The update rule is:
[0044] m t =β1m t-1 +(1-β1)g t ;
[0045]
[0046] Among them, m t and v t are the first-order and second-order momentum of the gradient, which are used to smooth and accelerate the gradient update; α is the learning rate, which controls the step size of the model parameter update; β1 and β2 are the momentum decay coefficients, which are used to adjust the update ratio of the first-order and second-order momentum; ∈ is a stabilization term, which is used to avoid the denominator being zero and improve the stability of numerical calculations; λ is a weight decay factor, which suppresses model overfitting by introducing regularization; g t Represents the gradient at the current time t, indicating the optimization direction of the model, t represents the number of iterations, and is used to track the optimization process; φ t A vector representing the parameters of the model.
[0047] Furthermore, the Kernel Update Head is calculated by weight W. dynamic Perform convolution operation, the calculation formula is as follows:
[0048] F out =F*W dynamic +b dynamic ;
[0049] Among them, F is the input feature map, which represents the feature data to be processed after being extracted by the backbone network and is used for subsequent feature extraction and enhancement; W dynamic and b dynamic The convolution kernel weights and biases are dynamically generated based on the input features, which are used to improve the expressiveness and flexibility of the convolution operation. * represents the convolution operation, which performs weighted calculation of the weights and biases on the input feature map F to complete the feature extraction and update, so as to capture the characteristic distribution of steel supports and columns under complex working conditions.
[0050] Furthermore, the S4 specifically includes:-
[0051] Extracting binary mask images of steel supports and columns, filtering out binary mask image regions with confidence values higher than a first threshold, and filtering out binary mask image regions with confidence values lower than the first threshold;
[0052] The binary mask image satisfies the following conditions:
[0053]
[0054] Where (x, y) is the pixel position in the image, M(x, y) is the extracted binary mask image, P(x, y) represents the segmentation confidence of the pixel, and θ is the threshold used to filter the low confidence area;
[0055] Morphological operations are used to eliminate the noise of the binary mask image and fill small holes;
[0056] The morphological operation is specifically performed through a closing operation, and the result of the closing operation is recorded as M morph , the formula is as follows:
[0057] M morph =Morph(M;kernel);
[0058] Among them, kernel is the structural element in morphological operations;
[0059] Perform connected domain analysis on the processed binary mask image, calculate the area of each region, and filter out regions smaller than the minimum area threshold according to the minimum area threshold, retaining the valid regions;
[0060] Mask M for the closing operation morph Perform connected domain analysis to identify each connected region R i And calculate the area A(R i ), the formula is as follows:
[0061]
[0062] By setting the first threshold T min To filter out the area smaller than T min The target area that meets the conditions is retained, and the valid area set is defined as:
[0063]
[0064] The exact location of steel supports and columns is determined by calculating the centroid of each effective area;
[0065] The calculation formula of the centroid position is as follows:
[0066]
[0067] Among them, C(Ri )=(x c ,y c ) is the region R i The centroid position of
[0068] The average Euclidean distance between the steel supports and columns is calculated based on the precise positions, and the distribution density of the steel supports and columns in the image is obtained based on the ratio of the total area of the effective region to the total area of the binary mask image to evaluate the distribution uniformity of the steel supports and columns;
[0069] Calculate the average Euclidean distance d between the steel support and the column avg , the formula is as follows:
[0070]
[0071] Among them, ||C(R i )-C(R i+1 )|| is the Euclidean distance between adjacent steel supports or columns, and the distribution density ρ of steel supports and columns in the image is calculated:
[0072]
[0073] in, is the total area of the effective region, A img is the total area of the binary mask image;
[0074] Analyze the geometric characteristics of steel supports and columns, as well as their impact on structural stability; obtain the total number of steel supports and columns by counting the number of effective areas and combining them with the calculation results of density and average Euclidean distance;
[0075] The shape factor κ is calculated to measure the shape consistency of the target area and analyze the geometric characteristics of the support structure. The formula is as follows:
[0076]
[0077] Among them, P i For region R i circumference;
[0078] Calculate the number of steel supports or columns respectively, the formula is as follows:
[0079]
[0080] Among them, N steel is the number of steel supports, is the effective area corresponding to the steel support. N pillar is the number of columns, is the effective area corresponding to the column.
[0081] Furthermore, S5 also includes:
[0082] The structural quantity counting results are stored in a database or file system to support the extraction of the structural quantity counting results from the database or file system when needed during construction site management, construction progress tracking and safety monitoring.
[0083] On the other hand, the KNet-based steel support and column quantity identification device includes:
[0084] An image data acquisition module is used to acquire image data of a construction site; the image coverage area includes steel supports, columns and background information that interferes with identification;
[0085] A preprocessing module, used for preprocessing image data of a construction site;
[0086] The model segmentation module is used to input the pre-processed image data into the pre-trained KNet-based semantic segmentation model to perform segmentation;
[0087] A quantitative statistics module is used to obtain a high-confidence binary mask image of steel supports and columns from the image data after model segmentation, perform morphological operations on the binary mask image to optimize the quality of the mask image, perform connected domain analysis on the optimized mask image, calculate the area of each region and screen the effective region according to the minimum area threshold, determine the precise position of the steel supports and columns in the effective region by centroid calculation, calculate the average Euclidean distance and distribution density between the steel supports and columns based on the precise position to evaluate the distribution uniformity, perform quantitative statistics and geometric feature analysis on the effective region based on the distribution uniformity, and obtain the structural stability and quantity of the steel supports and columns;
[0088] The report generation module is used to generate a structural quantity statistical report using the obtained number of steel supports and columns as the final identification results, and visually display it on the interface; the statistical report includes the specific location, quantity and distribution density of the steel supports and columns.
[0089] The present invention adopts the above technical solution and has the following beneficial effects:
[0090] (1) The present invention solves the accuracy and real-time problems of steel support and column quantity identification in complex construction environments through refined region segmentation, morphological operation and mask region extraction technology;
[0091] (2) The present invention extracts the mask area and focuses on the key information area, thereby reducing background interference; adopts the area size filtering step to improve the recognition accuracy of the actual target structure and reduce false detection and missed detection;
[0092] (3) The present invention accurately analyzes the structure position and density through dynamic centroid calculation and quantity statistics, and provides real-time monitoring of the support distribution in the scene. BRIEF DESCRIPTION OF THE DRAWINGS
[0093] Figure 1 A method for identifying the number of steel supports and columns based on KNet according to an embodiment of the present invention;
[0094] Figure 2 This is a schematic diagram of the application of KNet in identifying the number of steel supports and columns in a foundation pit condition of a construction site according to an embodiment of the present invention;
[0095] Figure 3 It is a structural block diagram of a device for identifying the number of steel supports and columns based on KNet according to an embodiment of the present invention. DETAILED DESCRIPTION
[0096] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0097] like Figure 1 As shown, the method for identifying the number of steel supports and columns based on KNet of the present invention comprises:
[0098] S1, acquiring image data of a construction site; the coverage area of the image data includes steel supports, columns and background information that interferes with identification.
[0099] Specifically, in this embodiment, image data of the construction site is acquired by a camera or other image acquisition equipment, including images of the construction site taken from different angles and different positions.
[0100] Specifically, in this embodiment, the background information that interferes with identification includes stacked construction materials (such as steel bars, formwork, wooden boards, cement bags, etc.), environmental factors (such as shadows, light reflections, dust or smoke, etc.), other temporary structures (such as support poles, protection nets, guardrails, etc.), and trees, vegetation, earth or sky in the natural environment.
[0101] S2, preprocessing the image data of the construction site;
[0102] Specifically, the preprocessing includes resizing, image normalization and data enhancement of the image data of the construction site.
[0103] The size adjustment is used to adjust the image data of the construction site to a standard size that meets the input requirements of the KNet model to ensure the consistency of the input image size;
[0104] The image normalization is used to perform a normalization operation on the resized image data, scaling the pixel value from the range of [0,255] to [0,1]. The calculation formula is as follows:
[0105]
[0106] Among them, X is the image pixel value of the construction site, X min and X max are the minimum and maximum values of the image pixel values respectively; X′ is the pixel value of the normalized image data, and its range is [0,1];
[0107] The data enhancement includes random cropping, rotation, color perturbation, and blur and noise addition;
[0108] The random cropping is used to randomly select the normalized image area. The normalized image is cropped to adapt to the target samples at different observation angles and distances. The cropping area is determined by randomly generating a center point and scale. The formula is as follows:
[0109] R c =X′[x0:x0+h c ,y0:y0+w c ];
[0110] Among them, h c and w c are the height and width of the cropped area, (x0, y0) are the coordinates of the randomly selected starting point, and R c is the normalized image area after random cropping;
[0111] The rotation is used to randomly rotate the resized image within the angle range of [-θ, θ], and the angle θ∈[-15°, 15°] is selected to simulate the multi-angle observation effect in the real construction site. The formula is as follows:
[0112] X′ rotated =X′·cos(θ)-Y′·sin(θ);
[0113] Among them, X′ rotated represents the pixel position of the rotated image, θ is the rotation angle, X′ and Y′ are the horizontal and vertical coordinates of the image respectively;
[0114] The color perturbation is used to randomly perturb the normalized image to simulate scenes under different lighting conditions. The basic calculation formula of the color perturbation is:
[0115] X′ adjusted =αX′+β;
[0116] Among them, X′adjusted is the image after color perturbation, α is used to control the contrast of the normalized image, and β is used to control the brightness of the normalized image;
[0117] The blur and noise addition is used to add Gaussian blur or random noise to the normalized image. The calculation formula is as follows:
[0118] X′ noisy =X′+N(0,σ 2 );
[0119] Among them, N(0,σ 2 ) is the added Gaussian noise, σ is the standard deviation, X′ noisy is the image after noise.
[0120] S3, input the preprocessed image data into the trained KNet-based semantic segmentation model to perform segmentation;
[0121] Specifically, the KNet-based semantic segmentation model includes a backbone network part, a decoding head part, an auxiliary head part, a loss function part, a cost-sensitive learning strategy part and an optimizer part.
[0122] The backbone network extracts global features of the input image to obtain basic feature representations; the decoding head performs sampling and semantic refinement on the basic features to generate accurate segmentation results; the auxiliary head provides additional supervision to the backbone network and the decoding head to help improve feature extraction capabilities and convergence speed; the loss function compares the segmentation results with the actual annotations, calculates the error and provides optimization targets; the cost-sensitive learning strategy improves the recognition of steel supports and columns through a weighted loss function; the optimizer updates the model parameters based on the loss to ensure effective network training;
[0123] Backbone network: Swin Transformer is used as the backbone network, and basic features are gradually extracted through the hierarchical self-attention mechanism. The self-attention calculation formula is:
[0124]
[0125] Among them, Q, K and V are query matrix, key matrix and value matrix respectively, d k is the scaling factor;
[0126] Decoding head part: It consists of Kernel Update Head and Unified Perceptron UPerHead. Kernel Update Head is used to dynamically adjust the segmentation features; Unified Perceptron UPerHead is used to aggregate context information.
[0127] Auxiliary head part: By combining the fully convolutional network head FCNHead to provide additional supervision signals, the auxiliary segmentation results are output by the fully convolutional network head FCNHead to realize the gradient transfer between the backbone network and the decoding head;
[0128] Loss function part: The cross entropy loss function is used to optimize the model. The cross entropy loss function is defined as:
[0129]
[0130] Among them, y i represents the true label, that is, the classification label corresponding to the steel support or column in the sample; p i It represents the probability predicted by the model, that is, the model's prediction probability for the steel support or column category; N is the number of samples, which represents the total number of samples involved in model training or testing;
[0131] Cost-sensitive learning strategy: Introduce cost-sensitive learning strategy and set different weight coefficients w for steel support, columns and background areas i , so that the model pays more attention to the target area of steel support and column during training. The loss function after weight correction is expressed as:
[0132]
[0133] Optimizer part: Use AdamW optimizer to update model parameters. The update rule is:
[0134] m t =β1m t-1 +(1-β1)g t ;
[0135]
[0136] Among them, m t and v t are the first-order and second-order momentum of the gradient, which are used to smooth and accelerate the gradient update; α is the learning rate, which controls the step size of the model parameter update; β1 and β2 are the momentum decay coefficients, which are used to adjust the update ratio of the first-order and second-order momentum; ∈ is a stabilization term, which is used to avoid the denominator being zero and improve the stability of numerical calculations; λ is a weight decay factor, which suppresses model overfitting by introducing regularization; g t Represents the gradient at the current time t, indicating the optimization direction of the model, t represents the number of iterations, and is used to track the optimization process; φ t A vector representing the parameters of the model.
[0137] Specifically, the Kernel Update Head is calculated by weight W dynamic Perform convolution operation, the calculation formula is as follows:
[0138] F out =F*W dynamic +b dynamic ;
[0139] Among them, F is the input feature map, W dynamic and b dynamic Convolution kernel weights and biases are dynamically generated based on input features, and * represents a convolution operation.
[0140] Specifically, in this embodiment, α takes values in the range of [0.8, 1.2], β takes values in the range of [-0.2, 0.2], and the model input data format is H×W×C, where H and W represent the height and width of the image, respectively, and C is the number of channels (usually three channels of RGB images). After normalization and data enhancement, the input data can effectively improve the generalization ability of the model in complex backgrounds.
[0141] Specifically, Kernel Update Head uses the generated learnable convolution kernel to update the target features. Dynamic convolution generates convolution kernel weights based on input features to adapt them to local feature changes of input features and improve segmentation details. UPerHead (Unified Perceptual Parsing Head) is used for multi-layer feature aggregation, fusing features from different levels and upsampling them to generate predictions of the same size as the input image. It mainly uses the feature pyramid network (FPN) strategy to upsample high-level semantic features and combine them with underlying detail features to obtain the final segmentation results. The fully convolutional network head FCNHead (Fully Convolutional Network Head) is used for auxiliary heads or basic segmentation heads in semantic segmentation, and mainly uses the architecture of the fully convolutional network to classify input features pixel by pixel.
[0142] S4, obtain a high-confidence binary mask image of the steel supports and columns from the image data after model segmentation, perform morphological operations on the binary mask image to optimize the mask image quality, perform connected domain analysis on the optimized mask image, calculate the area of each region and screen the valid area according to the minimum area threshold, determine the precise position of the steel supports and columns in the valid area by centroid calculation, calculate the average Euclidean distance and distribution density between the steel supports and columns based on the precise position to evaluate the distribution uniformity, perform quantitative statistics and geometric feature analysis on the valid area based on the distribution uniformity, and obtain the structural stability and quantity of the steel supports and columns.
[0143] Specifically, the S4 specifically includes:
[0144] Extracting binary mask images of steel supports and columns, filtering out binary mask image regions with confidence values higher than a first threshold, and filtering out binary mask image regions with confidence values lower than the first threshold;
[0145] The binary mask image satisfies the following conditions:
[0146]
[0147] Where (x, y) is the pixel position in the image, M(x, y) is the extracted binary mask image, P(x, y) represents the segmentation confidence of the pixel, and θ is the threshold used to filter the low confidence area;
[0148] Morphological operations are used to eliminate the noise of the binary mask image and fill small holes;
[0149] The morphological operation is specifically performed through a closing operation, and the result of the closing operation is recorded as M morph , the formula is as follows:
[0150] M morph =Morph(M;kernel);
[0151] Among them, kernel is the structural element in morphological operations;
[0152] Perform connected domain analysis on the processed binary mask image, calculate the area of each region, and filter out regions smaller than the minimum area threshold according to the minimum area threshold, retaining the valid regions;
[0153] Mask M for the closing operation morph Perform connected domain analysis to identify each connected region R i And calculate the area A(R i ), the formula is as follows:
[0154]
[0155] By setting the first threshold T min To filter out the area smaller than T min The target area that meets the conditions is retained, and the valid area set is defined as:
[0156]
[0157] The exact location of steel supports and columns is determined by calculating the centroid of each effective area;
[0158] The calculation formula of the centroid position is as follows:
[0159]
[0160] Among them, C(R i )=(x c ,y c ) is the region R iThe centroid position of
[0161] The average Euclidean distance between the steel supports and columns is calculated based on the precise positions, and the distribution density of the steel supports and columns in the image is obtained based on the ratio of the total area of the effective region to the total area of the binary mask image to evaluate the distribution uniformity of the steel supports and columns;
[0162] Calculate the average Euclidean distance d between the steel support and the column avg , the formula is as follows:
[0163]
[0164] Among them, ||C(R i )-C(R i+1 )|| is the Euclidean distance between adjacent steel supports or columns, and the distribution density ρ of steel supports and columns in the image is calculated:
[0165]
[0166] in, is the total area of the effective region, A img is the total area of the binary mask image;
[0167] Analyze the geometric characteristics of steel supports and columns, as well as their impact on structural stability; obtain the total number of steel supports and columns by counting the number of effective areas and combining them with the calculation results of density and average Euclidean distance;
[0168] The shape factor κ is calculated to measure the shape consistency of the target area and analyze the geometric characteristics of the support structure. The formula is as follows:
[0169]
[0170] Among them, P i For region R i circumference;
[0171] Calculate the number of steel supports or columns respectively, the formula is as follows:
[0172]
[0173] Among them, N steel is the number of steel supports, is the effective area corresponding to the steel support. N pillar is the number of columns, is the effective area corresponding to the column.
[0174] S5, taking the obtained number of steel supports and columns as the final recognition results, generating a structural quantity statistical report, and visually displaying it on the interface; the statistical report includes the specific location, quantity and distribution density of the steel supports and columns.
[0175] Specifically, the structural quantity counting results are stored in a database or a file system to support extracting the structural quantity counting results from the database or the file system when needed during construction site management, construction progress tracking, and safety monitoring.
[0176] Specifically, Figure 2 As shown, in this embodiment, the image data of steel supports and columns under the foundation pit working condition of a construction site is selected as input. I Y represents the input data set for training the model. It is obtained by preprocessing the historical data (such as steel support and column image data under different working conditions) after specific preprocessing (such as KNet feature extraction). Each image contains visual features such as the number of steel supports, column distribution, angle, and spacing under different working conditions. I Indicates the training phase corresponding to X I The label data is used as the supervised output of the model. It is the target value generated by manual annotation. These feature data are preprocessed by Knet as the input data of the model. After preprocessing, the input data set X is obtained. w , where each X w Represents multiple feature data fragments in a picture, including structural information such as the number of steel supports and column distribution. Input the data into the trained Knet-based cost-sensitive recognition model and output the recognition result Y w , where Y w is the prediction result of the corresponding picture (such as whether it meets the safety layout requirements, whether the number of supports or columns meets the standards, etc.), where w represents the application under the working condition.
[0177] At the same time, in order to verify the effectiveness of the steel support and column quantity recognition method based on the Knet model proposed in the present invention, the image data is randomly divided into a training set at a ratio of 80%, and 20% is used as a test set for model training and verification of recognition effects. The experimental parameters of the present invention are set as shown in Table 1 below:
[0178] Table 1. Experimental parameter settings
[0179]
[0180] The KNet-based steel support and column quantity recognition method of the present invention is used to train and test the model, and its performance is observed. The confusion matrix of the test set pixel results in the multi-classification data set is shown in Table 2:
[0181] Table 2. Confusion matrix
[0182] background Steel support Column background 1174414 53995 8479 Steel support 11764 698762 3331 Column 37446 3485 190301
[0183] The data on the diagonal (such as 1174414, 698762, 190301) indicates the number of sample pixels predicted correctly by the model.
[0184] The data on the non-diagonal lines represent the misclassification results of the model, including: misclassifying "background" as "steel support" or "column", misclassifying "steel support" as "background" or "column", and misclassifying "column" as "background" or "steel support".
[0185] According to the confusion matrix, the accuracy of multi-classification prediction is calculated to be 94.569%.
[0186] The precision, recall and F1 score of its classification prediction are calculated as shown in Table 3.
[0187] Table 3. Recall and F1 score results
[0188] category Accuracy Recall F1 score background 95.79 95.51 95.65 Steel support 91.49 92.89 92.18 Column 94.24 89.88 92.01
[0189] The accuracy of the prediction of the number of foundation pit steel supports and columns in the test set is shown in Table 4.
[0190] Table 4. Real-time fault prediction accuracy
[0191] type The actual number of occurrences The number of predicted failures Accuracy Steel support 142 132 91.03% Column 37 35 94.59% Overall accuracy 179 167 93.30%
[0192] The model is based on the KNet algorithm and performs well in the classification and fault prediction tasks of steel supports and columns. In terms of classification performance, the precision, recall rate and F1 score of the background category are around 90%, and the classification accuracy of the steel support and column categories reaches 92.18% and 92.01% respectively, but the recall rate of the column is slightly lower, and there is a certain problem of missed detection. In practical applications, the overall accuracy of the model in predicting the number of steel supports and columns under foundation pit conditions reached 93.30%, of which the steel support prediction accuracy was 91.03% and the column was 94.59%, which can effectively meet engineering needs.
[0193] like Figure 3 As shown, this embodiment also discloses a steel support and column quantity identification device based on KNet, including:
[0194] An image data acquisition module 31 is used to acquire image data of a construction site; the image data covers areas including steel supports, columns, and background information that interferes with identification;
[0195] A preprocessing module 32, used for preprocessing image data of the construction site;
[0196] A model segmentation module 33 is used to input the pre-processed image data into a pre-trained KNet-based semantic segmentation model to perform segmentation;
[0197] A quantity statistics module 34 is used to obtain a high-confidence binary mask image of steel supports and columns from the image data after model segmentation, perform morphological operations on the binary mask image to optimize the quality of the mask image, perform connected domain analysis on the optimized mask image, calculate the area of each region and screen the effective region according to the minimum area threshold, determine the precise position of the steel supports and columns in the effective region by centroid calculation, calculate the average Euclidean distance and distribution density between the steel supports and columns based on the precise position to evaluate the distribution uniformity, perform quantity statistics and geometric feature analysis on the effective region based on the distribution uniformity, and obtain the structural stability and quantity of the steel supports and columns;
[0198] The report generation module 35 is used to generate a structural quantity statistical report using the obtained steel support quantity and column quantity as the final recognition result, and visually display it on the interface; the statistical report includes the specific location, quantity and distribution density of the steel supports and columns.
[0199] The specific implementation of the steel support and column quantity identification device based on KNet is the same as the steel support and column quantity identification method based on KNet, and will not be repeated in this embodiment.
[0200] Although the present invention has been specifically shown and described in conjunction with the preferred embodiments, it should be understood by those skilled in the art that various changes may be made to the present invention in form and details without departing from the spirit and scope of the present invention as defined by the appended claims, all of which are within the scope of protection of the present invention.
Claims
1. A method for identifying the number of steel supports and columns based on KNet, characterized in that: include: S1, acquiring image data of a construction site; the image data covers an area including steel supports, columns, and background information that interferes with identification; S2, preprocessing the image data of the construction site; S3, input the preprocessed image data into the trained KNet-based semantic segmentation model to perform segmentation; S4, obtaining a high-confidence binary mask image of the steel supports and columns from the image data after model segmentation, performing morphological operations on the binary mask image to optimize the quality of the mask image, performing connected domain analysis on the optimized mask image, calculating the area of each region and screening the valid region according to the minimum area threshold, determining the precise position of the steel supports and columns in the valid region by centroid calculation, calculating the average Euclidean distance and distribution density between the steel supports and columns based on the precise position to evaluate the distribution uniformity, performing quantitative statistics and geometric feature analysis on the valid region based on the distribution uniformity, and obtaining the structural stability and quantity of the steel supports and columns; S5, taking the obtained number of steel supports and columns as the final recognition results, generating a structural quantity statistical report, and visually displaying it on the interface; the statistical report includes the specific location, quantity and distribution density of the steel supports and columns.
2. The method for identifying the number of steel supports and columns based on KNet according to claim 1, characterized in that: In S2, the preprocessing includes resizing, image normalization and data enhancement of the image data of the construction site; The size adjustment is used to adjust the image data of the construction site to a standard size that meets the input requirements of the KNet model to ensure the consistency of the input image size; The image normalization is used to perform a normalization operation on the resized image data, scaling the pixel value from the range of [0, 255] to [0, 1]; The calculation formula is as follows: Among them, X is the image pixel value of the construction site, X min and X max are the minimum and maximum values of the image pixel values respectively; X′ is the pixel value of the normalized image data, and its range is [0,1]; The data enhancement includes random cropping, rotation, color perturbation, and blur and noise addition; The random cropping is used to randomly select the normalized image area. The normalized image is cropped to adapt to the target samples at different observation angles and distances. The cropping area is determined by randomly generating a center point and scale. The formula is as follows: R c =X′[x0:x0+h c ,y0:y0+w c ]; Among them, h c and w c are the height and width of the cropped area, (x0, y0) are the coordinates of the randomly selected starting point, and R c is the normalized image area after random cropping; The rotation is used to randomly rotate the resized image within the angle range of [-θ, θ], and the angle θ∈[-15°, 15°] is selected to simulate the multi-angle observation effect in the real construction site. The formula is as follows: X′ rotated =X′·cos(θ)-Y′·sin(θ); Among them, X′ rotated represents the pixel position of the rotated image, θ is the rotation angle, X′ and Y′ are the horizontal and vertical coordinates of the image respectively; The color perturbation is used to randomly perturb the normalized image to simulate scenes under different lighting conditions. The basic calculation formula of the color perturbation is: X′ adjusted =αX′+β; Among them, X′ adjusted is the image after color perturbation, α is used to control the contrast of the normalized image, and β is used to control the brightness of the normalized image; The blur and noise addition is used to add Gaussian blur or random noise to the normalized image. The calculation formula is as follows: X′ noisy =X′+N(0,σ 2 ); Among them, N(0,σ 2 ) is the added Gaussian noise, σ is the standard deviation, X′ noisy is the image after noise.
3. The method for identifying the number of steel supports and columns based on KNet according to claim 1, characterized in that: In S3, the KNet-based semantic segmentation model includes a backbone network part, a decoding head part, an auxiliary head part, a loss function part, a cost-sensitive learning strategy part, and an optimizer part: The backbone network extracts the global features of the input image and obtains the basic feature representation; The decoding head performs sampling and semantic refinement on the basic features to generate accurate segmentation results; the auxiliary head provides additional supervision to the backbone network and the decoding head to help improve feature extraction capabilities and convergence speed; The loss function part compares the segmentation results with the actual annotations, calculates the error and provides the optimization target; the cost-sensitive learning strategy part improves the recognition of steel supports and columns through the weighted loss function; the optimizer updates the model parameters based on the loss to ensure the effective training of the network; Backbone network: Swin Transformer is used as the backbone network, and basic features are gradually extracted through the hierarchical self-attention mechanism. The self-attention calculation formula is: Among them, Q, K and V are query matrix, key matrix and value matrix respectively, d k is the scaling factor; Decoding head part: It consists of Kernel Update Head and Unified Perceptron UPerHead. Kernel Update Head is used to dynamically adjust the segmentation features; Unified Perceptron UPerHead is used to aggregate context information. Auxiliary head part: By combining the fully convolutional network head FCNHead to provide additional supervision signals, the auxiliary segmentation results are output by the fully convolutional network head FCNHead to realize the gradient transfer between the backbone network and the decoding head; Loss function part: The cross entropy loss function is used to optimize the model. The cross entropy loss function is defined as: Among them, y i represents the true label, that is, the classification label corresponding to the steel support or column in the sample; p i It represents the probability predicted by the model, that is, the model's prediction probability for the steel support or column category; N is the number of samples, which represents the total number of samples involved in model training or testing; Cost-sensitive learning strategy: Introduce cost-sensitive learning strategy and set different weight coefficients w for steel support, columns and background areas i , so that the model pays more attention to the target area of steel support and column during training. The loss function after weight correction is expressed as: Optimizer part: Use AdamW optimizer to update model parameters. The update rule is: m t =β1m t-1 +(1-β1)g t ; Among them, m t and v t are the first-order and second-order momentum of the gradient, which are used to smooth and accelerate the gradient update; α is the learning rate, which controls the step size of the model parameter update; β1 and β2 are the momentum decay coefficients, which are used to adjust the update ratio of the first-order and second-order momentum; ∈ is a stabilization term, which is used to avoid the denominator being zero and improve the stability of numerical calculations; λ is a weight decay factor, which suppresses model overfitting by introducing regularization; g t Represents the gradient at the current time t, indicating the optimization direction of the model, t represents the number of iterations, and is used to track the optimization process; φ t A vector representing the parameters of the model.
4. The method for identifying the number of steel supports and columns based on KNet according to claim 3 is characterized in that: The Kernel Update Head is calculated by weight W. dynamic Perform convolution operation, the calculation formula is as follows: F out =F*W dynamic +b dynamic ; Among them, F is the input feature map, which represents the feature data to be processed after being extracted by the backbone network and is used for subsequent feature extraction and enhancement; W dynamic and b dynamic The convolution kernel weights and biases are dynamically generated based on the input features, which are used to improve the expressiveness and flexibility of the convolution operation. * represents the convolution operation, which performs weighted calculation of the weights and biases on the input feature map F to complete the feature extraction and update, so as to capture the characteristic distribution of steel supports and columns under complex working conditions.
5. The method for identifying the number of steel supports and columns based on KNet according to claim 1, characterized in that: The S4 specifically includes: Extracting binary mask images of steel supports and columns, filtering out binary mask image regions with confidence values higher than a first threshold, and filtering out binary mask image regions with confidence values lower than the first threshold; The binary mask image satisfies the following conditions: Where (x, y) is the pixel position in the image, M(x, y) is the extracted binary mask image, P(x, y) represents the segmentation confidence of the pixel, and θ is the threshold used to filter the low confidence area; Morphological operations are used to eliminate the noise of the binary mask image and fill small holes; The morphological operation is specifically performed through a closing operation, and the result of the closing operation is recorded as M morph , the formula is as follows: M morph =Morph(M;kernel); Among them, kernel is the structural element in morphological operations; Perform connected domain analysis on the processed binary mask image, calculate the area of each region, and filter out regions smaller than the minimum area threshold according to the minimum area threshold, retaining the valid regions; Mask M for the closing operation morph Perform connected domain analysis to identify each connected region R i And calculate the area A(R i ), the formula is as follows: By setting the first threshold T min To filter out the area smaller than T min The target area that meets the conditions is retained, and the valid area set is defined as: The exact location of steel supports and columns is determined by calculating the centroid of each effective area; The calculation formula of the centroid position is as follows: Among them, C(R i )=(x c ,y c ) is the region R i The centroid position of The average Euclidean distance between the steel supports and columns is calculated based on the precise positions, and the distribution density of the steel supports and columns in the image is obtained based on the ratio of the total area of the effective region to the total area of the binary mask image to evaluate the distribution uniformity of the steel supports and columns; Calculate the average Euclidean distance d between the steel support and the column avg , the formula is as follows: Among them, ||C(R i )-C(R i+1 )|| is the Euclidean distance between adjacent steel supports or columns, and the distribution density ρ of steel supports and columns in the image is calculated: in, is the total area of the effective region, A img is the total area of the binary mask image; Analyze the geometric characteristics of steel supports and columns, as well as their impact on structural stability; obtain the total number of steel supports and columns by counting the number of effective areas and combining them with the calculation results of density and average Euclidean distance; The shape factor κ is calculated to measure the shape consistency of the target area and analyze the geometric characteristics of the support structure. The formula is as follows: Among them, P i For region R i circumference; Calculate the number of steel supports or columns respectively, the formula is as follows: Among them, N steel is the number of steel supports, is the effective area corresponding to the steel support. N pillar is the number of columns, is the effective area corresponding to the column.
6. The method for identifying the number of steel supports and columns based on KNet according to claim 1, characterized in that: S5 also includes: The structural quantity counting results are stored in a database or file system to support the extraction of the structural quantity counting results from the database or file system when needed during construction site management, construction progress tracking and safety monitoring.
7. The KNet-based steel support and column quantity identification device is characterized in that: include: An image data acquisition module, used to acquire image data of a construction site; The image coverage area includes steel supports, columns and background information that interferes with identification; A preprocessing module, used for preprocessing image data of a construction site; The model segmentation module is used to input the pre-processed image data into the pre-trained KNet-based semantic segmentation model to perform segmentation; A quantitative statistics module is used to obtain a high-confidence binary mask image of steel supports and columns from the image data after model segmentation, perform morphological operations on the binary mask image to optimize the quality of the mask image, perform connected domain analysis on the optimized mask image, calculate the area of each region and screen the effective region according to the minimum area threshold, determine the precise position of the steel supports and columns in the effective region by centroid calculation, calculate the average Euclidean distance and distribution density between the steel supports and columns based on the precise position to evaluate the distribution uniformity, perform quantitative statistics and geometric feature analysis on the effective region based on the distribution uniformity, and obtain the structural stability and quantity of the steel supports and columns; The report generation module is used to generate a structural quantity statistical report using the obtained number of steel supports and columns as the final identification results, and visually display it on the interface; the statistical report includes the specific location, quantity and distribution density of the steel supports and columns.
Citation Information
Patent Citations
Steel bar number statistical model training method and device, steel bar number statistical model statistical method and device, and equipment
CN111127457A
Lane line detection method, device and system based on semantic segmentation and storage medium
CN112613392A
Spine segmentation method in medical image
CN113643314A
Steel support early warning method and system
CN115017676A
Steel bar target counting system and method based on distance transformation and watershed operator in complex scene and storage medium
CN118823051A
Cited By
Outdoor power transmission channel hidden danger identification method and system based on semantic segmentation
CN120932237A