# Intelligent Detection of Rebar Size and Position Using Improved DeeplabV3+
## 5 Rebar Size Measurements  
After an accurate rebar segmentation configuration was obtained using the improved DeeplabV3+ model, Canny operator edge detection was applied to process the segmentation configuration to accurately locate the rebar edge information. Then, the edge contour lines were determined for rebar dimensional measurements. As shown in Figure 9, the blue lines show the result of the line fitting. The green box was the inner contour of the rebar grid, and the purple line shows the rebar spacing. To convert the image size into an actual one, rebar with a known diameter was placed on the photograph or the rebar size specification was obtained from the design drawing.  
A variety of different diameters of rebar was selected including 8, 10, 12, 14, 16, and 20 mm. For each diameter of rebar, eight isometric positions were selected to measure the diameter, and the average value of the diameter was obtained. Both the original and the improved DeeplabV3 + model were used to identify the rebars and obtain their diameter. Table 5 shows the results of the diameter detection before and after the improvement  
Figure 8: Visualization of segmentation results of each model (the red circles and boxes in the figures represent inaccuracies in the segmentation results).  
of DeeplabV3+. According to the requirements of the rebar diameter measurements, a diameter error should be within 0.8 mm.  
From Table 5, the measurement error using original DeeplabV3+ for the above six different types of steel bars was greater than 0.8 mm, which did not meet the diameter acceptance requirements. Meanwhile, the absolute values of the diameter detection errors using our improved DeeplabV3+ for six types of steel bars were 0.71, 0.58, 0.39, 0.66, 0.42, and 0.76 mm, all of which were less than 0.8 mm and met the requirements of the rebar diameter acceptance.  
Six rebar grids were randomly selected for spacing measurements using a ruler. For each grid, five isometric positions were selected and averaged for the spacing measurement. The spacings of the selected six locations were detected using the original and the improved DeeplabV3+ model to record the measured values and errors. According to the requirements of spacing measurements, a spacing error should be within 10 mm. The spacing detection results using the original and the improved DeeplabV3+ model are shown in Table 6. The results showed that the minimum value of the spacing detection error of the model before the improvement was 14.25 mm, which did not meet the spacing acceptance requirement, while the maximum value of the error after the improvement of the model was 7.27 mm, which was less than 10 mm and met the spacing acceptance requirement. Therefore, the detection accuracy of our proposed improved DeeplabV3+ model can meet the requirements of rebar detection acceptance.  
Figure 9: Schematic diagram of the diameter and spacing of rebar.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Type**} & **Real Diameter** & \multirow{2}{*}{**Model**} & **Test Results** & **Error** & **Qualified** \\  & **/mm** & & **/mm** & **/mm** & **or Not** \\ \hline \multirow{2}{*}{8} & \multirow{2}{*}{8.32} & DeeplabV3+ & 9.21 & +0.89 & No \\  & & Ours & 7.61 & \(-\)0.71 & Yes \\ \hline \multirow{2}{*}{12} & \multirow{2}{*}{11.86} & DeeplabV3+ & 13.12 & +1.26 & No \\  & & Ours & 12.44 & +0.58 & Yes \\ \hline \multirow{2}{*}{14} & \multirow{2}{*}{14.16} & DeeplabV3+ & 15.05 & +0.89 & No \\  & & Ours & 14.55 & +0.39 & Yes \\ \hline \multirow{2}{*}{16} & \multirow{2}{*}{15.94} & DeeplabV3+ & 17.17 & +1.23 & No \\  & & Ours & 15.48 & \(-\)0.66 & Yes \\ \hline \multirow{2}{*}{18} & \multirow{2}{*}{18.02} & DeeplabV3+ & 18.93 & +0.91 & No \\  & & Ours & 18.44 & +0.42 & Yes \\ \hline \multirow{2}{*}{20} & \multirow{2}{*}{19.92} & DeeplabV3+ & 21.04 & +1.12 & No \\  & & Ours & 20.68 & +0.76 & Yes \\ \hline \hline \end{tabular}
\end{table}
Table 5: Comparison of diameter detection results using original and improved DeeplabV3+.