A catenary defect detection method based on self-correction
By using a self-calibration module and multi-stage reflection component extraction, combined with defect interest maps and adaptive Gaussian smoothing, the accuracy and generalization problems of contact wire image detection under complex lighting conditions are solved, achieving efficient defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHENGDU NUOBIKAN TECH CO LTD
- Filing Date
- 2026-07-03
- Publication Date
- 2026-08-04
AI Technical Summary
Existing methods for detecting defects in overhead contact line images have low detection accuracy and poor cross-scene generalization ability under complex lighting changes. Retinex-type illumination-reflection decomposition methods struggle to balance the preservation of details in the defect area with the removal of low-frequency background areas.
A self-calibrated contact wire defect detection method is adopted. Multi-stage reflection component extraction is performed through a weight-sharing self-calibration module. Combined with defect interest map generation and spatial adaptive Gaussian smoothing scale assignment, multiple closed-loop calibrations are performed to improve detection accuracy and robustness.
Under different lighting conditions, the accuracy and robustness of the detection results are improved, which can meet the engineering requirements of online inspection of the overhead contact line and reduce memory usage and inference latency.
Smart Images

Figure CN122510261A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image detection technology, specifically relating to a self-correcting method for detecting defects in overhead contact lines. Background Technology
[0002] The overhead contact line is a crucial piece of equipment for transmitting electrical energy to electric locomotives on electrified railways. During high-speed operation, the pantograph continuously slides in contact with the contact wire. Over time, critical components such as the contact wire, catenary, droppers, insulators, and positioners are prone to defects such as strand breakage, wear, edge chipping, missing parts, and bird nesting. Failure to detect these defects in time can lead to pantograph-catenary arcing or even train delays. Therefore, relying on cameras mounted on the top of inspection vehicles to image the overhead contact line equipment area and automatically identify defects has become the industry standard.
[0003] Existing methods for detecting defects in overhead contact line images can be broadly categorized into two types. One type is based on manually designed features, including edge detection, grayscale histogram statistics, and Hough transform matching. These methods are sensitive to image lighting conditions, and their recognition rates fluctuate greatly depending on the time of day and weather. The other type is an end-to-end detection method based on convolutional neural networks, which directly feeds the original image into the detection network to output the defect category and location. However, the overhead contact line is located in an open-air environment, and trains rapidly switch between scenes such as tunnels and bridges. The lighting in the inspection images fluctuates drastically, with localized high-saturation caused by direct midday sunlight, as well as overall low contrast due to cloud cover or nighttime inspections. This causes the same intact component to exhibit drastically different grayscale distributions at different times. Directly feeding the image into the detection network can easily lead to misjudging strong light reflections as component wear and ignoring minute scratches in deep shadows, resulting in poor cross-scene generalization ability. Other methods incorporate Retinex-type illumination-reflection decomposition in the network pre-processing stage to remove the influence of illumination. However, these methods use a spatially uniform Gaussian smoothing scale when estimating illumination, which makes it difficult to balance small-scale texture areas that may be defects with large-scale uniform background areas. If the scale is too small, low-frequency interference in the background area will remain and be difficult to discriminate. If the scale is too large, the key textures in the defect area will be smoothed out. Summary of the Invention
[0004] Therefore, the main objective of this invention is to provide a self-correcting contact wire defect detection method to solve the technical problems of existing contact wire image defect detection methods having low detection accuracy and poor cross-scene generalization ability under complex illumination changes, as well as the difficulty of existing Retinex-type illumination-reflection decomposition methods in simultaneously preserving details in the defect area and removing low-frequency background areas by using spatially uniform Gaussian smoothing scales.
[0005] The technical solution adopted in this invention is as follows: A self-correcting method for detecting defects in overhead contact lines includes the following steps: S1. Acquisition and initialization: Acquire the overhead contact line inspection image as the initial input image and input it into the defect detection network, which includes a weight-sharing self-correction module, a shallow feature extraction part, and a deep feature extraction and detection head part. S2, Multi-stage weight-sharing self-correction: The initial reflection component is obtained by the weight-sharing self-correction module performing multiple cascaded stages of reflection component extraction on the initial input image; S3, Defect-Sensitive Closed-Loop Correction and Defect Detection: Multiple closed-loop corrections are performed on the initial reflection component to obtain the final reflection component. The result is then output after passing through the shallow feature extraction section and the deep feature extraction and detection head section. Each closed-loop correction is performed in the order of S3.1 to S3.5. S3.1 Defect Concern Map Generation: A defect concern map is generated from the input reflection components of the current loop closure correction by the shallow feature extraction part; S3.2, Focus Guidance Grouping: Divide all pixel positions into multiple attention guidance groups according to the values of the pixel positions in the defect attention map; S3.3, Spatial Adaptive Gaussian Smoothing Scale Assignment: Assign spatial adaptive Gaussian smoothing scale parameters to the pixel position according to the group number of the attention guidance group to which the pixel position belongs, and combine them into a spatial adaptive scale map; S3.4 Focus on guided multi-stage reflection component extraction: Using the spatial adaptive scale map as the scale input, the weight-shared self-calibration module performs reflection component extraction on the input reflection component of the current closed-loop calibration to obtain the output reflection component of the current closed-loop calibration; S3.5 Closed-loop iteration: The output reflection component of the current closed-loop correction is used as the input reflection component of the next closed-loop correction, and the output reflection component of the last closed-loop correction is used as the final reflection component.
[0006] Furthermore, the weight-sharing self-correction module consists of K cascaded stages, where K is the preset total number of cascaded stages. Each of the K cascaded stages performs a Gaussian weighted average operation and a division operation. The K cascaded stages share the same Gaussian weight generation rule, the same division operation rule, and the same preset small positive number used for stable division operations. Preset small positive numbers The Gaussian smoothing scale parameter is reused repeatedly in the K cascaded stages; the Gaussian smoothing scale parameter is used as the scale input when entering the weight-sharing self-calibration module, and is reused by the K cascaded stages during the same entry into the weight-sharing self-calibration module. The scale input assigned in S2 is the preset initial Gaussian smoothing scale parameter. The scale input assigned in S3.4 is a spatial adaptive scale map. .
[0007] Furthermore, the shallow feature extraction part consists of M convolutional blocks connected in sequence, where M is the preset total number of shallow convolutional blocks; each of the M convolutional blocks has a kernel size of... The convolutional layers, consisting of a stride of 1 and padding of 1, a batch normalization layer, and a ReLU activation function layer, are connected sequentially to ensure that the output feature map of each convolutional block has the same spatial size as the input feature map. The first convolutional block in the M convolutional blocks has the same number of input channels as the initial input image and the same number of output channels as the preset number of shallow feature channels C. The number of input channels and the number of output channels of each convolutional block from the second to the Mth convolutional blocks are both equal to C.
[0008] Furthermore, the deep feature extraction and detection head consists of several convolutional blocks following the shallow feature extraction part and a detection output layer connected in sequence. The detection output layer includes a defect classification branch and a defect localization branch. The defect classification branch outputs the defect category label and defect confidence score, and the defect localization branch outputs the location box of the defect in the image. The parameters of the shallow feature extraction part and the deep feature extraction and detection head part are all parameters that have been pre-trained with samples containing catenary defect annotations.
[0009] Furthermore, the illumination component estimation performed in each of the K concatenated stages in S2 includes: estimating the input image for the current concatenated stage. Each pixel position in by pixel position Centered on, with side length as A square region of 1 pixel is used as the pixel position. local neighborhood According to formula (1), from the local neighborhood Each pixel position Input image in the current concatenation stage The value in Calculate pixel position Illumination component estimates : ; in, The preset initial Gaussian smoothing scale parameters and Greater than 0, Indicates pixel position With pixel position The Euclidean distance between them This represents the floor operation; for local neighborhoods... The center position is a pixel position located outside the effective range of the image. The mirror fill method is used within the effective area of the image, relative to the image boundary and pixel position. The mirror-symmetric pixel position in the input image at the current concatenation stage. The value in is used as Substitute the input image into formula (1) for calculation; For multi-channel images, formula (1) is executed separately for each channel; the illumination component estimates of all pixel locations are combined according to pixel location to obtain the illumination component estimate map of the current concatenation stage. Illumination component estimation diagram Input image with the current concatenation stage The spatial dimensions are consistent with the number of channels.
[0010] Furthermore, the reflection component calculation performed in each of the K concatenation stages in S2 includes: for each pixel position According to the formula The input image of the current concatenation stage At pixel position The value of Illumination component estimation diagram with the current series stage At pixel position The value of The pixel position is calculated separately for each channel. The estimated value of the reflection component Preset small positive numbers The reflection components are multiplexed as a single scalar across all channels; the reflection component estimates for all pixel locations are combined according to pixel location to obtain the reflection components for the current concatenation stage. The inter-stage transfer of the K cascaded stages in S2 includes: when k is less than K, transferring the reflection component of the current cascaded stage. As the first Input image of each serial stage When k equals K, the reflected component output by the Kth series stage Perform a min-max normalization operation on each channel to normalize the reflection components. The value range of each channel falls within the interval The reflection component after normalization As the initial reflection component.
[0011] Furthermore, in the multiple closed-loop corrections, "multiple" refers to "T" corrections, where T is the preset total number of closed-loop corrections; the initial reflection component is denoted as... As the input reflection component of the first closed-loop correction in multiple closed-loop corrections, according to The sequence is from the first closed-loop correction to the Tth closed-loop correction, executing steps S3.1 to S3.5 sequentially in the tth closed-loop correction; when t is less than T, the output reflection component of the tth closed-loop correction is... As the first The input reflection component of the second closed-loop correction; when t equals T, the output reflection component of the Tth closed-loop correction. As the final reflection component; the defect concern map generated from the shallow feature map in S3.1 includes: the input reflection component of the t-th closed-loop correction. The shallow feature map is obtained by sequentially inputting M convolutional blocks from the shallow feature extraction part. ; for shallow feature maps Perform max pooling along the channel dimension to obtain the single-channel feature response map. Single-channel characteristic response map At pixel position The value of equal to shallow feature map At pixel position The maximum value among all C channel values; for single-channel characteristic response map By global maximum value and global minimum Perform min-max normalization according to the formula. The range of values obtained is Defect Concern Diagram Defect Concern Diagram At pixel position The value of The larger the value, the higher the pixel position. The higher the priority of a region that is considered a defect candidate for subsequent spatial adaptive Gaussian smoothing scale assignment, the better.
[0012] Furthermore, in S3.2, all pixel locations are divided into multiple attention-guided groups, including: the defect attention map. All pixel positions in the middle according to the value Sort the pixels from largest to smallest to obtain the pixel position sequence. For the value Equal pixel positions are ordered according to the image's preset scanning order, where P is the defect concern image. The total number of pixel positions; denoted as G for the total number of preset attention guidance groups, where G is an integer greater than or equal to 2 and less than or equal to P; the pixel position sequence is divided into G attention guidance groups sequentially according to the index interval: the first... Attention is drawn from the index of the pixel position sequence. to The pixel positions constitute the composition. , This indicates a floor operation; it rounds the pixel position down. The group number of the group to which the attention guide belongs is denoted as , The value of belongs to the set .
[0013] Furthermore, in S3.3, assigning spatially adaptive Gaussian smoothing scale parameters to pixel locations includes: for each pixel location According to formula (2), the pixel position Group number Calculate pixel position Spatial adaptive Gaussian smoothing scaling parameters : ; in, The preset minimum Gaussian smoothing scale parameter and Greater than 0, The preset maximum Gaussian smoothing scale parameter and Greater than From formula (2), the group number The larger the spatial adaptive Gaussian smoothing scale parameter, the better. The larger; combined with S3.2, press Defect Concern Diagram: Sorting and grouping from largest to smallest At pixel position The value of Larger, pixel position Corresponding spatial adaptive Gaussian smoothing scaling parameters The smaller the value, the better; the more it adapts to the spatially adaptive Gaussian smoothing scale parameter across all pixel locations. The spatial adaptive scale map of the t-th closed-loop correction is obtained by combining pixel positions. .
[0014] Furthermore, in S3.4, the weight-sharing self-calibration module uses a spatial adaptive scale map as the scale input to perform K cascaded stages of reflection component extraction on the input reflection component of the current closed-loop calibration to obtain the output reflection component of the current closed-loop calibration. This includes extracting the input reflection component of the t-th closed-loop calibration. The input image for the first concatenation stage in S3.4 In S3.4, each concatenated stage reuses the execution methods for illumination component estimation and reflection component calculation in each concatenated stage of S2, including mirror fill and separate execution rules per channel. The difference between S3.4 and S2 is that in S2, all K concatenated stages uniformly use preset initial Gaussian smoothing scale parameters. As the Gaussian smoothing scaling parameter for Gaussian weighted average calculation, the spatial adaptive scaling map is uniformly used in the K cascaded stages of S3.4. At pixel position The value of As pixel position The Gaussian smoothing scale parameter at the location, in S3.4 each concatenation stage is based on pixel position. Centered on, with side length as A square region of 1 pixel is used as the pixel position. local neighborhood The inter-stage transfer of the K cascaded stages in S3.4 includes: when k is less than K, transferring the reflection component of the current cascaded stage. As the first Input image of each serial stage When k equals K, the reflected component output by the Kth series stage Perform a min-max normalization operation on each channel to normalize the reflection components. The value range of each channel falls within the interval The reflection component after normalization The output reflection component of the current sub-closed-loop correction .
[0015] By adopting the above technical solutions, this invention achieves the following beneficial effects: In the pre-stage of defect discrimination decision-making, this invention introduces a weight-sharing self-correction process, decomposing the observed image into an illumination component reflecting incident illumination and a reflection component reflecting the intrinsic reflectivity of the object. Only the reflection component is fed into subsequent semantic discrimination, ensuring that the same target exhibits consistent texture representation in the reflection component domain under complex acquisition conditions such as different time periods, different weather conditions, and tunnel entry / exit, thus improving the generalization ability to adapt to changes in acquisition conditions. This invention employs a serial, multi-stage processing method that shares the same set of Gaussian weight generation rules and division calculation rules. The weight-sharing self-correction process does not introduce any learnable parameters, significantly reducing memory usage and inference latency compared to similar networks containing learnable parameters, and making training convergence behavior more controllable. Furthermore, addressing the problem that uniform Gaussian smoothing scales cannot simultaneously accommodate defect and background areas, this invention proposes a spatially adaptive Gaussian scale assignment strategy based on the defect interest map. This allows candidate defect locations to estimate local illumination using a compact neighborhood, preserving the texture details required for defect discrimination, while background locations are estimated using a wide neighborhood, removing low-frequency residues that interfere with deep discrimination. This invention employs a closed-loop iterative structure that moves from the reflection component to the map of interest, then to the scale map, and back to the reflection component. This allows the map of interest and the reflection component to mutually correct and refine each other step by step. The final output detection results are superior to existing methods in both accuracy and robustness, and can meet the engineering requirements of online inspection of overhead contact lines. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the one-dimensional cross-sectional principle of Retinex illumination-reflection decomposition provided in an embodiment of the present invention; Figure 2This is a schematic diagram of Gaussian weight decay profiles under different values of Gaussian smoothing scale parameters provided in an embodiment of the present invention. Figure 3 A two-dimensional schematic diagram illustrating the principle of spatial adaptive Gaussian scale distribution guided by defect concern, provided in an embodiment of the present invention. Figure 4 A one-dimensional cross-sectional superposition diagram illustrating the step-by-step refinement of K series-stage reflection components provided in an embodiment of the present invention; Figure 5 A schematic diagram illustrating the linear mapping relationship between grouping sequence number and spatial adaptive Gaussian smoothing scale parameter provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the convergence curve of the reflection component increment norm as a function of the number of iterations under closed-loop correction provided in an embodiment of the present invention. Detailed Implementation
[0017] A self-correcting method for detecting defects in overhead contact lines includes the following steps: S1. Acquisition and initialization: Acquire the overhead contact line inspection image as the initial input image and input it into the defect detection network, which includes a weight-sharing self-correction module, a shallow feature extraction part, and a deep feature extraction and detection head part. S2, Multi-stage weight-sharing self-correction: The initial reflection component is obtained by the weight-sharing self-correction module performing multiple cascaded stages of reflection component extraction on the initial input image; S3, Defect-Sensitive Closed-Loop Correction and Defect Detection: Multiple closed-loop corrections are performed on the initial reflection component to obtain the final reflection component. The result is then output after passing through the shallow feature extraction section and the deep feature extraction and detection head section. Each closed-loop correction is performed in the order of S3.1 to S3.5. S3.1 Defect Concern Map Generation: A defect concern map is generated from the input reflection components of the current loop closure correction by the shallow feature extraction part; S3.2, Focus Guidance Grouping: Divide all pixel positions into multiple attention guidance groups according to the values of the pixel positions in the defect attention map; S3.3, Spatial Adaptive Gaussian Smoothing Scale Assignment: Assign spatial adaptive Gaussian smoothing scale parameters to the pixel position according to the group number of the attention guidance group to which the pixel position belongs, and combine them into a spatial adaptive scale map; S3.4 Focus on guided multi-stage reflection component extraction: Using the spatial adaptive scale map as the scale input, the weight-shared self-calibration module performs reflection component extraction on the input reflection component of the current closed-loop calibration to obtain the output reflection component of the current closed-loop calibration; S3.5 Closed-loop iteration: The output reflection component of the current closed-loop correction is used as the input reflection component of the next closed-loop correction, and the output reflection component of the last closed-loop correction is used as the final reflection component.
[0018] The images of the overhead contact line inspection are captured by industrial cameras mounted on the top of the overhead contact line inspection vehicle during vehicle operation. In a typical deployment, one or two high-resolution industrial cameras image at a stable rate between 10 and 30 frames per second, with the optical axis generally pointing upwards and diagonally upwards. The imaging range covers key equipment areas above the pantograph slide, including the contact wire, catenary wire, droppers, positioners, insulator strings, cantilever base, and electrical connectors. A single frame image is typically a color image with a resolution of 1920×1080 or 2560×1440 pixels, with a color depth of 8 or 10 bits per channel. This embodiment does not strictly limit the camera resolution, frame rate, mounting position, or optical axis orientation; any acquisition scheme that can stably acquire visual images of the overhead contact line equipment area is applicable. In another embodiment, a line scan camera combined with a synchronous trigger can be used instead of an area scan camera to obtain higher vertical resolution; this embodiment is also applicable.
[0019] Each frame of raw data output from the camera is first divided by the maximum pixel value at that color depth for each channel (255 for 8-bit color depth, 1023 for 10-bit color depth), linearly mapping the value of each pixel position in each channel to the interval. Within this timeframe, the initial input image is obtained. . It is a three-dimensional tensor, where the first and second dimensions correspond to the pixel positions of the image in the vertical and horizontal directions, respectively. The shape of the tensor is denoted as... ,in and These represent the number of pixels in the height and width directions of the image, respectively, with the third dimension corresponding to the three color channels: red, green, and blue. In this embodiment, all subsequent calculations are based on the normalized values. The preprocessing, which normalizes the values to floating-point values, serves two purposes: firstly, it ensures the numerical stability of division operations during the illumination-reflection decomposition process; and secondly, it adapts to the commonly used magnitudes of weights in convolutional neural networks.
[0020] The overhead contact line is in a completely exposed environment, and its image acquisition conditions fluctuate drastically depending on the weather, time of day, train direction, and tunnel entry / exit scenarios. Tunnel exits often exhibit extremely high contrast; the area above the pantograph is sometimes directly exposed to strong midday sunlight, resulting in localized high-contrast saturation, while at other times it is obscured by clouds, resulting in uniform low-contrast. Nighttime inspections also require auxiliary light sources to provide directional illumination of the equipment area, and in rainy or snowy weather, the surfaces of insulators and conductors produce uneven localized reflections. These complex and variable lighting conditions mean that even the same intact component will exhibit drastically different grayscale distributions under different acquisition conditions. Directly feeding these raw images into a convolutional neural network for defect detection often leads to the most common failure patterns: misinterpreting specular reflections under strong light as signs of luminescence loss, and completely ignoring minute scratches in deep shadows. To alleviate this difficulty, this embodiment introduces an illumination-reflection decomposition process in the pre-stage of defect discrimination decision-making—decomposing the observed image into an illumination component that reflects the distribution of incident light and a reflection component that reflects the intrinsic reflectivity of the object. Only the reflection component is used as the input for subsequent discrimination decision-making—so that the same target under different lighting conditions exhibits a consistent texture in the reflection component domain.
[0021] The defect detection network consists of three sequentially connected segments. The initial processing segment performs illumination-reflectance decomposition on the initial input image; in this embodiment, this segment is implemented as a weight-sharing self-correction module, the internal details of which will be discussed below. Following this is a shallow feature extraction section, responsible for mapping from the reflection components to intermediate feature maps. The final segment is a deep feature extraction and detection head, composed of several deep convolutional blocks plus a detection output layer, outputting defect category labels and the defect's bounding box in the image. This three-segment structure aims to minimize the influence of illumination—a factor irrelevant to defect detection—before it is passed to the semantic layer, allowing the convolutional weights responsible for semantic detection to focus on learning texture and geometric features relevant to the defect itself, thereby improving the network's generalization ability to varying acquisition conditions. (Normalized...) As input to the defect detection network, the weights are shared by the self-correction module and flow sequentially through each segment, ultimately producing the defect detection result by the detection output layer.
[0022] From the initial input image Obtain the initial reflection component The process is based on the Retinex image decomposition theory. This theory states that any pixel location in a natural image... Observations on It can be decomposed into the illumination components at that pixel location. With reflection component The product of, i.e. .in Reflecting the scene incident on The light intensity at a given location typically exhibits a gradual variation in space—the incident intensity from the same light source changes slowly at neighboring pixel locations; while Reflects the surface of the object The intrinsic reflectivity at a given location is independent of lighting conditions and carries geometric and structural information such as the object's texture, edges, and material, which is precisely the signal of interest for defect detection. The goal of this embodiment is to... Estimate the corresponding , making While minimizing the effects of lighting, the texture details required for defect detection are preserved.
[0023] like Figure 1 As shown, the observed image value obtained by segmenting along a certain row of the image is obtained by multiplying the gradually varying illumination component and the peaked reflection component by the pixel position. The illumination component changes slowly with spatial position along the row, while the reflection component exhibits a sharp local peak at the defect location and is nearly flat in the background. This invention only uses the reflection component for subsequent semantic discrimination because the reflection component remains stable under different illumination conditions, while the texture and edge signals required for defect discrimination are precisely concentrated in the peak part of the reflection component. In the figure, solid lines represent the observed image, dashed lines represent the illumination component, and dotted lines represent the reflection component.
[0024] Directly by Solution and It is an ill-posed problem—given Under the circumstances, satisfy of The expression has infinitely many solutions in mathematics. To obtain a reasonable decomposition result, it is necessary to... Prior constraints are applied. The prior constraints used in this embodiment are: The illumination exhibits locally gradual variations in space after Gaussian weighting. The corresponding estimation method is to apply Gaussian weights that decay with distance to the local neighborhood of each pixel and then perform a weighted average. The result of the weighted average is used as the estimated value of the illumination component at that pixel location. This estimation method directly corresponds to the prior knowledge that "illumination is spatially gradual" and can be efficiently implemented by pre-generating convolutional kernels.
[0025] However, a single estimation-resolution process often smooths some reflection components into the illumination component, leaving low-frequency illumination traces in the resulting reflection component and limiting its ability to recover low-contrast details. The solution in this embodiment is to execute the estimation-resolution process in series multiple times: the reflection component obtained from the first estimation-resolution is input back into the estimation-resolution process, the remaining low-frequency components are re-estimated and divided again, and this process is repeated for a total of [number missing]. The reflection component output from the last series stage is normalized and used as the final reflection component. With each series stage, the remaining low-frequency illumination components are further stripped away, and the reflected components gradually approach the intrinsic reflectivity. Total number of series stages. It is a pre-defined positive integer, typically 2, 3, 4 or 5. When the value is too small, the effect of multiple refinements on lighting has not been fully realized; When the value is too large, the inference time per frame increases approximately linearly, but the resulting accuracy gain gradually levels off. This embodiment is recommended after engineering testing on the overhead contact line inspection dataset. .
[0026] like Figure 4 As shown, the same row of pixels is segmented, and the reflection components output from different serialization stages are stacked sequentially along the vertical axis. From bottom to top, they correspond to the unprocessed input image, the reflection component of the first serialization stage, the reflection component of the second serialization stage, and the reflection component of the third serialization stage, respectively. It can be seen that as the serialization stage number increases, the gradual change trend of each profile curve in the background position is successively suppressed and tends to be horizontal, while the three defect peaks remain at fixed pixel positions and show stable relative amplitudes. This verifies the characteristics of the residual low-frequency components being gradually stripped away and the peak signals required for defect discrimination being maintained across stages during the serialized multi-stage processing. The four profile curves in the figure are drawn from bottom to top with solid lines, dashed lines, dotted lines, and dotted lines, respectively.
[0027] In particular, all Each stage in the series shares the same set of Gaussian weight generation rules, the same set of division calculation rules, and the same preset small positive number for stable division operations. The term "sharing" refers to the fact that each concatenated stage uses the same Gaussian weight generation method (same Gaussian standard deviation, same neighborhood shape, same normalization method) when generating Gaussian weights, and uses the same division operation method when performing division (dividing by channel separately, and adding the same value to the denominator). (and then divide), and This scalar value is in The same value is repeatedly used in the computation within each concatenated stage. This shared design brings the following benefits: the total number of parameters is reduced to the level of a single concatenated stage; the self-calibrating module with shared weights does not introduce any learnable parameters, resulting in significantly reduced memory usage and inference latency compared to Retinex-like networks with learnable parameters; executing the same set of rules multiple times is equivalent to iteratively refining the Retinex decomposition process, which conforms to the theoretical mathematical process of approximating the intrinsic reflectivity in multiple steps; there is no risk of training instability due to the drift of independent parameters in each concatenated stage, and the convergence behavior of the entire network is more controllable during training.
[0028] The value usually falls within to between. Too small to be able to This effectively avoids numerical overflow caused by the denominator approaching zero when the value is extremely small; Too large an amount will affect normal The division result within the specified range produces a non-negligible deviation. This embodiment takes... As a recommended value, this value has been verified to be within the range of grayscale values involved in the contact wire image (after normalization, it is located in...). Within this range, numerical overflow can be effectively avoided while the impact on the normal reflection component value can be ignored—within For example, The introduced relative deviation is It is at the level of numerical noise.
[0029] Each time the self-calibration module for weight sharing is entered, a Gaussian smoothing scaling parameter needs to be assigned to the Gaussian weighted average calculation. This parameter is assigned upon entry. Each of the sequential stages shares the same scale value during execution. The scale input assigned in stage S2 is a preset initial Gaussian smoothing scale parameter. . The value of controls the strength of the prior hypothesis regarding the degree of spatial variability of the illumination component: The larger the value, the wider the corresponding Gaussian function, the more it tends to estimate the illumination distribution on a large scale, and the more high-frequency details are retained in the reflection component; The smaller the value, the more compact the estimation window, the more sensitive the illumination estimation is to local changes in brightness, and the more low-frequency information is retained in the reflection component. This embodiment typically selects... . The reasonable value range for this is between 1 and 5. A value below 1 results in an excessively small neighborhood, where the Gaussian weighting almost degenerates into the pixel's own value, rendering the illumination removal effect nearly ineffective. A value above 5 results in an excessively large neighborhood, causing over-smoothing of the illumination component, and some low-frequency components that should belong to the reflection component are incorrectly classified as illumination components. In another implementation, for large-span uniform illumination scenes such as tunnels and train stations, It can be adjusted to 3 or 4 to match the larger spatial scale of lighting changes in the scene.
[0030] like Figure 2As shown, plotting the horizontal offset from the center pixel on the x-axis and the normalized Gaussian weights on the y-axis, Gaussian weight decay curves are drawn for different Gaussian smoothing scale parameter values. It can be seen that the smaller the scale parameter value, the faster the Gaussian weight decays along the distance direction, the narrower the effective neighborhood range, and the better the weighted average illumination component estimate matches local details. Conversely, the larger the scale parameter value, the slower the Gaussian weight decays along the distance direction, the wider the effective neighborhood range, and the better the weighted average illumination component estimate reflects the lighting trend at a large scale. The Gaussian function at distances beyond 3 times the scale parameter from the center decays to less than 1.1% of its peak value; therefore, the side length of the local neighborhood is taken as... A single pixel is sufficient to cover the effective range of Gaussian weights. In the diagram, the solid line with the fastest decay from the center to both sides corresponds to a Gaussian smoothing scale parameter of 1, the dashed line with the second fastest decay corresponds to 2, the dotted-dash line with the next slowest decay corresponds to 3.5, and the dotted line with the slowest decay corresponds to 6.
[0031] The following is about the first A series of stages ( The value is The specific execution details of any integer in the text will be elaborated.
[0032] Step S2.1 performs illumination component estimation for the current concatenation stage. Let the input image for the current concatenation stage be... .when hour ;when hour By the Each serial stage is obtained in S2.3. Spatial dimensions, number of channels and Consistent.
[0033] right Each pixel position ,by Centered on, with side length as A square region of 1 pixel is used as the local neighborhood of that pixel. ,in This indicates rounding up. The reason for choosing this side length is that the Gaussian function's values beyond three standard deviations from the center have decayed to less than 1.1% of the peak value, and their contribution to the weighted average is negligible. Therefore, the neighborhood side length is taken to be approximately... This is sufficient to cover the effective range of the Gaussian weights; a larger window would only increase computation without significantly improving estimation accuracy, while a smaller window would truncate the tail of the Gaussian function, introducing estimation bias. For example, The neighboring area has a side length of 1. 1 pixel; with For example, The neighboring area has a side length of 1. 1 pixel.
[0034] Pixel position Estimated values of illumination components on Given by the following formula: ; in Traversing the local neighborhood All pixel positions in express At the neighboring pixel location The value on, express and Euclidean distance (in pixels) on the image plane. Let be the natural exponential function. The numerator of equation (1) is the Gaussian weighted sum of all pixel values within the local neighborhood, and the denominator is the normalization factor with the same Gaussian weights; dividing the two results in... The value is on the same order of magnitude as the original image and is independent of the number of pixels in the neighborhood. Distance The closer the neighboring pixel position The closer the obtained Gaussian weight is to 1, the greater the distance. The more distant the neighboring pixel position The closer the Gaussian weights are to 0, the better this weighting method, which decays with distance, aligns with the physical intuition that "neighboring pixels contribute more to illumination estimation."
[0035] In practical engineering implementation, equation (1) can be achieved by pre-generating a size of The Gaussian convolution kernel is used to perform a two-dimensional weighted convolution followed by normalization, which is an efficient method. Because the Gaussian function is separable, the two-dimensional Gaussian convolution can be further decomposed into two one-dimensional Gaussian convolutions in the horizontal and vertical directions, reducing the computational complexity from... Down to ,in Let be the neighborhood side length. In another implementation, it can also be directly generated using readily available Gaussian filter operators in dedicated image processing hardware. This embodiment does not limit the calculation method.
[0036] When pixel position When near the image boundary, the neighborhood Some pixel locations may fall outside the effective area of the image. This embodiment uses mirror filling to handle this situation: for neighboring pixel locations that fall outside the effective area of the image... Find the nearest boundary to the image within the valid area of the image. Mirror-symmetric pixel positions ,by Alternative Substitute these values into the numerator and denominator of equation (1) for calculation. For example, for a virtual position located one pixel above the first row. (i.e., the vertical axis is 0 and the horizontal axis is a certain value) ), its mirror symmetric position Take the second row as the first The actual pixel position of the column (i.e., the vertical coordinate is 2, the horizontal coordinate is 1) The advantages of mirror fill compared to zero fill or constant fill are as follows: Zero fill artificially introduces large areas of false zero-value pixels at the image boundary, causing the estimated illumination components near the boundary to be lowered, thus producing false "bright band" artifacts; constant fill either causes similar directional deviations or requires additional estimation of a suitable fill constant; mirror fill maintains the local statistical consistency between the extrapolated values and the values taken inside the image boundary, ensuring that the estimated illumination components near the boundary remain continuous with the internal regions of the image, avoiding the generation of false textures similar to defect morphologies near the boundary.
[0037] when When the image is a 3-channel color image, equation (1) is executed separately for each channel—the illumination component estimation maps for the red, green, and blue channels are calculated independently, and the results are obtained. On each channel The values for the corresponding channels are correlated. Estimating each channel separately is based on the consideration that the incident light intensity of the three channels is not consistent under different light sources—at dusk, under an orange color temperature, the red channel has stronger incident light and the blue channel has weaker incident light; at noon, under a white color temperature, the incident light intensity of the three channels is similar; and under moonlight or streetlight auxiliary light sources, a cool tone may dominate. If these color temperature differences are forcibly incorporated into a single illumination field for estimation, considerable color temperature perturbations will remain in the reflection component, thus interfering with subsequent defect identification. Estimating each channel separately allows the illumination changes of each channel to be adapted individually, and color temperature shifts are no longer mixed into the reflection component.
[0038] The estimated illumination components calculated by equation (1) at each pixel location are combined according to their spatial location to obtain the illumination component estimation map for the current concatenation stage. . Is with A three-dimensional tensor that is completely identical in spatial dimensions and number of channels.
[0039] Step S2.2 performs the reflection component calculation for the current series stage. Each pixel position ,Depend on and The estimated value of the reflection component in the current series stage is calculated using the following formula: ; in express At pixel position The value on, express At pixel position The value on, The aforementioned pre-defined small positive number. In the denominator... Superimposed on top The consideration is to prevent the division result from diverging when the denominator approaches zero: in catenary inspection images, strong shadow areas, corners without auxiliary lighting during night inspections, and dark cloud areas in the background sky may all show this. Pixels with values close to zero; if not introduced These positions Numerical overflow will occur, further generating NaN or Inf in floating-point operations, affecting the stability of the subsequent training process.
[0040] The reflection component is calculated separately for each channel. When it is a 3-channel color image, The red, green, and blue channels are respectively composed of and It is obtained by dividing the values on the corresponding channels. The same scalar value appears repeatedly in all channels and is not configured individually for each channel—this ensures that the reflection components of different channels remain comparable in magnitude, avoiding discrepancies due to variations in the values of different channels. Differences in values can be artificially amplified or suppressed.
[0041] The estimated reflection components calculated at each pixel location are combined according to their spatial location to obtain the reflection components of the current concatenation stage. . Is with A three-dimensional tensor that is completely identical in spatial dimensions and number of channels.
[0042] Step S2.3 performs inter-stage propagation. (The result is...) Afterwards, according to and The relationship determines subsequent actions. If Less than (That is, the current series stage is not the last series stage), then... As the first Input image of each serial stage Entering the Each cascaded stage re-executes S2.1 to S2.3. This transmission method ensures that the reflection component output from the previous cascaded stage is used as the object of reprocessing in the subsequent cascaded stage—because The image has already had some lighting effects removed, and the Gaussian weighted average estimation was performed again to obtain the result. will be closer The residual low-frequency components, rather than the true reflective structure, can be divided again to allow... Compare This further approximates the intrinsic reflectivity. Mathematically, this process is equivalent to fixed-point iteration of the Retinex decomposition—each iteration further reduces the residual, and multiple cascades can significantly suppress low-frequency residues that are difficult to separate in a single estimate.
[0043] like equal (That is, the current series stage is the last series stage), then for the first... The reflection components output by each series stage Perform min-max normalization on a channel-by-channel basis. Specifically, for For each channel, find the global maximum and global minimum values of that channel across all pixel positions, and then linearly map the values at each pixel position to the interval using the following formula. : ; in The channel number (values are 1, 2, or 3, corresponding to the red, green, and blue channels, respectively). express At pixel position ,aisle The value on, and They are respectively In the passage The global minimum and global maximum values on the [top / bottom] are [values]. These are the normalized values. The consideration for normalization is that after... After the series estimation and solution The overall numerical range of each channel may deviate due to data transfer. intervals, especially At pixel positions with values less than 1 It's easy for the value to exceed 1, and there might be a magnitude imbalance between adjacent channels; normalization ensures that the value of each channel is uniformly constrained to a certain level. Within the interval, the decoupling of the relative amplitudes between channels before and after normalization also improves the friendliness of the reflection component to subsequent semantic modeling, facilitating stable training and inference of the shallow feature extraction part. The denominators are then superimposed again. The purpose is also to maintain operational stability when the denominator is zero in a case where the global maximum and minimum values of a certain channel are exactly equal (in an extremely uniform case).
[0044] The normalized tensor is used as the initial reflection component. Output to subsequent segments of the defect detection network. and Maintaining consistency in spatial dimensions and number of channels, the value of each channel falls within the specified range. Inside.
[0045] Finally, several optional implementation methods are described to illustrate the applicability of this embodiment. Firstly, the Gaussian weight generation rule can be replaced with bilateral filtering weights—that is, multiplying the spatial Gaussian weights by a range Gaussian weight driven by the difference in neighboring pixel values—this replacement can further preserve the edge structure in the reflection component while maintaining the spatial smoothness of the illumination component; secondly, a preset small positive number... In other embodiments, it can be taken as , , etc., as long as its magnitude is much smaller than and The magnitude of the meaningful signal is sufficient; thirdly, the total number of serial stages. In other implementations, the value can be 2 or 4, and a compromise can be made on different hardware platforms based on the computational budget and discrimination accuracy requirements; fourth, the initial Gaussian smoothing scale parameter Alternatively, other values such as 1.5, 2.5, or 3.5 can be used depending on the spatial scale of the illumination changes corresponding to the image acquisition. Fifth, the global maximum and minimum values used in min-max normalization can be replaced with quantiles in other implementations (for example, taking the values at the 1% and 99th percentiles after sorting the values in the channels from smallest to largest), to improve robustness to extreme pixel perturbations. The above replacement schemes and the specific value combinations given in this embodiment are continuously adjustable in terms of technical effect, and the most suitable parameter combination can be selected according to the actual scenario during engineering implementation.
[0046] The initial reflection component obtained after S2 Most of the lighting effects introduced during the image acquisition stage have been isolated, but the lighting used during execution... Spatially uniform—every pixel in the image is Gaussian-weighted averaged with the same window width. For overhead contact line defect detection tasks, this globally uniform processing method presents a challenge. Areas potentially prone to defects, such as minute indentations on the contact wire surface, minor chipping on the edges of insulator skirts, or worn breaks in the wires of the dropper, often carry discrimination signals that appear on smaller spatial structures, with grayscale changes concentrated within a few adjacent pixels; while background areas, such as the distant sky, tunnel ceilings, and smooth metal surfaces of vehicle roofs, exhibit slower grayscale transitions, more closely resembling large-scale lighting changes. A unified... It is difficult to balance these two types of areas: if the size is small, the lighting capability is insufficient for the background, and the residual low frequencies will interfere with subsequent semantic discrimination; if the size is large, the details are smoothed out, and the key textures in the defective areas may be averaged out as well.
[0047] The ideal way to handle it should be to let Adapts to pixel position within the image—at locations that may be defects. Take a smaller size to retain details, in a position that clearly belongs to the background. A larger value is obtained for more thorough de-illumination. However, the difficulty lies in the fact that before the reflection component extraction is complete, it is impossible to determine which locations are defect candidates; and to know which locations are defect candidates, a relatively clean reflection component is needed for the convolution weights to interpret. The approach to handling this interdependence in this embodiment is: first use... As a coarse reflection component, a preliminary judgment is made on it by shallow convolution weights to obtain an attention map representing the degree to which each pixel location "may be defective". This attention map is then used to assign an adaptive Gaussian smoothing scale to each pixel location. Finally, the reflection component is extracted again using this adaptive scale to obtain a more accurate result. The reflection component is more aligned with the needs of defect identification; if necessary, this process can be repeated one or even several times. This forms a closed-loop structure that repeatedly closes from "reflection component to the map of interest, then to the scale map, and back to the reflection component".
[0048] The total number of executions in the closed loop is denoted as . , is a preset positive integer representing the total number of closed-loop corrections. The typical values are 2, 3 or 4. It only takes one round of coarse reading to re-correction, which is sufficient to handle most contact network images under uniform lighting. or The attention map and scale map have formed a "self-correcting" iterative effect. The second attention map focuses more on the real defect clues than the first one, and the reflection component of the second map is sharper in the defect area. When the gain is further increased to 4 or 5, it still exists but gradually levels off, while the inference time per frame increases almost linearly. This embodiment is recommended after engineering testing on the overhead contact line inspection dataset. .
[0049] Bundle Recorded as This serves as the input reflection component for the first closed-loop correction. Secondary closed-loop correction ( The value is The input reflection component of any integer in the set is denoted as . The output reflection component is denoted as ;No. Output of secondary closed-loop correction That is, as the final reflection component Send to subsequent processing. The closed-loop correction consists of five sub-steps, namely S3.1 to S3.5, which will be discussed in this order below.
[0050] Step S3.1 involves the existing input reflection components. Generate a defect concern graph. The specific process is: ... Input the shallow feature extraction part sequentially Each convolutional block yields a shallow feature map. . This is the preset total number of shallow convolutional blocks, typically 2, 3, or 4. If the value is too small, the shallow features will not be able to adequately describe the texture. If the receptive field is too large, it will prematurely expand into a large-scale context unrelated to the defect. It is a spatial dimension and Consistent, the number of channels equals the number of shallow feature channels. The three-dimensional tensor. This is the preset number of shallow feature channels, typically 16, 32, or 64. Larger features offer richer expressive power, but computational load and memory usage increase simultaneously. This embodiment is recommended after engineering testing on the overhead contact line inspection dataset. , .
[0051] Each convolutional block consists of a 2D convolutional layer, a batch normalization layer, and a ReLU activation function layer connected sequentially. The kernel size of the convolutional layer is set to... With a stride of 1 and padding of 1, the output feature map of the convolutional layer maintains the same spatial size as the input feature map—that is... Height and width compared to the initial input image same. The kernel size is a common trade-off between computational cost and receptive field; batch normalization layers ensure stable feature statistics during batch training, avoiding internal covariate drift that occurs as training progresses; ReLU activation function layers introduce non-linearity while maintaining gradient passivity. The number of input channels in the first convolutional block is... The number of channels is consistent - because Is with The isomorphic color image has 3 input channels; the output channels of this convolutional block are... The second to the third The number of input channels and the number of output channels of each convolutional block are both This ensures that the feature processing pathways across the channel dimension are unified.
[0052] get Then, max pooling is performed along its channel dimension to obtain the single-channel feature response map. In other words, At pixel position The value on equal exist All The maximum value is taken from each channel. The reasoning behind taking the maximum value along the channel dimension is that different channels of the shallow feature map learn different low-level visual patterns during end-to-end training—some channels are sensitive to horizontal edges, some to diagonal textures, some to local contrast, and some to blocky spots. A high response on any one channel may correspond to a potential defect cue. Taking the maximum value along the channel can be understood as "if any channel thinks there might be a problem here, this point will be recorded on the final response map," equivalent to performing an "OR" logic aggregation along the channel dimension. Compared to other aggregation methods such as averaging or summing by channel, the maximum value is not diluted by weak responses on other channels, making it more suitable for capturing defect cues that are usually sparsely distributed in contact network images.
[0053] It is still possible that the values will be numerically distributed within an indeterminate interval. To obtain the comparable values required for a stable ranking, [the following needs to be considered]... Min-max normalization is performed based on the global maximum and global minimum values. The specific normalization is given by the following formula:
[0054] In the formula and They represent The global minimum and global maximum values are obtained across all pixel positions; express At pixel position The value of ; This represents the defect concern map obtained after normalization. exist The value of ; This is a preset small positive number that has already been introduced in stage S2. The range of values for strictly falls within Within: At the global minimum The value is 0, at the global maximum value. The value is 1, and the rest are in between. The denominator is appended... In order to be in and In extreme cases where the weights are exactly equal (e.g., the convolution weights produce an almost flat feature response map under a certain closed-loop iteration order), the numerical curse of zero denominator can be avoided.
[0055] The purpose of normalization is not only to unify the numerical range, but more importantly, to make... Numerical comparability exists between different frame images and different closed-loop iteration orders—the same threshold (e.g., 0.7) is comparable across different... All of these correspond to the semantics of "responding in the top 30% relative to this frame", eliminating the need to individually calibrate the threshold for each frame or each iteration. The physical meaning of this value can be interpreted as: the larger the value, the closer it is to the pixel position. The more prominent the response on shallow features, the higher the priority for inclusion as a defect candidate region in subsequent spatial adaptive Gaussian smoothing scaling; the smaller the value, the more likely it is to be regarded as a background region. It should be noted that... It serves only as a guiding signal for subsequent scale assignment and is not directly used as the final result of defect discrimination—the actual defect category label and localization box are given by the deep feature extraction and detection head.
[0056] Step S3.2 All pixel positions are sorted from largest to smallest value, and then evenly divided into multiple attention-guided groups based on the index interval. First, [the following is a list of pixel positions]. Treat it as a one-dimensional sequence—enumerate all pixel positions, and sort by... Sort the pixels in descending order of size to obtain the pixel position sequence. In the formula Indicates the index after sorting. pixel position ( The value is (any integer in the range) express The total number of pixel locations (i.e., the product of image height and width). yes The pixel position with the largest value. yes The pixel position with the smallest value.
[0057] The sorting process determines the order of pixels with equal values according to the image's preset scanning order—for example, first by row number from smallest to largest, and then by column number from smallest to largest if row numbers are the same. This tie-breaking rule is necessary: without it, Pixels with equal values may be arranged in an arbitrary order after sorting, resulting in different groups. This can lead to different reflection components from the same input image in repeated runs, compromising the repeatability of the entire discrimination process. In engineering implementations, the preset scanning order is often the raster scanning order—enumerating the images according to their storage order naturally provides a definite order without additional overhead.
[0058] Then the sequence Divide the index interval evenly into A focus group for guidance. This is the preset total number of attention-guided groups, which is 1 greater than or equal to 2 and less than or equal to 2. Integer. The first One attention guide group ( The value is Any integer in the sequence is obtained from the index in the sequence. to The pixel positions constitute the composition, where This indicates a floor operation. This method of dividing the index range has three properties: first, all... The sum of the number of pixel locations covered by each attention guide group is exactly equal to First, all pixel positions are completely divided without repetition or omission; second, no two attention-guided groups share common pixel positions, making the division mutually exclusive; third, due to the length of the index interval... The difference is at most 1, meaning the difference in the number of pixel positions contained in any two attention guide groups does not exceed 1, and the division is almost balanced in terms of quantity.
[0059] The following explains why a balanced partitioning based on index intervals is used instead of a partitioning based on value thresholds. The defect distribution in different frames of images varies greatly under different acquisition conditions—a single frame may have only a few scattered suspected defect points while the vast majority of pixels are a uniform background. The histogram of one image is severely skewed towards low values; another image may contain large areas of suspicious texture. The histogram is relatively flat. Based on a fixed threshold (e.g., dividing...). Classified as Group 1 (Classifying images into group 2, and so on) causes almost all pixels in the first type of image to be assigned to the low-value group, while the groups in the second type of image are relatively evenly distributed. The result is that a small number of genuine defect candidate locations in the first type of image, which should have been assigned small scales, instead share the same group with a large number of background locations, causing confusion in subsequent scale assignments. Division based on subscript intervals groups the images within each frame according to their relative response strength—regardless of... Regardless of the histogram shape, it can guarantee that the response will be ranked first. Each position is independently assigned to group 1, thus obtaining the minimum. The value is determined by this property, which makes this method more robust to differences in inter-frame distribution.
[0060] Typical values are 4, 8, or 16. At that time, only a binary division of "high attention" and "low attention" was made, corresponding to Only one value is available and The transition between the two gears is too abrupt; to The transition between timescales is relatively natural; When further increased, the adjacent groups As the differences in values become smaller, the computational cost of grouping increases, but the accuracy gain of reflection component extraction is approaching saturation. This embodiment is recommended after engineering testing on the overhead contact line inspection dataset. . Pixel position The group number of the group to which the attention guide belongs is denoted as . The value of belongs to the set —where 1 corresponds to The pixel position with the largest value. The part that corresponds to the smallest value.
[0061] Step S3.3 assigns a spatially adaptive Gaussian smoothing scale parameter to each pixel location based on the group number of the attention-guided group to which that pixel location belongs. The specific assignment is given by the following formula:
[0062] In the formula Indicates pixel position In the The spatial adaptive Gaussian smoothing scale parameter assigned in the secondary closed-loop correction; and These are the preset minimum Gaussian smoothing scale parameters and the maximum Gaussian smoothing scale parameters, respectively; The total number of the aforementioned preset attention-guided groups; For the aforementioned pixel position The group number of the group to which it belongs.
[0063] Formula (2) is a formula about linear mapping - when hour ;when hour The group numbers in between correspond to In the interval The interior is distributed at equal intervals. and The value of satisfies two constraints: Strictly greater than 0 to ensure the Gaussian function can be defined; Strictly greater than This is to ensure that the linear mapping does not degenerate.
[0064] like Figure 5 As shown, with the group number as the horizontal axis and the spatial adaptive Gaussian smoothing scale parameter as the vertical axis, the linear mapping relationship represented by formula (2) is plotted. The curve is a monotonically increasing straight line segment. The left endpoint corresponds to the minimum Gaussian smoothing scale parameter value at group number 1, and the right endpoint corresponds to the maximum Gaussian smoothing scale parameter value at group number G. The Gaussian smoothing scale parameters corresponding to the group numbers in between are distributed at equal intervals between the minimum and maximum values. Since the attention guidance group with a small group number corresponds to the pixel position with a large defect attention map value, combined with this monotonically increasing mapping, the pixel position with a larger defect attention map value is assigned a smaller Gaussian smoothing scale parameter value, thereby realizing the spatial differentiation processing of compact de-illumination of defect candidate positions and sufficient de-illumination of background positions.
[0065] The reasonable range for its value is between 0.5 and 2.0, with a typical value of 1. Obtain the edge length of the Gaussian neighborhood when the value is too small (e.g., below 0.3). It is also too small, and the weighted average degenerates into a copy of the pixel's own value - the illumination estimation becomes meaningless, and the reflection component at the defect candidate position is almost equal to the original input image, which does not play a role in de-illumination. When the value is too large, the details of the defect candidate locations will be smoothed out, which violates the design intention of "preserving high frequencies at potential defect locations". The reasonable range of values is between 3 and 10, with a typical value of 6. Low-frequency residual light in the background area under low illumination was not sufficiently removed; When the value is too large, the neighborhood width expands rapidly (e.g. When the neighborhood side length reaches 61 pixels, the computational cost increases sharply, but the resulting accuracy gain is limited. This embodiment is recommended after engineering testing on the catenary inspection dataset. and .
[0066] The following explains the beneficial effects of this assignment method. From formula (2), Follow The value increases monotonically with increasing group number—the larger the group number, the greater the attention-guided group. Take the value. Then, from S3.2, "by..." The rule is to sort from largest to smallest and then group them evenly. The pixel with the smaller value is precisely Locations with larger values are potential defect locations where shallow feature responses are prominent; conversely, locations with smaller values are potential defect locations. The pixel position with the larger value corresponds to The background position with the smaller value. Combining the two monotonic relations yields a single overall correspondence: the defect candidate position receives a smaller value. The background position gets a larger This spatially differentiated scale arrangement perfectly matches the physical requirements of the overhead contact line defect identification task—the local illumination at the defect candidate site is estimated using a compact neighborhood to preserve the details required for defect identification to the maximum extent; the background is estimated using a wide neighborhood to estimate large-scale illumination to remove low-frequency residues that may interfere with deep identification to the maximum extent.
[0067] like Figure 3 As shown, the rectangular area represents a typical overhead contact line inspection image. Several small patches filled with diagonal lines within the area correspond to candidate defect locations with higher values in the defect interest map, while the remaining blank areas correspond to background locations with lower values. At the candidate defect locations, compact concentric circles represent the local neighborhood corresponding to a smaller spatial adaptive Gaussian smoothing scale parameter. At the background locations, wider concentric circles represent the local neighborhood corresponding to a larger spatial adaptive Gaussian smoothing scale parameter. Because the candidate defect locations have a compact neighborhood and limited weighting range, the illumination component estimation only absorbs the grayscale mean within a very small spatial range, thus preserving the subtle textures required for defect identification to the maximum extent. At the background locations, due to the wide neighborhood and large weighting range, the illumination component estimation can cover large-scale gradual illumination changes, thus removing low-frequency residues that may interfere with deeper identification to the maximum extent.
[0068] From all pixel positions Combine them according to their positions on the image plane to obtain the first... Spatial adaptive scaling diagram of secondary closed-loop correction . It is a height of Width is A two-dimensional tensor, where each position... The value is corresponding . This serves as the scale input for the next step, S3.4.
[0069] Step S3.4 As a scale input, the input reflection component is processed by a weight-sharing self-calibration module. Perform the reflection component extraction again once to obtain the refined reflection component. S3.4 is completely identical to S2 in terms of internal architecture and execution rules—the same... Each stage in a series, the same Gaussian weighted average and division solution, the same The same mirror fill and the same channel-by-channel execution are used—the only difference lies in the Gaussian smoothing scale parameter used for the Gaussian weighted average: in stage S2, all pixel positions uniformly use the preset initial Gaussian smoothing scale parameter. In stage S3.4, the position of each pixel is changed to use from The space extracted from the adaptive value .
[0070] Specifically, to The input image for the first concatenation stage in S3.4 . No. A series of stages ( The value is The input image (of any integer) is denoted as The illumination component estimation diagram is denoted as The reflection component is denoted as .right Each pixel position ,by Centered on, with side length as A square region of 1 pixel is used as the local neighborhood of that pixel. The side length of the neighborhood here is the same as that fixed in S2.1. The difference is that in S3.4, the neighborhood side length of each pixel location depends on its... The values are determined individually, and may be due to a narrow neighborhood at the location of the defect (e.g.) The neighborhood side length is 7 pixels, while the neighborhood is wider in the background position (e.g., The neighborhood side length is 37 pixels.
[0071] Pixel position The estimated value of the illumination component on the surface is given by the following formula:
[0072] In the formula Traversal All neighboring pixel positions; express exist The value of ; express and Euclidean distance in pixels on the image plane; It is a natural exponential function; For the aforementioned pixel position In the The spatial adaptive Gaussian smoothing scale parameter assigned in the secondary closed-loop correction; This indicates the estimated illumination components output in the current cascade stage. The value of is taken on . This formula is completely consistent with the form of formula (1) in S2.1, except that the value of in formula (1) is changed. Replace with ,Bundle Replace with ,Bundle Replace with Note that the same term is used in both the numerator and denominator. —that is, based on the center pixel position The scale value at a given point defines the Gaussian weight distribution over the entire neighborhood, rather than the location of each neighboring pixel. Each uses its own scale—this arrangement ensures that the normalized denominator and numerator of the weights use the same set of weights, and also avoids artifacts caused by different scale values between spatially adjacent pixels.
[0073] The processing of image boundaries is the same as in S2.1: when When some pixel positions fall outside the effective image area, the values at the out-of-bounds positions are replaced by the values at the actual pixel positions within the effective image area that are mirror-symmetrical to the nearest boundary position, using a mirror-fill method. When When dealing with multi-channel color images, illumination component estimation is performed separately for each channel—each of the three color channels obtains its own corresponding illumination component estimation map, which are independent of each other.
[0074] There are several feasible and specific ways to implement this project. One way is to... discrete The values are generated separately. Apply a Gaussian convolution kernel to Do them separately The complete convolution yields Zhang Candidate Illumination Component Estimation Map Then according to each pixel position The values are selected from the corresponding candidate illumination component estimation map at that location and assembled into a single image. The advantage of this approach is that it can utilize the convolution operators of dedicated image processing hardware for batch acceleration; the disadvantage is... The intermediate storage space overhead of candidate images and Proportional. Another way is pixel-by-pixel based. Instantaneous generation of Gaussian weights and weighted averaging eliminates the need to store intermediate candidate images, but the weighted calculation for each pixel cannot be batched. There is also a middle ground: "local clustering"—grouping spatially adjacent pixels... Pixels with the same value are grouped into a single block for unified execution, balancing the advantages of batch processing with the overhead of intermediate storage. This embodiment does not limit the specific implementation method; any implementation that is numerically equivalent to the above formula is applicable.
[0075] get Then, the reflection component is calculated using the following formula:
[0076] In the formula This indicates the position of the reflection component output in the current concatenation stage at the pixel location. The value of ; and The input image and the illumination component estimation map of the current concatenation stage are respectively located in... The value of ; The preset small positive number introduced in stage S2 will still be used in the calculation in S3.4 as the same value, without being configured separately. Division operations are performed separately for each channel, consistent with the processing method in S2.2.
[0077] The inter-stage transfer rules are also consistent with S2.3: when Less than hour, As the first Input image of each serial stage Re-execute the estimation-solution process within S3.4, and so on, for a total of [number] executions. A series of stages; when equal At that time, for the first The reflection components output by each series stage Perform min-max normalization on each channel to linearly map the value of each channel to the maximum value. The interval, the normalized tensor is used as the output reflection component of this closed-loop correction. The global maximum and global minimum values used for normalization are respectively... The global extrema on each channel are normalized in the same form as the normalization formula at the end of S2.3.
[0078] It is important to emphasize that S3.4 reuses the exact same weight-sharing self-correction mechanism as S2—the same one. The same set of Gaussian weighted average rules, the same set of division calculation rules, the same mirror fill method, and the same method of executing separately by channel—the only difference is the Gaussian smoothing scale parameter. Replace with The advantages of this reuse design are obvious: the entire S3.4 does not introduce any additional learnable parameters, and the increased computational cost mainly comes from spatially adaptive Gaussian convolution, which is comparable in magnitude to S2, thus avoiding the additional training burden and possible training instability brought about by introducing new parameters.
[0079] Step S3.5 puts the first The output reflection component obtained from the secondary closed-loop correction Used to drive the next closed-loop correction or as the final output. Specifically, when Less than At that time, As the first The input reflection component of the secondary closed-loop correction is re-executed through steps S3.1 to S3.5—that is, the defect concern map is recalculated. , Re-grouping and guiding attention The spatial adaptive Gaussian smoothing scaling parameter is reassigned using formula (2). The refined reflection components are re-extracted by the weight-sharing self-correction mechanism. ;when equal At that time, As the final reflection component It is sent directly to the subsequent processing stage.
[0080] During closed-loop iteration and These are all regenerated based on the current input reflection components—they are not fixed, but updated synchronously as the reflection components are refined. This mutual correction mechanism of "reflection component to map of interest, then to scale map, and back to reflection component" brings a gradual convergence effect: the first loop closure has a slightly residual low frequency... (Right now The shallow convolutional weights interpret the input as input. It contains both genuine defect clues and spurious responses introduced by low-frequency remnants; click here. After assigning a scale value Already more The loop is finer at defect-sensitive locations, while low-frequency remnants at spurious responses are also partially suppressed. The next loop closure... As input, the interpretation of shallow convolution weights Comparison More focused—previous false responses were suppressed accordingly, while genuine defective responses were relatively highlighted—by Obtained by scale assignment Contrast ratio in defect areas Further enhancement. And so on. This mutual correction is mathematically an example of fixed-point iteration—if Large enough and the mapping has a fixed point, the iterative sequence It will converge toward a fixed point, corresponding to a stable state where "the reflection component and its interest graph are consistent".
[0081] like Figure 6 As shown, a convergence curve is plotted with the number of closed-loop corrections on the horizontal axis and the L2 norm of the difference between the reflection components output from two adjacent closed-loop corrections on the vertical axis, illustrating the change in the reflection component increment as a function of the number of corrections during the closed-loop iteration process. It can be seen that as the number of closed-loop corrections increases, the reflection component increment exhibits a quasi-exponential decay trend—the change in reflection components brought about by the first 1 to 2 closed-loop corrections is relatively large, while after the 3rd closed-loop correction, the change has significantly decreased and fallen below the preset convergence threshold. The gain from further iterations gradually flattens out. This convergence behavior reflects the fixed-point approximation characteristic of the closed-loop iteration process in mathematics, and also corroborates that the recommended total number of closed-loop corrections, T=3, is a reasonable trade-off between accuracy gain and inference time. The horizontal dashed line in the figure represents the preset convergence threshold.
[0082] Right now Its relationship with the initial input image The spatial dimensions and number of channels remain consistent. The inputs are sequentially fed into the shallow feature extraction part (using the same set of convolutional blocks and the same set of trained parameters as in S3.1) and the deep feature extraction and detection head part. The defect classification branch of the detection output layer outputs the defect category label and defect confidence score, while the defect localization branch outputs the localization box of the defect in the image. The two are combined as the defect detection result. The deep feature extraction and detection head part usually adopts the mid-to-late stage structure of existing object detection networks—such as multi-scale detection heads based on anchor boxes, query token-based detection heads, or point-based detection heads. This embodiment does not limit the specific detection head structure; any structure that can derive defect category and location prediction from the shallow feature map is applicable. The defect classification branch takes the shallow feature map as input, passes through several layers of convolution or fully connected layers, and outputs the probability of existence of each type of defect. The defect localization branch takes the shallow feature map as input, passes through a regression head, and outputs four values representing the bounding rectangle of the defect, such as the center coordinates plus width and height, or the coordinates of two sets of diagonal vertices.
[0083] The following briefly explains how the parameters of the shallow feature extraction part and the deep feature extraction and detection head part are obtained during the training phase. Training uses a dataset containing labeled samples of overhead contact line defects—each training sample consists of one overhead contact line inspection image and its corresponding defect label. The defect label includes the defect category name (e.g., conductor strand breakage, insulator rupture, missing dropper, bird's nest, etc.) and the coordinates of the defect's bounding box in the image. Training is performed end-to-end—the entire image is input into the complete defect detection network (including S1 to S3 of the weight-sharing self-correction process, the shallow feature extraction part, and the deep feature extraction and detection head part). The defect detection results obtained from the detection output layer are used to calculate the classification loss (e.g., category cross-entropy) and localization loss (e.g., L1 loss, smooth L1 loss, IoU loss), which are summed to form the total loss. The convolution weights of the shallow feature extraction part and the deep feature extraction and detection head part are updated through backpropagation. It should be noted that the weight-sharing self-correction process itself does not contain any learnable parameters—its internal... , , , , , , These are all pre-defined hyperparameters and do not participate in gradient updates—therefore, gradient backpropagation during training only occurs on the convolution weights of the shallow feature extraction part and the deep feature extraction and detection head part.
[0084] The handling of closed-loop correction during training requires some explanation. One implementation is to process the entire... The second closed loop expands into a single forward computation chain, with the gradient propagated back along this chain from end to end—this implementation yields the most accurate gradient, but memory overhead increases with... Linear increase. Another implementation is staged training—first with... After several rounds of training to make the shallow feature extraction part converge quickly, switch to the target. Continue training. Another approach is the stopping gradient approximation—treating the sorting and grouping operations in S3.2 as non-differentiable operations, and applying this approximation to their upstream... The gradient backpropagation is stopped, and only the shallow feature extraction part is updated based on the current defect detection loss—this approximation results in minimal accuracy loss in engineering practice but significantly reduces training memory overhead. This embodiment does not limit the specific training method. Regarding training hyperparameters, this embodiment recommends the following combination of values: batch size of 16; initial learning rate... Using a cosine annealing strategy to decay to The optimizer uses Adam or AdamW; the total number of training iterations is 100 to 300 epochs; the image undergoes conventional data augmentation such as random horizontal flipping, random color jittering, and random cropping before input. These training hyperparameters are not the core innovation of this embodiment and can be flexibly adjusted according to the task difficulty and dataset size.
[0085] The following describes several optional implementation methods. Firstly, the convolutional block structure of the shallow feature extraction section can employ lighter-weight depthwise separable convolutions, convolutional blocks with residual connections, convolutional blocks with spatial attention gating, or alternatively... Equivalent to the feeling of two, but lighter. and In this embodiment, the internal structure of the convolutional blocks is not strictly limited, and the combination of consecutive convolutions is used. Secondly, the defect concern diagram... Besides taking the maximum value along the channel dimension, alternative methods for generating the signal include channel-weighted averaging (with learnable weights) and summing the squares of each channel and then taking the square root (i.e., L2 aggregation). The goal is to obtain a scalar signal reflecting the probability of a defect at each pixel location. Thirdly, regarding the partitioning method for guiding the grouping, besides balanced partitioning based on index intervals, adaptive grouping based on K-means clustering and grouping based on natural quantiles (e.g., taking...) can also be used. (The 25%, 50%, and 75% equivalence points are used as grouping boundaries). Other partitioning methods only need to satisfy "complete partitioning of all pixel positions, mutual exclusion, approximate balance, or controllable imbalance". Fourth, in addition to the linear mapping in formula (2), the assignment formula for spatial adaptive Gaussian smoothing scale can adopt nonlinear mappings such as... This type of exponential mapping, or direct continuous mapping based on values taken from the attention graph, is... In this embodiment, the specific function form of the assignment method is not limited. Fifth, the number of closed-loop iterations. In addition to setting a fixed value, a dynamic stopping strategy can also be used—calculating after each closed-loop correction. and The difference norm is used to terminate the loop closure early when the difference is less than a preset threshold—this method can reduce unnecessary iteration overhead on some images. Sixth, internally, S3.4, in addition to using the same methods as S2 in this embodiment, also employs... In addition to the number of series stages, a different total number of series stages can also be used than that of S2 (e.g., S2 takes...). S3.4 take (or vice versa), as long as the design requirement of "reusing the same set of weight-sharing self-correction mechanisms" is met. Seventh, the visualization results of the defect concern map itself have diagnostic value in engineering debugging—[…]. Displaying the image as a heatmap overlaid on the original image allows for a direct view of the potential defective areas identified by the network in each closed-loop iteration. This helps in locating the causes of false positives and false negatives during training, but this visualization application does not affect the core process of this embodiment.
[0086] Thus, starting from the acquisition of images during overhead contact line inspection, the initial reflection components are extracted through a weight-sharing self-calibration process, and then... The final reflection component is obtained through secondary defect-sensitive closed-loop correction, and the complete process of outputting defect detection results from the shallow feature extraction part and the deep feature extraction and detection head part is thus explained.
[0087] While specific embodiments of the present invention have been described above, those skilled in the art should understand that these specific embodiments are merely illustrative. Those skilled in the art can omit, substitute, and modify the details of the above methods and systems in various ways without departing from the principles and essence of the present invention. For example, combining the above method steps to perform substantially the same function and achieve substantially the same result according to substantially the same method falls within the scope of the present invention. Therefore, the scope of the present invention is defined only by the appended claims.
Claims
1. A self-calibrating method for detecting defects in overhead contact lines, characterized in that, Includes the following steps: S1. Acquisition and initialization: Acquire the overhead contact line inspection image as the initial input image and input it into the defect detection network, which includes a weight-sharing self-correction module, a shallow feature extraction part, and a deep feature extraction and detection head part. S2, Multi-stage weight-sharing self-correction: The initial reflection component is obtained by the weight-sharing self-correction module performing multiple cascaded stages of reflection component extraction on the initial input image; S3, Defect-Sensitive Closed-Loop Correction and Defect Detection: Multiple closed-loop corrections are performed on the initial reflection component to obtain the final reflection component. The result is then output after passing through the shallow feature extraction section and the deep feature extraction and detection head section. Each closed-loop correction is performed in the order of S3.1 to S3.
5. S3.1 Defect Concern Map Generation: A defect concern map is generated from the input reflection components of the current loop closure correction by the shallow feature extraction part; S3.2, Focus Guidance Grouping: Divide all pixel positions into multiple attention guidance groups according to the values of the pixel positions in the defect attention map; S3.3, Spatial Adaptive Gaussian Smoothing Scale Assignment: Assign spatial adaptive Gaussian smoothing scale parameters to the pixel position according to the group number of the attention guidance group to which the pixel position belongs, and combine them into a spatial adaptive scale map; S3.4 Focus on guided multi-stage reflection component extraction: Using the spatial adaptive scale map as the scale input, the weight-shared self-calibration module performs reflection component extraction on the input reflection component of the current closed-loop calibration to obtain the output reflection component of the current closed-loop calibration; S3.5 Closed-loop iteration: The output reflection component of the current closed-loop correction is used as the input reflection component of the next closed-loop correction, and the output reflection component of the last closed-loop correction is used as the final reflection component.
2. The method as described in claim 1, characterized in that, The weight-sharing self-calibration module consists of K cascaded stages, where K is the preset total number of cascaded stages. Each of the K cascaded stages performs a Gaussian weighted average operation and a division operation. The K cascaded stages share the same Gaussian weight generation rule, the same division operation rule, and the same preset small positive number used for stable division operations. Preset small positive numbers The Gaussian smoothing scale parameter is reused repeatedly in the K cascaded stages; the Gaussian smoothing scale parameter is used as the scale input when entering the weight-sharing self-calibration module, and is reused by the K cascaded stages during the same entry into the weight-sharing self-calibration module. The scale input assigned in S2 is the preset initial Gaussian smoothing scale parameter. The scale input assigned in S3.4 is a spatial adaptive scale map. .
3. The method as described in claim 2, characterized in that, The shallow feature extraction section consists of M convolutional blocks connected sequentially, where M is the preset total number of shallow convolutional blocks; each of the M convolutional blocks has a kernel size of... The convolutional layers are constructed by sequentially connecting convolutional layers with a stride of 1 and padding of 1, batch normalization layers, and ReLU activation function layers, so that the output feature map of each convolutional block is consistent with the spatial size of the input feature map. The number of input channels of the first convolutional block in the M convolutional blocks is consistent with the number of channels of the initial input image, and the number of output channels is equal to the preset number of shallow feature channels C. The number of input channels and the number of output channels of each convolutional block from the second to the Mth convolutional blocks are all equal to C.
4. The method as described in claim 3, characterized in that, The deep feature extraction and detection head consists of several convolutional blocks following the shallow feature extraction part and a detection output layer connected in sequence. The detection output layer includes a defect classification branch and a defect localization branch. The defect classification branch outputs the defect category label and defect confidence score, and the defect localization branch outputs the location box of the defect in the image. The parameters of the shallow feature extraction part and the deep feature extraction and detection head part are all parameters that have been pre-trained with samples containing catenary defect annotations.
5. The method as described in claim 4, characterized in that, The illumination component estimation performed in each of the K concatenated stages in S2 includes: [the process involves] estimating the input image for the current concatenated stage. Each pixel position in by pixel position Centered on, with side length as A square region of 1 pixel is used as the pixel position. local neighborhood According to formula (1), from the local neighborhood Each pixel position Input image in the current concatenation stage The value in Calculate pixel position Illumination component estimates : ; in, The preset initial Gaussian smoothing scale parameters and Greater than 0, Indicates pixel position With pixel position The Euclidean distance between them This represents the floor operation; for local neighborhoods... The center position is a pixel position located outside the effective range of the image. The mirror fill method is used within the effective area of the image, relative to the image boundary and pixel position. The mirror-symmetric pixel position in the input image at the current concatenation stage. The value in is used as Substitute the input image into formula (1) for calculation; For multi-channel images, formula (1) is executed separately for each channel; the illumination component estimates of all pixel locations are combined according to pixel location to obtain the illumination component estimate map of the current concatenation stage. Illumination component estimation diagram Input image with the current concatenation stage The spatial dimensions are consistent with the number of channels.
6. The method as described in claim 5, characterized in that, The reflection component calculation performed in each of the K concatenation stages in S2 includes: for each pixel position According to the formula The input image of the current concatenation stage At pixel position The value of Illumination component estimation diagram with the current series stage At pixel position The value of The pixel position is calculated separately for each channel. Estimated value of reflection component Preset small positive numbers The reflection components are multiplexed as a single scalar across all channels; the estimated reflection components for all pixel locations are combined according to pixel location to obtain the reflection components for the current concatenation stage. The inter-stage transfer of the K cascaded stages in S2 includes: when k is less than K, transferring the reflection component of the current cascaded stage. As the first Input image of each serial stage When k equals K, the reflected component output by the Kth series stage Perform a min-max normalization operation on each channel to normalize the reflection components. The value range of each channel falls within the interval The reflection component after normalization As the initial reflection component.
7. The method as described in claim 6, characterized in that, In multiple closed-loop corrections, "multiple" refers to T cycles, where T is the preset total number of closed-loop corrections; the initial reflection component is denoted as... As the input reflection component of the first closed-loop correction in multiple closed-loop corrections, according to The sequence is from the first closed-loop correction to the Tth closed-loop correction, executing steps S3.1 to S3.5 sequentially in the tth closed-loop correction; when t is less than T, the output reflection component of the tth closed-loop correction is... As the first The input reflection component of the second closed-loop correction; when t equals T, the output reflection component of the Tth closed-loop correction. As the final reflection component; In S3.1, the generation of the defect concern map from the shallow feature map includes: the input reflection component of the t-th closed-loop correction. The shallow feature map is obtained by sequentially inputting M convolutional blocks from the shallow feature extraction part. ; for shallow feature maps Perform max pooling along the channel dimension to obtain the single-channel feature response map. Single-channel characteristic response map At pixel position The value of equal to shallow feature map At pixel position The maximum value among all C channel values; for single-channel characteristic response map By global maximum value and global minimum Perform min-max normalization according to the formula. The range of values obtained is Defect Concern Diagram Defect Concern Diagram At pixel position The value of The larger the value, the higher the pixel position. The higher the priority of a region that is considered a defect candidate for subsequent spatial adaptive Gaussian smoothing scale assignment, the better.
8. The method as described in claim 7, characterized in that, S3.2 divides all pixel locations into multiple attention-guided groups, including: the defect attention map. All pixel positions in the middle according to the value Sort the pixels from largest to smallest to obtain the pixel position sequence. For the value Equal pixel positions are ordered according to the image's preset scanning order, where P is the defect concern image. The total number of pixel positions; denoted as G for the total number of preset attention guidance groups, where G is an integer greater than or equal to 2 and less than or equal to P; the pixel position sequence is divided into G attention guidance groups sequentially according to the index interval: the first... Attention is drawn from the index of the pixel position sequence. to The pixel positions constitute the composition. , This indicates a floor operation; it rounds the pixel position down. The group number of the group to which the attention guide belongs is denoted as , The value of belongs to the set .
9. The method as described in claim 8, characterized in that, In S3.3, the spatially adaptive Gaussian smoothing scale parameter for pixel positions includes: for each pixel position According to formula (2), the pixel position Group number Calculate pixel position Spatial adaptive Gaussian smoothing scaling parameters : ; in, The preset minimum Gaussian smoothing scale parameter and Greater than 0, The preset maximum Gaussian smoothing scale parameter and Greater than From formula (2), the group number The larger the spatial adaptive Gaussian smoothing scale parameter, the better. The larger; combined with S3.2, press Defect Concern Diagram: Sorting and grouping from largest to smallest At pixel position The value of Larger, pixel position Corresponding spatial adaptive Gaussian smoothing scaling parameters The smaller the value, the better; the more it adapts to the spatially adaptive Gaussian smoothing scale parameter across all pixel locations. The spatial adaptive scale map of the t-th closed-loop correction is obtained by combining pixel positions. .
10. The method as described in claim 9, characterized in that, In S3.4, the weight-sharing self-calibration module uses a spatial adaptive scale map as the scale input to perform K cascaded stage reflection component extraction on the input reflection component of the current sub-closed-loop calibration to obtain the output reflection component of the current sub-closed-loop calibration. This includes: extracting the input reflection component of the t-th sub-closed-loop calibration. The input image for the first concatenation stage in S3.4 In S3.4, each concatenated stage reuses the execution methods for illumination component estimation and reflection component calculation in each concatenated stage of S2, including mirror fill and separate execution rules per channel. The difference between S3.4 and S2 is that in S2, all K concatenated stages uniformly use preset initial Gaussian smoothing scale parameters. As the Gaussian smoothing scaling parameter for Gaussian weighted average calculation, the spatial adaptive scaling map is uniformly used in the K cascaded stages of S3.
4. At pixel position The value of As pixel position The Gaussian smoothing scale parameter at the location, in S3.4 each concatenation stage is based on pixel position. Centered on, with side length as A square region of 1 pixel is used as the pixel position. local neighborhood The inter-stage transfer of the K cascaded stages in S3.4 includes: when k is less than K, transferring the reflection component of the current cascaded stage. As the first Input image of each serial stage When k equals K, the reflected component output by the Kth series stage Perform a min-max normalization operation on each channel to normalize the reflection components. The value range of each channel falls within the interval The reflection component after normalization The output reflection component of the current sub-closed-loop correction .