An image processing method and system of an image defogging recognition large model based on power edge side deployment, and an artificial intelligence chip
Patent Information
- Application Number
- CN202611264975.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-20
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]传统的DCP(Dark Channel Prior,暗通道先验)算法在处理电力巡检图像时,恢复出的无雾图像在画面中明度较高的区域容易出现颜色失真、局部过亮或块状伪影,导致视觉效果不自然
[0027] According to the technical solution provided in this disclosure, a binary mask for the sky region is generated by using HSV color space threshold segmentation. This mask is used to set the pixel values of the sky region in the dark channel image to zero, fundamentally eliminating the interference of the sky region on the estimation of atmospheric light values. This solves the problem of color shift and artifacts in the sky region caused by traditional dark channel dehazing algorithms. At the same time, guided filtering maintains the sharpness of the transmittance edge, and combined with the lower limit protection of the transmittance in the sky region, the delicate lines and insulator contours are protected from erosion and breakage during the dehazing process, avoiding the increase in missed detections caused by "dehazing damages the target". In the defect identification stage, a spatial attention mechanism is introduced into the high-level feature map of the CNN model, so that the model focuses on key areas such as insulators and conductors.
Smart Images

Figure CN122929353A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the fields of image processing and artificial intelligence technology, specifically to an image processing method and system based on a large-scale image dehazing recognition model deployed on the power edge side, and an artificial intelligence chip. Background Technology
[0002] In intelligent inspection of power lines, fixed monitoring cameras or drone aerial photography equipment are usually used to acquire images of power lines and equipment, and then deep learning AI models are used to identify potential faults such as insulator defects and conductor breaks.
[0003] Because power transmission lines are often located in harsh environments with high humidity, fog, and haze, the images acquired suffer from problems such as a sharp drop in overall contrast, blurred textures of key targets, and extremely low signal-to-noise ratios for minor defects. To improve the detection accuracy of deep learning AI models in foggy scenes, existing technical solutions typically introduce image dehazing algorithms for preprocessing before inputting the data into the AI model.
[0004] Traditional DCP (Dark Channel Prior) algorithms, when processing power line inspection images, often produce haze-free images with color distortion, localized overexposure, or blocky artifacts in brighter areas, resulting in unnatural visual effects. Furthermore, after dehazing, crucial structural features such as delicate lines and insulator outlines are prone to texture blurring or edge breakage, affecting the recognition accuracy of subsequent deep learning AI detection models. Therefore, there is an urgent need for a power line inspection image dehazing enhancement method that can effectively remove fog interference, maintain natural colors in bright areas, and preserve the integrity of key structural features. Summary of the Invention
[0005] To address the problems in related technologies, this disclosure provides an image processing method and system, and an artificial intelligence chip, based on a large-scale image dehazing recognition model deployed at the power edge.
[0006] In a first aspect, this disclosure provides an image processing method based on a large-scale image dehazing recognition model deployed at the power edge, including:
[0007] Acquire an RGB image of a power line component taken in a foggy environment, convert the RGB image to the HSV color space to obtain the corresponding HSV image, and calculate the dark channel image of the power line component based on the RGB image. The HSV image is binarized according to a preset HSV threshold range for the sky region to generate a sky binary mask. The dark channel image is then corrected using the sky binary mask to obtain a corrected dark channel image. Based on the corrected dark channel image, global atmospheric light values are extracted from the RGB image. The RGB image is then normalized using the global atmospheric light values, and the normalized image is subjected to minimum value filtering to obtain a normalized dark channel image. The initial transmittance of each pixel in the normalized dark channel image is calculated based on an atmospheric scattering model to obtain an initial transmittance map. Using the grayscale image of the RGB image as a guide image, the initial transmittance image is optimized by guided filtering to obtain an optimized transmittance image; based on a preset lower limit threshold for transmittance, pixels belonging to the sky region in the optimized transmittance image are subjected to lower limit protection processing to obtain a target transmittance image; using the target transmittance image and the global atmospheric light value, and based on an atmospheric scattering model, the RGB image is dehazed and restored to obtain a target haze-free image; The target haze-free image is input into the image dehazing recognition large model for multi-level feature extraction, resulting in hierarchical feature maps of multiple levels from low to high. The highest-level hierarchical feature map is adaptively weighted using a spatial attention mechanism. Based on the weighted hierarchical feature map, defect recognition is performed, and the defect recognition result of the power line component is output.
[0008] According to embodiments of this disclosure, the step of correcting the dark channel image using the sky binary mask includes: Traverse each pixel in the dark channel image and obtain the mask value of the sky binary mask at the pixel coordinates of that pixel; If the mask value is the first value, then the pixel value at the pixel coordinate in the dark channel image is set to zero; If the mask value is the second value, then the pixel value at the pixel coordinates in the dark channel image remains unchanged.
[0009] According to embodiments of this disclosure, calculating the dark channel image of the power line assembly based on the RGB image includes: For each pixel in the RGB image, the minimum value among the pixel values in the R, G, and B channels is selected as the grayscale value of the pixel to generate an initial grayscale image. The initial grayscale image is subjected to minimum value filtering of a first preset window to obtain the dark channel image of the power line component.
[0010] According to embodiments of this disclosure, extracting global atmospheric light values from the RGB image based on the corrected dark channel image includes: Select the top K pixels with the highest brightness values in the corrected dark channel image, and calculate the average pixel values of the R, G, and B channels based on the RGB pixel values of the corresponding pixel coordinates of the top K pixels in the RGB image. The global atmospheric light value is obtained based on the average pixel values of each channel.
[0011] According to embodiments of this disclosure: The step of performing channel normalization processing on the RGB image using the global atmospheric light value and performing minimum value filtering on the obtained normalized image includes: dividing the pixel value of the R channel, G channel, and B channel of each pixel in the RGB image by the corresponding R channel, G channel, and B channel component value in the global atmospheric light value to obtain the normalized image; and performing minimum value filtering on the normalized image with a second preset window size to obtain the normalized dark channel image. The step of calculating the initial transmittance of each pixel in the normalized dark channel image based on the atmospheric scattering model to obtain an initial transmittance map includes: obtaining a preset fog retention coefficient; for each pixel in the normalized dark channel image, multiplying the fog retention coefficient with the pixel value of the pixel to obtain a product result; subtracting the product result from a constant 1, and using the difference as the initial transmittance of the pixel, thereby generating the initial transmittance map.
[0012] According to embodiments of this disclosure, the step of using the grayscale image of the RGB image as a guide image to perform guided filtering optimization on the initial transmittance image includes: The RGB image is converted into a grayscale image using a weighted average method, which serves as a grayscale guide image. Construct a guided filtering model with the gray-scale guide image as input and the initial transmittance image as the image to be filtered; The initial transmittance map is filtered using the guided filtering model to obtain the optimized transmittance map; wherein the guided filtering model is configured with a filtering window radius and a regularization parameter.
[0013] According to embodiments of this disclosure, the step of dehazing and restoring the RGB image using the target transmittance map and the global atmospheric light value, based on an atmospheric scattering model, includes: For each pixel in the RGB image, the RGB pixel value of the pixel is subtracted from the global atmospheric light value to obtain the difference; the transmittance value at the position corresponding to the pixel in the target transmittance map is obtained, and the larger value between the transmittance value and a preset lower transmittance threshold is used as the denominator. The difference is divided by the denominator to obtain the quotient; the quotient is added to the global atmospheric light value to obtain the RGB pixel value of the pixel in the fog-free image; The target haze-free image is generated by iterating through all pixels of the RGB image.
[0014] According to embodiments of this disclosure, the method further includes: After dehazing and restoring the RGB image, the obtained target haze-free image is contrast stretched, including: linearly mapping the range of each pixel value in the image to a preset pixel range interval, and using the obtained new haze-free image as the final target haze-free image.
[0015] According to embodiments of this disclosure, the large-scale image dehazing recognition model is obtained through the following steps: Obtain a sample image set containing power line components, wherein the sample image set is labeled with defect category tags; The sample image set is input into an initial convolutional neural network model, and features are extracted from the sample images through convolution operations at different levels in the initial convolutional neural network model to obtain hierarchical feature maps at each level. The spatial attention mechanism is used to adaptively weight the top-level hierarchical feature map, and the predicted defect category is output based on the weighted hierarchical feature map. Calculate the loss value between the predicted defect category and the corresponding defect category label, and update the network parameters through the backpropagation algorithm for iterative training until the loss value converges, thus obtaining the large-scale image dehazing recognition model.
[0016] According to embodiments of this disclosure, the adaptive weighting processing of the highest-level hierarchical feature map using a spatial attention mechanism includes: A convolution operation is performed on the highest-level hierarchical feature map to obtain a single-channel feature map; the single-channel feature map is normalized by an activation function to generate a spatial attention weight map; the spatial attention weight map is multiplied element-wise with the highest-level hierarchical feature map to obtain the weighted hierarchical feature map.
[0017] According to embodiments of this disclosure, the step of performing defect identification based on a weighted, hierarchical feature map and outputting the defect identification result of the power line assembly includes: Global average pooling is performed on the weighted hierarchical feature map to obtain the dimensionality-reduced feature vector; The feature vector is input into a fully connected layer for nonlinear transformation, and the integrated feature is output. The integrated features are input into the Softmax layer to calculate the probability value of the power line component having a defect. The probability value is compared with a preset probability threshold to output the defect identification result.
[0018] According to embodiments of this disclosure, the method further includes: When the defect identification result is no defect, a sleep control command is generated. The sleep control command is used to control the power inspection equipment to enter a low-power sleep mode and stop image acquisition and processing tasks. When an external wake-up signal or inspection cycle trigger signal is detected, the power inspection device is controlled to exit the low-power sleep mode.
[0019] Secondly, this disclosure provides an image processing system based on a large-scale image dehazing recognition model deployed at the power edge, comprising: The preprocessing module is configured to acquire an RGB image of a power line component taken in a foggy environment, convert the RGB image to the HSV color space to obtain a corresponding HSV image, and calculate the dark channel image of the power line component based on the RGB image. The parameter calculation module is configured to binarize the HSV image according to a preset HSV threshold range for the sky region to generate a sky binary mask; use the sky binary mask to correct the dark channel image to obtain a corrected dark channel image; extract global atmospheric light values from the RGB image based on the corrected dark channel image; use the global atmospheric light values to perform channel normalization on the RGB image, and perform minimum value filtering on the obtained normalized image to obtain a normalized dark channel image; calculate the initial transmittance of each pixel in the normalized dark channel image based on an atmospheric scattering model to obtain an initial transmittance map. The dehazing module is configured to use the grayscale image of the RGB image as a guide image to perform guided filtering optimization on the initial transmittance image to obtain an optimized transmittance image; based on a preset lower transmittance threshold, to perform lower limit protection processing on pixels belonging to the sky region in the optimized transmittance image to obtain a target transmittance image; and to use the target transmittance image and the global atmospheric light value, and based on an atmospheric scattering model, to perform dehazing restoration on the RGB image to obtain a target haze-free image. The defect identification module is configured to perform multi-level feature extraction on the target haze-free image input image dehazing identification large model to obtain hierarchical feature maps of multiple levels from low to high; use a spatial attention mechanism to perform adaptive weighting processing on the highest level hierarchical feature map; perform defect identification based on the weighted hierarchical feature map, and output the defect identification result of the power line component.
[0020] According to embodiments of this disclosure, the defogging module is further configured to: For each pixel in the RGB image, the RGB pixel value of the pixel is subtracted from the global atmospheric light value to obtain the difference; the transmittance value at the position corresponding to the pixel in the target transmittance map is obtained, and the larger value between the transmittance value and a preset lower transmittance threshold is used as the denominator. The difference is divided by the denominator to obtain the quotient; the quotient is added to the global atmospheric light value to obtain the RGB pixel value of the pixel in the fog-free image; The target haze-free image is generated by iterating through all pixels of the RGB image.
[0021] According to embodiments of this disclosure, the defogging module is further configured to: The pixel values of the R, G, and B channels of each pixel in the RGB image are divided by the corresponding R, G, and B channel component values in the global atmospheric light value to obtain the normalized image. The normalized image is then subjected to minimum value filtering with a second preset window size to obtain the normalized dark channel image. For each pixel in the normalized dark channel image, a preset fog retention coefficient is multiplied by the pixel value to obtain the product result. The product result is subtracted from the constant 1, and the difference is used as the initial transmittance of the pixel to generate the initial transmittance map.
[0022] According to embodiments of this disclosure, the large-scale image dehazing recognition model is obtained through the following steps: Obtain a sample image set containing power line components, wherein the sample image set is labeled with defect category tags; The sample image set is input into an initial convolutional neural network model, and features are extracted from the sample images through convolution operations at different levels in the initial convolutional neural network model to obtain hierarchical feature maps at each level. The spatial attention mechanism is used to adaptively weight the top-level hierarchical feature map, and the predicted defect category is output based on the weighted hierarchical feature map. Calculate the loss value between the predicted defect category and the corresponding defect category label, and update the network parameters through the backpropagation algorithm for iterative training until the loss value converges, thus obtaining the large-scale image dehazing recognition model.
[0023] According to embodiments of this disclosure, a power consumption control module is further included; the power consumption control module is configured to: When the defect identification result is no defect, a sleep control command is generated. The sleep control command is used to control the power inspection equipment to enter a low-power sleep mode and stop image acquisition and processing tasks. When an external wake-up signal or inspection cycle trigger signal is detected, the power inspection device is controlled to exit the low-power sleep mode.
[0024] Thirdly, embodiments of this disclosure provide an artificial intelligence chip, including an image processing system as described in any of the second aspects; or, including a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the image processing method as described in any of the first aspects.
[0025] Fourthly, this disclosure provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the image processing method as described in any one of the first aspects.
[0026] Fifthly, this disclosure provides a computer program product including computer instructions that, when executed by a processor, implement the image processing method as described in any one of the first aspects.
[0027] According to the technical solution provided in this disclosure, a binary mask for the sky region is generated by using HSV color space threshold segmentation. This mask is used to set the pixel values of the sky region in the dark channel image to zero, fundamentally eliminating the interference of the sky region on the estimation of atmospheric light values. This solves the problem of color shift and artifacts in the sky region caused by traditional dark channel dehazing algorithms. At the same time, guided filtering maintains the sharpness of the transmittance edge, and combined with the lower limit protection of the transmittance in the sky region, the delicate lines and insulator contours are protected from erosion and breakage during the dehazing process, avoiding the increase in missed detections caused by "dehazing damages the target". In the defect identification stage, a spatial attention mechanism is introduced into the high-level feature map of the CNN model, so that the model focuses on key areas such as insulators and conductors.
[0028] This disclosure achieves a dehazing effect for colorless polarization artifacts in the sky region while maintaining the integrity of key structural features, resolving the contradiction between dehazing and target preservation, and further reducing the false detection rate of defect detection.
[0029] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0030] Other features, objects, and advantages of this disclosure will become more apparent from the following detailed description of non-limiting embodiments, taken in conjunction with the accompanying drawings. In the drawings: Figure 1 A flowchart is shown below illustrating an image processing method for a large-scale image dehazing recognition model based on power edge deployment according to an embodiment of the present disclosure; Figure 2A complete operation flowchart of an image processing method for image dehazing recognition based on a large model deployed on the power edge side, according to an embodiment of the present disclosure, is shown. Figure 3 This diagram illustrates the feature output of a large image dehazing recognition model incorporating a spatial attention mechanism in an embodiment of this disclosure. Figure 4 A logical block diagram of an image processing system based on a large-scale image dehazing recognition model deployed at the power edge, according to an embodiment of the present disclosure, is shown. Figure 5 A structural block diagram of an artificial intelligence chip according to an embodiment of the present disclosure is shown; Figure 6 A schematic diagram of the structure of a computer system suitable for implementing an image processing method according to an embodiment of the present disclosure is shown. Detailed Implementation
[0031] In the following, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to enable those skilled in the art to readily implement them. Furthermore, for clarity, portions unrelated to the description of exemplary embodiments have been omitted from the drawings.
[0032] In this disclosure, it should be understood that terms such as “comprising” or “having” are intended to indicate the presence of features, figures, steps, behaviors, components, parts or combinations thereof disclosed in this specification, and are not intended to exclude the possibility of the presence or addition of one or more other features, figures, steps, behaviors, components, parts or combinations thereof.
[0033] It should also be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0034] In this disclosure, any operation involving the acquisition of user information or user data, or the display of user information or user data to others, is an operation authorized or confirmed by the user, or actively selected by the user.
[0035] As mentioned earlier, when processing power line inspection images, traditional dehazing algorithms often result in color distortion, local overbrightness, or block artifacts in areas with high brightness, leading to unnatural visual effects.
[0036] After in-depth research, the inventors discovered that the statistical law upon which the dark channel prior algorithm relies—that "at least one color channel value approaches zero in a local region of a fog-free image"—is not universally applicable in power line inspection scenarios. Power line inspection images typically contain large areas of sky, where pixels have high pixel values in the R, G, and B channels, and no low-value channels exist. Therefore, the basic assumption of the dark channel prior is not satisfied.
[0037] Therefore, when using the traditional dark channel prior algorithm, the dark channel value of the sky region is significantly higher because it does not meet the prior, causing the algorithm to misjudge the region as a dense fog region, which in turn leads to deviations in atmospheric light value estimation and errors in transmittance calculation, ultimately resulting in severe color cast and artifacts in the defogging image.
[0038] This disclosure provides an image processing method for a large-scale image dehazing recognition model deployed at the power edge, including: Acquire an RGB image of a power line component taken in a foggy environment, convert the RGB image to the HSV color space to obtain the corresponding HSV image, and calculate the dark channel image of the power line component based on the RGB image. The HSV image is binarized according to a preset HSV threshold range for the sky region to generate a sky binary mask; the dark channel image is then corrected using the sky binary mask to obtain a corrected dark channel image. Based on the corrected dark channel image, global atmospheric light values are extracted from the RGB image; the global atmospheric light values are used to perform channel normalization on the RGB image, and the obtained normalized image is subjected to minimum value filtering to obtain a normalized dark channel image; the initial transmittance of each pixel in the normalized dark channel image is calculated based on the atmospheric scattering model to obtain an initial transmittance map. Using the grayscale image of the RGB image as a guide image, the initial transmittance image is optimized by guided filtering to obtain an optimized transmittance image; based on a preset lower limit threshold for transmittance, pixels belonging to the sky region in the optimized transmittance image are subjected to lower limit protection processing to obtain a target transmittance image; using the target transmittance image and the global atmospheric light value, and based on an atmospheric scattering model, the RGB image is dehazed and restored to obtain a target haze-free image; The target haze-free image is input into the image dehazing recognition large model for multi-level feature extraction, resulting in hierarchical feature maps of multiple levels from low to high. The highest-level hierarchical feature map is adaptively weighted using a spatial attention mechanism. Based on the weighted hierarchical feature map, defect recognition is performed, and the defect recognition result of the power line component is output.
[0039] This disclosure enables dehazed images to retain key structural details while maintaining visual realism, thereby improving the recall rate of defect detection and reducing the false detection rate.
[0040] Figure 1 A flowchart is shown for an image processing method for a large-scale image dehazing recognition model based on power edge deployment according to an embodiment of the present disclosure.
[0041] like Figure 1 As shown, the method includes the following steps S101~S105: In step S101, an RGB image of a power line component taken in a foggy environment is acquired, the RGB image is converted to the HSV color space to obtain the corresponding HSV image, and the dark channel image of the power line component is calculated based on the RGB image.
[0042] In this disclosure, the power line component is any power line component in a power line inspection scenario, such as an insulator, conductor, etc. The RGB image is an image of the power line component captured in the power line inspection scenario under foggy conditions, for example, through a camera.
[0043] Specifically, converting the RGB image to the HSV color space to obtain the corresponding HSV image includes: For each pixel in the RGB image, perform the following calculations: ; ; ; Among them, R G B The coordinates of any pixel in the RGB image are respectively The pixel values at a given location in the red, green, and blue channels, H S V The pixel coordinates of the HSV image are respectively Hue, saturation, and brightness; This represents the difference between the maximum and minimum pixel values in the RGB three channels; when the calculated value is... When <0, let To ensure The range of values for is [ ).
[0044] According to an embodiment of this disclosure, calculating the dark channel image of the power line assembly based on the RGB image includes: for each pixel in the RGB image, selecting the minimum value from the pixel values in the R, G, and B channels as the grayscale value of the pixel to generate an initial grayscale image; and performing minimum value filtering of the initial grayscale image within a first preset window to obtain the dark channel image of the power line assembly.
[0045] Specifically, the pixel coordinates are calculated using the following formula. Dark channel value at the location : ; in, For any pixel coordinate A filter window centered on a pre-defined window size; For the filtering window Any pixel coordinate within; The pixel coordinates within the filtering window The c-channel pixel value. The preset window can be set according to user needs; optionally, the preset window size is 15×15 pixels, and the step size is 1 pixel.
[0046] After research, the inventors discovered that the pixels in the sky area of power inspection images have the following distribution characteristics in the HSV color space: the hue H value of blue sky is usually in the range of 100~125, the saturation S value is between 50~150, and the brightness V value is relatively high; the H value of gray or cloudy sky has a wide distribution range, the S value is low, and the V value is also relatively high.
[0047] Accordingly, in step S102, the HSV image is binarized according to a preset HSV threshold range for the sky region to generate a sky binary mask; the dark channel image is corrected using the sky binary mask to obtain a corrected dark channel image; global atmospheric light values are extracted from the RGB image based on the corrected dark channel image; the RGB image is channel normalized using the global atmospheric light values, and the obtained normalized image is subjected to minimum value filtering to obtain a normalized dark channel image; the initial transmittance of each pixel in the normalized dark channel image is calculated based on an atmospheric scattering model to obtain an initial transmittance map.
[0048] This disclosure specifies the following two sets of HSV threshold ranges for sky region identification: For a bright blue sky: =100, =125; =50, =150; =200, =255.
[0049] For gray / cloudy skies: =0, =180; =0, =50; =200, =255.
[0050] Specifically, if the pixel value at any pixel coordinate in the HSV image simultaneously satisfies either of the following two sets of conditions, then the mask value at that pixel coordinate in the sky binary mask is set to 1 (sky); otherwise, the mask value is set to 0 (non-sky). The logical judgment formula for the sky binary mask is as follows: ; in, For any pixel coordinate The mask value at that location.
[0051] According to an embodiment of this disclosure, the step of correcting the dark channel image using the sky binary mask includes: traversing each pixel in the dark channel image and obtaining the mask value of the sky binary mask at the pixel coordinates of the pixel; If the mask value is the first value, then the pixel value at the pixel coordinate in the dark channel image is set to zero; If the mask value is the second value, then the pixel value at the pixel coordinates in the dark channel image remains unchanged.
[0052] Specifically, the dark channel image is corrected using the following formula: ; in, pixel coordinates The corrected dark channel value at that location.
[0053] According to an embodiment of this disclosure, extracting global atmospheric light value from the RGB image based on the corrected dark channel image includes: selecting the top K pixels with the highest brightness values in the corrected dark channel image; calculating the average pixel values of the R channel, G channel, and B channel based on the RGB pixel values of the corresponding pixel coordinates of the top K pixels in the RGB image; and obtaining the global atmospheric light value based on the average pixel values of each channel.
[0054] Specifically, after obtaining the corrected dark channel image, the pixel coordinates of the top K pixels with the highest brightness values are selected from the corrected dark channel image. Assuming the number of non-zero pixels in the corrected dark channel image is N, then... The set is obtained by combining the pixel coordinates of the first K pixels with the highest brightness. ,in, , which is the set of coordinates of the first K pixels in the corrected dark channel image after sorting the pixel values from largest to smallest.
[0055] Then, the K pixel coordinates are found in the RGB image of the power line component initially acquired, and the average pixel value of the pixels at these K pixel coordinates in the RGB three channels is calculated as the corresponding component in the final global atmospheric light value. This is achieved through the following formula: ; in, K represents the global atmospheric light value. The number of pixels in the set. RGB image in pixel coordinates The pixel value of the c-th channel at the given location, where c is the color channel index.
[0056] As can be seen, this disclosure introduces a sky binary mask to eliminate the interference in the sky region from the dark channel image, fundamentally changing the candidate region range when selecting the pixel with the highest brightness value.
[0057] According to embodiments of this disclosure, the step of performing channel normalization processing on the RGB image using the global atmospheric light value and performing minimum value filtering on the obtained normalized image includes: dividing the pixel values of the R, G, and B channels of each pixel in the RGB image by the corresponding R, G, and B channel component values in the global atmospheric light value to obtain the normalized image; and performing minimum value filtering on the normalized image using a second preset window to obtain the normalized dark channel image. The second preset window can be customized according to user needs.
[0058] Specifically, the normalized RGB image is obtained using the following formula: ; in, To normalize the image in pixel coordinates The normalized value of the c-th channel.
[0059] The normalized dark channel image is obtained using the following formula: ; in, In the normalized dark channel image, at pixel coordinates Normalized dark channel value at the location; For any pixel coordinate A filter window centered on a second preset window size; For the filtering window Any pixel coordinate within.
[0060] According to an embodiment of this disclosure, the step of calculating the initial transmittance of each pixel in the normalized dark channel image based on an atmospheric scattering model to obtain an initial transmittance map includes: obtaining a preset fog retention coefficient; for each pixel in the normalized dark channel image, multiplying the fog retention coefficient with the pixel value of the pixel to obtain a product result; subtracting the product result from a constant 1, and using the difference as the initial transmittance of the pixel, thereby generating the initial transmittance map.
[0061] Specifically, the initial transmittance map is achieved using the following formula: ; in, The fog retention coefficient typically ranges from 0.85 to 0.95. The closer the value is to 1, the more thorough the defogging. The smaller the size, the more fog is retained; For any pixel coordinate in the initial transmittance map The transmittance value.
[0062] In step S103, the grayscale image of the RGB image is used as a guide image to perform guided filtering optimization on the initial transmittance image to obtain an optimized transmittance image; based on a preset lower limit threshold for transmittance, pixels belonging to the sky region in the optimized transmittance image are subjected to lower limit protection processing to obtain a target transmittance image; using the target transmittance image and the global atmospheric light value, and based on the atmospheric scattering model, the RGB image is dehazed and restored to obtain a target haze-free image.
[0063] According to embodiments of this disclosure, the step of using the grayscale image of the RGB image as a guide image to perform guided filtering optimization on the initial transmittance image includes: The RGB image is converted into a grayscale image using a weighted average method, which serves as a grayscale guide image. A guided filtering model is constructed with the grayscale guide image as input and the initial transmittance image as the image to be filtered. The guided filtering model is used to perform filtering operations on the initial transmittance image to obtain the optimized transmittance image. The guided filtering model is configured with a filtering window radius and regularization parameters.
[0064] The grayscale guide image is obtained using the following formula: ; The initial transmittance map is optimized using the following formula:
[0065] in, Guided filtering model The radius of the filtering window determines the position of any pixel coordinate. The local neighborhood centered on the image, ranging from 5 to 10 pixels. This is the regularization parameter, ranging from 0.01 to 0.1. To optimize the coordinates of any pixel in the transmittance map The transmittance value.
[0066] According to embodiments of this disclosure, the step of performing lower limit protection processing on pixels belonging to the sky region in the optimized transmittance map based on a preset lower transmittance threshold includes: setting a lower transmittance threshold; and correcting the optimized transmittance map using the lower transmittance threshold to obtain a target transmittance map. The target transmittance map is specifically implemented using the following formula: ; in, For any pixel coordinate in the target transmittance map The transmittance value at that location, the This is a preset lower threshold for transmittance. When the pixel coordinates... When the pixel at that location belongs to the sky region, The value of is 1, when the pixel coordinates When the pixel at that location belongs to a non-sky region, The value of is 0.
[0067] In this disclosure, a transmittance lower limit protection mechanism is introduced for the sky area: that is, the transmittance of the sky pixels is forced to be no less than the set minimum threshold to prevent excessive dehazing; at the same time, the original transmittance value of the pixels in the non-sky area is maintained to ensure that the restoration effect of the ground scene is not affected.
[0068] According to embodiments of this disclosure, the step of using the target transmittance map and the global atmospheric light value to perform dehazing restoration on the RGB image based on an atmospheric scattering model includes: for each pixel in the RGB image, subtracting the global atmospheric light value from the RGB pixel value of the pixel to obtain a difference; obtaining the transmittance value at the position corresponding to the pixel in the target transmittance map, using the larger value between the transmittance value and a preset lower transmittance threshold as the denominator, dividing the difference by the denominator to obtain a quotient; adding the quotient to the global atmospheric light value to obtain the RGB pixel value of the pixel in the haze-free image; and traversing all pixels of the RGB image to generate the target haze-free image.
[0069] Specifically, the RGB image is dehazed and restored based on the atmospheric scattering model using the following formula: ; in, The preset lower limit threshold for transmittance can be set to 0.1 based on prior knowledge to avoid noise amplification caused by an excessively small denominator. The target image is a fog-free image; The RGB image in pixel coordinates The pixel value of the c-th channel.
[0070] According to embodiments of this disclosure, after dehazing and restoring the RGB image, the obtained target haze-free image is contrast-stretched, including: linearly mapping the range of each pixel value in the image to a preset pixel range interval, and using the obtained new haze-free image as the final target haze-free image.
[0071] That is, after dehazing and restoring the RGB image, some pixel values in the restored target hazy image may exceed the standard display range or have a relatively concentrated distribution range. Therefore, the range of each pixel value in the target hazy image can be linearly mapped to the normal pixel range range [0, 255], so that the final output image can make full use of the complete dynamic range, improve the overall contrast and visual clarity, and use the new hazy image as the final target hazy image.
[0072] In step S104, the target haze-free image input image dehazing recognition large model is subjected to multi-level feature extraction to obtain hierarchical feature maps of multiple levels from low to high; the highest level hierarchical feature map is adaptively weighted using a spatial attention mechanism; and defect recognition is performed based on the weighted hierarchical feature map to output the defect recognition result of the power line component.
[0073] This disclosure identifies and eliminates interference from the sky region on the prior dehazing of the dark channel, so that the restored image retains natural colors, no color cast, and no block artifacts in the sky region. At the same time, it uses guided filtering to optimize the transmittance edge preservation, so that the fine lines and insulator outlines are clearly distinguishable after dehazing and do not become broken or blurred.
[0074] The image dehazing recognition large model is obtained through the following steps: A sample image set containing power line components is obtained, and the sample image set is labeled with defect category tags. The sample image set is input into an initial convolutional neural network model, and features are extracted from the sample images through convolution operations at different levels in the initial convolutional neural network model to obtain hierarchical feature maps at each level. The highest-level hierarchical feature map is adaptively weighted using a spatial attention mechanism, and the predicted defect category is output based on the weighted hierarchical feature map. The loss value between the predicted defect category and the corresponding defect category tag is calculated, and the network parameters are updated through a backpropagation algorithm for iterative training until the loss value converges, thus obtaining the large-scale image dehazing recognition model.
[0075] In this disclosure, a large model refers to a deep learning model with a large parameter scale and trained on massive amounts of data. It can efficiently extract and represent the spatial structure and semantic information of data through local perception and layer-by-layer feature abstraction, thereby possessing the generalization ability of image dehazing and defect recognition.
[0076] According to embodiments of this disclosure, the adaptive weighting processing of the highest-level hierarchical feature map using a spatial attention mechanism includes: performing a convolution operation on the highest-level hierarchical feature map to obtain a single-channel feature map; normalizing the single-channel feature map using an activation function to generate a spatial attention weight map; and multiplying the spatial attention weight map element-wise with the highest-level hierarchical feature map to obtain the weighted hierarchical feature map.
[0077] According to embodiments of this disclosure, the step of performing defect identification based on a weighted hierarchical feature map and outputting the defect identification result of the power line component includes: performing global average pooling on the weighted hierarchical feature map to obtain a dimensionality-reduced feature vector; inputting the feature vector into a fully connected layer for nonlinear transformation to output an integrated feature; inputting the integrated feature into a Softmax layer to calculate the probability value of the power line component having a defect; comparing the probability value with a preset probability threshold to output the defect identification result.
[0078] This disclosure also introduces a spatial attention mechanism into the high-level feature maps of CNNs, enabling the large image dehazing recognition model to focus on key regions to reduce background interference. This allows the dehazed image to retain key structural details while maintaining visual realism, thereby improving the recall rate of defect detection and reducing the false detection rate.
[0079] Figure 2 A complete operation flowchart of an image processing method for image dehazing recognition large model based on power edge deployment according to an embodiment of the present disclosure is shown.
[0080] like Figure 2As shown, the complete process includes the entire process from environmental parameter estimation, image dehazing and restoration to defect identification.
[0081] First, dark channel images of power line components are calculated, corrected using a sky binary mask, and global atmospheric light values are estimated in non-sky regions.
[0082] Then, using an atmospheric scattering physics model, combined with global atmospheric light values and an optimized transmittance map, the radiance image of the fog-free scene is derived and recovered. To address the potential issue of insufficient dynamic range in the restored image, contrast stretching is performed to further enhance image clarity and detail visibility, outputting the final enhanced image for subsequent recognition.
[0083] The enhanced image is then input into a large-scale image dehazing and recognition model for intelligent analysis. A backbone network consisting of four consecutive convolutional blocks extracts hierarchical feature maps layer by layer through convolution, normalization, activation, and pooling downsampling operations, abstracting from basic texture to high-level semantics. A spatial attention mechanism is introduced into the highest-level hierarchical feature map to generate an attention weight map, which is then multiplied element-wise with the feature map to adaptively highlight key defect regions and suppress background noise. Finally, the weighted feature map is compressed into a one-dimensional feature vector through global average pooling. This vector is then nonlinearly mapped and integrated through a fully connected layer, and the probability of belonging to each defect category is calculated using the Softmax function, ultimately outputting the defect recognition result.
[0084] Finally, based on the defect identification results, the system enters the corresponding operating mode, including sleep mode, waiting for the next wake-up, or maintaining normal inspection state, in order to achieve low-power operation.
[0085] The training and application of the large-scale image dehazing recognition model will be described below using a specific embodiment.
[0086] In this embodiment, a convolutional neural network (CNN) is first trained using a sample image set containing power line components to obtain pre-trained model parameters. The sample image set has been pre-labeled with defect category labels.
[0087] The specific training process is as follows: The sample image set is input into the convolutional neural network model for iterative training. The feature extraction backbone of the model consists of four consecutive convolutional blocks. Each convolutional block performs two convolutions, normalization, activation, and downsampling to progressively extract and compress features.
[0088] Furthermore, in the convolution calculation, each convolutional layer uses a 3×3 kernel, and its calculation follows the formula: ,in, The input features are the first layer, which is the input haze-free image, and the subsequent layers are the output feature maps of the previous layer. For convolution operations; W is the learnable weight tensor; b is the bias vector; Z is the feature map of the convolution output. Then, it is activated by the ReLU function. Introduce nonlinearity.
[0089] Then, normalization calculations are performed on the convolution output feature maps. Each pixel in the image undergoes normalization processing, using the following formula: ;in, The original pixel value at any location in the feature map. This is the average of all pixel values in the current batch. For variance, It is a very small constant. and This is a learnable offset factor, which accelerates training convergence and improves model stability.
[0090] Finally, pooling downsampling is performed: at the end of each convolutional block, 2×2 max pooling is used for dimensionality reduction, as shown in the following formula: Where A is the feature map. These represent the spatial coordinates of the output feature map, where k is the channel index. For the pooled window index, S=2 in this embodiment. , This is the local traversal index within the pooling window, with values ranging from 0 to S-1. This operation is used to retain the most salient features and compress the data volume.
[0091] During training, the loss value between the predicted category and the true defect category label is calculated, and the network parameters W, b, and c are updated using the backpropagation algorithm. , This continues until the loss value converges, thus obtaining the large-scale image dehazing recognition model.
[0092] During the forward propagation of the model, the backbone network of the large image dehazing recognition model extracts hierarchical feature maps at different levels layer by layer. This embodiment further utilizes a spatial attention mechanism to enhance the highest level and finally outputs the defect classification result. The highest level is typically a high-level semantic feature; for example, assuming the model has four levels, from lowest to highest (levels 1-4), then level 4 is the highest level.
[0093] Specifically, for the hierarchical feature map of the highest level. First, spatial information is aggregated through convolution operations to generate a single-channel spatial attention weight map. This process follows the formula: ;in, The input is a hierarchical feature map. This is a convolution operation using a 1×1 convolution kernel, used to compress the channel dimension; As an activation function, it maps the output values to the interval (0, 1). This is a spatial attention weight map, whose spatial size is... Maintain consistency.
[0094] Figure 3 This diagram illustrates the feature output of a large image dehazing recognition model that incorporates a spatial attention mechanism in an embodiment of this disclosure.
[0095] like Figure 3 As shown, the spatial attention weight map is multiplied element-wise with the hierarchical feature map extracted by the large-scale image dehazing recognition model to achieve adaptive weighting of features, highlighting defective areas and suppressing background noise. The calculation formula is as follows: ;in, This represents element-wise multiplication. This is the weighted, hierarchical feature map.
[0096] To convert the weighted hierarchical feature maps into class prediction vectors, global average pooling is first performed to reduce the dimensionality of the two-dimensional feature map for each channel to a single scalar value. For the k-th channel, the calculation formula is as follows: ;in, and These are the height and width of the weighted hierarchical feature map, respectively; For feature map In spatial location and the pixel value of the k-th channel; It is the k-th element in the aggregated global feature vector.
[0097] Next, a fully connected layer with Dropout regularization is introduced to perform nonlinear transformation and integration of the global feature vectors to enhance the model's generalization ability. The calculation process is as follows: Where V is composed of all The global feature vector formed by this process; and These are the weight matrix and bias vector of the fully connected layer, respectively; ReLU is the rectified linear activation function. This represents the output characteristics of the fully connected layer.
[0098] Finally, the output features are transformed into probability distributions for each defect category using a Softmax layer, as shown in the following formula: ;in, , represents the raw scores of the model output belonging to the 'no defects' class and the 'defective' class, respectively; P represents the probability of predicting a certain class.
[0099] According to an embodiment of this disclosure, the method further includes: when the defect identification result is no defect, generating a sleep control command, the sleep control command being used to control the power inspection equipment to enter a low-power sleep mode and stop image acquisition and processing tasks; when an external wake-up signal or an inspection cycle trigger signal is detected, controlling the power inspection equipment to exit the low-power sleep mode.
[0100] When the current image is determined to be normal, this disclosure can trigger the device to enter a low-power sleep mode until the next inspection cycle or an external wake-up signal is triggered, which effectively reduces the energy consumption of large models when deployed on edge devices and is suitable for power inspection equipment that is deployed in the external environment for a long time.
[0101] Figure 4 A logical block diagram of an image processing system for large-scale image dehazing recognition based on a power edge deployment according to an embodiment of the present disclosure is shown. This device can be implemented as part or all of an electronic device through software, hardware, or a combination of both.
[0102] like Figure 4 As shown, the image dehazing enhancement and recognition device 400 includes a preprocessing module 410, a parameter calculation module 420, a dehazing processing module 430, and a defect recognition module 440.
[0103] The preprocessing module 410 is configured to acquire an RGB image of a power line component taken in a foggy environment, convert the RGB image to the HSV color space to obtain a corresponding HSV image, and calculate the dark channel image of the power line component based on the RGB image. The parameter calculation module 420 is configured to: binarize the HSV image according to a preset HSV threshold range for the sky region to generate a sky binary mask; correct the dark channel image using the sky binary mask to obtain a corrected dark channel image; extract global atmospheric light values from the RGB image based on the corrected dark channel image; perform channel normalization on the RGB image using the global atmospheric light values, and perform minimum value filtering on the obtained normalized image to obtain a normalized dark channel image; and calculate the initial transmittance of each pixel in the normalized dark channel image based on an atmospheric scattering model to obtain an initial transmittance map. The dehazing module 430 is configured to use the grayscale image of the RGB image as a guide image to perform guided filtering optimization on the initial transmittance image to obtain an optimized transmittance image; based on a preset lower transmittance threshold, to perform lower limit protection processing on pixels belonging to the sky region in the optimized transmittance image to obtain a target transmittance image; and to use the target transmittance image and the global atmospheric light value, and based on an atmospheric scattering model, to perform dehazing restoration on the RGB image to obtain a target haze-free image. The defect identification module 440 is configured to perform multi-level feature extraction on the target haze-free image input image dehazing identification large model to obtain hierarchical feature maps of multiple levels from low to high; use a spatial attention mechanism to perform adaptive weighting processing on the highest level hierarchical feature map; perform defect identification based on the weighted hierarchical feature map, and output the defect identification result of the power line component.
[0104] According to an embodiment of this disclosure, the dehazing module 430 is further configured to: for each pixel in the RGB image, subtract the global atmospheric light value from the RGB pixel value of the pixel to obtain a difference; obtain the transmittance value at the position corresponding to the pixel in the target transmittance map, use the larger value between the transmittance value and a preset lower transmittance threshold as the denominator, divide the difference by the denominator to obtain a quotient; add the quotient to the global atmospheric light value to obtain the RGB pixel value of the pixel in the haze-free image; and traverse all pixels of the RGB image to generate the target haze-free image.
[0105] According to an embodiment of this disclosure, the dehazing module 430 is further configured to: divide the pixel values of the R, G, and B channels of each pixel in the RGB image by the corresponding R, G, and B channel component values in the global atmospheric light value to obtain the normalized image; perform minimum value filtering of the normalized image with a second preset window size to obtain the normalized dark channel image; for each pixel in the normalized dark channel image, multiply the preset fog retention coefficient with the pixel value of the pixel to obtain the product result; subtract the product result from the constant 1, and use the resulting difference as the initial transmittance of the pixel to generate the initial transmittance map.
[0106] According to embodiments of this disclosure, the large-scale image dehazing recognition model is obtained through the following steps: Obtain a sample image set containing power line components, wherein the sample image set is labeled with defect category tags; The sample image set is input into an initial convolutional neural network model, and features are extracted from the sample images through convolution operations at different levels in the initial convolutional neural network model to obtain hierarchical feature maps at each level. The spatial attention mechanism is used to adaptively weight the top-level hierarchical feature map, and the predicted defect category is output based on the weighted hierarchical feature map. Calculate the loss value between the predicted defect category and the corresponding defect category label, and update the network parameters through the backpropagation algorithm for iterative training until the loss value converges, thus obtaining the large-scale image dehazing recognition model.
[0107] According to an embodiment of this disclosure, the image dehazing enhancement and recognition device further includes a power consumption control module; the power consumption control module is configured to: generate a sleep control command when the defect recognition result is no defect, the sleep control command being used to control the power inspection equipment to enter a low-power sleep mode and stop image acquisition and processing tasks; and control the power inspection equipment to exit the low-power sleep mode when an external wake-up signal or inspection cycle trigger signal is detected.
[0108] This disclosure also discloses an artificial intelligence chip. Figure 5 A structural block diagram of an artificial intelligence chip according to an embodiment of the present disclosure is shown.
[0109] In this disclosure, the artificial intelligence chip includes the image processing system of embodiments of this disclosure.
[0110] Or, such as Figure 5 As shown, the artificial intelligence chip includes a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement an image processing method according to an embodiment of the present disclosure.
[0111] Specifically, the artificial intelligence chip, or AI chip, refers to a dedicated processor chip designed for artificial intelligence computing tasks. The AI chip is deployed at the edge of a power line inspection scenario to perform the image processing method described in any embodiment of this disclosure on power line component images acquired at the edge.
[0112] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing an image processing method according to an embodiment of the present disclosure is shown.
[0113] like Figure 6 As shown, the computer system includes a processing unit that can execute various methods described above based on a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM). The RAM also stores various programs and data required for the operation of the computer system. The processing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0114] The following components are connected to the I / O interface: input sections including keyboards, mice, etc.; output sections including cathode ray tubes (CRTs), liquid crystal displays (LCDs), and speakers; storage sections including hard disks; and communication sections including network interface cards such as LAN cards and modems. The communication section performs communication processes via a network such as the Internet. Drives are also connected to the I / O interface as needed. Removable media, such as disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on the drive as needed so that computer programs read from them can be installed into the storage section as required. The processing unit can be implemented as a CPU, GPU, TPU, FPGA, NPU, etc.
[0115] In particular, according to embodiments of this disclosure, the methods described above can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing the methods described above. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium.
[0116] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0117] The units or modules described in the embodiments of this disclosure can be implemented in software or programmable hardware. The described units or modules can also be located in a processor, and the names of these units or modules do not necessarily constitute a limitation on the unit or module itself.
[0118] In another aspect, this disclosure also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the electronic device or computer system described above; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to perform the methods described in this disclosure.
[0119] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
Claims
1. An image processing method for a large-scale image dehazing recognition model deployed at the power edge, characterized in that, include: Acquire an RGB image of a power line component taken in a foggy environment, convert the RGB image to the HSV color space to obtain the corresponding HSV image, and calculate the dark channel image of the power line component based on the RGB image. The HSV image is binarized according to a preset HSV threshold range for the sky region to generate a sky binary mask. The dark channel image is corrected using the aforementioned sky binary mask to obtain the corrected dark channel image; Based on the corrected dark channel image, extract the global atmospheric light value from the RGB image; The RGB image is normalized using the global atmospheric light value, and the normalized image is then filtered by minimum value to obtain a normalized dark channel image. The initial transmittance of each pixel in the normalized dark channel image is calculated based on the atmospheric scattering model to obtain an initial transmittance map. Using the grayscale image of the RGB image as a guide image, the initial transmittance image is optimized by guided filtering to obtain an optimized transmittance image; Based on a preset lower limit threshold for transmittance, pixels belonging to the sky region in the optimized transmittance map are subjected to lower limit protection processing to obtain a target transmittance map; using the target transmittance map and the global atmospheric light value, and based on the atmospheric scattering model, the RGB image is dehazed and restored to obtain a target haze-free image; The target haze-free image is input into the image dehazing recognition large model for multi-level feature extraction, resulting in hierarchical feature maps of multiple levels from low to high; the highest-level hierarchical feature map is adaptively weighted using a spatial attention mechanism. Defect identification is performed based on the weighted hierarchical feature map, and the defect identification results of the power line components are output.
2. The image processing method according to claim 1, characterized in that, The step of correcting the dark channel image using the sky binary mask includes: Traverse each pixel in the dark channel image and obtain the mask value of the sky binary mask at the pixel coordinates of that pixel; If the mask value is the first value, then the pixel value at the pixel coordinate in the dark channel image is set to zero; If the mask value is the second value, then the pixel value at the pixel coordinates in the dark channel image remains unchanged.
3. The image processing method according to claim 1, characterized in that, The step of calculating the dark channel image of the power line assembly based on the RGB image includes: For each pixel in the RGB image, the minimum value among the pixel values in the R, G, and B channels is selected as the grayscale value of the pixel to generate an initial grayscale image. The initial grayscale image is subjected to minimum value filtering of a first preset window to obtain the dark channel image of the power line component.
4. The image processing method according to claim 1, characterized in that, The step of extracting global atmospheric light values from the RGB image based on the corrected dark channel image includes: Select the top K pixels with the highest brightness values in the corrected dark channel image, and calculate the average pixel values of the R, G, and B channels based on the RGB pixel values of the corresponding pixel coordinates of the top K pixels in the RGB image. The global atmospheric light value is obtained based on the average pixel values of each channel.
5. The image processing method according to claim 1, characterized in that: The step of performing channel normalization processing on the RGB image using the global atmospheric light value and performing minimum value filtering on the obtained normalized image includes: dividing the pixel value of the R channel, G channel, and B channel of each pixel in the RGB image by the corresponding R channel, G channel, and B channel component value in the global atmospheric light value to obtain the normalized image; and performing minimum value filtering on the normalized image with a second preset window size to obtain the normalized dark channel image. The step of calculating the initial transmittance of each pixel in the normalized dark channel image based on the atmospheric scattering model to obtain an initial transmittance map includes: obtaining a preset fog retention coefficient; for each pixel in the normalized dark channel image, multiplying the fog retention coefficient with the pixel value of the pixel to obtain a product result; subtracting the product result from a constant 1, and using the difference as the initial transmittance of the pixel, thereby generating the initial transmittance map.
6. The image processing method according to claim 1, characterized in that, The step of using the grayscale image of the RGB image as a guide image to perform guided filtering optimization on the initial transmittance image includes: The RGB image is converted into a grayscale image using a weighted average method, which serves as a grayscale guide image. Construct a guided filtering model with the gray-scale guide image as input and the initial transmittance image as the image to be filtered; The initial transmittance map is filtered using the guided filtering model to obtain the optimized transmittance map; wherein the guided filtering model is configured with a filtering window radius and a regularization parameter.
7. The image processing method according to claim 1, characterized in that, The step of using the target transmittance map and the global atmospheric light value to perform dehazing and restoration of the RGB image based on an atmospheric scattering model includes: For each pixel in the RGB image, the RGB pixel value of the pixel is subtracted from the global atmospheric light value to obtain the difference; the transmittance value at the position corresponding to the pixel in the target transmittance map is obtained, and the larger value between the transmittance value and a preset lower transmittance threshold is used as the denominator. The difference is divided by the denominator to obtain the quotient; the quotient is added to the global atmospheric light value to obtain the RGB pixel value of the pixel in the fog-free image; The target haze-free image is generated by iterating through all pixels of the RGB image.
8. The image processing method according to claim 7, characterized in that, The method further includes: After dehazing and restoring the RGB image, the obtained target haze-free image is contrast stretched, including: linearly mapping the range of each pixel value in the image to a preset pixel range interval, and using the obtained new haze-free image as the final target haze-free image.
9. The image processing method according to claim 1, characterized in that, The large-scale image dehazing recognition model is obtained through the following steps: Obtain a sample image set containing power line components, wherein the sample image set is labeled with defect category tags; The sample image set is input into an initial convolutional neural network model, and features are extracted from the sample images through convolution operations at different levels in the initial convolutional neural network model to obtain hierarchical feature maps at each level. The spatial attention mechanism is used to adaptively weight the top-level hierarchical feature map, and the predicted defect category is output based on the weighted hierarchical feature map. Calculate the loss value between the predicted defect category and the corresponding defect category label, and update the network parameters through the backpropagation algorithm for iterative training until the loss value converges, thus obtaining the large-scale image dehazing recognition model.
10. The image processing method according to claim 1, characterized in that, The adaptive weighting processing of the highest-level hierarchical feature map using spatial attention mechanism includes: A convolution operation is performed on the highest-level hierarchical feature map to obtain a single-channel feature map; the single-channel feature map is normalized by an activation function to generate a spatial attention weight map; the spatial attention weight map is multiplied element-wise with the highest-level hierarchical feature map to obtain the weighted hierarchical feature map.
11. The image processing method according to claim 1, characterized in that, The defect identification based on the weighted hierarchical feature map, and the output of the defect identification results for the power line components, include: Global average pooling is performed on the weighted hierarchical feature map to obtain the dimensionality-reduced feature vector; The feature vector is input into a fully connected layer for nonlinear transformation, and the integrated feature is output. The integrated features are input into the Softmax layer to calculate the probability value of the power line component having a defect. The probability value is compared with a preset probability threshold to output the defect identification result.
12. The image processing method according to claim 1, characterized in that, The method further includes: When the defect identification result is no defect, a sleep control command is generated. The sleep control command is used to control the power inspection equipment to enter a low-power sleep mode and stop image acquisition and processing tasks. When an external wake-up signal or inspection cycle trigger signal is detected, the power inspection device is controlled to exit the low-power sleep mode.
13. An image processing system for large-scale image dehazing recognition based on power edge deployment, characterized in that, include: The preprocessing module is configured to acquire an RGB image of a power line component taken in a foggy environment, convert the RGB image to the HSV color space to obtain a corresponding HSV image, and calculate the dark channel image of the power line component based on the RGB image. The parameter calculation module is configured to perform binarization processing on the HSV image according to a preset HSV threshold range for the sky region, and generate a sky binary mask. The dark channel image is corrected using the aforementioned sky binary mask to obtain the corrected dark channel image; Based on the corrected dark channel image, extract the global atmospheric light value from the RGB image; The RGB image is normalized using the global atmospheric light value, and the normalized image is then filtered by minimum value to obtain a normalized dark channel image. The initial transmittance of each pixel in the normalized dark channel image is calculated based on the atmospheric scattering model to obtain the initial transmittance map. The dehazing module is configured to use the grayscale image of the RGB image as a guide image to perform guided filtering optimization on the initial transmittance image to obtain an optimized transmittance image. Based on a preset lower limit threshold for transmittance, pixels belonging to the sky region in the optimized transmittance map are subjected to lower limit protection processing to obtain a target transmittance map; using the target transmittance map and the global atmospheric light value, and based on the atmospheric scattering model, the RGB image is dehazed and restored to obtain a target haze-free image; The defect identification module is configured to perform multi-level feature extraction on the target haze-free image input image dehazing identification large model to obtain hierarchical feature maps of multiple levels from low to high; and to use a spatial attention mechanism to perform adaptive weighting processing on the highest level hierarchical feature map. Defect identification is performed based on the weighted hierarchical feature map, and the defect identification results of the power line components are output.
14. The image processing system according to claim 13, characterized in that, The defogging module is further configured to: For each pixel in the RGB image, the RGB pixel value of the pixel is subtracted from the global atmospheric light value to obtain the difference; the transmittance value at the position corresponding to the pixel in the target transmittance map is obtained, and the larger value between the transmittance value and a preset lower transmittance threshold is used as the denominator. The difference is divided by the denominator to obtain the quotient; the quotient is added to the global atmospheric light value to obtain the RGB pixel value of the pixel in the fog-free image; The target haze-free image is generated by iterating through all pixels of the RGB image.
15. The image processing system according to claim 13, characterized in that, The defogging module is further configured to: The normalized image is obtained by dividing the pixel values of the R, G, and B channels of each pixel in the RGB image by the corresponding R, G, and B channel component values in the global atmospheric light value. The normalized image is subjected to minimum value filtering of a second preset window size to obtain the normalized dark channel image; For each pixel in the normalized dark channel image, a preset fog preservation coefficient is multiplied by the pixel value of the pixel to obtain the product result; The initial transmittance map is generated by subtracting the product result from the constant 1 and using the difference as the initial transmittance of the pixel.
16. The image processing system according to claim 13, characterized in that, The large-scale image dehazing recognition model is obtained through the following steps: Obtain a sample image set containing power line components, wherein the sample image set is labeled with defect category tags; The sample image set is input into an initial convolutional neural network model, and features are extracted from the sample images through convolution operations at different levels in the initial convolutional neural network model to obtain hierarchical feature maps at each level. The spatial attention mechanism is used to adaptively weight the top-level hierarchical feature map, and the predicted defect category is output based on the weighted hierarchical feature map. Calculate the loss value between the predicted defect category and the corresponding defect category label, and update the network parameters through the backpropagation algorithm for iterative training until the loss value converges, thus obtaining the large-scale image dehazing recognition model.
17. The image processing system according to claim 13, characterized in that, It also includes a power consumption control module; the power consumption control module is configured to: When the defect identification result is no defect, a sleep control command is generated. The sleep control command is used to control the power inspection equipment to enter a low-power sleep mode and stop image acquisition and processing tasks. When an external wake-up signal or inspection cycle trigger signal is detected, the power inspection device is controlled to exit the low-power sleep mode.
18. An artificial intelligence chip, characterized in that, The image processing system includes any one of claims 13 to 17; or, it includes a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the image processing method of any one of claims 1 to 12.
19. A computer-readable storage medium storing computer instructions thereon, characterized in that, When the computer instructions are executed by the processor, they implement the image processing method according to any one of claims 1 to 12.
20. A computer program product comprising computer instructions that, when executed by a processor, implement the image processing method according to any one of claims 1 to 12.