Railway inspection image defogging method and device, electronic equipment and storage medium
By combining a deep learning network with a physical model's multi-scale feature extraction module, the problem of poor dehazing effect in railway inspection images was solved, achieving clearer image restoration and more accurate target detection.
Patent Information
- Application Number
- CN202410229451.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-29
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-02-29
AI Technical Summary
Existing methods for dehazing railway inspection images are ineffective, especially due to the difficulty in target detection caused by the mixing of near and far views, high contrast, color distortion, and uneven fog distribution.
A multi-scale feature extraction module is constructed by combining a deep learning network model with a physical model. Image dehazing is performed by estimating atmospheric illumination, transmittance, and depth map, combined with channel and pixel attention modules.
It improves the dehazing effect of railway inspection images, enhances image clarity and true color, and improves the accuracy of target detection.
Smart Images

Figure CN118411307B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image dehazing technology, and in particular to a method, apparatus, electronic device, and storage medium for dehazing railway inspection images. Background Technology
[0002] Single-image dehazing is an important research direction in computer vision, aiming to recover a clear image from a single image containing haze. Traditional dehazing methods are usually based on physical models and image statistics principles, such as dark channel priors and atmospheric scattering models. These methods can effectively remove haze from images to a certain extent, but they often require relatively accurate prior knowledge of the characteristics of the scene and the haze, and are quite sensitive to parameter selection.
[0003] Currently, the main methods for image dehazing include: The first category is inversion algorithms based on physical models. These algorithms comprehensively consider information such as depth and global illumination to construct a physical model of the hazy image, thereby achieving the goal of removing haze. Parameter estimation or prediction has a significant impact on the model's accuracy. The second category is image enhancement algorithms based on non-physical models. These algorithms primarily filter noise, increase contrast, and restore a clear image in the presence of fog. Typical image enhancement dehazing algorithms include the Retinex algorithm and wavelet transform. This type of dehazing algorithm has very poor dehazing effects, and after dehazing, the image still suffers from information loss and color distortion. The third category utilizes deep neural networks for image removal. This algorithm uses convolutional neural networks as its core, constructing a model that can effectively remove haze using multiple hazy images and corresponding clear images. However, this model is easily limited by the image database, cannot be applied to single hazy images or special scenes, and has a long training time.
[0004] Railway inspection images are usually collected by drones. The collection location is far from the railway, and the difference between the railway track area and the environmental area in the image is small. Therefore, the above-mentioned method is not very effective in removing fog. Summary of the Invention
[0005] This invention provides a method, apparatus, electronic device, and storage medium for dehazing railway inspection images to solve the problem of improving the dehazing effect of railway inspection images.
[0006] In a first aspect, embodiments of the present invention provide a method for dehazing railway inspection images, comprising:
[0007] Acquire railway inspection images to be defogging;
[0008] The railway inspection image to be defogged is input into a trained image defogging model to obtain a defogged railway inspection image. The image defogging model includes a sequentially connected encoding module, three multi-scale feature extraction modules, a feature fusion module, and a decoding module. Each multi-scale feature extraction module includes multiple sequentially connected basic blocks. Each basic block includes two sets of sequentially connected physical feature extraction modules. Each physical feature extraction module includes a parallel atmospheric illumination estimation module and a transmittance estimation module. The atmospheric illumination estimation module includes a sequentially connected global atmospheric illumination estimation layer and a pixel atmospheric illumination estimation layer. The transmittance estimation module includes a sequentially connected depth map estimation layer and a transmittance estimation layer.
[0009] In one possible implementation, the railway inspection image to be dehazed is input into a trained image dehazing model to obtain the dehazed railway inspection image, including:
[0010] The railway inspection image to be defogging is encoded by the encoding module to obtain a feature image;
[0011] In each physical feature extraction module, the illumination intensity and color of the feature image are described by a global atmospheric illumination estimation layer, and the illumination intensity and color of the feature image are enhanced by pixel weighting by a pixel atmospheric illumination estimation layer to obtain the illumination intensity and color of each pixel in the feature image. The feature image is converted into a depth map by a depth map estimation layer, and the transmittance estimation information of the feature image is extracted from the depth map by a transmittance estimation layer. The illumination intensity, color and transmittance estimation information of each pixel in the feature image are superimposed on the feature image by pixel and used as the input feature image for the next module.
[0012] The feature fusion module merges the feature images output by each multi-scale feature extraction module into a haze density image.
[0013] The fog density image is decoded by the decoding module to obtain the defogging railway inspection image.
[0014] In one possible implementation, the feature fusion module includes a concatenate module, a channel attention module, and a pixel attention module connected in series, with each multi-scale feature extraction module connected to the concatenate module.
[0015] The feature fusion module merges the feature images output by each multi-scale feature extraction module into a haze density image, including:
[0016] The concatenate module merges the feature images output by each multi-scale feature extraction module by combining the number of channels, resulting in a fused feature image.
[0017] The fused feature image is weighted and filtered by the channel attention module and the pixel attention module to obtain the haze density image.
[0018] In one possible implementation, each basic block also includes an efficient attention module, which is concatenated after two sets of concatenated physical feature extraction modules;
[0019] The efficient attention module consists of a global average pooling layer, a convolutional layer, and a sigmoid activation layer connected in sequence.
[0020] In one possible implementation, before inputting the railway inspection image to be dehazed into the trained image dehazing model, the following steps are also included:
[0021] Obtain the initial image dehazing model;
[0022] The initial image dehazing model is trained based on the training sample set to obtain the trained image dehazing model. The training sample set includes multiple training samples, each of which consists of multiple railway inspection images with different concentrations of fog superimposed on them. The railway inspection images before fog superposition are used as sample labels.
[0023] In one possible implementation, before training the initial image dehazing model based on the training sample set, the following is also included:
[0024] Acquire multiple railway inspection images;
[0025] Convert multiple railway inspection images into multiple grayscale images;
[0026] For each grayscale image, fog of different concentrations is added to the grayscale image to obtain multiple railway inspection images with fog of different concentrations superimposed on the grayscale image, and these images are combined into a training sample.
[0027] A training sample set is constructed based on each training sample.
[0028] In one possible implementation, the global atmospheric illumination estimation layer comprises a first convolutional layer, a ReLU activation layer, a second convolutional layer, a ReLU activation layer, and a max pooling layer connected in series; wherein the first and second convolutional layers have 3 input channels, 64 output channels, a kernel_size of 3, a stride of 1, and a padding of 1, and the max pooling layer has a kernel_size of 2 and a stride of 2.
[0029] The pixel atmospheric illumination estimation layer consists of a third convolutional layer, a ReLU activation layer, a fourth convolutional layer, a ReLU activation layer, and a fifth convolutional layer connected in series; the third convolutional layer has 3 input channels and 64 output channels. 、The kernel_size is 3, stride is 1, and padding is 1. The fourth convolutional layer has 64 input channels, 64 output channels, kernel_size is 3, stride is 1, and padding is 1. The fifth convolutional layer has 64 input channels, 1 output channel, kernel_size is 1, stride is 1, and padding is 0.
[0030] The depth map estimation layer consists of a sixth, seventh, and eighth convolutional layer, a ReLU activation layer, and a sigmoid activation layer, all connected in series. The sixth convolutional layer has 3 input channels and 64 output channels. 、 The kernel_size is 3, stride is 1, and padding is 1. The seventh convolutional layer has 64 input channels, 64 output channels, kernel_size is 3, stride is 1, and padding is 1. The eighth convolutional layer has 64 input channels, 1 output channel, kernel_size is 1, stride is 1, and padding is 0.
[0031] The transmittance estimation layer consists of a ninth convolutional layer, a ReLU activation layer, a tenth convolutional layer, another ReLU activation layer, and an eleventh convolutional layer connected in series; the ninth convolutional layer has 4 input channels and 64 output channels. 、 The kernel size is 3, the stride is 1, and the padding is 1. The tenth convolutional layer has 64 input channels and 64 output channels. 、 The kernel_size is 3, the stride is 1, and the padding is 1. The eleventh convolutional layer has 64 input channels, 1 output channel, a kernel_size of 1, a stride of 1, and padding of 0.
[0032] Secondly, embodiments of the present invention provide a railway inspection image dehazing device, comprising:
[0033] The acquisition module is used to acquire railway inspection images that need to be defogged.
[0034] The dehazing module is used to input the railway inspection image to be dehazed into the trained image dehazing model to obtain the dehazed railway inspection image. The image dehazing model includes a sequentially connected encoding module, three multi-scale feature extraction modules, a feature fusion module, and a decoding module. Each multi-scale feature extraction module includes multiple sequentially connected basic blocks. Each basic block includes two sets of sequentially connected physical feature extraction modules. Each physical feature extraction module includes a parallel atmospheric illumination estimation module and a transmittance estimation module. The atmospheric illumination estimation module includes a sequentially connected global atmospheric illumination estimation layer and a pixel atmospheric illumination estimation layer. The transmittance estimation module includes a sequentially connected depth map estimation layer and a transmittance estimation layer.
[0035] Thirdly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method as described in the first aspect or any possible implementation of the first aspect.
[0036] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in the first aspect or any possible implementation thereof.
[0037] This invention provides a method, apparatus, electronic device, and storage medium for dehazing railway inspection images. Based on a deep learning network model, a multi-scale feature extraction module is constructed through a physical model to form an image dehazing model. During the image dehazing process based on this model, image features can be extracted based on physical prior information, thereby improving the dehazing effect of railway inspection images. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is a flowchart illustrating the implementation of a railway inspection image dehazing method according to an embodiment of the present invention;
[0040] Figure 2 This is a schematic diagram of the structure of an image dehazing model provided in an embodiment of the present invention;
[0041] Figure 3 This is a schematic diagram of the structure of a basic block provided in an embodiment of the present invention;
[0042] Figure 4 This is a flowchart of training an image dehazing model according to an embodiment of the present invention;
[0043] Figure 5 This is a schematic diagram of the structure of a railway inspection image defogging device provided in an embodiment of the present invention;
[0044] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0045] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.
[0046] To make the objectives, technical solutions, and advantages of the present invention clearer, specific embodiments will be described below in conjunction with the accompanying drawings.
[0047] The applicant discovered that railway inspection images have the following characteristics, which makes dehazing of these images difficult:
[0048] 1. Mixed views: Railway inspection images may simultaneously include distant railway lines and nearby railway infrastructure, which can cause distant objects to be more severely affected by smog, while nearby objects are less affected.
[0049] 2. High contrast: Due to the presence of smog, the image may have low contrast, making distant objects appear blurry.
[0050] 3. Color distortion: Haze can cause color distortion in images, which may result in a bluish or grayish tint.
[0051] 4. Uneven fog distribution: In railway inspection images, the fog distribution may be uneven, with some areas having denser fog and others having relatively clear fog.
[0052] 5. Difficulty in target detection: Due to the presence of smog, targets such as railway lines, sleepers, and weeds may be obscured or blurred, making target detection and recognition difficult.
[0053] The current methods for dehazing single images are described below:
[0054] 1. Physical Model-Based Inversion Algorithms: These are methods that use physical laws and models to infer unknown parameters or processes. Their advantages include: physical model-based inversion algorithms can provide an understanding of the physical processes behind observed data, helping to interpret results and predict future behavior. Because inferences are based on known physical laws and models, these algorithms are generally more stable when data is noisy or incomplete. However, they also have some drawbacks: physical models are often simplifications and approximations of the real world, and therefore may not fully capture complex real-world situations, leading to biased inference results. Building and solving physical models can require significant computational resources and time, especially when dealing with large-scale data or complex systems.
[0055] 2. Image Enhancement Algorithms Based on Non-Physical Models: These algorithms utilize image processing techniques to enhance images affected by haze, improving image clarity and quality. The advantages of this method are as follows: Unlike some traditional dehazing methods that require depth information, image enhancement-based methods do not require additional depth information, making them more suitable for situations with only a single image. Compared to some complex physical models or deep learning methods, image enhancement-based methods are generally simpler and faster, enabling applications in real-time or near real-time scenarios. Image enhancement-based methods are generally applicable to various image types, including natural images and urban landscapes, thus having broad applicability. Disadvantages include: Image enhancement-based methods often rely on local features and texture information of the image, which may lead to unstable results in some cases, especially when dealing with complex haze conditions. For very dense haze, image enhancement-based methods may not be effective in removing haze, performing worse than some physical models or deep learning methods. Image enhancement-based methods usually have certain requirements on the quality and content of the input image; poor input image quality or complex content may affect the dehazing effect.
[0056] 3. Image Dehazing Using Deep Neural Networks: This involves using deep learning neural network models, such as convolutional neural networks. The advantages of this algorithm include: deep learning models can learn and extract high-level features from images, resulting in more realistic and detailed effects during image enhancement. Compared to traditional hand-designed feature extraction algorithms, deep learning models can automatically learn features in images, making them more suitable for various types of image enhancement tasks. However, there are also some disadvantages: deep learning models typically require large amounts of labeled data for training, which can be challenging, especially in areas where image data is scarce or expensive. Training and using deep learning models requires significant computational resources, including GPU acceleration, which can increase the cost and complexity of the algorithm.
[0057] A single-image dehazing method combining physical priors and deep learning can fully leverage the advantages of physical models and image statistics principles, while using deep learning to learn more complex image features and haze distribution patterns, thereby improving dehazing effectiveness and generalization ability. Therefore, this embodiment aims to model a neural network by fusing prior information from atmospheric scattering and dark channel, and effectively model the neural network using existing prior knowledge, thereby improving haze removal capabilities in real-world environments. Based on this, a novel method is proposed: acquiring global atmospheric light based on dark channel prior information, and then combining the obtained visibility and clear image with an atmospheric scattering model. Furthermore, a deep learning model based on physical prior knowledge is proposed to estimate transmittance and clear image, employing a combination of supervised and autonomous learning to fully leverage the advantages of physical priors and autonomous learning to improve the network's generalization ability and achieve the restoration of haze weather and haze weather scenes. This method can better adapt to the dehazing needs of different scenarios and haze conditions in practical applications.
[0058] See Figure 1 The document illustrates a flowchart of the railway inspection image dehazing method provided in an embodiment of the present invention, which is described in detail below:
[0059] Step 101: Obtain the railway inspection image to be defogging.
[0060] Step 102: Input the railway inspection image to be defogged into the trained image defogging model to obtain the defogged railway inspection image. The image defogging model includes a sequentially connected encoding module, three multi-scale feature extraction modules, a feature fusion module, and a decoding module. Each multi-scale feature extraction module includes multiple sequentially connected basic blocks. Each basic block includes two sets of sequentially connected physical feature extraction modules. Each physical feature extraction module includes a parallel atmospheric illumination estimation module and a transmittance estimation module. The atmospheric illumination estimation module includes a sequentially connected global atmospheric illumination estimation layer and a pixel atmospheric illumination estimation layer. The transmittance estimation module includes a sequentially connected depth map estimation layer and a transmittance estimation layer.
[0061] In this embodiment, according to the formula I(z)=J(z)t(z)+A(1-t(z)), the clean image after dehazing can be obtained using the atmospheric illumination and transmittance in the image to be dehazed. Here, I(z) and J(z) represent the hazy image and the clean image, respectively, A represents the global atmospheric illumination, and t(x) represents the transmittance map, which can be represented as:
[0062]
[0063] Where d(z) represents the scene depth, and β represents the atmospheric scattering parameter. The scene depth can be expressed as:
[0064]
[0065] Where Ωr(x) is an r×r neighborhood centered at x, and dr(x) is a depth map with a scale of r. Therefore, the clean image after dehazing can be represented as:
[0066]
[0067] The atmospheric scattering model I(x) = J(x)t(x) + A(1-t(x)) describes two mechanisms in foggy imaging: direct attenuation and atmospheric light. On one hand, direct attenuation, caused by a reduction in reflected energy, leads to low brightness. In the atmospheric scattering model, t(x)J(x) describes direct attenuation, meaning the intensity of pixels in the image decreases multiplicatively. Therefore, brightness intensity decreases under the influence of direct attenuation. On the other hand, white or gray atmospheric light, formed by scattering from ambient lighting, enhances brightness and reduces saturation. This can also be explained by the atmospheric scattering model. A(1-t(x)) represents the effect of atmospheric light. From this, we can infer that the effect of white or gray atmospheric light on the observed values is additive (the effect of atmospheric light in the atmospheric scattering model is added to the direct attenuation term). Therefore, brightness increases and saturation decreases due to the effect of atmospheric light. Since atmospheric light plays a more significant role in most cases, foggy areas in images are characterized by high brightness and low saturation. More importantly, the greater the fog, the greater the influence of atmospheric light.
[0068] Removing haze from real-world images is challenging because weather conditions are unpredictable, leading to a mismatch between foggy and clear images. Figure 2 This embodiment illustrates the overall structure of the image dehazing model provided, consisting of... Figure 2 As can be seen, the image dehazing model comprises three functional parts: dehazing, atmospheric light estimation, and transmittance estimation. After the image to be dehazed is input into the image dehazing model, it is first passed to a shallow feature extraction part (encoding module), and then input into three multi-scale feature extraction modules. Each multi-scale feature extraction module is a group structure of N multi-hop connections, i.e. Figure 2 Below are N concatenated basic blocks B-1, B-2, ..., BN. The feature fusion module then fuses the output features from these N group structures together. Finally, these features are passed to the decoding module for reconstruction and global residual learning, resulting in a fog-free output.
[0069] Furthermore, each group structure combines N basic block structures with local residual learning, and each basic block incorporates skip connections and a feature attention module. Most image dehazing networks treat channel and pixel features equally, failing to handle images with uneven haze distributions and weighted channels. The attention module introduced in this embodiment provides additional flexibility when processing different types of information. Treating different features and pixel regions unequally provides additional flexibility when processing different types of information and can extend the network's representational capabilities. A key step is how to generate different weights for each channel and pixel feature.
[0070] Based on a deep learning network model, this invention constructs a multi-scale feature extraction module using a physical model approach, forming an image dehazing model. This model enables image feature extraction based on prior physical information during image dehazing, thereby improving the dehazing effect of railway inspection images.
[0071] In one possible implementation, the railway inspection image to be dehazed is input into a trained image dehazing model to obtain the dehazed railway inspection image, including:
[0072] The railway inspection image to be defogging is encoded by the encoding module to obtain a feature image;
[0073] In each physical feature extraction module, the illumination intensity and color of the feature image are described by a global atmospheric illumination estimation layer, and the illumination intensity and color of the feature image are enhanced by pixel weighting by a pixel atmospheric illumination estimation layer to obtain the illumination intensity and color of each pixel in the feature image. The feature image is converted into a depth map by a depth map estimation layer, and the transmittance estimation information of the feature image is extracted from the depth map by a transmittance estimation layer. The illumination intensity, color and transmittance estimation information of each pixel in the feature image are superimposed on the feature image by pixel and used as the input feature image for the next module.
[0074] The feature fusion module merges the feature images output by each multi-scale feature extraction module into a haze density image.
[0075] The fog density image is decoded by the decoding module to obtain the defogging railway inspection image.
[0076] In this embodiment, the encoding module encodes the input fog image into a feature image through convolution processing, which facilitates subsequent feature extraction.
[0077] A multi-scale feature extraction module is used to learn haze features and clear image features. Its functions include transmittance estimation, global atmospheric illumination estimation, and atmospheric illumination estimation for each pixel. Transmittance describes the attenuation of light as it travels through the atmosphere and is related to haze concentration and distance. Global atmospheric illumination describes the light intensity and color throughout the scene. Transmittance can be estimated based on changes in pixel values in the image, while global atmospheric illumination can be estimated through statistical analysis of the image. Using the estimated transmittance and global atmospheric illumination, the image can be dehazed, resulting in clear scene details and realistic colors. Depth map estimation can be used to calculate transmittance, thus aiding in image dehazing. Transmittance is related to depth information and can be estimated using the gradient of depth information or other features. Once the transmittance is obtained, the formulas in the image dehazing model can be used for dehazing, resulting in clear scene details and realistic colors.
[0078] The feature fusion module utilizes the channel attention module and the pixel attention module to dynamically adjust the channel weights and pixel weights of features at different scales, learn rich contextual information and suppress redundant information, thereby enhancing the network's ability to extract haze density images and making dehazing more thorough.
[0079] The decoding module and the encoding module are structurally symmetrical. The decoding module is used to upsample the features of the decoder and connect them to the features of the encoder through skip connections. The fused features are nonlinearly mapped to obtain the haze density image. Then, the haze density image is added to the original image to be dehazed to gradually restore the clear image.
[0080] In one possible implementation, the feature fusion module includes a concatenate module, a channel attention module, and a pixel attention module connected in series, with each multi-scale feature extraction module connected to the concatenate module.
[0081] The feature fusion module merges the feature images output by each multi-scale feature extraction module into a haze density image, including:
[0082] The concatenate module merges the feature images output by each multi-scale feature extraction module by combining the number of channels, resulting in a fused feature image.
[0083] The fused feature image is weighted and filtered by the channel attention module and the pixel attention module to obtain the haze density image.
[0084] In this embodiment, the concatenate module is used to merge the number of channels in the feature image. The merged feature image has more features, but the information under each feature is not increased.
[0085] Most image dehazing networks treat channel and pixel features equally, failing to handle images with uneven haze distributions or weighted channels. The channel attention module and pixel attention module introduced in this embodiment provide additional flexibility when processing different types of information. Treating different features and pixel regions unequally offers this added flexibility when dealing with diverse information types.
[0086] In one possible implementation, each basic block also includes an efficient attention module, which is concatenated after two sets of concatenated physical feature extraction modules;
[0087] The efficient attention module consists of a global average pooling layer, a convolutional layer, and a sigmoid activation layer connected in sequence.
[0088] In this embodiment, the efficient channel attention mechanism can expand the receptive field and extract different scale features through weighted filtering for fusion; by using the efficient channel attention mechanism, the channel weights of different scale features are dynamically adjusted, rich contextual information is learned and redundant information is suppressed, thereby enhancing the network's ability to extract haze density images and making dehazing more thorough.
[0089] In one possible implementation, before inputting the railway inspection image to be dehazed into the trained image dehazing model, the following steps are also included:
[0090] Obtain the initial image dehazing model;
[0091] The initial image dehazing model is trained based on the training sample set to obtain the trained image dehazing model. The training sample set includes multiple training samples, each of which consists of multiple railway inspection images with different concentrations of fog superimposed on them. The railway inspection images before fog superposition are used as sample labels.
[0092] In this embodiment, the process of constructing a training sample set and training the image dehazing model is as follows: Figure 4 As shown, the process reads the fogged image from the fogged image path, and obtains the filename of the fog-free image based on the filename of the fogged image, then reads the fog-free image. This is because the fogged image is generated by superimposing fog of different concentrations onto the fog-free image. One fog-free image can generate more than a dozen fogged images, and the filenames are related, so the filename of the corresponding fog-free image can be obtained from the filename of the fogged image.
[0093] During model training, mean squared error (MSE) was used as the loss function, and the Adam optimizer was used for parameter updates. Peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) were used to measure the image dehazing capabilities of various algorithms, and the average PSNR and SSIM of the test images were measured. The average PSNR of this invention was significantly higher than that of other algorithms, and the average SSIM of this invention was also higher than that of other algorithms, thus demonstrating that this invention achieves better dehazing results.
[0094] In one possible implementation, before training the initial image dehazing model based on the training sample set, the following is also included:
[0095] Acquire multiple railway inspection images;
[0096] Convert multiple railway inspection images into multiple grayscale images;
[0097] For each grayscale image, fog of different concentrations is added to the grayscale image to obtain multiple railway inspection images with fog of different concentrations superimposed on the grayscale image, and these images are combined into a training sample.
[0098] A training sample set is constructed based on each training sample.
[0099] In this embodiment, the railway inspection image is first converted into a grayscale image, which can remove the influence of image color and enhance the haze effect in the image, thereby improving the training effect of the model.
[0100] Next, information about the foggy images in the fog-free image dataset is estimated, image gradients and image logarithms are calculated, and the resulting images are initialized for data augmentation.
[0101] Next, the edges of the haze-free image are cropped. This is because the data in the haze-free image has a problem; there's a useless white ring around the edges. Only after cropping do the pixels correspond to those in the haze image. Random cropping is performed on both images. At this point, a random cropping factor should be generated first, and then applied to both images to ensure that the cropping positions are consistent.
[0102] Finally, the same random flipping and rotation operations are performed on each set of foggy and fog-free images, which is equivalent to data augmentation. The pixel values of the foggy images are standardized to ensure a consistent distribution of the model's input data.
[0103] In one possible implementation, the global atmospheric illumination estimation layer comprises a first convolutional layer, a ReLU activation layer, a second convolutional layer, a ReLU activation layer, and a max pooling layer connected in series; wherein the first and second convolutional layers have 3 input channels, 64 output channels, a kernel_size of 3, a stride of 1, and a padding of 1, and the max pooling layer has a kernel_size of 2 and a stride of 2.
[0104] The pixel atmospheric illumination estimation layer consists of a third convolutional layer, a ReLU activation layer, a fourth convolutional layer, a ReLU activation layer, and a fifth convolutional layer connected in series; the third convolutional layer has 3 input channels and 64 output channels. 、 The kernel_size is 3, stride is 1, and padding is 1. The fourth convolutional layer has 64 input channels, 64 output channels, kernel_size is 3, stride is 1, and padding is 1. The fifth convolutional layer has 64 input channels, 1 output channel, kernel_size is 1, stride is 1, and padding is 0.
[0105] The depth map estimation layer consists of a sixth, seventh, and eighth convolutional layer, a ReLU activation layer, and a sigmoid activation layer, all connected in series. The sixth convolutional layer has 3 input channels and 64 output channels. 、 The kernel_size is 3, stride is 1, and padding is 1. The seventh convolutional layer has 64 input channels, 64 output channels, kernel_size is 3, stride is 1, and padding is 1. The eighth convolutional layer has 64 input channels, 1 output channel, kernel_size is 1, stride is 1, and padding is 0.
[0106] The transmittance estimation layer consists of a ninth convolutional layer, a ReLU activation layer, a tenth convolutional layer, another ReLU activation layer, and an eleventh convolutional layer connected in series; the ninth convolutional layer has 4 input channels and 64 output channels. 、 The kernel size is 3, the stride is 1, and the padding is 1. The tenth convolutional layer has 64 input channels and 64 output channels. 、 The kernel_size is 3, the stride is 1, and the padding is 1. The eleventh convolutional layer has 64 input channels, 1 output channel, a kernel_size of 1, a stride of 1, and padding of 0.
[0107] In this embodiment, Figure 3 The structure of each basic block in the multi-scale feature extraction module is shown. Figure 3 As can be seen, each basic block consists of three parts. The first part on the far left, from left to right, has six parts: a convolutional layer, an instance normalization layer, a ReLU layer, another convolutional layer, an instance normalization layer, and a ReLU layer. The second part in the middle, from left to right, has eight parts: a global atmospheric illumination estimation layer, a pixel atmospheric illumination estimation layer, a depth map estimation layer, a transmittance estimation layer, another global atmospheric illumination estimation layer, a pixel atmospheric illumination estimation layer, a depth map estimation layer, and a transmittance estimation layer. The third part on the right is the efficient attention module, which has two parts from left to right: a global average pooling layer and a convolutional layer.
[0108] The global atmospheric illumination estimation layer first calls the initialization method of the parent class `nn.Module`, and then defines three layers: two convolutional layers `self.conv1` and `self.conv2`, and a max-pooling layer `self.pool`. `self.conv1` and `self.conv2` are convolutional layers with 3 input channels and 64 output channels, a kernel size of 3, a stride of 1, and padding of 1, respectively; `self.pool` is a max-pooling layer with a kernel size of 2 and a stride of 2. In the forward propagation method of the global atmospheric illumination estimation layer, the input `x` first passes through the `self.conv1` convolutional layer and ReLU activation function, then through the `self.conv2` convolutional layer and ReLU activation function, and finally through the `self.pool` max-pooling layer, ultimately obtaining the processed output `x`. The function of the global atmospheric illumination estimation layer is to perform convolution and pooling processing on the input image to extract image features and perform dimensionality reduction, thereby achieving global atmospheric illumination estimation.
[0109] The pixel atmospheric illumination estimation layer is used for atmospheric illumination estimation for each pixel. Three convolutional layers are defined: self.conv1, self.conv2, and self.conv3. Specifically, self.conv1 is a convolutional layer with 3 input channels and 64 output channels, a kernel_size of 3, a stride of 1, and padding of 1; self.conv2 is a convolutional layer with 64 input channels and 64 output channels, a kernel_size of 3, a stride of 1, and padding of 1; and self.conv3 is a convolutional layer with 64 input channels and 1 output channel, a kernel_size of 1, a stride of 1, and padding of 0.
[0110] In the forward propagation method of the pixel atmospheric illumination estimation layer, the input x is first processed by the self.conv1 convolutional layer and the ReLU activation function, then by the self.conv2 convolutional layer and the ReLU activation function, and finally by the self.conv3 convolutional layer to obtain the processed output x.
[0111] The pixel atmospheric illumination estimation layer learns weights based on the importance of features at different pixel locations. Each channel has the same weight, but the weights at different pixel locations within the same channel are different. The input image is processed by multiple convolutional layers to extract features from each pixel and perform dimensionality reduction, thereby achieving atmospheric illumination estimation for each pixel.
[0112] The depth map estimation layer is used for depth map estimation. Three convolutional layers are defined: `self.conv1`, `self.conv2`, and `self.conv3`. `self.conv1` is a convolutional layer with 3 input channels and 64 output channels, a kernel size of 3, a stride of 1, and padding of 1. `self.conv2` is a convolutional layer with 64 input channels and 64 output channels, a kernel size of 3, a stride of 1, and padding of 1. `self.conv3` is a convolutional layer with 64 input channels and 1 output channel, a kernel size of 1, a stride of 1, and padding of 0. In the forward propagation method of the depth map estimation layer, the input `x` first passes through the `self.conv1` convolutional layer and the ReLU activation function, then through the `self.conv2` convolutional layer and the ReLU activation function, and finally through the `self.conv3` convolutional layer, ultimately obtaining the processed output `x`. The function of the depth map estimation layer is to perform multi-layer convolutional processing on the input image to extract image features and perform dimensionality reduction, thereby achieving depth map estimation. By estimating the depth information of each pixel in an image, algorithms can more accurately understand the 3D structure of a scene, thus better removing haze. Depth map estimation helps algorithms identify the distance between the foreground and background, thereby helping them better recover realistic scene information and improve the dehazing effect.
[0113] The transmittance estimation layer defines three convolutional layers: `self.conv1`, `self.conv2`, and `self.conv3`. `self.conv1` is a convolutional layer with 4 input channels and 64 output channels, a kernel size of 3, a stride of 1, and padding of 1. `self.conv2` is a convolutional layer with 64 input channels and 64 output channels, a kernel size of 3, a stride of 1, and padding of 1. `self.conv3` is a convolutional layer with 64 input channels and 1 output channel, a kernel size of 1, a stride of 1, and padding of 0. In the forward propagation method of the transmittance estimation layer, the input `x` first passes through the `self.conv1` convolutional layer and the ReLU activation function, then through the `self.conv2` convolutional layer and the ReLU activation function, and finally through the `self.conv3` convolutional layer, ultimately obtaining the processed output `x`. The function of the transmittance estimation layer is to perform multi-layer convolutional processing on the input image to extract image features and perform dimensionality reduction, thereby achieving transmittance estimation.
[0114] The railway inspection image dehazing method provided in this embodiment of the invention can be applied to the following scenarios:
[0115] Image classification and recognition: It can be used for image classification and recognition tasks, improving the accuracy and robustness of image classification through feature fusion and attention mechanisms. Applications include using networks as the core component of image classification and recognition systems to extract and fuse image features.
[0116] Object detection and tracking: This technology can be used for object detection and tracking tasks, improving accuracy and robustness by fusing multi-scale features and introducing attention mechanisms. Applications include incorporating networks into object detection and tracking systems to extract and fuse object features.
[0117] Image segmentation and semantic segmentation: This technology can be used for image segmentation and semantic segmentation tasks, improving the accuracy and robustness of these tasks through feature fusion and attention mechanisms. Applications include incorporating networks into image segmentation and semantic segmentation systems to extract and fuse image features.
[0118] Image enhancement and restoration: This technology can be used for image enhancement and restoration tasks, improving the effectiveness of image enhancement and restoration through feature fusion and attention mechanisms. Applications include incorporating networks into image enhancement and restoration systems to extract and fuse image features.
[0119] Video analysis and processing: This can be used for video analysis and processing tasks, including video classification, object tracking, and video segmentation. It improves the effectiveness of video analysis and processing through feature fusion and attention mechanisms. Applications include using networks in video analysis and processing systems to extract and fuse video features.
[0120] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0121] The following are device embodiments of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.
[0122] Figure 5 A schematic diagram of the railway inspection image defogging device provided in an embodiment of the present invention is shown. For ease of explanation, only the parts related to the embodiment of the present invention are shown, and are described in detail below:
[0123] like Figure 5 As shown, the railway inspection image defogging device 5 includes:
[0124] The acquisition module 51 is used to acquire railway inspection images to be defogged;
[0125] The dehazing module 52 is used to input the railway inspection image to be dehazed into the trained image dehazing model to obtain the dehazed railway inspection image. The image dehazing model includes an encoding module, three multi-scale feature extraction modules, a feature fusion module, and a decoding module connected in series. Each multi-scale feature extraction module includes multiple connected basic blocks. Each basic block includes two sets of connected physical feature extraction modules. Each physical feature extraction module includes a parallel atmospheric illumination estimation module and a transmittance estimation module. The atmospheric illumination estimation module includes a connected global atmospheric illumination estimation layer and a pixel atmospheric illumination estimation layer. The transmittance estimation module includes a connected depth map estimation layer and a transmittance estimation layer.
[0126] In one possible implementation, the defogging module 52 is specifically used for:
[0127] The railway inspection image to be defogging is encoded by the encoding module to obtain a feature image;
[0128] In each physical feature extraction module, the illumination intensity and color of the feature image are described by a global atmospheric illumination estimation layer, and the illumination intensity and color of the feature image are enhanced by pixel weighting by a pixel atmospheric illumination estimation layer to obtain the illumination intensity and color of each pixel in the feature image. The feature image is converted into a depth map by a depth map estimation layer, and the transmittance estimation information of the feature image is extracted from the depth map by a transmittance estimation layer. The illumination intensity, color and transmittance estimation information of each pixel in the feature image are superimposed on the feature image by pixel and used as the input feature image for the next module.
[0129] The feature fusion module merges the feature images output by each multi-scale feature extraction module into a haze density image.
[0130] The fog density image is decoded by the decoding module to obtain the defogging railway inspection image.
[0131] In one possible implementation, the feature fusion module includes a concatenate module, a channel attention module, and a pixel attention module connected in series, with each multi-scale feature extraction module connected to the concatenate module.
[0132] Defogging module 52 is specifically used for:
[0133] The concatenate module merges the feature images output by each multi-scale feature extraction module by combining the number of channels, resulting in a fused feature image.
[0134] The fused feature image is weighted and filtered by the channel attention module and the pixel attention module to obtain the haze density image.
[0135] In one possible implementation, each basic block also includes an efficient attention module, which is concatenated after two sets of concatenated physical feature extraction modules;
[0136] The efficient attention module consists of a global average pooling layer, a convolutional layer, and a sigmoid activation layer connected in sequence.
[0137] In one possible implementation, the acquisition module 51 is also used for:
[0138] Before inputting the railway inspection image to be dehazed into the trained image dehazing model, obtain the initial image dehazing model;
[0139] The initial image dehazing model is trained based on the training sample set to obtain the trained image dehazing model. The training sample set includes multiple training samples, each of which consists of multiple railway inspection images with different concentrations of fog superimposed on them. The railway inspection images before fog superposition are used as sample labels.
[0140] In one possible implementation, the acquisition module 51 is also used for:
[0141] Before training the initial image dehazing model based on the training sample set, acquire multiple railway inspection images;
[0142] Convert multiple railway inspection images into multiple grayscale images;
[0143] For each grayscale image, fog of different concentrations is added to the grayscale image to obtain multiple railway inspection images with fog of different concentrations superimposed on the grayscale image, and these images are combined into a training sample.
[0144] A training sample set is constructed based on each training sample.
[0145] In one possible implementation, the global atmospheric illumination estimation layer comprises a first convolutional layer, a ReLU activation layer, a second convolutional layer, a ReLU activation layer, and a max pooling layer connected in series; wherein the first and second convolutional layers have 3 input channels, 64 output channels, a kernel_size of 3, a stride of 1, and a padding of 1, and the max pooling layer has a kernel_size of 2 and a stride of 2.
[0146] The pixel atmospheric illumination estimation layer consists of a third convolutional layer, a ReLU activation layer, a fourth convolutional layer, a ReLU activation layer, and a fifth convolutional layer connected in series; the third convolutional layer has 3 input channels and 64 output channels. 、 The kernel_size is 3, stride is 1, and padding is 1. The fourth convolutional layer has 64 input channels, 64 output channels, kernel_size is 3, stride is 1, and padding is 1. The fifth convolutional layer has 64 input channels, 1 output channel, kernel_size is 1, stride is 1, and padding is 0.
[0147] The depth map estimation layer consists of a sixth, seventh, and eighth convolutional layer, a ReLU activation layer, and a sigmoid activation layer, all connected in series. The sixth convolutional layer has 3 input channels and 64 output channels. 、 The kernel_size is 3, stride is 1, and padding is 1. The seventh convolutional layer has 64 input channels, 64 output channels, kernel_size is 3, stride is 1, and padding is 1. The eighth convolutional layer has 64 input channels, 1 output channel, kernel_size is 1, stride is 1, and padding is 0.
[0148] The transmittance estimation layer consists of a ninth convolutional layer, a ReLU activation layer, a tenth convolutional layer, another ReLU activation layer, and an eleventh convolutional layer connected in series; the ninth convolutional layer has 4 input channels and 64 output channels. 、 The kernel size is 3, the stride is 1, and the padding is 1. The tenth convolutional layer has 64 input channels and 64 output channels. 、 The kernel_size is 3, the stride is 1, and the padding is 1. The eleventh convolutional layer has 64 input channels, 1 output channel, a kernel_size of 1, a stride of 1, and padding of 0.
[0149] Based on a deep learning network model, this invention constructs a multi-scale feature extraction module using a physical model approach, forming an image dehazing model. This model enables image feature extraction based on prior physical information during image dehazing, thereby improving the dehazing effect of railway inspection images.
[0150] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. For example... Figure 6 As shown, the electronic device 6 in this embodiment includes: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60. When the processor 60 executes the computer program 62, it implements the steps in the various railway inspection image dehazing method embodiments described above, for example... Figure 1 Steps 101 to 102 are shown. Alternatively, when the processor 60 executes the computer program 62, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 5 The functions of modules / units 51 to 52 shown.
[0151] For example, the computer program 62 can be divided into one or more modules / units, which are stored in the memory 61 and executed by the processor 60 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 62 in the electronic device 6. For example, the computer program 62 can be divided into... Figure 5 Modules / units 51 to 52 are shown.
[0152] The electronic device 6 can be a desktop computer, laptop, handheld computer, or cloud server, etc. The electronic device 6 may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will understand that... Figure 6This is merely an example of electronic device 6 and does not constitute a limitation on electronic device 6. It may include more or fewer components than shown, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.
[0153] The processor 60 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0154] The memory 61 can be an internal storage unit of the electronic device 6, such as a hard disk or memory. The memory 61 can also be an external storage device of the electronic device 6, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 61 can include both internal and external storage units of the electronic device 6. The memory 61 is used to store the computer program and other programs and data required by the electronic device. The memory 61 can also be used to temporarily store data that has been output or will be output.
[0155] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0156] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0157] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0158] In the embodiments provided by this invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0159] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0160] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0161] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various railway inspection image defogging method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately added to or subtracted from the content as required by the legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium may not include electrical carrier signals and telecommunication signals.
[0162] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for dehazing railway inspection images, characterized in that, include: Acquire railway inspection images to be defogging; The railway inspection image to be dehazed is input into a trained image dehazing model to obtain a dehazed railway inspection image. The image dehazing model includes a sequentially connected encoding module, three multi-scale feature extraction modules, a feature fusion module, and a decoding module. Each multi-scale feature extraction module includes multiple sequentially connected basic blocks. Each basic block includes two sets of sequentially connected physical feature extraction modules. Each physical feature extraction module includes a parallel atmospheric illumination estimation module and a transmittance estimation module. The atmospheric illumination estimation module includes a sequentially connected global atmospheric illumination estimation layer and a pixel atmospheric illumination estimation layer. The transmittance estimation module includes a sequentially connected depth map estimation layer and a transmittance estimation layer. The process of inputting the railway inspection image to be dehazed into the trained image dehazing model to obtain the dehazed railway inspection image includes: The railway inspection image to be defogging is encoded by the encoding module to obtain a feature image; In each physical feature extraction module, the illumination intensity and color of the feature image are described by the global atmospheric illumination estimation layer, and the illumination intensity and color of the feature image are enhanced by pixel weighting by the pixel atmospheric illumination estimation layer to obtain the illumination intensity and color of each pixel in the feature image. The feature image is converted into a depth map by the depth map estimation layer, and the transmittance estimation information of the feature image is extracted from the depth map by the transmittance estimation layer. The illumination intensity and color of each pixel in the feature image and the transmittance estimation information are superimposed on the feature image by pixel and used as the input feature image for the next module. The feature fusion module merges the feature images output by each multi-scale feature extraction module into a haze density image. The decoding module decodes the haze density image to obtain a defogging railway inspection image.
2. The method for dehazing railway inspection images according to claim 1, characterized in that, The feature fusion module includes a concatenate module, a channel attention module, and a pixel attention module connected in series, with each multi-scale feature extraction module connected to the concatenate module. The step of fusing the feature images output by each multi-scale feature extraction module into a haze density image through the feature fusion module includes: The concatenate module merges the channel numbers of the feature images output by each multi-scale feature extraction module to obtain a fused feature image. The fused feature image is subjected to feature weighting and filtering by the channel attention module and the pixel attention module to obtain a haze density image.
3. The method for dehazing railway inspection images according to claim 1, characterized in that, Each basic block also includes an efficient attention module, which is connected in series after the two sets of connected physical feature extraction modules; The efficient attention module includes a global average pooling layer, a convolutional layer, and a sigmoid activation layer connected in series.
4. The method for dehazing railway inspection images according to claim 1, characterized in that, Before inputting the railway inspection image to be dehazed into the trained image dehazing model, the method further includes: Obtain the initial image dehazing model; The initial image dehazing model is trained based on the training sample set to obtain the trained image dehazing model; wherein, the training sample set includes multiple training samples, each training sample is multiple railway inspection images with different concentrations of fog superimposed, and the railway inspection image before fog superposition is the sample label.
5. The method for dehazing railway inspection images according to claim 4, characterized in that, Before training the initial image dehazing model based on the training sample set, the method further includes: Acquire multiple railway inspection images; The multiple railway inspection images are converted into multiple grayscale images; For each grayscale image, fog of different concentrations is added to the grayscale image to obtain multiple railway inspection images with fog of different concentrations superimposed on the grayscale image, and these images are combined into a training sample. A training sample set is constructed based on each training sample.
6. The method for dehazing railway inspection images according to claim 1, characterized in that, The global atmospheric illumination estimation layer comprises a first convolutional layer, a ReLU activation layer, a second convolutional layer, a ReLU activation layer, and a max pooling layer connected in series; wherein the first convolutional layer and the second convolutional layer have 3 input channels, 64 output channels, a kernel_size of 3, a stride of 1, and a padding of 1, and the max pooling layer has a kernel_size of 2 and a stride of 2. The pixel atmospheric illumination estimation layer includes a third convolutional layer, a ReLU activation layer, a fourth convolutional layer, a ReLU activation layer, and a fifth convolutional layer connected in series. Specifically, the third convolutional layer has 3 input channels, 64 output channels, a kernel size of 3, a stride of 1, and padding of 1; the fourth convolutional layer has 64 input channels, 64 output channels, a kernel size of 3, a stride of 1, and padding of 1; and the fifth convolutional layer has 64 input channels, 1 output channel, a kernel size of 1, a stride of 1, and padding of 0. The depth map estimation layer comprises a sixth convolutional layer, a seventh convolutional layer, an eighth convolutional layer, a ReLU activation layer, and a sigmoid activation layer connected in series. Specifically, the sixth convolutional layer has 3 input channels, 64 output channels, a kernel size of 3, a stride of 1, and padding of 1; the seventh convolutional layer has 64 input channels, 64 output channels, a kernel size of 3, a stride of 1, and padding of 1; and the eighth convolutional layer has 64 input channels, 1 output channel, a kernel size of 1, a stride of 1, and padding of 0. The transmittance estimation layer comprises a ninth convolutional layer, a ReLU activation layer, a tenth convolutional layer, a ReLU activation layer, and an eleventh convolutional layer connected in series. Specifically, the ninth convolutional layer has 4 input channels, 64 output channels, a kernel size of 3, a stride of 1, and padding of 1; the tenth convolutional layer has 64 input channels, 64 output channels, a kernel size of 3, a stride of 1, and padding of 1; and the eleventh convolutional layer has 64 input channels, 1 output channel, a kernel size of 1, a stride of 1, and padding of 0.
7. A dehazing device for railway inspection images, characterized in that, include: The acquisition module is used to acquire railway inspection images that need to be defogged. The dehazing module is used to input the railway inspection image to be dehazed into a trained image dehazing model to obtain a dehazed railway inspection image. The image dehazing model includes a sequentially connected encoding module, three multi-scale feature extraction modules, a feature fusion module, and a decoding module. Each multi-scale feature extraction module includes multiple sequentially connected basic blocks. Each basic block includes two sets of sequentially connected physical feature extraction modules. Each physical feature extraction module includes a parallel atmospheric illumination estimation module and a transmittance estimation module. The atmospheric illumination estimation module includes a sequentially connected global atmospheric illumination estimation layer and a pixel atmospheric illumination estimation layer. The transmittance estimation module includes a sequentially connected depth map estimation layer and a transmittance estimation layer. The defogging module is specifically used for: The railway inspection image to be defogging is encoded by the encoding module to obtain a feature image; In each physical feature extraction module, the illumination intensity and color of the feature image are described by the global atmospheric illumination estimation layer, and the illumination intensity and color of the feature image are enhanced by pixel weighting by the pixel atmospheric illumination estimation layer to obtain the illumination intensity and color of each pixel in the feature image. The feature image is converted into a depth map by the depth map estimation layer, and the transmittance estimation information of the feature image is extracted from the depth map by the transmittance estimation layer. The illumination intensity and color of each pixel in the feature image and the transmittance estimation information are superimposed on the feature image by pixel and used as the input feature image for the next module. The feature fusion module merges the feature images output by each multi-scale feature extraction module into a haze density image. The decoding module decodes the haze density image to obtain a defogging railway inspection image.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 6 above.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6 above.
Citation Information
Patent Citations
Single image defogging method, device and equipment based on physical model
CN117372289A
Image defogging method, device and equipment based on deep network learning
CN117611490A
