A steel bar counting method for prefabricated building prefabricated component production

By optimizing parameters using a YOLOv5-based deep learning network model and genetic algorithm, the problems of low efficiency and poor accuracy in rebar counting during the production of prefabricated components for prefabricated buildings are solved, achieving efficient and accurate rebar counting, which is suitable for real-time monitoring and management of prefabricated building production sites.

CN115311611BActive Publication Date: 2025-11-18GREEN IND INNOVATION RES INST OF ANHUI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210954734.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-10
Publication Date
2025-11-18
Estimated Expiration
2042-08-10

AI Technical Summary

Technical Problem

In the current production of prefabricated components for prefabricated buildings, steel bar counting is inefficient, manual counting is tedious and prone to errors, and traditional weight sensor methods have the problem of uncontrollable product quality.

Method used

A deep learning network model based on YOLOv5 is adopted, and the anchor box parameters are optimized by combining a genetic algorithm. Image processing technology is used to automatically count steel bars, including image feature extraction, preprocessing, training, verification and correction, to achieve accurate detection of the number and location of steel bars.

Benefits of technology

It achieves efficient and accurate rebar counting, reduces manual intervention, improves counting speed and accuracy, reduces time and space costs, supports unified counting of multiple types of rebar, and is suitable for real-time monitoring and management of prefabricated building production sites.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115311611B_ABST
    Figure CN115311611B_ABST
Patent Text Reader

Abstract

The application provides a steel bar counting method for prefabricated building prefabricated component production. First, a counting network based on a steel bar end face image is constructed; then, an image containing a steel bar end face is acquired as original input data of the counting network; then, the image is subjected to feature extraction and analysis processing through the counting network, the position of each steel bar end face in the image and the number of steel bars are acquired; then, the position of the steel bar is marked in the image, and the steel bar end face that is detected to be abnormal is corrected. Based on the unique advantages of deep learning and neural network, the application can realize efficient steel bar counting in multiple scenes in the prefabricated building industry, has feature map extraction and detection functions of multiple scales, can support steel bar counting of different diameters, can complete steel bar counting of multiple types in the unified prefabricated building production construction site without changing the network model, can monitor the inventory steel bar capacity and steel bar parameter information in real time, and has strong practicability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of prefabricated building industry, and particularly relates to a steel bar counting method for prefabricated building prefabricated component production. BACKGROUND

[0002] The prefabricated building is a new building mode that various types of building components are processed in a factory and then transported to a construction site to be assembled through reliable connection and assembly. Compared with the existing cast-in-place building, the prefabricated building has the advantages of scalable production, fast construction speed and low construction cost, and is an important direction of future building industry development.

[0003] In the actual production of prefabricated building prefabricated components, steel bars, as the main building material, are used in multiple links in the production process of prefabricated components. Generally, in the complete life cycle of steel bars, including production, transportation, sale and other links, bundling and counting are key steps for calculating profits and measuring output. Whether it is out of stock or into stock, whether it is for steel bar manufacturers, steel bar sellers or buyers, in order to ensure accurate control at each link, accurate numbers must be obtained to avoid measurement disputes, which can greatly reduce the economic risks and disputes that may occur in the transfer link. After the steel bars are transported to the site by the transportation vehicle, the site personnel of the supplier, the labor team material officer and the project department material officer generally count the steel bars to complete the goods acceptance. At present, the site generally adopts manual counting method, and different colored pigments or point electronic automatic counting pens are used to distinguish and mark the steel bars to be counted.

[0004] Manual counting is simple, but the work intensity is high, the counting process is tedious and boring, and the workers will be in a state of high tension for a long time, which is easy to cause counting errors. In addition, the whole process often needs to be repeated and corrected, and it usually takes about half an hour for the workers to count a truck of steel bars, and if multiple vehicles enter at one time, it will take several hours, and its efficiency cannot meet the needs of modern steel enterprises for rapid production. In addition, for bundled steel bars, some people also try to use weight sensors to count, since the same type of steel bars meet the corresponding national standards, in theory, the conversion equation of weight and quantity should be met: bundled steel bar quantity = bundled steel bar mass / average mass of single length steel bar. This method seems feasible, but the steel manufacturing industry generally adopts negative tolerance production in order to maximize profits, which easily leads to uncontrollable product quality. SUMMARY

[0005] The purpose of the present application is to provide a steel bar counting method for prefabricated building prefabricated component production to solve the problems in the background art.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] A method for counting steel bars in the production of prefabricated components for prefabricated buildings specifically includes the following steps:

[0008] S1. Construct a counting network based on the end face image of the rebar;

[0009] S2. Obtain an image containing the end face of the reinforcing bar as the raw input data for the counting network;

[0010] S3. Use a counting network to extract and analyze features from the image to obtain the position of each rebar end face and the number of rebars in the image;

[0011] S4. Mark the location of the reinforcing bars in the image and correct any abnormal reinforcing bar ends.

[0012] Furthermore, the counting network adopts a YOLOv5-based network model. The counting network uses images containing the rebar end faces, taken from the same angle, and with the same distribution as the original input data, sequentially completing the training, testing, and validation processes of the network model. This is specifically achieved through the following methods:

[0013] Images that meet the shooting angle requirements are selected as images, and the original images are preprocessed to expand the dataset;

[0014] The original images in the dataset are manually labeled, with the labeling objects being the rebar end faces in the images. The labeling information includes the quantity and location information of the rebar end faces.

[0015] The images and their corresponding label information are saved to obtain a new dataset, and the new dataset is randomly divided into training set, validation set and test set according to the data ratio of 8:1:1;

[0016] The counting network is trained in multiple rounds using the training set, and after each round of training, it is validated using the validation set. The loss values ​​of the counting network in the training and validation phases are obtained respectively. When the loss value obtained from the training set decreases and the loss value obtained from the validation set increases in each round, the training is stopped and the top five network models with the highest loss values ​​obtained in the training phase are saved.

[0017] The five saved network models were tested using a test set, and the network model with the highest AP value in the test results was selected as the final counting network.

[0018] Furthermore, the counting network uses anchor boxes as priors to obtain the number of reinforcing bars, and before processing the image, it uses a genetic algorithm to generate a set of optimal parameters for the number, size, and aspect ratio of the anchor boxes. This is specifically achieved through the following method:

[0019] M groups of anchor box parameters are randomly generated and used as M individuals as the initial population P(0);

[0020] Calculate the fitness of each individual in the population P(t), and select individuals based on the highest Intersection over Union (IOU). The IOU is calculated using the following formula:

[0021] IOU = (A∩B) / (A∪B)

[0022] In the formula: A and B represent two sets respectively. The larger the Intersection over Union (IOU) ratio, the more suitable the set of parameters is for the training dataset.

[0023] Based on the fitness assessment of individuals in the population, optimized individuals are directly inherited to the next generation or new individuals are generated through pairing and crossover and then inherited to the next generation.

[0024] Applying the crossover operator to the population causes selected individuals to cross over each other, giving offspring a probability of inheriting the superior performance of the crossed-over individuals.

[0025] The mutation operator is applied to the population to change the gene values ​​at certain loci of the individual strings in the population, so that the population P(t) is transformed into the next generation population P(t+1) after selection, crossover and mutation operations.

[0026] If the maximum number of generations is reached, the individual with the highest fitness obtained during the evolutionary process is output as the optimal solution, and the calculation is terminated.

[0027] Furthermore, the location of each rebar end face in the image and the number of rebars are obtained through the following methods:

[0028] S301: A network based on CSPDarknet with an additional 160*160 size feature map is used as the backbone network, combined with the focus network structure and the SiLU activation function Silu(x)=x·sigmoid(x) for feature extraction of steel bar images;

[0029] S302: Based on the prior box, predict the exact location of the rebar end face in the image by using the confidence level of whether the predicted box contains the rebar end face as a primary parameter of the classification head.

[0030] S303: Predicted results are screened using nonmaximum suppression;

[0031] S304: Remove duplicates from the filtered results to obtain the number of prediction boxes, which is the number of steel bars obtained by the counting network in this iteration.

[0032] Furthermore, the correction of abnormal rebar end faces is achieved through the following methods:

[0033] The position and quantity of rebar ends output by the counting network are manually checked in the image. For a small number of falsely detected rebar ends, the position is corrected by clicking on the false detection point. For a small number of missed rebar ends, the position is added by clicking on the missed detection point, and the total quantity of rebar ends is updated simultaneously. If there are too many missed or false detections, the image is sent back to the counting network, the image is normalized, and the count is recalculated.

[0034] As can be seen from the above technical solutions, the steel bar counting method of the present invention for the production of prefabricated components for prefabricated buildings has the following beneficial effects:

[0035] (1) Based on the unique advantages of deep learning, this invention can achieve efficient steel bar counting in multiple scenarios in the prefabricated building industry; and the model built by the neural network has a large number of network parameters, so it can fit some complex problem parameters, and the advantages of deep learning become more obvious as the complexity of the problem increases; and the steel bar counting network model has high robustness, very stable performance, and the performance of the counting network often improves as the number of training samples increases.

[0036] (2) This invention has feature map extraction and detection at multiple scales, can support steel bar counting of different diameters, can complete the counting of various types of steel bars at the unified prefabricated building production and construction site without changing the network model, and divides the image into multiple grids. Based on the anchor prior box strategy, it has a faster speed than the traditional network model and can complete a large number of steel bar counting tasks in a short time.

[0037] (3) This invention is lightweight and easy to deploy, with very low equipment requirements, and can greatly control the time and space costs of steel bar inspection tasks;

[0038] (4) The present invention has strong real-time performance and can be applied to the material management workshop of the prefabricated building component production plant. It can be used to monitor the inventory capacity and steel bar parameter information in real time, and can assist the production department in quickly and accurately requisitioning steel bars and counting the exact number of steel bars for prefabricated component production. With accurate monitoring of the inventory steel bar quantity, the factory can formulate a detailed steel bar material procurement plan based on the inventory and future orders. Attached Figure Description

[0039] Figure 1 This is a schematic diagram of the steps of the rebar counting method of the present invention;

[0040] Figure 2 This is a diagram of the rebar counting network structure based on YOLOv5 improved in this invention;

[0041] Figure 3 This is a schematic diagram of the anchor boxes-based prior bounding boxes used in the counting network of this invention;

[0042] Figure 4 This is a flowchart of the evolutionary algorithm for generating optimal anchor box prior parameters by analyzing and regressing the steel reinforcement dataset according to the present invention.

[0043] Figure 5 This is a flowchart illustrating the logic of the counting network model in this invention. Detailed Implementation

[0044] A preferred embodiment of the present invention will now be described in detail with reference to the accompanying drawings.

[0045] like Figure 1 The steel bar counting method shown for the production of prefabricated components for prefabricated buildings specifically includes the following steps:

[0046] S1. Construct a counting network based on the end face image of the rebar;

[0047] S2. Obtain an image containing the end face of the reinforcing bar as the raw input data for the counting network;

[0048] S3. Use a counting network to extract and analyze features from the image to obtain the position of each rebar end face and the number of rebars in the image;

[0049] S4. Mark the location of the reinforcing bars in the image and correct any abnormal reinforcing bar ends.

[0050] like Figure 2 As shown, the counting network in this preferred embodiment adopts a YOLOv5-based network model. The counting network uses images containing the rebar end face, with the same shooting angle and the same distribution as the original input data, and sequentially completes the training, testing and verification process of the network model. Specifically, this is achieved through the following methods:

[0051] Images that meet the shooting angle requirements are selected as images, and the original images are preprocessed to expand the dataset;

[0052] The original images in the dataset are manually labeled, with the labeling objects being the rebar end faces in the images. The labeling information includes the quantity and location information of the rebar end faces.

[0053] The images and their corresponding label information are saved to obtain a new dataset, and the new dataset is randomly divided into training set, validation set and test set according to the data ratio of 8:1:1;

[0054] The counting network is trained in multiple rounds using the training set, and after each round of training, it is validated using the validation set. The loss values ​​of the counting network in the training and validation phases are obtained respectively. When the loss value obtained from the training set decreases and the loss value obtained from the validation set increases in each round, the training is stopped and the top five network models with the highest loss values ​​obtained in the training phase are saved.

[0055] The five saved network models were tested using a test set, and the network model with the highest AP value in the test results was selected as the final counting network.

[0056] In practical applications, since the images of steel bars fed into the network are often independent, parallel training can be performed while making predictions, thereby helping the network model obtain better model parameters.

[0057] like Figure 3 As shown, the counting network in this preferred embodiment uses anchor boxes as prior bounding boxes to obtain the number of reinforcing bars, and uses a genetic algorithm to generate a set of optimal parameters for the number, size, and aspect ratio of anchor boxes before image processing, such as... Figure 4 As shown, this is achieved through the following method:

[0058] M groups of anchor box parameters are randomly generated and used as M individuals as the initial population P(0);

[0059] Calculate the fitness of each individual in the population P(t), and select individuals based on the highest Intersection over Union (IOU). The IOU is calculated using the following formula:

[0060] IOU = (A∩B) / (A∪B)

[0061] In the formula: A and B represent two sets respectively. The larger the Intersection over Union (IOU) ratio, the more suitable the set of parameters is for the training dataset.

[0062] Based on the fitness assessment of individuals in the population, optimized individuals are directly inherited to the next generation or new individuals are generated through pairing and crossover and then inherited to the next generation.

[0063] Applying the crossover operator to the population causes selected individuals to cross over each other, giving offspring a probability of inheriting the superior performance of the crossed-over individuals.

[0064] The mutation operator is applied to the population to change the gene values ​​at certain loci of the individual strings in the population, so that the population P(t) is transformed into the next generation population P(t+1) after selection, crossover and mutation operations.

[0065] If the maximum number of generations is reached, the individual with the highest fitness obtained during the evolution process is output as the optimal solution, and the calculation is terminated; and the final set of anchor boxes' number, size, and aspect ratio parameters maximize the intersection-union ratio of the anchorboxes parameters with the rebar dataset.

[0066] The following training strategy is adopted for the parameters in the initial group mentioned above:

[0067] First, the necessary information for calculating the loss value is needed. Loss calculation is essentially a comparison between the network's predictions and the network's actual results. The loss of the counting network includes the loss for the marked rebar end face location and the loss for whether the rebar end face is included, which are the Reg part and the Obj part, respectively. The Reg part determines the regression parameters of the feature points, and the Obj part determines whether the feature points include rebar end faces. Specifically, the Binary Cross-Entropy Loss Function (BCE) is used for the Obj part, as shown in the following formula:

[0068]

[0069] Where p(y) i ) represents the probability that the predicted frame contains a steel bar, 1-p(y) i y represents the probability that the prediction box does not contain steel bars. i and 1-y i These are labels indicating whether the prediction box contains reinforcing bars.

[0070] For the Reg part, the CIOU loss function is used. This loss function considers three loss parameters: overlap area, center point distance, and aspect ratio. The specific formula is as follows:

[0071]

[0072]

[0073]

[0074] In the formula: ω, h and ω gt h gt These represent the height and width of the predicted bounding box and the height and width of the ground truth bounding box, respectively. It can be seen that this loss function fully considers the positional parameters and IOU of the model's predicted bounding box, thus enabling the model to train to achieve better results.

[0075] Next, a positive sample matching process is performed, including prior box matching and feature point matching. For prior box matching, this preferred embodiment designs 12 prior boxes of different sizes in the counting network. Each output feature layer corresponds to 3 prior boxes. For any ground truth box, the counting network uses aspect ratio for matching, that is, it calculates the aspect ratio using the ground truth box and the 12 prior boxes of different sizes. If the aspect ratio of the ground truth box to a certain prior box is greater than a set threshold, it means that the matching degree between the ground truth box and the prior box is insufficient, and the prior box is considered a negative sample. The ratio of the ground truth box to the prior box is considered to be the maximum multiple of the difference between the two. When calculating the aspect ratio of the ground truth box to the 12 prior boxes, two cases need to be considered: one is that the aspect ratio of the ground truth box is larger than that of the prior box, and the other is that the aspect ratio of the prior box is larger than that of the ground truth box. Therefore, we need to calculate simultaneously: the aspect ratio of the ground truth box / the aspect ratio of the prior box; and the aspect ratio of the prior box / the aspect ratio of the ground truth box, and then select the maximum value among them. For feature point matching, in this preferred embodiment, in the rebar calculation network, each ground truth bounding box is predicted by the top-left corner feature point within the grid containing its center point. Generally, each feature point corresponds to multiple prior bounding boxes, from which the one closest to the ground truth bounding box is selected for regression of the final prediction result.

[0076] Then, based on the parts required to calculate the loss value, we know that the loss of the counting network consists of two parts: Reg part, which is the prior box corresponding to each ground truth box. After obtaining the prior box corresponding to each box, the predicted box corresponding to that prior box is extracted, and the intersection-over-union (IoU) loss is calculated using the ground truth box and the predicted box, which constitutes the loss value of the Reg part. Obj part, which is the prior box corresponding to each ground truth box. All prior boxes corresponding to ground truth boxes are positive samples, and the remaining prior boxes are negative samples. The cross-entropy loss is calculated based on the positive and negative samples and the prediction results of whether the feature point contains an object, which constitutes the loss value of the Obj part.

[0077] In specific applications, such as Figure 5 As shown, the location of each rebar end face in the image and the number of rebars are obtained through the following method:

[0078] S301: A network based on CSPDarknet with an additional 160*160 feature map is used as the backbone network. This is combined with a focus network structure and the SiLU activation function Silu(x) = x·sigmoid(x) for feature extraction from the rebar image. The backbone of the deepened CSPDarknet network consists of several 1*1 and 3*3 convolutions. The residual edges are not processed; the input and output of the backbone are directly combined. The focus network structure halves the width and height of an image and quadruples the number of channels. In this preferred embodiment, the SiLU activation function outperforms other functions. This network uses an SPP structure, employing max pooling with different kernel sizes for feature extraction, increasing the network's receptive field and enabling the extraction of multi-scale image features.

[0079] Due to the unique nature of rebar counting, rebar end faces in rebar end face images often overlap and exhibit large clusters. For the detection of such dense small targets, the three scales of traditional feature pyramids cannot meet the accuracy requirements of rebar counting tasks. Therefore, this method further improves the YOLOv5 backbone feature extraction network CSPDarknet by adding a 160*160 feature map and enhancing its features to enable it to handle smaller-scale rebar end face detection tasks. It also reduces the number of anchor boxes for large-scale features to improve the accuracy and speed of rebar counting tasks.

[0080] S302: The confidence level of whether a rebar end face exists in the prediction box is used as a key parameter of the classification head to predict based on the prior box, determining the precise location of the rebar end face in the image. Specifically, based on the YOLOv5 YOLOhead classification head and regression head, the regression head mainly includes four parameters: the center coordinates (x, y) of the rebar end face prediction box and the width and height (w, h) of the prediction box. This set of parameters can determine the precise location of the rebar end face in the image. The classification head mainly has one parameter, which is the confidence level of whether a rebar end face exists in the prediction box, with a value ranging from 0 to 1. The sigmoid function is used to regress it. The accuracy of this parameter directly affects the rebar quantity result of the counting network model. The graph of the sigmoid function is a smooth curve, so it is differentiable everywhere, which facilitates model training. The mathematical expression of the sigmoid function is:

[0081]

[0082] S303: Filtering prediction results through non-maximum suppression; In practical applications, the prediction results obtained in step S302 contain some duplicate predictions, so sorting and non-maximum suppression are needed to obtain the final result; non-maximum suppression is to filter out the largest predicted prior box that is closest to the true box within a certain region and belongs to the same category. First, find the predicted boxes in the image with a confidence level greater than the threshold function. Filtering by confidence level before filtering overlapping boxes can significantly reduce the number of predicted boxes; then, sort the predicted boxes of the rebar end face from largest to smallest according to their confidence level; and each time, take the predicted box with the highest confidence level, calculate its overlap with all other predicted boxes, and discard those with excessive overlap. The final remaining predicted boxes are the final result.

[0083] S304: Remove duplicates from the filtered results to obtain the number of prediction boxes, which is the number of steel bars obtained by the counting network in this iteration.

[0084] In practical applications, to ensure the accuracy of the technology, the position information of the rebar end faces and the rebar quantity information output by the counting network need to be manually corrected. This is done by direct manual inspection. For a small number of falsely detected rebar end faces, corrections are made by clicking on the false detection points. For a small number of missed rebar end faces, positions are added by clicking on the missed detection points, and the total number of rebar end faces is updated simultaneously. If there are too many missed or false detections, the image is retransmitted to the counting network, normalized, and then recalculated.

[0085] In practical applications, it can be combined with automated patrol equipment to achieve automatic counting without the need for manual counting.

[0086] The counting method of the present invention will be further illustrated below through a specific embodiment:

[0087] A total of 332 original images of rebar samples were collected manually, with a resolution of 1512*2016. These images constitute the original dataset in this embodiment. The original dataset is divided into a training set, a validation set, and a test set. The training set contains 266 images, the validation set contains 33 images, and the test set contains 33 images. The original images have extremely high resolution, occupy too much data space, and contain too much noise, which is not conducive to model training. Therefore, the original images are compressed, and the resolution of the compressed images is 640*640. The images in the processed dataset are manually labeled, and the labeling objects are the rebar end faces appearing in the images. In this embodiment's dataset, there are a total of 34,125 rebar end faces.

[0088] In this embodiment, a rebar counting network model based on the improved YOLOv5 is built. A pre-trained model based on the VOC dataset is used to accelerate the training process. At the same time, a pre-prepared training set is loaded for training, and the number of epochs in the training process is set to 1000.

[0089] Specifically, in this embodiment, five test samples were set for testing. The image resolution of test sample one is 612*386, and the image contains 66 rebar end faces; the image resolution of test sample two is 612*340, and the image contains 140 rebar end faces; the image resolution of test sample three is 612*402, and the image contains 149 rebar end faces; the image resolution of test sample four is 590*460, and the image contains 163 rebar end faces; the image resolution of test sample five is 570*380, and the image contains 22 rebar end faces. Test sample five is a partial image of test sample four.

[0090] The results of the network model in this embodiment identifying each test sample, and the analysis of the above experimental results, reveal the following:

[0091] (1) Test samples one and two showed good detection results, with all the rebar end faces included being completely identified. This demonstrates the good performance of the rebar counting network model in this embodiment.

[0092] (2) Test sample three contained missed detections; specifically, only one of two highly overlapping rebar end faces was detected. This result indicates that the network model provided in this embodiment still needs improvement in detecting targets with high overlap. In this embodiment or other embodiments, the image acquisition position of the camera can be changed to minimize severe overlap between the rebar end faces in the acquired images.

[0093] (3) Test sample four had some missed detections, but when a portion of it, namely test sample five, was extracted, the detection effect was better. The reason for this phenomenon is that the image resolution is relatively high, resulting in a large difference in the size of different rebar ends in one image. The model divides the test image into grids, causing multiple rebar ends of extremely small size to appear in the same grid, resulting in missed detections. That is, the target detection model provided in this embodiment has poor generalization effect on high-resolution images. At the same time, this also illustrates the necessity of setting up a deep, multi-scale feature area network in the method provided in this embodiment; it is a very correct choice. This method does not require image cropping. Image cropping and processing will further increase the amount of data processed by the network model and reduce the real-time performance of the network model. Moreover, in addition to improving the processing speed and real-time performance of the counting method, this processing method can also improve the detection accuracy of the method to a certain extent.

Claims

1. A method for counting steel bars in the production of prefabricated components for prefabricated buildings, characterized in that, Specifically, the following steps are included: S1. Construct a counting network based on the end face image of the rebar; S2. Obtain an image containing the end face of the reinforcing bar as the raw input data for the counting network; S3. Use a counting network to extract and analyze features from the image to obtain the position of each rebar end face and the number of rebars in the image; S4. Mark the location of the reinforcing bars in the image and correct any abnormal reinforcing bar ends; The counting network uses anchor boxes as priors to obtain the number of reinforcing bars, and before processing the image, it uses a genetic algorithm to generate a set of optimal parameters for the number, size, and aspect ratio of the anchor boxes. This is achieved through the following method: M groups of anchor box parameters are randomly generated and used as M individuals as the initial population P(0); Calculate the fitness of each individual in the population P(t), and select individuals based on the highest Intersection over Union (IOU) ratio. The IOU ratio is calculated using the following formula: IOU = (A∩B) / (A∪B) In the formula: A and B represent two sets respectively. The larger the Intersection over Union (IOU) ratio, the more suitable the set of parameters is for the training dataset. Based on the fitness assessment of individuals in the population, optimized individuals are directly inherited to the next generation or new individuals are generated through pairing and crossover and then inherited to the next generation. Applying the crossover operator to the population causes selected individuals to cross over each other, giving offspring a probability of inheriting the superior performance of the crossed-over individuals. The mutation operator is applied to the population to change the gene values ​​at certain loci of the individual strings in the population, so that the population P(t) is transformed into the next generation population P(t+1) after selection, crossover and mutation operations. If the maximum number of generations is reached, the individual with the highest fitness obtained during the evolutionary process is output as the optimal solution, and the calculation is terminated.

2. The method for counting reinforcing bars in the production of prefabricated components for prefabricated buildings according to claim 1, characterized in that, The counting network adopts a YOLOv5-based network model. The network uses images containing the rebar end faces, taken from the same angle, and with the same distribution as the original input data. The training, testing, and validation processes of the network model are completed sequentially, specifically through the following methods: Images that meet the shooting angle requirements are selected as images, and the original images are preprocessed to expand the dataset; The original images in the dataset are manually labeled, with the labeling objects being the rebar end faces in the images. The labeling information includes the quantity and location information of the rebar end faces. The images and their corresponding label information are saved to obtain a new dataset, and the new dataset is randomly divided into training set, validation set and test set according to the data ratio of 8:1:1; The counting network is trained in multiple rounds using the training set, and after each round of training, it is validated using the validation set. The loss values ​​of the counting network in the training and validation phases are obtained respectively. When the loss value obtained from the training set decreases and the loss value obtained from the validation set increases in each round, the training is stopped and the top five network models with the highest loss values ​​obtained in the training phase are saved. The five saved network models were tested using a test set, and the network model with the highest AP value in the test results was selected as the final counting network.

3. The method for counting reinforcing bars in the production of prefabricated components for prefabricated buildings according to claim 1, characterized in that, The location of each rebar end face in the image and the number of rebars are obtained through the following method: S301: A network based on CSPDarknet with an additional 160*160 size feature map is used as the backbone network, combined with the focus network structure and the SiLU activation function Silu(x)=x·sigmoid(x) for feature extraction of the rebar image; S302: Based on the prior box, predict the exact location of the rebar end face in the image by using the confidence level of whether the predicted box contains the rebar end face as a primary parameter of the classification head. S303: Predicted results are screened using nonmaximum suppression; S304: Remove duplicates from the filtered results to obtain the number of prediction boxes, which is the number of steel bars obtained by the counting network in this iteration.

4. The method for counting reinforcing bars in the production of prefabricated components for prefabricated buildings according to claim 1, characterized in that, The correction of abnormal rebar end faces is achieved through the following methods: Manually check the position information of the rebar end face and the rebar quantity information output by the counting network in the image; For a small number of falsely detected rebar ends, click on the falsely detected area to correct and modify them. For a small number of missed rebar ends, click on the missed area to add the location, and at the same time update the total number of rebar ends. If there are too many missed or false detections, the image is sent back to the counting network, normalized, and then recalculated.

Citation Information

Patent Citations

  • Reinforcing steel bar detecting and counting method based on deep neural network model

    CN113888513A

  • Target identification detection method based on improved YOLOv5

    CN114627502A