Method, device and medium for collaborative identification and calibration of apparent defects of hydraulic concrete
By employing global-local collaborative detection and geometric continuity calibration, the accuracy problem of identifying fine cracks in hydraulic concrete images has been solved, improving recognition efficiency and reliability while reducing false alarm rates.
Patent Information
- Application Number
- CN202611643788.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-22
- Publication Date
- 2026-12-01
AI Technical Summary
Existing technologies struggle to accurately identify fine cracks and linear defects in hydraulic concrete images, and are prone to missed detections and false alarms in complex scenarios, especially under wet conditions after rain.
A global-local collaborative detection method is adopted. Through a multi-scale apparent disease detection network with shared parameters, the local slice size and overlap rate are determined by combining texture complexity, edge density and candidate disease probability. Global-local consistency constraints are constructed, and geometric continuity calibration is performed to output geometric continuity quality score and risk level.
It improves the detection rate of slender cracks and small-scale defects, reduces false alarms caused by repeated detection at slice edges and interference from complex scenes, and provides reliable defect identification and risk assessment.
Smart Images

Figure CN123201014A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing and recognition technology, specifically to a method, equipment, and medium for collaborative identification and calibration of apparent defects in hydraulic concrete. Background Technology
[0002] The identification and calibration of apparent defects in hydraulic concrete refers to locating and identifying defects such as cracks, spalling, honeycomb surfaces, holes, exposed steel bars, and suspected apparent water seepage marks from visible light inspection images of the surface of hydraulic structures, calibrating the reliability of the identification results, and then calculating the geometric quantitative parameters of the defects and outputting the risk level.
[0003] Existing technologies typically use drones, handheld cameras, or mobile inspection devices to acquire high-resolution inspection images and use target detection networks to identify diseases. Since scaling up the entire image will lose the texture of small diseases, existing technologies often divide the original image into fixed-size local slices for separate inspection and then merge the detection results of each slice.
[0004] In practical applications, existing technologies still have some problems: First, in hydraulic concrete images, linear defects such as cracks appear as small, discontinuous, and weakly textured features from a global perspective, requiring high resolution for accurate identification; while the structural context information of components such as dam surfaces and tunnel linings depends on the global image; although fixed slices can preserve local details, they will generate duplicate detection boxes in overlapping slice areas and may truncate cracks that cross slice boundaries; if fragment splicing is only performed in the post-inference processing stage without introducing constraints for slice breakage during network training, it is difficult to alleviate crack under-detection and fragment breakage at the model level; Second, the confidence level of existing technologies only reflects the model's discrimination of image features, without utilizing the geometric continuity evidence of crack instances obtained through cross-slice fusion, and without considering the differences in crack morphology between different component types such as dam surface components and tunnel lining components; in wet scenarios after rain, it is easy to lower the confidence level of geometrically continuous real cracks along with pseudo cracks generated at slice edges, causing real and effective cracks to be incorrectly suppressed, and the risk classification results are difficult to directly support inspection and review decisions. Summary of the Invention
[0005] The method, equipment, and medium for collaborative identification and calibration of apparent defects in hydraulic concrete proposed in this invention can at least solve one of the technical problems in the background art.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: A collaborative identification and calibration method for apparent defects in hydraulic concrete includes: acquiring inspection images of hydraulic concrete structures to be identified and associated scene information; performing distortion correction, scale normalization, and imaging quality evaluation on the inspection images to be identified to obtain scene vectors and preprocessed inspection images; generating a global image based on the preprocessed inspection images, and determining the size, overlap rate, and sampling position of local slices according to the texture complexity, edge density, and candidate defect probability of the image region to obtain a set of local slices and coordinate indices; inputting the global image and the set of local slices into a multi-scale apparent defect detection network with shared parameters to obtain initial detection results, including the defect category, location, and initial confidence level; during the training phase of the detection network, constructing global-local consistency constraints based on the spatial correspondence of the same defect in the global image and local slices; and determining the direction of samples with crack instance numbers, connection endpoints, local directions, and local width supervision information according to the component type. The threshold and endpoint distance threshold are constructed by differentiable geometric prediction branches that share features with the detection network to establish crack geometric continuity constraints. The detection loss, global-local consistency loss, and effective crack geometric continuity loss are weighted and backpropagated to update the apparent defect detection network. Samples lacking geometric supervision information are not included in the geometric loss. Based on the coordinate index, the initial detection results of the global image and local slices are uniformly back-mapped to the geometrically calibrated high-resolution inspection image coordinate system. Cross-slice weighted fusion is performed to obtain the fused detection result, and the geometric continuity quality score and usable geometric score label of the crack instance are calculated. The confidence of the fused detection result is adaptively calibrated based on the scene vector, geometric continuity quality score, and usable geometric score label. Defect instances to be quantified are selected by combining the calibrated confidence and quantification validity label. Defect quantification parameters are calculated based on their geometric region and pixel spatial resolution, and the risk level or pending review status is output for inspection review ranking.
[0007] Preferably, the process of obtaining the scene vector and the preprocessed inspection image includes: acquiring the inspection image and associating it with the image number, acquisition time, equipment identification, facility type, component type, and acquisition location; performing lens distortion correction, color space unification, and orientation correction on the inspection image, retaining the high-resolution corrected image, and performing scale normalization on the network input; calculating sharpness, brightness, contrast, shadow ratio, stain ratio, and wetness interference probability, converting the six indicators into normalized quality components with larger values indicating better quality, and then weighting and summing them; integrating information on facilities, components, shooting scale, viewing angle, lighting, sharpness, wetness, shadow, stains, and repair areas to form the scene vector; outputting a resampling mark when the quality is insufficient, and outputting a quantization invalid mark when the scale is missing, unreliable, or the relative calibration error exceeds the threshold.
[0008] Preferably, the process of obtaining the local slice set and coordinate index includes: scaling and filling the preprocessed inspection image proportionally along a preset long side to obtain a global image; dividing the preprocessed inspection image or its low-magnification feature map into multiple candidate regions, calculating the normalized gradient mean, edge pixel ratio, normalized local entropy, and candidate disease probability for each candidate region; obtaining the texture complexity by weighted summation of the normalized gradient mean, edge pixel ratio, and normalized local entropy, and obtaining the slice priority by weighted summation of the texture complexity and candidate disease probability; determining the size and overlap rate of the local slices based on the slice priority, with higher slice priority resulting in smaller slice size and higher overlap rate; using the geometrically corrected high-resolution inspection image as the local slice cropping reference, establishing a network input coordinate system for each local slice, and recording the slice number, the starting coordinates of the slice in the corrected image coordinate system, the horizontal scaling ratio, the vertical scaling ratio, the left fill amount, and the top fill amount to form a coordinate index; and simultaneously saving the scaling ratio and fill amount of the global image.
[0009] Preferably, the process of determining the size and overlap rate of local slices based on slice priority includes: adaptively selecting the size and overlap rate of local slices according to the relationship between slice priority and preset first priority threshold and second priority threshold, wherein the first priority threshold is greater than the second priority threshold; the coordinate index satisfies the following inverse transformation relationship: , ; and The coordinates of the detection point in the high-resolution corrected image; and Input coordinates for the scaled and filled local network; and To capture the coordinates of the top left corner of the window for slicing; and For effective content scaling ratios, all are greater than zero; and The left and top padding amounts are the input to the network. The global image starts at zero and undergoes the same inverse transformation as its scaling and padding amounts.
[0010] Preferably, the process of obtaining the initial detection result includes: using the same color channel order, pixel normalization parameters, and network input size for the global image and local slices; extracting features at least three resolution levels using a backbone network with shared parameters, and aggregating features through top-down and bottom-up paths; decoupling the detection head output class score and boundary position, combining the probability with the class conditional probability when there is an independent target existence probability branch, and directly using the class score defined by the detection head as the initial confidence level when there is no such branch; and attaching the input source and coordinate index to each result.
[0011] Preferably, the process of constructing global-local consistency constraints includes: generating pairs of global and local samples from the same inspection image to be identified; mapping the local predictions to the coordinate system of the inspection image to be identified; establishing a matching set based on the same category and spatial overlap; calculating the category distribution consistency loss and the location mapping consistency loss based on the matching set to obtain the global-local consistency constraints. The process of constructing crack geometric continuity constraints includes: determining orientation thresholds and endpoint distance thresholds based on component type and local reference orientation; for crack segment pairs with reliable orientation, connection endpoints, and width annotations, outputting continuous geometric quantities using a differentiable geometric branch on shared features, transforming to the same coordinate system and dimensionlessly converting to the aforementioned thresholds and local width scale, and calculating the loss with the same defined annotation reference quantities; the gradient is then passed to the shared feature layer via this branch. Samples with only bounding box annotations do not participate in geometric supervision; during the training phase, hard thresholding, binarization, or skeletonization are not used as paths to pass gradients to the detection network based on geometric loss.
[0012] Preferably, the process of calculating the geometric continuity quality score and available markers for crack instances includes: inversely transforming the detection boxes, key points, or segmentation contours in the global image and local slices to the geometrically corrected high-resolution inspection image coordinate system based on the coordinate index; discarding results that completely fall into the filled area or do not correspond to valid image content, and cropping some out-of-bounds results to the valid area; establishing candidate clusters according to the disease category, performing weighted box fusion on the facet disease candidate clusters based on the initial confidence level, slice center position weight, and global context weight to obtain the fused detection result; merging adjacent segments for crack candidate segments according to the direction threshold and endpoint distance threshold, constructing connecting edges and calculating edge quality, summing the edge quality, weighting and normalizing it according to the weight of its effective connecting area, and then multiplying it by the source slice quantity adjustment coefficient to obtain the geometric continuity quality score of the crack instance; when there are effective connecting edges, reliable geometric measurements, and the sum of the weights of the effective connecting areas is greater than zero, setting the available marker for the geometric score as valid; otherwise, setting the marker as invalid and setting the geometric continuity quality score of the crack instance to zero.
[0013] Preferably, the calibrated confidence level is calculated according to the following formula:
[0014] in, For the Sigmoid function; To integrate confidence levels; For scene vectors; This is a vector of calibration coefficients of the same dimension, with the superscript tr indicating transpose; For bias; The quality score for the geometric continuity of the crack instance; A flag is used to indicate the geometric score; 1 is used if the score is valid, and 0 is used otherwise. This represents the probability of moisture interference. This is the offset from the scoring baseline; This is the geometric score gain coefficient; The interaction penalty coefficient for wetting interference in geometric gating; This is a temperature parameter. The parameter satisfies... , , , , and When the geometric score is valid, other inputs are fixed, and the confidence level does not decrease with the score; when the geometric score is invalid, both geometric-related corrections are reset to zero, and only the fusion response and basic scene calibration are retained. The wetting factor can be fitted by the scene item, and no unconditional wetting deduction item is set separately.
[0015] The risk level is determined as follows: the actual length of the crack skeleton, the maximum width of the crack, and the proportion of the area of the planar disease are calculated based on the geometric area of the disease and the effective pixel spatial resolution; the inspection and review risk level or the status to be reviewed is output based on the calibration confidence, quantification validity, current quantification parameters, periodic changes of the same disease instance, disease type, and component type, and a structured inspection record is generated.
[0016] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.
[0017] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.
[0018] As can be seen from the above technical solutions, the collaborative identification and calibration method, equipment and medium for apparent defects in hydraulic concrete of the present invention aim to improve the detection rate of slender cracks and small-scale defects in high-resolution inspection images and reduce false alarms caused by repeated detection of slice edges and interference from complex scenes through global and local collaborative detection and scene adaptive calibration.
[0019] 1. This invention utilizes a collaborative approach between global images and high-resolution local slices, taking into account both component context and subtle textures. Slice size and overlap rates are allocated based on texture, edges, and candidate probabilities, allowing for more local observation of suspected areas. Shared detection parameters, explicit coordinate indexing, and category-based fusion constitute a unified processing path. Training and inference employ consistent component conditional orientations and endpoint thresholds, providing supervision and connectivity for cross-slice crack continuity. Under conditions of coverage checks and configuration budgets, this mechanism helps reduce the impact of scale compression, slice truncation, and repeated predictions on recognition. Specific changes in detection rate, positioning accuracy, and computational cost are determined by testing under the same conditions.
[0020] 2. This invention calculates the geometric continuity quality score and available markers for crack instances after cross-slice fusion, using directional consistency, endpoint proximity, and width continuity as supplementary evidence for confidence calibration. Under the constraints of valid geometric evidence and non-negative calibration coefficients, the calibration confidence does not decrease with the geometric score; the wetting interference interaction term weakens as the geometric score increases, helping to reduce the over-suppression of continuous cracks under wetting conditions. When geometric evidence is missing or unreliable, the calibration degrades to the basic scenario calibration, avoiding the direct equation of a lack of connectivity evidence with the absence of real cracks. This mechanism provides a basis for confidence assessment in complex scenarios that is linked to the component's geometric priors, and the extent of improvement is determined by independent field testing.
[0021] 3. This invention integrates quality assessment, global and local detection, component condition geometric constraints, defect fusion, and geometric quality feedback calibration into a complete processing flow, generating quantitative results when the geometric region and scale are reliable; uncertain, invalidally quantified, or suspected seepage results retain a verification status. Structured records summarize defect categories, original image locations, calibration confidence levels, quantitative validity, and inspection verification levels, enabling local identification evidence to be linked to overall inspection management and result traceability.
[0022] 4. Quality assessment and scale effectiveness control enable low-quality images, missing scales, and calibration out-of-limits images to be identified and transferred for resampling or verification in the automated workflow, reducing the occurrence of unreliable physical dimensions directly entering the grading process; local slices are generated on high-resolution corrected images, preserving fine textures in local inputs; global inputs provide component and environmental contexts, both using a unified network configuration, which reduces differences in processing rules caused by different scales; slice density is jointly allocated by texture, edges, local entropy, and candidate probability, allowing more computational resources to be devoted to suspected fine disease areas; low-priority basic coverage, boundary patching, and boundary processing reduce sampling omissions. Slice budgeting provides configurable computational control for deployment, with savings depending on actual image measurements; shared parameters reduce the need to maintain two independent global and local detection models, and global-local consistency training provides representation and location constraints for the same lesion at different observation scales; consistent visible area comparison of truncated windows reduces supervision conflicts caused by incomplete local annotations; component condition thresholds are used consistently in training and inference, ensuring that crack continuity supervision and segment connectivity are defined at the same scale; undirected angle difference, local endpoint tangency, and width continuity provide a basis for distinguishing bends, cross-slice connections, and proximity interference; explicit coordinate indexing unifies the positions of global and local predictions, records scaling, filling, and effective windows, and reduces the impact of coordinate drift, invalid edge predictions, and duplicate counting on localization and subsequent quantization; regional candidate fusion and crack connectivity maps are used separately according to lesion categories, taking into account the different representation requirements of planar regions and linear topologies; slice center position and global context weights can reduce the impact of incomplete slice edge predictions while retaining minor lesions detected only locally.
[0023] 5. Geometrically available labels separate “no geometric evidence obtained” from “obtained but of low quality”; single-piece cracks, planar defects, or skeleton extraction failures can still output results through basic scene calibration and manual review processes, avoiding additional judgment bias caused by invalid geometric quantities; constraining geometry and wetting interaction terms with independent calibration samples helps adjust the meaning of the fusion response according to the deployment scenario; freezing parameters, configuring difficult negative samples, and controlled manual review updates reduce the possibility of automatic prediction errors continuously entering the model. The calibration effect is evaluated using ECE, Brier, and grouping indices. When the mask and scale are reliable, length, width, and visible area are treated as independent quantification results, and their validity is recorded. Cross-period correspondence of the same defect supports change screening, reducing misjudgments caused by direct subtraction of geometric quantities from different components or perspectives. Structured records preserve the original image location, constituent segments, source slices, geometric scores, model configuration, and rule versions, enabling reviewers to trace the basis for detection and grading, and supporting database queries, on-site verification, and subsequent controlled model updates. The output grade is used for inspection screening and ranking; uncertainties, invalid quantifications, and suspected seepage are retained for review or joint monitoring status, ensuring the system's image recognition results are integrated with engineering management processes. The above advantages correspond to specific technical mechanisms, and the quantification improvement conclusions are based on results within the corresponding test range. Attached Figure Description
[0024] Figure 1 This is a flowchart of the present invention; Figure 2 This is a flowchart of the adaptive slice generation and shared parameter detection process of the present invention; Figure 3 This is a flowchart of the adaptive calibration and risk classification process for the present invention. Figure 4 The graph shows the mean and standard deviation of five independent replicates of the simulated ablation experiment. Figure 5 The simulation connection determination PR curve is shown in the figure. Figure 6 This is a simulation reliability diagram and a sample distribution diagram. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0026] Example 1, as Figure 1As shown, the collaborative identification and calibration method for apparent defects in hydraulic concrete described in this embodiment includes steps 1 to 6. In this method, defects refer to cracks, spalling, honeycomb surfaces, holes, exposed steel bars, and suspected apparent water seepage marks that can be located from the visible images of the concrete surface. The global image is an image obtained by scaling up the original inspection image as a whole. The local slice is an image area that retains the local spatial resolution of the original image and carries the coordinate index of the original image. The pixel spatial resolution is the actual physical size corresponding to a single pixel.
[0027] Step 1: Inspection image and scene information acquisition and image preprocessing.
[0028] The system acquires images of hydraulic concrete structures to be identified and inspected, as well as scene information associated with these images. It then performs distortion correction, scale normalization, and imaging quality evaluation on the images to be identified and inspected, and constructs a complete scene vector.
[0029] Step 1.1: Image acquisition and metadata association.
[0030] Images to be identified are collected using drones, handheld cameras, mobile inspection devices, tunnel robots, or fixed cameras; the image number, collection time, camera identification, facility type, component type, and collection location are associated with the images to be identified; component types include dam surface components and tunnel lining components.
[0031] Check the image for file corruption, missing channels, or abnormal dimensions.
[0032] The processing result is an inspection image to be identified with metadata tags.
[0033] Step 1.2: Image correction and quality index calculation.
[0034] The inspection images to be identified are sequentially subjected to integrity checks, lens distortion correction, color space unification, and orientation correction, and the geometrically corrected high-resolution inspection images are saved. Scale normalization is used as the network input for subsequent global images and slices, and the overall scaled-down images are not used to replace the high-resolution slice source images. The "original image coordinate system" used for slicing, fusion, and quantization in the following text refers to the coordinate system of this high-resolution corrected image. If the results need to be superimposed on the original image output by the acquisition device, the saved geometric correction mapping is used for coordinate back projection.
[0035] Calculate sharpness, brightness, contrast, shadow ratio, smudge ratio, and wetness interference index. Sharpness can be calculated using the variance of the Laplacian response of the grayscale image; brightness uses the grayscale mean, and contrast uses the grayscale standard deviation. These three raw statistics do not naturally fall between 0 and 1 and need to be normalized and truncated using upper and lower limits determined and frozen based on training or calibration data. Shadow and smudge ratios are calculated by dividing the corresponding mask area by the effective image area. Specular reflectance ratio is only used as a wetness interference feature and cannot be directly considered as the wetness probability; if outputting the wetness interference probability, the classifier should be trained or calibrated using manually verified wet and non-wet samples, and calculated in conjunction with brightness, specular, color, and local texture features.
[0036] The overall image quality index is a non-negative weighted sum of six quality components in the same direction, with the sum of the weights being 1. Sharpness and contrast are calculated using the normalized positive components; brightness is calculated based on its proximity to a reasonable exposure range to avoid evaluating overexposure as high quality; shadow proportion, smudge proportion, and wetness probability are calculated using their corresponding inverse components, such as 1 minus the index. Each normalization boundary, exposure range, weight, and quality threshold should be determined and frozen on independent validation data, and the same calculation rules should be used during deployment.
[0037] The processing results are corrected and normalized images to be identified during inspection, as well as a set of image quality indicators.
[0038] Step 1.3: Scene vector construction and validity marker generation.
[0039] Read or calibrate the shooting distance, focal length, shooting angle, and pixel spatial resolution. Integrate facility type, component type, shooting distance, pixel spatial resolution, shooting angle, light intensity, image sharpness, surface wetness, shadow ratio, stain ratio, and repair area markers to form a complete scene vector.
[0040] For planar components, the pixel spatial resolution can be determined from the known dimensions of the calibration object or the relationship between the camera parameters and the planarity of the component; the shooting distance or focal length alone cannot eliminate the scale changes caused by oblique photography. For perspective changes or tunnel surfaces, appropriate geometric corrections should be performed, or a region-by-region scale and area conversion relationship should be established, and the applicable scope and effectiveness of the scale calibration should be recorded.
[0041] When the overall image quality index is lower than the preset quality threshold, a resampling marker is output. 0.4 to 0.6, preferably 0.5, can be used as an example candidate range for the quality threshold; the actual value should be determined based on quality evaluation and downstream identification results. When the scale is missing, the scale is not applicable to the current component surface, or the calibration relative error exceeds the threshold, a physical quantization invalid marker is output. The scale relative error is defined as the absolute value of the difference between the calibration length and the known reference length divided by the reference length; 8% to 12%, preferably 10%, is only a configurable example and must be verified in conjunction with the minimum crack width to be measured and the allowable error. This percentage is not equivalent to the reprojection error per pixel or a unified photogrammetry standard.
[0042] The processing result is a complete scene vector z, along with optional resampling and quantization invalidation labels.
[0043] Step 2: Global image generation and adaptive overlapping local slice construction.
[0044] A global image preserving the component context is generated from the preprocessed inspection image; texture complexity is calculated for candidate regions in the original image, and the slice priority is calculated by combining the defect probability output by a lightweight candidate network. Based on the slice priority, the slice size and an overlap rate of 10% to 50% are adaptively selected to generate a set of overlapping local slices; a coordinate index is generated for each local slice to record the mapping relationship from the slice to the original inspection image, such as... Figure 2 As shown.
[0045] Step 2.1: Global image generation.
[0046] A global image is generated by scaling and filling the high-resolution corrected image proportionally to the long side of the network input, and the scaling ratio and the amount of filling on the left and top sides are recorded. In this embodiment, a network input of 960×960 pixels is used uniformly. 1024 to 2048 pixels can be used as a configuration range for separate training and verification. The global image and local slices use the same deployment configuration to avoid generating a 1536-pixel global image first and then scaling it to 960 pixels without recording.
[0047] The global image is calculated as a low-resolution panoramic image that preserves the facility, components, and environmental context.
[0048] Step 2.2: Calculation of multiple indicators for candidate regions.
[0049] The inspection image to be identified or its low-magnification feature map is divided into multiple candidate regions; for each candidate region, the normalized gradient mean, edge pixel ratio, normalized local entropy, and candidate disease probability output by the lightweight candidate network are calculated.
[0050] Let g be the mean of the normalized gradient of the i-th candidate region. iFirst, determine the grayscale value range, gradient operator, and magnitude calculation method. Then, normalize the gradient magnitude using a fixed reference magnitude and truncate it to 0 to 1. If the Sobel operator is used, you cannot simply divide by 255 to assume that the gradient magnitude has been normalized. The reference magnitude is determined based on the theoretical range of the operator or statistical analysis of training data and should be kept consistent during deployment.
[0051] Let e be the percentage of edge pixels in the i-th candidate region. i The percentage of edge pixels is obtained by dividing the number of edge pixels in the candidate region by the total number of pixels in the candidate region.
[0052] For an 8-bit grayscale image, calculate the local entropy using a 256-level grayscale histogram. ,in, The local entropy of the i-th candidate region Let be the probability of gray level 'a' appearing in the candidate region. Zero-probability terms are treated as zero, and the normalized local entropy is: When using other gray levels, the corresponding maximum entropy is used as the normalization constant.
[0053] Let r be the probability of candidate disease in the i-th candidate region. i ;r i The algorithm is computed using a lightweight candidate network. The lightweight candidate network is a convolutional neural network (CNN) that takes candidate region images as input and outputs the probability of candidate diseases. The lightweight candidate network consists of three convolutional layers and two fully connected layers. The kernel sizes of the three convolutional layers are 3x3, 3x3, and 3x3, respectively, with 16, 32, and 64 channels, respectively. The number of neurons in the two fully connected layers is 128 and 1, respectively. The lightweight candidate network is trained using independently trained candidate region samples, supervised by a cross-entropy loss function, and outputs the probability value of disease presence in the candidate region. The number of training epochs ranges from 50 to 200, preferably 100; the learning rate ranges from 0.001 to 0.01, preferably 0.005.
[0054] The lightweight candidate network employs fixed candidate input size, convolutional activation, and pooling, or uses adaptive pooling at the end of the convolution to fix the feature size before connecting a fully connected layer; finally, it outputs probabilities via a sigmoid function. Training labels indicate whether the candidate region contains manually confirmed defects, with shadows and seams used as negative samples; data partitioning is based on the original image or engineering source, and the candidate network does not use ground truth values during deployment.
[0055] All of the above indicators are normalized to the range of 0 to 1.
[0056] Step 2.3: Calculate texture complexity and slice priority.
[0057] The various metrics obtained in step 2.2 are weighted to obtain the texture complexity and slice priority.
[0058] Texture complexity Q i From the normalized gradient mean g i Edge pixel ratio e i and normalized local entropy V ent,i The values are obtained by multiplying each value by weights α1, α2, and α3 respectively and then summing them. The sum of the three weights equals 1. The value of α1 ranges from 0.25 to 0.4, the value of α2 ranges from 0.3 to 0.45, and the value of α3 ranges from 0.2 to 0.35. The preferred values are α1=0.3, α2=0.4, and α3=0.3. The basis for these values is as follows: the weight of the edge proportion term α2 is set to a larger value because the edges of cracks and holes are important distinguishing features in the appearance defects of hydraulic concrete; the weight of the local entropy term α3 is set to a moderate value to help judge the degree of texture irregularity; and the weight of the gradient mean term α1 is set to a moderate value to reflect the strength of the basic texture.
[0059] Slice priority P i Texture complexity Q i And the probability of candidate diseases r i The result is obtained by multiplying each value by weights μ1 and μ2 and then summing them up; the sum of the two weights equals 1. The value of μ1 ranges from 0.4 to 0.6, and the value of μ2 ranges from 0.4 to 0.6. The preferred values are μ1=0.5 and μ2=0.5. The reason for these values is that texture complexity reflects the amount of information in a region, and the probability of a candidate disease reflects the degree of suspicion in a region. The weights of the two are equal, taking into account both the amount of information and the prior knowledge of the disease.
[0060] P i Q i and r i All are normalized to the range of 0 to 1.
[0061] Step 2.4: Determine slice parameters and generate local slices.
[0062] Set the first threshold P high Second threshold P low First threshold P high The value ranges from 0.6 to 0.8, with 0.7 being preferred. The second threshold P low The value ranges from 0.2 to 0.4, with 0.3 being preferred.
[0063] When P i >P high When using a smaller slice size and a higher overlap rate, the smaller slice size ranges from 256 to 384 pixels, preferably 320 pixels; the higher overlap rate ranges from 40% to 50%.
[0064] When P low ≤P i ≤P highWhen using standard slice size, the standard slice size ranges from 512 to 768 pixels, preferably 640 pixels; the standard overlap rate ranges from 20% to 40%.
[0065] When P i <P low And the probability r of candidate diseases i When the probability threshold is less than 10%, use a larger slice size, such as 768 to 1024 pixels, and set the overlap rate to 10% to 20%, preferably 15%; when P i <P low And the probability r of candidate diseases i When the probability threshold is ≥, the standard slice size and overlap rate are used; a probability threshold of 0.3 to 0.6, preferably 0.5, is a configuration example to be verified, based on the balance between candidate recall and false positive rate on the validation set; low priority areas still retain basic coverage to avoid the area being completely undetected after the candidate network misses the detection.
[0066] Slices are generated based on the determined slice size, overlap rate, and sampling position; assuming the slice side length is s and the overlap rate is 0, then the step size along the corresponding direction is max(1, floor(s(1)). o))); Add edge-fitting slices or record necessary padding when near the right and bottom boundaries of the image; perform coverage checks and patching at the boundaries of regions with different parameters, and remove duplicate slices with the same position and window. The upper limit of the number of slices can be set according to the deployed computing power, prioritizing the retention of basic coverage, and then allocating the remaining budget to high-priority regions; the upper limit of the number needs to be verified in conjunction with the target recall rate.
[0067] Step 2.5: Construct the local slice coordinate index.
[0068] A local slice is a rectangular region extracted from a high-resolution corrected image. Its position and extent are determined by the coordinates of its top-left corner and the slice's width and height. The top-left corner coordinates alone cannot uniquely determine a variable-size slice. This coordinate system has its origin at the top-left corner of the image, with the horizontal axis pointing to the right and the vertical axis pointing downwards.
[0069] When using the center point, lower right corner, or other positioning references of the slice, the slice width and height should be recorded simultaneously, and then converted to consistent upper left corner coordinates before using the following inverse transformation formula.
[0070] For the slice numbered ψ, record the slice number, top-left corner coordinates, effective width and height, network input width and height, horizontal and vertical scaling ratios, and left and top padding amounts. The scaling ratio is defined as the effective content size after scaling divided by the cropping window size, both of which must be greater than zero. The local coordinates in the formula are the network input coordinates after scaling and padding. The global image uses the same indexing rule, with the starting coordinates being zero.
[0071] The inverse transformation formula from the local coordinate system to the original inspection image coordinate system is:
[0072]
[0073] and The coordinates of the detection point in the high-resolution corrected image; and Input coordinates for the scaled and filled local network; and To capture the coordinates of the top left corner of the window for slicing; and For effective content scaling ratios, all are greater than zero; and The left and top padding amounts are the input to the network; the global image starts at zero and undergoes the same inverse transformation as its scaling factor and padding amount.
[0074] The result of the inverse transformation formula is the position of the detection point in the original coordinate system.
[0075] Step 3: Multi-scale apparent disease detection network with shared parameters between the global image and local slice inputs from the same source.
[0076] Consistent network preprocessing is applied to both the global image and local slices originating from the same source. These are then fed into a multi-scale detection network with shared parameters. Texture and semantic information are aggregated through bidirectional feature fusion. The decoupled detection head outputs the category score and location, while retaining the input source and coordinate index. Shared parameters refer to using the same set of network weights to process different inputs; it does not necessarily imply direct cross-attention or feature exchange between the input features.
[0077] Step 3.1: Unified preprocessing and shared backbone feature extraction.
[0078] The pixel normalization scheme is determined by the model training configuration and deployed along with the model file. Only one scheme is used within the same deployment instance; the global image and local slices perform the same color channel order, input size, and normalization operation. Training, validation, calibration, and inference use consistent input conventions. The deployment record saves the scheme identifier, input value range, channel order, scaling and padding parameters, normalization parameters, and corresponding model version, and verifies the consistency between the configuration and the model upon loading.
[0079] When using the YOLO26s pre-trained weights in this embodiment, the RGB channel order is used, the original pixel values are divided by 255, the input size is 960×960 pixels, and the mean and standard deviation are not added for standardization. The other network configuration is only used when its weights are trained according to the corresponding standardization scheme: first, the pixel values are scaled to 0 to 1, then the mean of 0.485, 0.456, and 0.406 is subtracted from each of the three RGB channels respectively, and then divided by the standard deviations of 0.229, 0.224, and 0.225. These two schemes belong to different model configurations and should not be mixed in the same inference; changing the scheme requires simultaneously changing the matching model and calibration parameters and completing verification.
[0080] The shared backbone network can employ convolutional modules containing residuals or cross-stage connections, with its specific structure consistent with the selected model weights. In this embodiment, when using YOLO26s, its convolutional, C3k2, and related feature modules are used, but it is not equivalent to a network with a fixed number of standard ResNet residual blocks stacked together. Each input sample includes its source and coordinate index.
[0081] The processing result is a set of input tensors for the backbone network, along with source labels and coordinate indices.
[0082] Step 3.2: Multi-scale feature extraction and bidirectional multi-scale feature fusion.
[0083] The backbone feature extraction module outputs at least three different resolution levels of features, corresponding to shallow texture features, mid-level structural features, and deep semantic features, respectively. The shallow feature map has the highest resolution and contains texture and edge information; the mid-level feature map has a medium resolution and contains structural information; and the deep feature map has the lowest resolution and contains semantic information.
[0084] The bidirectional multi-scale feature fusion module includes a top-down upsampling path and a bottom-up downsampling path. After spatial size alignment, channel concatenation followed by convolution can be used for fusion; if element-wise addition is used, the number of channels must be aligned first; this embodiment uses the concatenation and fusion configuration corresponding to YOLO26s.
[0085] The resulting fused feature map is obtained after processing.
[0086] Step 3.3: Decouple the detection head and output the initial disease detection results.
[0087] The decoupled detection head outputs the defect category score and boundary location. For networks with independent target existence probability branches, the initial confidence level can be obtained by multiplying the category conditional probability by the target existence probability; when using the YOLO26s standard detection head, its category score is used, without assuming a separate target existence probability branch. The standard detection model outputs bounding boxes; key points or segmentation contours must be provided by the corresponding trained branches or independent region extraction modules; defect categories include cracks, spalling, honeycomb surfaces, holes, exposed rebar, and suspected apparent water seepage marks.
[0088] When using another head configuration employing discrete boundary distribution regression, the distributed focal loss (DFL) can be used to predict discrete probability distributions and decode them into continuous distances; for a continuous labeled location y and its adjacent discrete locations... , The loss of a single boundary regression term is given by the following formula; the aggregation on the sample and the four edges is summed or averaged separately; the standard direct regression configuration of YOLO26s does not use this discrete distribution branch, therefore this DFL supervision is not used.
[0089]
[0090] in, This represents the loss value at the distribution focus. ≤y≤ , and , which are the predicted probabilities at adjacent discrete locations, and the two interpolation weights are normalized by the interval between adjacent discrete locations; when the interval is 1, the denominator can be omitted; the probability is truncated by a lower limit to avoid log(0); ζ represents the index of the adjacent interval containing y, and a single label y is not calculated repeatedly for all ζ.
[0091] Each test result includes an input source marker, slice number, and coordinate index.
[0092] The processing result is all the initial test results.
[0093] Step 4: Multi-constraint joint training during model training.
[0094] This step is performed only during the training phase. The base mode calculates localization, classification, global-local consistency, and class balance losses using bounding box labels; the geometrically supervised mode also requires confirmed geometric labels and a differentiable geometric prediction branch connected to the shared feature layer. Geometric losses are only calculated on validly labeled samples; geometric constraints participate in joint updates only if the mode is actually enabled, the geometric loss weights are greater than zero, and valid fragment pairs are sampled during training. Samples or batches without geometric labels can still participate in base training. The DFL term is not enabled in the YOLO26s standard direct regression configuration. Deployment loads frozen weights and skips parameter updates.
[0095] Step 4.1: Stratified sampling of training samples and configuration of difficult negative samples.
[0096] Training samples are stratified and sampled according to the frequency of disease categories and target scale ranges; the sampling probability is increased for low-frequency disease categories and small-scale targets; the difficult negative sample set includes samples of shadows, seams, template marks, rust spots, efflorescence, stains, normal wetness after rain, and repaired areas.
[0097] Class probability P of stratified sampling sample,χ equal to the weight of class χ Divide by the sum of the weights of all categories; increase the chance of low-frequency diseases appearing in the training batch according to this prior, and configure the scale stratification and negative sample ratio separately.
[0098] Images containing multiple types of diseases are extracted a priori by category, and then sampled from available images of that category, retaining all labels. Small-scale targets are oversampled using scale stratification or slicing, as the category weights themselves cannot guarantee an increase in small targets. Difficult negative samples are added at a predetermined ratio, and the sampling weights and upper limits are determined through validation to prevent a small number of noisy samples from being repeatedly amplified.
[0099] Category Balance Weights The calculation formula is:
[0100] in, This represents the number of valid samples for disease category χ, where χ is the category subscript and weight. Maintain consistency; The smoothing coefficient represents the number of valid samples. Satisfy 0≤ <1, can be 0.9 or 0.99; the weight is larger when the sample size is small, and decreases and tends to the lower limit as the sample size increases; When the weight is close to 1, it is approximately inversely proportional to the number of samples. =1 will result in 0 / 0 in the original expression, so it cannot be directly substituted.
[0101] Step 4.2: Constructing homologous paired samples and generating global and local prediction matching sets.
[0102] For the same training image, pairs of global and local samples are generated, and both types of predictions are mapped to the high-resolution calibrated image coordinate system. A correspondence is first established based on the same labeled instance number, and then matching is performed within the candidate predictions of that instance based on category and spatial overlap; the matching index does not participate in the differentiation, and the gradient of the selected prediction tensor is preserved.
[0103] When calculating location consistency, the global prediction and corresponding annotation are cropped into the effective window of the local slice and then compared with the mapped local prediction. Samples with too small a visible ratio or severe truncation are skipped to avoid incorrectly dragging the locally visible fragments into the complete lesion box. A fixed one-to-one rule is used in the matching. The same instance can be paired with different slices, but no repeated matching is allowed within the same input. The cross-intersection over union (CUI) threshold is 0.3 to 0.7, preferably 0.5, as a configuration example.
[0104] Step 4.3: Calculation of global and local consistency loss and component adaptive crack geometric continuity loss.
[0105] The formula for calculating the global local consistency loss is:
[0106] Where M is the matching set, The number of matching pairs; the loss is set to zero when the set is empty; g represents the global prediction in the matching pair; l represents the local prediction in the matching pair. This represents the class probability distribution for global prediction. This represents the local predicted class probability distribution after mapping; Let KL divergence be the KL divergence. Represents the boundary location vector of the global prediction; This represents the boundary position vector predicted locally after mapping; η represents the intersection-union ratio of the two sets of bounding boxes; η is a non-negative position weight, ranging from 0.4 to 0.8, with a preferred value of 0.6. The basis for this value is that the position consistency term weight should be a moderate value, which ensures that the position consistency constraint is effective without excessively penalizing position deviation.
[0107] When using the Softmax class distribution, the symmetric KL can be calculated directly; when using the YOLO-style class-wise Sigmoid scores, the symmetric KL of the class-wise Bernoulli distribution is used, or it is explicitly converted to a normalized distribution before calculation, and the unnormalized scores are not treated as probability distributions; all probabilities are truncated numerically before calculating the logarithm.
[0108] The component type driving parameters are defined as follows: the component code is denoted as k; the direction threshold is determined based on the component type and the component's local reference direction. and endpoint distance threshold This set of thresholds is used simultaneously for calculating the crack geometric continuity loss during the training phase and for determining cross-slice crack connections during the inference phase.
[0109] The orientation threshold for dam surface components can be selected from 10 to 20 degrees, and the endpoint distance threshold can be selected from 20 to 40 pixels as candidate ranges, such as 15 degrees and 30 pixels; these values are configuration examples at a specific imaging scale and do not represent that all dam surface cracks are in the horizontal or vertical direction; the thresholds should be verified based on the manually labeled connection relationship of the corresponding components, the shooting scale, and the cost of mismerging.
[0110] The orientation threshold for tunnel lining components can be selected from 5 to 15 degrees, and the endpoint distance threshold can be selected from 15 to 30 pixels as candidate ranges, such as 10 degrees and 20 pixels; the circumferential and longitudinal directions are only reference directions for components and cannot exclude oblique and branch cracks; when the curved surface or perspective changes significantly, the local reference direction at the connection of each segment should be used; this configuration is explained separately from the simulation parameters of Example 3, and their statistical conclusions are not mixed.
[0111] For a pair of crack segments u and v, the segment directions are transformed to the local reference coordinate system of the component, and the dimensionless directional difference is calculated. Dimensionless endpoint distance and dimensionless width difference .
[0112] Directional differences The calculation formula is:
[0113]
[0114] in, and The local tangential angle at the junction of the segments is given, and the coordinates are transformed to the same component reference coordinate system; the crack is treated as an undirected line, and its direction difference is... use The range is from 0 to π / 2, and a 180-degree reversal of direction is still considered equivalent; the cosine value is truncated to [value missing] during calculation. 1 to 1; This represents the direction threshold corresponding to component type k; the direction angle and the direction threshold use the same angle unit, and are converted to radians before entering the trigonometric functions.
[0115] Endpoint distance The calculation formula is:
[0116] in, The minimum Euclidean distance between the endpoints that can be connected to two segments must be the same corrected image coordinate system and use the same unit as the endpoint coordinates and the endpoint distance threshold. If the threshold is configured based on physical distance, it should be converted to the corresponding pixel threshold based on the local pixel spatial resolution. When there are spatial scale changes on the surface, local scale or surface coordinates should be used.
[0117] The formula for calculating the width difference is:
[0118] in, and These represent the local widths at the joint ends of crack segments; This represents the smallest positive number that prevents the denominator from being zero, and takes the value 10. 6 .
[0119] , and Calculate the geometric continuity loss of the input crack.
[0120] Crack geometric continuity loss during training phase The calculation formula is:
[0121] in, For the same manually annotated crack instance, this is the set of fragment pairs that have valid direction, connection endpoints, and local width, and corresponding connection positions; the denominator is the number of fragment pairs in this set, and the set is empty. Predicted quantity , , The reference values use the same coordinates, scale, and normalization as the corresponding labeled reference values; the labeled reference values do not need to be differentiated with respect to the network parameters. For Huber loss, the transition parameter can be set to 1; , , For non-negative weights, each equally weighted example takes 1 / 3. The bounding box labels alone are insufficient to provide the detailed geometric truth values mentioned above; therefore, the long side, endpoints, or width of the bounding box are not used to replace the local geometric annotations of the crack.
[0122] One implementation of the geometric supervision model involves adding a crack geometry prediction branch to the shared backbone and multi-scale fusion features, outputting continuous coordinates, two-dimensional direction vectors, and width parameters for the corresponding connection ends. The direction vectors are normalized with numerical protection, and the width parameters are transformed using the Softplus function and given a positive lower bound to obtain a positive local width. The geometric loss is calculated from these continuous tensors, preserving their automatic differentiation relationship, without converting the prediction results into binary images, skeletons, or arrays detached from the computational graph before calculating the loss. Backpropagation updates the geometric branch and the shared feature layer; the detection head is updated by the detection loss, thus enabling geometric supervision to participate in the joint optimization of the detection network.
[0123] Supervision labels can be manually annotated directly or obtained by offline extraction and verification of fine crack region labels verified manually. Offline label generation may include non-differentiable skeletonization and distance transformations, as labels, as fixed supervision targets, do not require gradients; the prediction side must maintain a differentiable path to the shared network parameters. Slicing and geometric augmentation simultaneously transform endpoint, orientation, and width labels, and record instance numbers, corresponding connection positions, and validity. The matching indexes of fragment pairs and connection ends are determined by supervision information and differentiation stops, but the selected prediction tensor maintains its gradient; training does not rely on prediction hard thresholding to determine the presence of supervision.
[0124] In training computation, the inverse trigonometric function input for the directional difference is restricted to a numerically safe range to prevent derivative divergence at endpoints; the absolute value of the cosine is used for undirected directions to ensure equivalence for 180 degrees in the opposite direction. The distance norm is smoothly implemented with a minimal positive number at zero distance; the absolute value and maximum value at inflection points are calculated using the subgradient defined by the automatic differentiation framework, and the labeled reference values are calculated according to the same numerical rules. This item is set to zero when geometric labels are missing, invalid, or the fragment pair set is empty; if the entire training set has no valid geometric labels, then... This configuration only performs basic training and is not considered as having completed geometric constraint joint training. (Inference phase) It can be extracted and post-processed from an independent region, and its non-differentiability does not affect the above training path.
[0125] Step 4.4: Calculate total loss and backpropagate to update the network.
[0126] The formula for calculating the total loss L is:
[0127] in, Indicates positioning loss; Indicates classification loss; This represents the loss of global and local consistency. This represents the loss of geometric continuity due to cracks; This is a supplementary category for categorical weighting; This represents the distribution focus loss, and is only applicable to the discrete boundary distribution regression branch; when using the YOLO26s standard direct regression detector head, it will... Set the loss to zero and use the localization regression loss for the corresponding model version; to The weights are non-negative, and their configuration should be determined by the validation data. =1.0, =1.0, =0.8, =0.4, =0.4, =0.5 is only an example when using the DFL branch and does not represent the original training parameters of YOLO26s; when the classification loss is superimposed with the class balance term, the total weight needs to be controlled, or a uniform weighted classification loss should be used to avoid redundant amplification.
[0128] Backpropagation is performed based on the total loss to update trainable parameters that are computationally connected to the corresponding losses. Valid geometric losses are passed to the shared feature layer via the geometric prediction branch; samples with only bounding box annotations are updated through the basic detection and consistency losses. Training records save the geometric supervision mode, the number of valid fragment pairs, geometric loss weights, and branch configurations, and check on valid samples that the gradient of this loss with respect to the shared feature layer is computable and numerically finite; after training, the model weights and associated configurations are saved for use in step 3 of the inference phase.
[0129] Step 5: Reverse mapping of original image coordinates and weighted fusion of local slice detection results across slices.
[0130] Using coordinate indexing, the slice detection boxes, key points, and segmentation contours are inversely transformed and mapped back to the coordinate system of the original inspection image; invalid detections in filled areas are removed; candidate clusters are established according to disease categories. Weighted bounding box fusion is performed on planar diseases. Connecting edges are constructed for crack segments, edge quality is calculated, and the summation yields the crack instance-level geometric continuity quality score G. i Simultaneously, geometric scores can be generated using the marker m. i Record the source slice number.
[0131] Step 5.1: Inverse transformation of detection results and removal of invalid detections.
[0132] Both the global image and local slice predictions are mapped to the high-resolution calibrated image coordinate system according to their respective indices. The filling region is first determined in the network input coordinates. Results with no valid image content are discarded, and partially out-of-bounds detection boxes and contours are cropped to the valid window with truncation markers recorded. The original image coordinates after inverse mapping cannot be directly compared with the network input filling amount.
[0133] The output is all the detection results after the mapping is completed.
[0134] Step 5.2: Disease grouping and candidate cluster establishment.
[0135] According to the disease type, the mapped local detection results and global image detection results are grouped; for planar diseases, candidate clusters are established based on spatial overlap and global context support; for crack diseases, candidate adjacent edges are established between different crack segments based on the principal direction angle, endpoint distance, and pixel spatial resolution, where the principal direction angle is determined using... endpoint distance used Width difference used .
[0136] Candidate clusters for areal lesions are established based on the spatial overlap of similar predictions, with an intersection-union ratio threshold of 0.3 to 0.7, 0.5 in example. Global prediction provides contextual support and fusion weights, but is not a necessary condition for retaining local lesions. Only small lesions supported by local detection are retained as candidates and handed over for subsequent calibration and verification to avoid failure of local high-resolution detection when the whole map is not detected.
[0137] Crack fragments are first deduplicated within the overlapping window based on instance and spatial support; for different connectable fragments across slices, the directional difference is required to not exceed [a certain value]. The distance between the endpoints does not exceed equivalent ≤1 and ≤1; the width difference can be set with an additional threshold. For example, 0.6 can be used as a candidate value for verification; different crack instances, parallel adjacent cracks and component joints should not be merged simply based on the proximity of their endpoints.
[0138] Step 5.3: Weighted frame fusion of planar diseases.
[0139] For the candidate cluster Ω of the herbaceous disease, the fusion boundary location The calculation formula is:
[0140] in, Ω represents the fusion boundary location vector; j represents the candidate cluster of the same type; j represents the index of the detection result in the candidate cluster. The mapped boundary position; This is the initial confidence level; This represents the location and contextual weight of the j-th detection result; the local location weight can be calculated by dividing the distance from the detection center to the nearest slice boundary by half the short side of the effective slice, then truncating to 0 to 1; the contextual support can be determined based on the maximum IoU between global and local predictions of the same type, and a base support weight greater than zero is set to retain candidates that are only detected locally. The product of the two constitutes... Global prediction does not apply to slice edge weights, but can be configured according to verified global source weights; specific functions and parameters are saved with the deployment version.
[0141] When the denominator of the fusion position is greater than zero, a weighted formula is used; when the denominator is zero, the candidate position with the highest initial confidence is retained, and the confidence of the candidate position is used as the fusion confidence, so as to avoid the position being retained but the confidence becoming zero.
[0142] When the denominator is greater than zero, the uncalibrated fusion response of the candidate clusters It can be calculated using the following formula; this response does not yet represent the calibrated probability of the presence of the disease:
[0143] Different slice predictions are correlated, and product aggregation may increase with the number of duplicate candidates. Therefore, duplicate detections of the same physical segment from the same source and in overlapping regions are first deduplicated, and then a calibration function is fitted on an independent calibration set according to a fixed fusion rule. For cracks, a merged instance is first established according to step 5.4, and then the following formula is applied to the deduplicated source detection set of the instance; this set may contain global and local sources, but global sources are not included in the number of local slices in the geometric score.
[0144]
[0145] in, For the first The source detection set after deduplication of each crack instance; and These represent the initial confidence score for source detection and the position and context weights defined in step 5.3, both ranging from 0 to 1. When the set contains only one candidate, its weighted response is used; when all weights are zero, the highest initial confidence score is used as the degradation value; no instances are generated for an empty set. Recorded in step 6 This indicates an uncalibrated fusion response; This indicates the geometric quality of an effective cross-piece connection; the two are not interchangeable.
[0146] Step 5.4: Crack fragment connection and instance merging.
[0147] For each crack candidate segment, the included angle of the principal direction, the distance to the nearest endpoint, and the width difference are calculated, and the direction threshold corresponding to k is encoded according to the component type. and endpoint distance threshold Determine whether a connection can be established.
[0148] For local crack segments u and v, first transform the principal directions to the local reference directions of the component, and then calculate the dimensionless directional differences. Dimensionless endpoint distance and dimensionless width difference .
[0149] The direction difference, endpoint distance, and width difference are dimensionless according to the direction threshold, distance threshold, and local width scale, respectively. The direction and distance thresholds configured according to the components are used simultaneously for training loss and inference connection rules; the connection angle should preferentially use the local tangent of the endpoint neighborhood to avoid the entire main direction from obscuring bends or branches.
[0150] Step 5.5: Calculation of the geometric continuity quality score for crack instances.
[0151] For the set of valid connected edges E i uv of the connecting edge in the calculation of edge quality :
[0152] in, This represents the quality score of the UV of the connected edge, with a value range of 0 to 1; , , Non-negative weights, constraints + + =1, preferred value =0.35, =0.35, =0.3, the value is based on the fact that the contribution of directional difference and endpoint distance to crack connection quality is roughly equal, while the contribution of width difference is slightly lower. and Take 0.35, Take 0.3; the smaller the direction difference, endpoint distance, and width difference, the better the edge quality. The closer to 1, the larger the three values are, and the lower the edge quality.
[0153] Crack instance geometric continuity quality score The calculation formula is:
[0154] in, Let be the geometric quality score for the i-th crack instance. This is the set of valid edges obtained after deduplication and connection determination; It can be defined as the minimum proportion of valid non-filled pixels in the neighborhood of two connected ends, with a value of 0 to 1, and zero for invalid edges. This is an adjustment factor for the number of source slices; only when... Non-empty, geometrically reliable and The score is calculated if the value is greater than 0, otherwise... .
[0155] Source slice quantity adjustment coefficient The calculation formula is:
[0156] in, The number of local slices that actually provide valid connection evidence after deduplication is used, and duplicate boxes or global predictions in the same slice are not counted as independent sources. This is a normalized reference parameter.
[0157] Labeling rules: A valid connection edge exists, the connection geometry is reliable, and the sum of the weights of the valid edges is greater than zero. =1; otherwise =0 and =0. Both planar defects and single-section cracks were treated using... The basic calibration branch with a value of 0 is not judged as non-disease simply because cross-slice geometric evidence cannot be obtained; the constituent fragments, connecting edges, source numbers, and indexes are saved for traceability.
[0158] The output is a fusion detection result of all defects; crack examples are attached. and parameter.
[0159] Step 6: Scene-adaptive confidence calibration and disease quantification.
[0160] This will integrate confidence level, scene vector, wetting interference probability, and quality score of geometric continuity of crack instances. and available tags The data are fed into the scene calibration function, which outputs the calibration confidence level. Based on pixel spatial resolution, crack geometric parameters and the proportion of planar defects are calculated. Combining the calibration confidence level, defect quantification parameters, inspection cycle changes, defect type, and component type, the risk level is calculated, generating a complete structured inspection record, such as... Figure 3 As shown.
[0161] Step 6.1: Calculate scene-adaptive confidence calibration.
[0162] The calibration function will fuse confidence levels. Scene vector z, probability of wetting interference, and and Common mapping to calibration confidence:
[0163] The geometric score can be marked to distinguish between "no usable evidence" and "evidence exists but geometric quality is low," and does not indicate the authenticity of the crack. Examples of single-slice cracks, cracks without valid connecting edges, or failed geometric measurements are marked as follows: In this process, the calibration formula degenerates into:
[0164] when At that time, both the geometric gain term and the geometrically gated wetting interaction term are set to zero; the lack of cross-slice evidence does not preclude the calculation of the geometric gain term and the geometrically gated wetting interaction term. This is interpreted as poor geometric quality, and an unconditional base wetting deduction is not used. The scene vector retains fields such as wetting state defined in step 1.3, and its coefficients are fitted on an independent calibration set. It is not assumed that the confidence level must be reduced simply because the scene is wet. The base scene calibration may still adjust the confidence level based on the learned scene associations, therefore it is not guaranteed that the confidence level of all single-piece real cracks will remain unchanged.
[0165] when At that time, instances with low geometric quality suffer a greater wet interaction penalty; The interactive item is zero at that time; At this time, the interaction item is also zero; after fixing the fused response, scene vector, and available markers, the rate of change of the Sigmoid function input with respect to the geometric score is... Under the above constraints, it is non-negative. The geometric gain is relative to... A baseline value is used; values below this baseline can be negative, but this is not necessarily interpreted as increasing the confidence level.
[0166] This formula cannot distinguish between pseudo-cracks at the slice edge and true cracks on a single slice based solely on geometric scores and available markers. The distinction between the two types of samples still relies on detection features and calibration results fitted with independent annotations. The calibration set should cover true cracks on a single slice, true cracks across slices, pseudo-cracks at the slice edge, and difficult negative samples in both dry and wet scenarios, and should be grouped according to the availability of geometric scores to check for missed detections and calibration errors. If the confidence level or quantification reliability is insufficient, output for review as per step 6.3; the lack of evidence across slices should not be used directly as a basis for excluding defects.
[0167] in, For the Sigmoid function; To integrate confidence levels; For scene vectors; This is a vector of calibration coefficients of the same dimension, with the superscript tr indicating transpose; For bias; The quality score for the geometric continuity of the crack instance; A flag is used to indicate the geometric score; 1 is used if the score is valid, and 0 is used otherwise. This represents the probability of moisture interference. This is the offset from the scoring baseline; This is the geometric score gain coefficient; The interaction penalty coefficient for wetting interference in geometric gating; This is a temperature parameter. The parameter satisfies... , , , , and Before calculation Truncate to [0.001, 0.999] and define The field order and encoding of the scene vector are consistent with step 1.3. Continuous fields are standardized according to frozen statistics, and missing fields are filled according to established rules and their validity is recorded. Parameters and missing handling rules are frozen with the model version.
[0168] On an independently annotated hydraulic engineering calibration dataset, candidate correct or incorrect labels are assigned using fixed categories and one-to-one instance matching rules. Calibration parameters are fitted using binary cross-entropy and necessary regularization terms to constrain the calibration process. , Non-negative and It is positive; The validation set is fixed after selection. The wetting correlation coefficient in the scene item is fitted from the data and is not pre-constrained to be negative; no additional unconditional wetting penalty is added. Calibration samples are divided into dry and wet scenes and... Grouping is used to cover real diseases and difficult negative samples; if a group lacks reliable calibration samples, the calibration evidence for that group is insufficient and it is transferred to manual review, and it is not extrapolated to be verified as reliable. After the detection weights, screening, slicing and fusion rules are determined, the calibration function is fitted, all parameters are deployed and frozen, and predictions that have not been manually reviewed shall not be used for updates.
[0169] Step 6.2: Geometric Quantitative Calculation of Diseases.
[0170] The actual length of the crack skeleton, the maximum crack width, and the proportion of the area of the surface disease are calculated as disease quantification parameters, which are used for risk classification in step 6.3, calculation of changes in adjacent inspection cycles, output of structured inspection records, and on-site review decision support.
[0171] The crack skeleton, endpoints, and width are obtained from trained segmentation branches or explicit region extraction modules: for example, crack region segmentation is performed within the detection box, and the centerline, branches, and Euclidean distance transformation are extracted after mapping and merging masks; the training geometric branches and inference region extraction use the same geometric definition; if only the output box is used, there is no direct measurement basis for fine length, width, and region area.
[0172] Actual length of the crack skeleton The calculation formula is:
[0173] Where r is the effective pixel spatial resolution on the corrected image, in units of actual length per pixel; The ordered number of points for a given unbranched skeleton path; , This represents the difference in coordinates between adjacent points.
[0174] When branches exist, a skeleton diagram is created, and the lengths of adjacent pixels are accumulated along each real branch. Each actual skeleton edge is counted only once. The ends of different branches must not be directly connected sequentially. The missing intervals filled by cross-slice connections are only recorded as estimated gaps and are not included in the observed lengths by default.
[0175] Maximum crack width The calculation formula is:
[0176] in, Take the maximum value of the Euclidean distance transformation at the effective points of the crack skeleton, with the distance unit being pixels; For width estimation based on local half-width, it is necessary to remove bifurcation, clumping noise and invalid boundary points, and the binary mask, distance transformation and r should be located on the same coordinate scale; when engineering width accuracy is required, the two side boundaries can be found and verified along the local skeleton normal; the crack width cannot be replaced by the detection box width alone.
[0177] The percentage of area affected by surface defects is obtained by dividing the area of the defective region by the area of the effective visible region of the same component and then multiplying by 100%. The defective region and the component region are obtained by segmentation or region extraction, and the area of the detection box is not used to replace the actual defective area. When the plane is calibrated and the scale is uniform, the pixel area ratio can be used. When the curved surface or perspective scale changes significantly, it is calculated by weighting the local area scale. The output is only for the currently visible area and is not extrapolated to the entire unobserved component.
[0178] When the scale is missing, unreliable, or exceeds the error limit, the pixel length, pixel width, and pixel area are retained and the physical quantization is marked as invalid, and the threshold in millimeters is not applied; when segmentation or skeleton extraction fails, the corresponding geometric quantities are marked as unusable, and the width or area is not arbitrarily generated by the detection box; the visible area ratio is only output when the region mask is reliable.
[0179] Step 6.3: Risk classification and structured record output.
[0180] Risk classification is based on calibration confidence, quantification validity, current disease geometry, periodic variation of the same disease instance, disease type, and component type, using table lookup or decision tree mapping. Periodic variation must first be cross-period registration and one-to-one instance correspondence by component number and disease location, unifying visible area, coordinate scale, and unit, and then subtracting historical value from current value. If there is no historical record, the viewpoint is not comparable, or quantification is invalid, the variation is marked as missing and not treated as zero growth.
[0181] The risk level determination criteria are as follows: when When the confidence level is below the confidence threshold or the required quantification parameter is invalid, the output status is "Pending review / Risk undetermined", and candidates with potentially higher risks are retained for manual inspection. Low identification confidence is not automatically interpreted as low engineering risk. The confidence threshold of 0.4 to 0.6, preferably 0.5, is only a candidate configuration. The actual value is determined by the false alarm, missed alarm and review capacity.
[0182] when When the confidence threshold is reached and the required quantification parameters are valid, the configured grading table is selected according to the type of defect and component type; cracks are judged based on length and maximum width, and the higher grade is selected; spalling, honeycomb surfaces, and holes are judged based on area ratio and observable morphological conditions; exposed rebar is judged based on the visible range and component importance, and suspected apparent water seepage marks are judged based on the mark range and joint monitoring information using specific rules; if corresponding rules or necessary information are missing, the output is "pending review," and low risk is not defaulted to; foundation grade. ∈{0,1,2} represents only the screening level of this system.
[0183] Number of promotions : Add 1 when the reliable intertemporal growth of the same defect instance exceeds the corresponding threshold for the defect and component; add another 1 when it hits a pre-configured and frozen key defect or important component condition; key conditions should be defined item by item in the rule table, and "the component belongs to the dam face or tunnel lining" should not be used as the universal truth upgrade condition for all candidates; a crack growth of 20 mm or 0.1 mm is only an example threshold and must be verified in combination with scale, detectable width and engineering requirements; missing growth amount does not trigger growth upgrade, but a verification mark is retained. The final risk level R is:
[0184] Among them, R=0, 1, 2 correspond to low risk, medium risk, and high risk respectively; no upgrade is made when R=2.
[0185] When the calibration confidence level is lower than the preset confidence threshold or the quantification validity is marked as invalid, the numerical risk level is not directly output. Instead, a "pending review" status is output, which is not included in the calculation. Numerical operations.
[0186] The confidence threshold, quantitative grading intervals for various defects, inter-period growth thresholds, and key upgrade conditions are configured, verified, and frozen by the project management unit based on available historical data and project requirements. The grading table must record at least the defect category, component category, parameter name, unit, two level boundaries, growth threshold, missing information handling, and rule version. Deployments that are not fully configured will not output a definitive grade.
[0187] Risk levels are only used for inspection, screening, review, and ranking, and are not equivalent to structural safety assessment results.
[0188] Generate structured inspection records, with fields including original drawing number, facility number, component number, defect category, original drawing location, calibration confidence level, quantification parameters, quantification validity marker, risk level, and review status marker.
[0189] Additional business limitations: For suspected apparent seepage marks, the identification result only represents the detection of wet spot water features in the image; this result cannot determine the seepage source, flow rate, phreatic line, or dam safety status on its own, and needs to be combined with external monitoring data such as water level, piezometer, and seepage flow rate for comprehensive judgment.
[0190] Example 2 provides a specific implementation method for training and inference recognition: during the training phase, samples are constructed and the network is updated according to steps 1, 2, 3, and 4; during the inference phase, frozen weights are loaded and steps 1, 2, 3, 5, and 6 are executed; after training, calibration fitting is performed separately using independent calibration data.
[0191] I. Training data preparation.
[0192] Training data consists of images of concrete surface defects from hydraulic engineering or similar engineering scenarios, categorized as cracks, spalling, honeycomb surfaces, voids, exposed rebar, and suspected surface seepage marks, with a unified category mapping established. Detection training uses bounding box labels. The geometrically supervised mode requires at least one finely labeled subset with valid crack fragment pairs, recording crack instance numbers, corresponding connection endpoints, local orientation, and local width, or exporting and verifying the above information offline from manually confirmed fine-label regions. The finely labeled subset can be mixed with samples containing only bounding box labels for training; the geometric loss only considers valid fragment pairs from the former. Without this subset, only basic training can be performed, and it cannot be claimed that the geometric loss has updated the detection network. Regions that are difficult to identify are not directly used as positive samples; data deduplication combines perceptual hashing and acquisition sequence information.
[0193] The project's initial image inventory may include 8898 training images and 1112 validation images; these numbers do not automatically equal the number of valid samples that have completed annotation review. When used for training this scheme, image label pairings, missing labels, isolated labels, and background samples should be verified, and the actual quantities should be reported in the reviewed inventory. Training, validation, calibration, and final test data should be isolated as much as possible by project location, component, or acquisition sequence; global samples and all slices generated from the same original image must belong to the same set.
[0194] For each high-resolution training image, a global sample and several local samples are generated simultaneously; overlapping areas are set in the standard local slices; the sampling probability is increased for areas containing small-scale cracks, holes, or rebar ends; local labels are obtained by intersecting the original image annotation with the slice window, and truncation marks and visibility ratios are recorded.
[0195] II. Model Training.
[0196] The basic detector can use a YOLO26s single-stage anchor-free model, with a 960×960 pixel input and loaded with general detection pre-training weights. The standard model outputs class scores and direct regression boundary positions, and its preprocessing, backbone, splicing feature fusion, and loss are consistent with the corresponding version configuration. Global-local consistency training, differential crack geometry supervision, and calibration are parts that need to be implemented separately in this solution; it cannot be assumed that all constraints have been enabled simply by calling the native YOLO training.
[0197] During training, pairs of global and local samples are generated from the same original image; a matching relationship is established for predictions that have spatial overlap and the same labeled category after mapping, so that the network maintains stable representation under different scaling scales.
[0198] The total training loss is configured as per step 4.4. The YOLO26s standard direct regression branch resets the DFL (Digital Fluid Loss) weights to zero; this term is only enabled in the other configuration with the DFL branch. Initially, localization and classification are stabilized before increasing the consistency loss weights. In geometric supervision mode, both finely labeled subsets and geometric prediction branches on shared features are loaded simultaneously, setting positive geometric loss weights and ensuring valid fragment pairs are sampled during training, while checking gradient propagation to the shared feature layer. Data with only bounding boxes uses the basic mode, resetting the geometric loss weights to zero; the results are not used as validation results for geometric joint training.
[0199] III. Calibration set fitting.
[0200] After the main model is trained, the detection network parameters are frozen, and a scene calibration function is fitted using an independent calibration set with the same equipment and facilities as the deployment site. The calibration set includes both real defects and challenging negative samples such as shadows, seams, stains, post-rain wetting, efflorescence, and repair materials. The calibration function integrates confidence scores, scene vectors, wetting interference probabilities, geometric continuity quality scores, and available geometric score labels, mapping them together to a calibration confidence score.
[0201] The calibration label for a test instance should correspond to the event of "correct category and location reaching a fixed matching threshold," and should not be labeled as correct simply because the candidate area contains defects. Multiple candidates for the same labeled instance should be handled according to a fixed deduplication and one-to-one rule. Different label meanings are used for connection pair calibration and instance test calibration, and they are fitted and evaluated separately.
[0202] After all coefficients have been fitted on the independently labeled hydraulic calibration dataset, they are frozen, and online parameter updates using prediction results that have not been manually verified are prohibited.
[0203] IV. On-site identification.
[0204] Taking UAV inspection images of concrete dam surfaces, spillway floor slabs, or tunnel linings as examples, the system reads the original image and its metadata to detect blurred, overexposed, and occluded areas. For images with quality below a threshold, resampling suggestions are first output; for available images, a global image is generated, and candidate region priorities are calculated.
[0205] Overlapping slices of different sizes are generated based on priority, and batch inference is performed on the global image and each slice. Local predictions are mapped back to the original image through coordinate indexing; for cross-slice cracks, candidate segments are connected using direction and endpoints; for spalling, honeycomb surfaces, holes, exposed rebar, and suspected apparent water seepage marks, instances are formed by spatial overlap and weighted bounding box fusion.
[0206] Subsequently, the confidence level is calibrated based on the type of facility and component, imaging clarity, lighting, shooting scale, and probability of moisture interference. When pixel spatial resolution is available, crack length, crack width, and area of planar damage are converted into actual units; when reliable scale is unavailable, the number of pixels is retained and the quantization status is marked. The identification results are overlaid on the original image and written into the inspection database, allowing reviewers to view the source slices and global predictions before fusion; for suspected apparent seepage traces, only on-site review or joint monitoring prompts are generated, without directly outputting the seepage source, flow rate, piping conclusion, or dam safety level.
[0207] V. Verification Plan.
[0208] To verify the independent role of component type prior and geometric quality feedback, and to maintain consistency in data partitioning, basic detection weights, input dimensions, candidate selection rules, and random seeds, the following controls were set: M0 was used for global and local detection, fusion, and basic scene calibration of the original document; M1 added component conditional orientation and distance thresholds to M0, and was also used for training constraints and cross-slice merging; M2 added geometric continuity quality score feedback calibration to M0; and M3 used both M1 and M2.
[0209] The training set is used for learning the parameters of the detection network and candidate networks; the independent calibration set is used to fit the calibration function; the validation set is used to select the geometric threshold, loss weights, calibration hyperparameters, and output threshold; after freezing all configurations, evaluation is performed on the final test set isolated by project or sequence. With fixed categories and one-to-one matching rules, it reports precision, recall, F1, mAP50, mAP50-95, cross-slice breakage rate, false merging rate, correct connection recall, ECE, Brier score, and end-to-end time including slices, fusion, and calibration.
[0210]
[0211]
[0212]
[0213]
[0214] Among them, TP, FP, and FN are the number of correctly detected, incorrectly detected, and missed instances under fixed categories and one-to-one matching rules, respectively; Let N be the candidate set for the b-th confidence interval, where N is the total number of candidates and M is the number of bins. and In respectively Internal calculation; during detection calibration, y=1 indicates that the category and position match is correct, and y=0 indicates that the candidate does not match correctly; during connection calibration, y indicates whether the connection relationship is correct or not, and the two are counted separately; the contribution of the empty separation box is zero, and the detection index with a denominator of zero is reported according to the predetermined rules without changing the candidate pool.
[0215] The cross-slice fracture rate uses the instances of artificial cracks that actually cross the slice boundary as the denominator; the false merging rate uses the actual established connection edges as the denominator, and also reports the correct connection recall rate; calibration metrics are compared on the same candidate pool, and candidates cannot be screened out with different thresholds before comparison; before obtaining actual test results, only M0 to M3 are used as verification schemes, and the expected results are not written as verified conclusions.
[0216] The final deployment package includes detection model weights, class mappings, input size, a unique preprocessing scheme and its parameters, dynamic slicing parameters, fusion threshold, geometric supervision mode and branch configuration, calibration parameters, and version information. The model file is bound to the above configuration, and consistency is verified during loading. Each update retains the training data version, a subset of valid geometric labels, and a configuration summary, enabling inspection results to be traced back to the corresponding training mode and model.
[0217] VI. On-site relocation and controlled online calibration.
[0218] When the model is migrated to new dam types, tunnel materials, imaging equipment, or seasonal conditions, a small number of samples are extracted layer by layer from the field images for manual review, focusing on easily confused joints, shadows, stains, rust spots, efflorescence, repaired areas, and normal post-rain moisture. A low learning rate is used to fine-tune the detection head and some feature layers, while retaining the playback of original training samples to reduce catastrophic forgetting. During field operation, only manually confirmed results are added to the incremental sample library. New detection weights and calibration parameters are released as a version after offline validation; the system records changes in grouping indicators and thresholds between the old and new models, and does not directly perform online self-learning based on unreviewed automatic predictions.
[0219] Example 3: This example is a simulation of the mechanism of candidate crack fragments on the layer, not an actual test of a complete image detection network.
[0220] Four schemes were set up on the same simulated candidate fragment pairs: S0 uses a uniform geometric threshold and does not add geometric feedback; S1 adds a component condition threshold; S2 adds geometric feedback under a fixed threshold; S3 adds both; random seeds are set from 20260924 to 20260928, generating 12,000 pairs of samples each time, which are divided into 6,000 pairs of fitted samples, 2,000 pairs of threshold selection samples and 4,000 pairs of independent test samples. Each scheme uses the same candidate samples.
[0221] In the simulation, the uniform direction and distance thresholds were 22.5 degrees and 9 pixels, respectively; the component condition thresholds were 30 degrees and 12 pixels for the dam surface, and 15 degrees and 6 pixels for the tunnel; the width difference threshold was 0.6; and the edge mass was set to... =exp( (0.4A² + 0.4D² + 0.2W²)), this For individual candidate pair quality, source slice adjustment coefficients from the full instance score are not included; simulations employ logistic regression with non-negative geometric coefficient constraints. Probability of moisture interference Component coding and interactive items The probability of a correctly fitted connection; its trainable logit coefficients and input definitions differ from the instance calibration formula in step 6; test statistics are as follows. Figures 4 to 6 As shown.
[0222] The simulation generation rules are as follows: component code k is uniformly taken as 0 or 1, connection truth value y is taken as 1 with a probability of 0.5, and the wetting variable h is uniformly sampled from 0 to 1; the true connection angle difference is an absolute zero mean Gaussian quantity, with standard deviations of 12 degrees for the dam surface and 5 degrees for the tunnel, and standard deviations of 4 pixels and 1.6 pixels for the true endpoint distance, respectively; the erroneous connection angle difference is uniformly sampled from 0 to 65 degrees, and the distance is uniformly sampled from 0 to 24 pixels. The first end width is uniformly sampled from 2 to 6 pixels, the true connection relative width difference is taken as an absolute Gaussian quantity with a standard deviation of 0.15 and truncated to 0.9, and the erroneous connection width difference is uniformly sampled from 0 to 0.85, thus generating the second end width. The visual response is taken as 1.25(2y). 1)+1.5h(1 2y)+ε, where ε is zero-mean Gaussian noise with a standard deviation of 1.05. The Sigmoid value for the response is given; the logistic regression regularization coefficient is 0.001, used for training the fitted subset; the output threshold is scanned in steps of 0.01 from 0.05 to 0.95 to verify the selection of the subset with the highest F1 score; the test ECE is calculated using 10 equal-width bins across all 4000 candidate pairs, and the standard deviation is the standard deviation of the samples after five repetitions.
[0223] The mean and standard deviation of five independent replicates are as follows: Figure 4 As shown, the mean F1 score for connection determination in S3 is 0.9579±0.0024, which is 2.48 percentage points higher than that in S0 (0.9331±0.0048). The recall rate of S1 increases from 0.9588 to 0.9903, but the precision decreases slightly, indicating that adjusting the threshold according to the component can recover some true bending connections, while introducing a small number of interfering connections. The precision of S2 increases to 0.9426, indicating that geometric quality feedback helps to suppress erroneous connections.
[0224] Regarding erroneous connections and probability errors, the erroneous connection rate of S3 decreased from 9.12% in S0 to 5.81%, and the missing connection rate decreased from 4.12% to 2.54%. The Brier ratio decreased from 0.2102 to 0.0411, indicating that the mean square error between the candidate connection probability and the actual label has been significantly reduced. The ECE of S3 is 0.0330, which is higher than that of S0 (0.0189), indicating that geometric feedback enhances the ability to distinguish between true and false candidates. However, the probability still has a bias, and it cannot be claimed that all calibration indicators have been improved based on this.
[0225] like Figure 5 As shown, after scanning the output confidence threshold on the first preset seed and retaining the geometric threshold of each scheme, S3 maintains a high precision in a high recall interval, and the overall curve is better than or close to other schemes. Figure 6 In the simulation reliability plot and sample distribution, all candidate pairs were not filtered according to the output threshold. Figure 6 The results show that S3 pushes more positive and negative samples to both ends of the probability spectrum, improving the discrimination ability and Brier index, but the middle confidence interval still deviates from the ideal calibration line.
[0226] The simulation above supports the feasibility of combining component condition thresholds and geometric feedback under the set candidate distribution; however, it does not train the image backbone, evaluate geometric training loss, or reproduce multi-slice instance aggregation and source quantity coefficients, and cannot directly prove the improvement in detection rate, length and width accuracy, instance ECE, or end-to-end speed of the complete method. Engineering applications require verification of the complete workflow using real images according to Example 2; geometric invalidation markers and verification branches should be enabled when geometric noise, coordinate errors, or skeleton failures occur.
[0227] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.
[0228] The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0229] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.
[0230] The computer-readable storage medium can be any usable medium that a computer can access, or a data storage device such as a server or data center that integrates one or more usable media. The usable medium can be a magnetic medium, an optical medium, or a semiconductor medium, etc.
[0231] It is understood that the devices and storage media provided in the embodiments of the present invention correspond to the methods provided in the embodiments of the present invention, and the explanations, examples and beneficial effects of the relevant content can be referred to the corresponding parts of the above methods.
[0232] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the above-described methods for collaborative identification and calibration of apparent defects in hydraulic concrete. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means.
[0233] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated.
[0234] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0235] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0236] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for collaborative identification and calibration of apparent defects in hydraulic concrete, characterized in that, include: The process involves acquiring images of hydraulic concrete structures to be identified and inspected, along with associated scene information. Distortion correction, scale normalization, and imaging quality evaluation are then performed on the images to be identified and inspected to obtain scene vectors and preprocessed inspection images. A global image is generated based on the preprocessed inspection image. The size, overlap rate and sampling position of the local slices are determined according to the texture complexity, edge density and candidate disease probability of the image region, and the local slice set and coordinate index are obtained. The global image and local slice set are input into a multi-scale apparent disease detection network with shared parameters to obtain initial detection results, including the disease category, location, and initial confidence level. During the training phase of the detection network, global-local consistency constraints are constructed based on the spatial correspondence of the same disease in the global image and local slices. Crack geometric continuity constraints are constructed based on the orientation threshold and endpoint distance threshold determined according to the component type. The apparent disease detection network is then jointly updated. Based on the coordinate index, the initial detection results of the global image and local slices are uniformly back-mapped to the geometrically corrected high-resolution inspection image coordinate system, cross-slice weighted fusion is performed to obtain the fused detection results, and the geometric continuity quality score and geometric score available label of the crack instance are calculated. Based on the scene vector, geometric continuity quality score, and available geometric score labels, the confidence of the fusion detection results is adaptively calibrated according to the scene vector, geometric continuity quality score, and available geometric score labels. Based on the calibrated confidence level, the disease quantification parameters are calculated, and the risk level or pending review status is output for inspection review and ranking.
2. The method for collaborative identification and calibration of apparent defects in hydraulic concrete according to claim 1, characterized in that, The process of obtaining the scene vector and the preprocessed inspection image includes: The process involves acquiring inspection images to be identified, associating image number, acquisition time, camera identification, facility type, component type, and acquisition location with these images, performing lens distortion correction, color space unification, and orientation correction on the images, preserving high-resolution corrected images, and normalizing the scale of the network input. The process also includes calculating sharpness, brightness, contrast, shadow ratio, stain ratio, and wetness interference probability, converting these six indicators into normalized quality components with higher values for better quality, and then weighting and summing them to obtain a comprehensive image quality index. The scene vector is formed by integrating facility type, component type, shooting distance, pixel spatial resolution, shooting angle, light intensity, image sharpness, surface wetness, shadow ratio, stain ratio, and repair area markings. When the overall image quality index is lower than the preset quality threshold, a resampling marker is output; when the pixel spatial resolution is missing, unreliable, or the calibration relative error is greater than the preset error threshold, a quantization invalid marker is output.
3. The method for collaborative identification and calibration of apparent defects in hydraulic concrete according to claim 1, characterized in that, The process of obtaining the local slice set and coordinate index includes: The pre-processed inspection image is scaled and filled proportionally along the preset long side to obtain the global image; The preprocessed inspection image or its low-magnification feature map is divided into multiple candidate regions. For each candidate region, the normalized gradient mean, edge pixel ratio, normalized local entropy and candidate disease probability are calculated. Texture complexity is obtained by weighted summation of normalized gradient mean, edge pixel proportion and normalized local entropy, and slice priority is obtained by weighted summation of texture complexity and candidate disease probability. The size and overlap rate of local slices are determined based on slice priority. The higher the slice priority, the smaller the slice size and the higher the overlap rate. Using the geometrically corrected high-resolution inspection image as the reference for local slicing, a network input coordinate system is established for each local slice, and the slice number, the starting coordinates of the slice in the corrected image coordinate system, the horizontal scaling ratio, the vertical scaling ratio, the left fill amount, and the top fill amount are recorded to form a coordinate index; at the same time, the scaling ratio and fill amount of the global image are saved.
4. The method for collaborative identification and calibration of apparent defects in hydraulic concrete according to claim 3, characterized in that, The process of determining the size and overlap rate of local slices based on slice priority includes: Based on the relationship between the slice priority and the preset first priority threshold and second priority threshold, the size and overlap rate of the local slice are adaptively selected, and the first priority threshold is greater than the second priority threshold. The coordinate indices satisfy the following inverse transformation relationship: , and The coordinates of the detection point in the high-resolution corrected image; and Input coordinates for the scaled and filled local network; and To capture the coordinates of the top left corner of the window for slicing; and For effective content scaling ratios, all are greater than zero; and The left and top padding amounts are the input to the network; the global image starts at zero and undergoes the same inverse transformation as its scaling factor and padding amount.
5. The method for collaborative identification and calibration of apparent defects in hydraulic concrete according to claim 1, characterized in that, The process of obtaining the initial detection result includes: The global image and local slice collections use the same color channel order, pixel normalization parameters, and input size; The multi-scale apparent disease detection network adopts a weight-sharing backbone network to extract features at least three different resolution levels, including shallow texture edge features, mid-level structural features, and deep semantic features; features at different resolution levels are aggregated through top-down and bottom-up paths. The decoupled detection head outputs the disease category score and boundary location; when using the independent target existence probability branch, the category conditional probability and the target existence probability are combined to form the initial confidence level; when using a detection head without an independent target existence probability branch, the category score defined by the detection head is directly used as the initial confidence level. Each test result includes an input source marker, slice number, and coordinate index.
6. The method for collaborative identification and calibration of apparent defects in hydraulic concrete according to claim 1, characterized in that, The process of constructing global-local consistency constraints includes: generating pairs of global and local samples from the same inspection image to be identified; mapping the local predictions to the coordinate system of the inspection image to be identified; establishing a matching set based on the same category and spatial overlap; calculating the category distribution consistency loss and the location mapping consistency loss based on the matching set to obtain the global-local consistency constraints. The process of constructing crack geometric continuity constraints includes: selecting samples with crack instance numbers, connection endpoints, local directions, and local widths labeled in the training set, or offline exporting crack instance numbers, connection endpoints, local directions, and local widths from manually confirmed fine-grained region labels; outputting continuous endpoint coordinates, direction vectors, and positive local widths from the geometric prediction branch that shares features with the detection network; determining direction thresholds and endpoint distance thresholds based on component type and component local reference direction; calculating the predicted dimensionless direction difference, endpoint distance, and width difference for corresponding segments of the same crack instance in adjacent slices, comparing them with the corresponding labeled reference values, and weighting them to obtain the crack geometric continuity loss; the gradient is transmitted to the shared feature layer via the geometric prediction branch; samples without valid geometric labels do not participate in this loss. The dimensionless directional difference is obtained by dividing the directional angle difference between segments by the directional threshold; the dimensionless endpoint distance is obtained by dividing the endpoint distance by the endpoint distance threshold; the dimensionless width difference is obtained by dividing the absolute difference of the local widths of the two connection ends by the maximum value among the widths of the two and the smallest positive number.
7. The method for collaborative identification and calibration of apparent defects in hydraulic concrete according to claim 1, characterized in that, The process of calculating the geometric continuity quality score of the crack instance and the labeling available for the geometric score includes: Based on the coordinate index, the detection boxes, key points or segmentation contours in the global image and local slices are inversely transformed to the geometrically corrected high-resolution inspection image coordinate system; results that fall completely into the filling area or do not correspond to the valid image content are removed, and some out-of-bounds results are cropped to the valid area; Candidate clusters are established by grouping according to disease type. Weighted bounding box fusion is performed on the candidate clusters of surface diseases based on initial confidence, slice center position weight and global context weight to obtain fused detection results. For candidate crack segments, adjacent segments are merged according to the direction threshold and the endpoint distance threshold, connecting edges are constructed and edge quality is calculated. The edge quality is summarized, weighted and normalized according to the weight of its effective connecting area, and then multiplied by the source slice number adjustment coefficient to obtain the geometric continuity quality score of the crack instance. When there are valid connecting edges, the geometric measurement is reliable, and the sum of the weights of the valid connecting regions is greater than zero, the geometric score is set to be valid; otherwise, the mark is set to invalid, and the geometric continuity quality score of the crack instance is set to zero.
8. The method for collaborative identification and calibration of apparent defects in hydraulic concrete according to claim 1, characterized in that, The adaptive calibration process includes: Calculate the calibrated confidence level using the following formula. : For the Sigmoid function; To integrate confidence levels; For scene vectors; This is a vector of calibration coefficients of the same dimension, with the superscript tr indicating transpose; For bias; The quality score for the geometric continuity of the crack instance; A flag is used to indicate the geometric score; 1 is used if the score is valid, and 0 is used otherwise. This represents the probability of moisture interference. This is the offset from the scoring baseline; This is the geometric score gain coefficient; The interaction penalty coefficient for wetting interference in geometric gating; The parameter is temperature; the parameter satisfies... , , , , and ; The risk level is determined as follows: the actual length of the crack skeleton, the maximum width of the crack, and the proportion of the area of the planar disease are calculated from the geometric region of the disease and the effective pixel spatial resolution, and used as the disease quantification parameters; the risk level used for inspection review and ranking is determined based on the calibration confidence, quantification validity, disease quantification parameters in the current inspection period, changes in adjacent inspection cycles of the same disease instance, disease type code, and component type code; when the confidence or quantification reliability is insufficient, the status to be reviewed is output, and a structured inspection record is generated.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the computer program is executed by the processor, it causes the processor to perform the steps of the method as described in any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method as described in any one of claims 1 to 8.
