Dust concentration detection method and device based on extinction coefficient

Through the air pump and camera shooting dust-containing images, combined with deep learning and image processing technology of convolutional neural networks, brightness and color restoration are optimized, and the problem of environmental interference of traditional dust concentration detection methods is solved, achieving higher precision dust concentration detection.

CN120471855AInactive Publication Date: 2025-08-12HUBEI BAOYUAN DECORATION MATERIAL +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510549062.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-08-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional dust concentration detection methods are susceptible to external environment interference, resulting in low detection accuracy.

Method used

The dust in the air is extracted through the air pump, dust-containing images are taken using a preset camera, and the brightness optimization is performed through the deep learning model of attention mechanism, the color reduction model based on the convolutional neural network is performed for color reduction, and finally the dust concentration is output through the haze image formation model.

Benefits of technology

It effectively eliminates the impact of environmental interference on dust concentration detection results, and improves detection accuracy and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120471855A_ABST
    Figure CN120471855A_ABST
Patent Text Reader

Abstract

The invention provides a dust concentration detection method and device based on an extinction coefficient, and relates to the field of image enhancement. The method comprises the steps that dust in air is extracted through an air extracting pump, and a dust-containing image is shot through a preset camera; carrying out preprocessing operation on the dust-containing image, wherein the preprocessing operation comprises the steps of carrying out brightness optimization on the dust-containing image through a deep learning model composed of an attention mechanism, carrying out color restoration on the dust-containing image through a color restoration model based on a convolutional neural network, and carrying out graying processing on the dust-containing image through a preset processing method; and inputting the preprocessed dust-containing image into a haze image forming model, and outputting the dust concentration according to the haze image forming model. The problem that when traditional dust concentration detection is interfered by the external environment, the dust concentration detection accuracy is low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image enhancement, and in particular to a method and device for detecting dust concentration based on extinction coefficient. Background Art

[0002] With the rapid development of dust concentration detection technology, market competition is becoming increasingly fierce. Because current dust concentration detection technology has some limitations, this technical solution has been proposed to maintain or enhance product competitiveness. This solution aims to detect dust concentration by analyzing dust images, providing significant performance improvements, optimized user experience, and cost-effectiveness, thereby distinguishing the product from its competitors.

[0003] The wood dust concentration detection methods used in traditional wood-based panel production enterprises often have some significant disadvantages: traditional dust concentration detection is easily affected by external environmental interference, such as changes in temperature, humidity, wind speed, or the presence of other pollutants in the environment, which will greatly affect the accuracy of the detection results. Therefore, there is a problem of low dust concentration inspection accuracy.

[0004] Therefore, there is an urgent need for a dust concentration detection method and device based on the extinction coefficient. Summary of the Invention

[0005] The present application provides a dust concentration detection method and device based on the extinction coefficient, which solves the problem that the traditional dust concentration detection has low dust concentration detection accuracy when it is interfered by the external environment.

[0006] In a first aspect of the present application, a dust concentration detection method based on extinction coefficient is provided, the method comprising: extracting dust from the air through an air pump, and capturing a dust-containing image through a preset camera; performing a preprocessing operation on the dust-containing image, the preprocessing operation comprising optimizing the brightness of the dust-containing image through a deep learning model composed of an attention mechanism, restoring the color of the dust-containing image through a color restoration model based on a convolutional neural network, and grayscale processing of the dust-containing image through a preset processing method; inputting the preprocessed dust-containing image into a haze image formation model, and outputting the dust concentration according to the haze image formation model.

[0007] Optionally, dust in the air is extracted by an air pump, and a dust-containing image is captured by a preset camera, specifically including: dust sampling at a preset position by an air pump, and inputting the dust-containing airflow into a transparent rectangular chamber; starting a small fan, an LED light and an air pump, and when the transparent rectangular chamber is evenly filled with dust, starting the preset camera to capture the dust-containing image.

[0008] Optionally, the brightness of the dust-containing image is optimized by a deep learning model composed of an attention mechanism, specifically including: taking pixels in areas with uneven brightness distribution in the dust-containing image as attention response areas, and constructing a deep learning model based on the attention response areas, the deep learning model including a generator network and a discriminator network, the generator network introduces a grayscale value loss function during the training process; the first image and the second image are input into the generator network, and a brightness-enhanced image is generated through the generator network for brightness optimization; the first image is an attention image generated by inverting the dust-containing image, and the second image is a low-light image of the dust-containing image obtained by adjusting the LED light source; the first image and the brightness-enhanced image are input into the discriminator network, and the discriminator network distinguishes the authenticity of the brightness-enhanced image through an adversarial mechanism to reversely optimize the deep learning model.

[0009] Optionally, the grayscale loss function is constructed using the following formula:

[0010]

[0011] Among them, L GVL is the gray value loss function, m and n represent the size of a single channel, I real represents a dusty image, I att Represents the first image, I n Represents the second image, G(I n ,I att ) represents the brightness enhanced image, (G(I n ,I att )-I real ) i,j represents the difference Q(·) between the pixel values of the brightness enhanced image and the dust image at the pixel position (i, j) i,j Represents the sum of the three RGB channels.

[0012] Optionally, color restoration of the dust-containing image is performed using a color restoration model based on a convolutional neural network, specifically including: converting the low-light image into a first RGB ratio map, and inputting the first RGB ratio map into a color restoration model composed of multiple convolutional layers, wherein the color restoration model introduces a ratio consistency loss function during training; based on the first RGB ratio map, outputting learned color information through the color restoration model; based on the learned color information, enhancing the first RGB ratio map into a second RGB ratio map to perform color restoration on the dust-containing image.

[0013] Optionally, a ratio consistency loss function is constructed using the following formula:

[0014]

[0015] Among them, L RCLis the ratio consistency loss function, m and n represent the size of a single channel, ‖·‖1 is the L1 norm, and Q(·) represents E F The sum of the three RGB channels, (E F ) i,j Represents the color information learned by the color restoration model at pixel position (i, j).

[0016] Optionally, the dust concentration is output according to the haze image formation model, specifically including: calculating the average gradient modulus corresponding to each area in the preprocessed dust-containing image through the haze image formation model; calculating the local contrast in the spatial domain according to the average gradient modulus corresponding to each area; calculating the average peak extinction coefficient according to the local contrast and with a preset error tolerance as a selection condition; calculating the absorbance according to the Lambert-Beer law, and outputting the dust concentration in combination with the average peak extinction coefficient.

[0017] In a second aspect of the present application, a dust concentration detection device based on extinction coefficient is provided, the device comprising an image acquisition module, an image processing module, and a dust concentration output module, wherein:

[0018] The image acquisition module is used to extract dust from the air through an air pump and take dust-containing images through a preset camera.

[0019] The image processing module is used to perform preprocessing operations on dust-laden images. The preprocessing operations include optimizing the brightness of dust-laden images through a deep learning model composed of an attention mechanism, restoring the color of dust-laden images through a color restoration model based on a convolutional neural network, and grayscale processing of dust-laden images through a preset processing method.

[0020] The dust concentration output module is used to input the pre-processed dust-containing image into the haze image formation model and output the dust concentration according to the haze image formation model.

[0021] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device performs any of the methods described above.

[0022] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to perform any of the above methods.

[0023] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0024] 1. Dust is extracted from the air through an air pump, and a dust-laden image is captured through a preset camera. The dust-laden image is preprocessed, including brightness optimization of the dust-laden image through a deep learning model composed of an attention mechanism, color restoration of the dust-laden image through a color restoration model based on a convolutional neural network, and grayscale processing of the dust-laden image through a preset processing method. The preprocessed dust-laden image is input into a haze image formation model, and the dust concentration is output based on the haze image formation model. By combining multiple advanced technologies such as deep learning, image enhancement, color restoration, and grayscale processing, the influence of environmental interference on the dust concentration detection results is effectively eliminated, thereby improving the detection accuracy and reliability.

[0025] 2. Pixels in the area of non-uniform brightness distribution in the dust-containing image are used as attention response areas, and a deep learning model is constructed based on the attention response areas. The deep learning model includes a generator network and a discriminator network. The generator network introduces a grayscale value loss function during the training process; the first image and the second image are input into the generator network, and a brightness-enhanced image is generated through the generator network for brightness optimization; the first image is an attention image generated by inverting the dust-containing image, and the second image is a low-light image of the dust-containing image obtained by adjusting the LED light source; the first image and the brightness-enhanced image are input into the discriminator network, and the discriminator network distinguishes the authenticity of the brightness-enhanced image through an adversarial mechanism to reversely optimize the deep learning model, thereby generating high-quality images in practical applications through the adversarial training mechanism, ensuring that the dust information in the image can be accurately extracted even under complex environmental conditions, providing strong support for brightness optimization for the subsequent calculation of dust concentration.

[0026] 3. Convert the low-light image into a first RGB ratio map, and input the first RGB ratio map into a color restoration model composed of multiple convolutional layers. The color restoration model introduces a ratio consistency loss function during the training process. Based on the first RGB ratio map, the color restoration model outputs the learned color information. Based on the learned color information, the first RGB ratio map is enhanced into a second RGB ratio map to perform color restoration on the dust-laden image. Through color restoration, the details of the dust image and the representation of dust particles are improved, providing strong support for color restoration optimization for subsequent dust concentration calculations. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 1 is a flow chart of a dust concentration detection method based on extinction coefficient provided in an embodiment of the present application;

[0028] Figure 2 This is a schematic diagram of the structure of a dust concentration measurement system based on an extinction coefficient imaging model provided in an embodiment of the present application;

[0029] Figure 3 This is a schematic diagram of a GAN-based image enhancement process provided in an embodiment of the present application;

[0030] Figure 4 1 is a module schematic diagram of a dust concentration detection device based on extinction coefficient provided in an embodiment of the present application;

[0031] Figure 5 This is a structural diagram of an electronic device provided in an embodiment of the present application.

[0032] Explanation of the accompanying symbols: 41, image acquisition module; 42, image processing module; 43, dust concentration output module; 501, processor; 502, communication bus; 503, user interface; 504, network interface; 505, memory. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0034] The terms used in the following examples of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of the present application, the singular expressions "a", "an", "said", "above", "the", and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more of the listed items.

[0035] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

[0036] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.

[0037] Please refer to Figure 1 , which shows a flow chart of a dust concentration detection method based on extinction coefficient provided in an embodiment of the present application, the flow chart mainly includes the following steps: S101 to S103.

[0038] Step S101: extract dust from the air through an air pump, and take a dust-containing image through a preset camera.

[0039] Specifically, please refer to Figure 2 , which shows a schematic diagram of the structure of a dust concentration measurement system based on an extinction coefficient imaging model, provided in an embodiment of the present application. The main switch 201, as the core component of the system, is responsible for controlling and starting the entire hardware module. The transparent rectangular chamber 202, serving as the housing for the image acquisition device, measures 0.8 × 0.8 × 1.0 m³. Acrylic was chosen for its high transmittance in the visible light range, comparable to the performance of optical glass. The vacuum pump 203 and duct 204 primarily extract dust from the air into the image acquisition device and discharge the airflow in the transparent rectangular chamber 202 into the atmosphere to maintain consistency with the surrounding environment. The LED light 205 provides an adjustable lighting environment for the entire image acquisition device. Next to the LED light is a small electric fan 206, which ensures that the dust-laden airflow extracted by the vacuum pump 203 circulates more quickly and fully within the transparent rectangular chamber 202. The image acquisition device uses a video camera 207 with a frame rate of 50 fps and a resolution of 1080p. Its function is to capture a video clip at regular intervals and provide images for subsequent processing. Placed behind the video camera 207 is an annular guide rail 208 fixed on the side wall of the transparent rectangular chamber 202, and its function is to allow the video camera to collect dust-containing images in a wider range. The black and white striped target 209 is placed on the cavity wall of the rectangular inlet chamber 202, and its function is to help quantify the dust concentration. The transmitted light detection instrument 210 is installed below the image acquisition device, and its function is to measure the ratio of the incident light and the transmitted light intensity to provide assistance for subsequent calculations. Next to the transparent rectangular chamber 202 is a data cable and a computer 211 connected to the video camera, which is used to process the collected images and use the haze image formation model to solve the extinction coefficient value and finally calculate the dust concentration value in combination with the Lambert-Beer law. Under the entire transparent rectangular chamber 202 are four universal wheels 212, whose function is to facilitate the movement of the measurement system and measure the dust concentration in different locations of the workshop. Therefore, through Figure 2 It can be seen that dust sampling is carried out at a preset position through the vacuum pump 203, and the dust-laden airflow is input into the transparent rectangular chamber 202; the small electric fan 206, the LED light 205 and the vacuum pump 203 are started, and when the transparent rectangular chamber 202 is evenly filled with dust, the preset camera, i.e., the video camera 207, is started to capture the dust-laden image.

[0040] Step S102: performing pre-processing on the dust-containing image.

[0041] Specifically, the video from the image acquisition device is uploaded to a computer system, which then identifies it and uses video processing software to extract several still images for analysis from the video, from the moment the dust enters until it becomes aligned with the environment. The image is then cropped to isolate a valid area from a single target on the inner wall of the experimental chamber. After the previous image cropping step, the dust-laden image, captured under uneven and unbalanced lighting conditions, suffers from a series of quality degradation issues, such as low contrast and color distortion, making it difficult to meet the requirements of the subsequent haze image formation model analysis. Therefore, to address these issues, the dust-laden image is preprocessed. This preprocessing includes: brightness optimization of the dust-laden image using a deep learning model comprised of an attention mechanism; color restoration of the dust-laden image using a convolutional neural network-based color restoration model; and grayscale conversion of the dust-laden image using a preset processing method.

[0042] In a possible embodiment, step S102 also includes: taking pixels in the area of non-uniform brightness distribution in the dust-containing image as attention response areas, and constructing a deep learning model based on the attention response areas, the deep learning model includes a generator network and a discriminator network, and the generator network introduces a grayscale value loss function during the training process; inputting the first image and the second image into the generator network, and generating a brightness-enhanced image through the generator network for brightness optimization; the first image is an attention image generated by inverting the dust-containing image, and the second image is a low-light image of the dust-containing image obtained by adjusting the LED light source; inputting the first image and the brightness-enhanced image into the discriminator network, and the discriminator network distinguishes the authenticity of the brightness-enhanced image through an adversarial mechanism to reversely optimize the deep learning model.

[0043] Specifically, GAN is a deep learning model consisting of a generator called G (Generator) and a discriminator called D (Discriminator). Its adversarial mechanism is that the generator continuously generates more and more realistic fake data, while the discriminator tries to distinguish between true and false data, and the two compete with each other during the training process. After the discriminator outputs an incorrect judgment, the weight of the generator will be updated. In order to achieve the purpose of dialogue D, G will output as many realistic results as possible. Until the true and false data reach the same distribution, D cannot distinguish between the generated data and the real data, then this means that G does have the ability to generate data similar to the real data. Therefore, the core principle of GAN is that the trained D has the ability to recognize real data, and the trained G can output data similar to the real data. The result of D will optimize the generation effect of G and can achieve a balanced state of the two parts of GAN. The loss function of GAN is:

[0044]

[0045] Among them, max min represents a minimax optimization problem, where the generator G tries to minimize the function and the discriminator D tries to maximize the function. V(D,G) is the value function of GAN, which measures the performance of the entire system given the generator G and the discriminator D. data (x) represents the distribution of real data, It means to calculate the expected value of its real data x. D(x) represents the output of the discriminator for the input data x. z represents random noise, and p(z) represents the noise distribution, which is usually Gaussian distribution or other simple distribution. represents the expected value calculation of the noise z sampled from the noise distribution p(z). G(z) represents the data generated by the generator based on the noise z, so D(G(z)) represents the output of the discriminator for the data generated by the generator based on the noise z.

[0046] GANs alternately optimize G and D, meaning the weights of G remain constant while training D, and vice versa. When training the generator, the loss function is reduced by pushing D(G(z)) toward 1. The loss function is increased by pushing D(x) toward 1 and D(G(z)) toward 0 while training the discriminator. Ultimately, the loss function converges to a value where the generated data resembles real data. This adversarial mechanism results in GAN-enhanced images that appear more natural.

[0047] Under normal image enhancement conditions, the problem of under-enhancement of images often occurs during the process due to unbalanced and insufficient lighting or other factors. The wood dust concentration detection results of this technology are directly related to the image, in order to reduce the interference of this problem on the experimental results. Therefore, this technical solution uses the attention mechanism to improve the problem of under-enhancement of images by adding more weights to the dim areas in the input image during the convolution process. At the same time, the inverse map of the I channel in the HSI color space is used as the attention map, and it is multiplied with all the layers after the convolution in the encoding process to further improve other problems in the image enhancement. Inspired by the effectiveness of generative adversarial networks in low-light image enhancement, if there is a problem of unbalanced light in the image, blindly enhancing the entire image indiscriminately is not a good choice. Therefore, this technical solution constructs a brightness optimization module guided by the attention mechanism based on the generative adversarial network, please refer to Figure 3 , which presents a schematic diagram of a GAN-based image enhancement process provided in an embodiment of the present application.

[0048] In the brightness optimization module guided by the attention mechanism on the left, first, the real image I real Perform the inversion as the attention map, that is, the first image, where the real image I realThe original dust image is obtained without adjusting the LED light source, and the low-light image I n , that is, the second image is input to the generator network together, where the low-light image I n is the image obtained by adjusting the LED light source. Next, the attention image will be multiplied pixel by pixel with the feature map of the corresponding size in the low-light image. After that, the darker areas can get more weight in the enhancement process, which will alleviate the problem of under-enhancement of the image. After multiplication, the generated brightness enhanced image I is obtained. g Afterwards, the low-light image I n and the resulting brightness enhanced image I g The discriminator network is fed together with the generated adversarial mechanism of GAN, and the discriminator improves its ability to distinguish low-light images. n and the resulting brightness enhanced image I g , thereby promoting the generator to generate higher quality brightness enhanced images.

[0049] In addition, the generator network introduces a grayscale loss function during the training process and constructs the grayscale loss function through the following formula:

[0050]

[0051] Among them, L GVL is the gray value loss function, m and n represent the size of a single channel, I real represents a dusty image, I att Represents the first image, I n Represents the second image, G(I n ,I att ) represents the brightness enhanced image, (G(I n ,I att )-I real ) i,j represents the difference Q(·) between the pixel values of the brightness enhanced image and the dust image at the pixel position (i, j) i,j Represents the sum of the three RGB channels. The total loss function L BOM It is constructed by the following formula:

[0052] L BOM =MSE+L GVL +L GEN +L DIS +kL0;

[0053] L BOM is the total loss function, MSE stands for mean square error, which is used to measure the error of pixel values; L GEN Expressed as the loss function of the generator; L GVL Expressed as the loss function of image vision; LDIS represents the loss function of the discriminator; k is a hyperparameter used to balance the importance of different loss terms in the overall loss function. By adjusting the value of k, the model can control the emphasis placed on different loss terms during training. L0 represents the loss function for the remaining steps.

[0054] This approach combines widely used loss functions with grayscale loss functions to train a deep learning model, achieving the goal of accurately completing tasks and generating high-quality images. To address the issue of vanishing gradients, an improved activation function, LeakyReLU, is used in every layer of the generator and discriminator networks. In this deep learning model, except for the final output layer of the generator, all other layers are carefully configured with 5×5 convolution kernels and a stride of 2. Furthermore, a 3×3 max pooling layer with a stride of 2 is embedded in the deep learning model.

[0055] In one possible implementation, step S102 further includes: converting the low-light image into a first RGB ratio map, and inputting the first RGB ratio map into a color restoration model composed of multiple convolutional layers, wherein the color restoration model introduces a ratio consistency loss function during training; outputting learned color information through the color restoration model based on the first RGB ratio map; and enhancing the first RGB ratio map into a second RGB ratio map based on the learned color information to perform color restoration on the dust-laden image.

[0056] Specifically, the color information and lighting conditions of an image have a combined impact on the human visual system's perception of color. As an inherent property of an image, color information can be preserved by eliminating the effects of low-light conditions, as follows:

[0057]

[0058] Among them, L is the lighting condition, C is the color information, and R represents the result of the convolution of the two.

[0059] Based on MSR (Multi-Scale Retina Enhancement), the relationship between the three RGB channels can be adjusted using the color restoration index to improve the contrast of low-light images and preserve color information. Currently, an effective method based on color constancy is to convert the image to HSI or other color spaces to separate color and brightness to preserve the original color information and improve brightness. Although this method improves the color richness of low-light images, it still cannot preserve colors well when using the original color information.

[0060] In this technical solution, the color information of the image is represented by the RGB ratio, which is defined as a ratio map, namely the first RGB ratio map. The ratio map of a specific pixel E(x, y) is as follows:

[0061]

[0062] Among them, E(x,y) is a specific pixel, P R ,P G ,P B Represents the ratio of the red, green and blue channels respectively, (x,y) represents the pixel position, R(x,y), G(x,y) and B(x,y) represent the values of the red, green and blue channels at the pixel position (x,y), respectively, and sum(x,y) represents the sum of the pixels at the (x,y) position. The formula is as follows:

[0063] sum(x,y)=R(x,y)+G(x,y)+B(x,y);

[0064] In addition, when the value of sum(x,y) is 0, in order to avoid the error of dividing by zero, E(x,y) will be set to 0. The color restoration module proposed in this paper can learn the low-light image I n The ratio graph relationship between the output of the color restoration module and the ground truth. F , that is, the second RGB ratio diagram is as follows:

[0065]

[0066] Among them, CRM is the abbreviation of Color Restoration Module. is the learned second RGB ratio map E F However, due to the huge difference in color information between low-light images and real images, the final enhanced image is based on the learned color information E F Instead of directly using the original color information E, the color restoration is better than using the original color information. The relationship between the three RGB channels is learned through a carefully designed loss function.

[0067] Therefore, in order to protect the color information, this paper also proposes a color restoration module based on convolutional neural network, namely Figure 3 The color restoration module guided by color constancy is shown in . By combining the output of the color restoration module guided by color constancy and the GAN brightness optimization module with the attention mechanism, the final enhanced image can be obtained. And the pixel value of the enhanced image It can be calculated as follows:

[0068]

[0069] in, They represent the values of the red, green, and blue channels after processing by the color restoration module, and sum′(x,y) represents the sum of the pixel values of the three RGB channels of the image generated by the brightness optimization module. F This is the second RGB ratio map, which is the color information learned by this module.

[0070] It is worth noting that if the sum of the three color channel values of a pixel is zero, the ratio of the pixel is set to zero to prevent division by zero errors and ensure the stability of the calculation. In addition to making the ratio map of the low-light image fit close to the real image, this application also hopes that the ratio enhanced by the module has consistency, that is, the sum of the ratio map of a pixel needs to be close to 1. Therefore, a ratio consistency loss function L is designed. RCL as follows:

[0071]

[0072] Among them, L RCL is the ratio consistency loss function, m and n represent the size of a single channel, ‖·‖1 is the L1 norm, and Q(·) represents E F The sum of the three RGB channels, (E F ) i,j represents the color information learned by the color restoration model at pixel position (i, j). The total loss function is as follows:

[0073] L CRM =L RCL +MAE;

[0074] MAE stands for mean absolute error, providing an intuitive assessment of image quality at the pixel level. To better extract features from the ratio map, the color restoration module employs a deeper architecture than the generator, adding three convolutional layers. The convolution kernel size is 5*5 with a stride of 2; the maximum pooling size is 3*3 with a stride of 2.

[0075] Color distortion has always been a major challenge in the field of image enhancement. The color information of low-light images deviates significantly from that of real images. Therefore, it is not reasonable to perform enhancement processing directly through the color information of low-light images. In GAN, the task of the discriminator is to distinguish between real images and generated images. CNN, as the core structure of the discriminator, can learn high-level features in the image and accurately judge the authenticity of the image. Through training, the discriminator can continuously improve its performance, thereby driving the generator to generate more realistic images. Therefore, to address this problem, this patent innovatively proposes a color restoration module based on a convolutional neural network (CNN) guided by color constancy. The core of the module is to learn the relationship between the RGB ratio between low-light images and real images as a discriminator. Specifically, as mentioned above Figure 3 As shown:

[0076] First, the low-light image I is calculated using the above formula for obtaining a specific pixel. n The first RGB ratio map E is taken as input and passed to the color restoration module with CNN as the core to learn the RGB relationship between the low-light image and the original dust-containing image and output the learned second RGB ratio map E F Finally, the pixel values of the image will be reconstructed based on the pixel values of the enhanced image. F Under the guidance of , the brightness enhancement image I generated in the brightness optimization module is rearranged g The ratio relationship of the three RGB channels is used to obtain the final brightness enhanced image I F .

[0077] In addition, in the embodiments of the present application, the dust-laden image can also be optimized by other pre-processing operations. Generally speaking, the main reasons for converting an image from color to grayscale include simplifying the image matrix, improving the operation speed, reducing the amount of data and highlighting the image structure. First of all, improving the operation speed is one of the main reasons for this technical solution. Each pixel of a color image is determined by three components: R (red), G (green), and B (blue), and the value range of each component is 0-255, which means that a pixel can have 16777216 kinds of color changes (the cube of 256). In contrast, the R, G, and B component values of a grayscale image are equal, and the color change range of a pixel is limited to 256 possibilities from 0 to 255. Therefore, converting a color image to a grayscale image can significantly reduce computational complexity and improve operation speed.

[0078] Secondly, reducing the amount of data is also one of the important reasons for this technical solution. Grayscale images only require one byte to represent the brightness value of a pixel, while color images usually require three bytes. This means that when storing and transmitting images, grayscale images require less data, which can save storage space and transmission bandwidth. Finally, highlighting image structure is also very useful in some cases. In the haze image formation model in this article, color information is not required, and grayscale images can better highlight the texture, shape, and structure of the image, making the edge detection in the next step more effective.

[0079] Grayscale conversion can be achieved in a variety of ways, including component-based methods, average-based methods, and methods based on the YUV color space. For example, the component-based method selects the R, G, or B component as the grayscale value; the average-based method converts by calculating the average of the three R, G, and B components; and this paper converts RGB color channels to grayscale using a weighted average method, as it better aligns with the human eye's perception and preserves image detail and contrast.

[0080] D(x,y)=0.299* R(x,y)+0.587 * G(x,y)+0.114 * B(x,y)

[0081] In the above formula, D(x,y) represents the converted grayscale value of a point (x,y) in the image, while R(x,y), G(x,y), and B(x,y) represent the red, green, and blue monochromatic components of the point (x,y), respectively. Since the human eye is most sensitive to green, followed by red, and least sensitive to blue, different weights are assigned to these components. After a series of image processing steps, the average amplitude of the gradient change of spatial pixel intensity is processed using the following haze image formation model.

[0082] Step S103 : inputting the pre-processed dust-containing image into a haze image forming model, and outputting dust concentration according to the haze image forming model.

[0083] Specifically, the haze image formation model is used to calculate the average gradient modulus corresponding to each area in the preprocessed dust-containing image; the local contrast in the spatial domain is calculated based on the average gradient modulus corresponding to each area; the average peak extinction coefficient is calculated based on the local contrast and with a preset error tolerance as the selection condition; the absorbance is calculated according to the Lambert-Beer law, and the dust concentration is output in combination with the average peak extinction coefficient.

[0084] The haze image formation model explains that the hazy image is formed by connecting the transmission of light. The total extinction is only affected by scattering, and the absorption of some light is negligible compared to the total light intensity. The single target method for suspended dust measurement is also used in this model. This method involves using a 0.8×0.8×1.0m3 transparent rectangular acrylic chamber and a black and white striped target in the above hardware module to measure the suspended dust concentration. Any detectable change or deviation in the light at a single target by the inner wall of the device can be attributed to the presence of dust particles in front of the target. The target is then used as a baseline, allowing the observed b ext The change in pattern accurately measures and quantifies dust concentration. Light transmission can be related to image formation using the following expression:

[0085] I F (x) = C (1 - y (x)) + y (x) Q (x);

[0086] Among them, x is a two-dimensional space variable, I F (x) is the dust-containing image after the above preprocessing operation, Q(x) is the scene radiance, C is the ambient (atmospheric) light, and y(x) is the atmospheric transmittance, which is inversely proportional to the extinction coefficient through an exponential relationship and is calculated as follows:

[0087] y(x)=exp(-b*bext );

[0088] Among them, b ext is the extinction coefficient, and b is the path length of light from the point where the image is observed to the position where the light propagates to the target image. F (x) estimates y(x) and can calculate b ext Then, applying spatial contrast to the observed image in the equation, the following expression can be derived from the light transmission expression:

[0089]

[0090] in, It represents the gradient value of the brightness enhanced image. represents the gradient of the scene radiation. Formula (14) assumes that the ambient light C is locally constant and independent of x. Formula (16) is derived from the fact that the value of the transmission y(x) is always positive and assumes that it remains constant within a specific location. If the scene transmission is perfect, then the value of the contrast in the scene is given by To measure. This is the real contrast scene, for the contrast in the spatial domain, is the absolute value of the brightness enhanced image gradient. Edge detection is performed using the Scharr filter of the first-order derivative of the image in the horizontal and vertical directions, and the image gradient is estimated for each pixel. To compensate for slight camera motion and image noise, we determine the local contrast C in the spatial domain by calculating the mean value of the gradient modulus of the image region x under a constant transmission coefficient y(x) l , the local contrast is calculated as follows:

[0091]

[0092] in, is the averaging factor, where |Ω| represents all regions of the brightness enhanced image, ∑ x∈Ω It represents the sum of all regions in the brightness enhanced image. Combining the calculation formula of atmospheric transmittance and the above derived formula, and then through logarithmic transformation, and based on the average intensity value in the spatial domain and the true contrast under perfect transmission, we can calculate the b extracted from each frame of the dust image. ext The analytical value of the last repetition is selected. ext The value is selected with the preset error tolerance as the selection condition, that is, the average peak extinction coefficient b is calculated considering the selected value with a 3% error tolerance. ext , which is calculated as follows:

[0093]

[0094] The extinction coefficient is usually used to describe the absorption capacity of a substance to light at a unit concentration, while the molar absorptivity is the absorption coefficient at a concentration of 1 mol / L. Since the extinction coefficient and the molar absorptivity are equivalent in the Lambert-Beer law, the extinction coefficient and the molar absorptivity can be used interchangeably in the Lambert-Beer law, and because they both express the absorption capacity of a substance to light. The Lambert-Beer law is as follows:

[0095]

[0096] In the above formula, A represents absorbance, I0 is the intensity of incident light, I is the intensity of transmitted light, c is the concentration of the substance, l is the length of the medium through which light passes, and ∈ represents the extinction coefficient or molar absorption coefficient. Then, the present technical solution can use a transmittance detection instrument to obtain the ratio of incident light intensity to transmitted light intensity, thereby calculating the absorbance A and then converting the molar absorption coefficient ∈ into the extinction coefficient b. ext , and then by combining formula (18) and formula (19), we can establish the concentration c and extinction coefficient b ext The dust concentration that needs to be measured can be calculated using the following equation:

[0097]

[0098] The present application adopts the above method to extract dust from the air through the vacuum pump 203, and capture the dust-containing image through a preset camera; preprocessing operations are performed on the dust-containing image, and the preprocessing operations include optimizing the brightness of the dust-containing image through a deep learning model composed of an attention mechanism, restoring the color of the dust-containing image through a color restoration model based on a convolutional neural network, and grayscale processing of the dust-containing image through a preset processing method; the preprocessed dust-containing image is input into a haze image formation model, and the dust concentration is output according to the haze image formation model, thereby effectively eliminating the influence of environmental interference on the dust concentration detection results by combining multiple advanced technologies such as deep learning, image enhancement, color restoration and grayscale processing, and improving the detection accuracy and reliability.

[0099] Please refer to Figure 4 , which shows a module schematic diagram of a dust concentration detection device based on extinction coefficient provided in an embodiment of the present application, the device includes an image acquisition module 41 and an image processing module 42, wherein,

[0100] The image acquisition module 41 is used to extract dust from the air through an air pump and take dust-containing images through a preset camera.

[0101] The image processing module 42 is used to perform a preprocessing operation on the dust-laden image. The preprocessing operation includes optimizing the brightness of the dust-laden image through a deep learning model composed of an attention mechanism, restoring the color of the dust-laden image through a color restoration model based on a convolutional neural network, and grayscaling the dust-laden image through a preset processing method.

[0102] The dust concentration output module 43 is configured to input the pre-processed dust-containing image into a haze image forming model, and output dust concentration according to the haze image forming model.

[0103] In one possible embodiment, the image acquisition module 41 is used to extract dust from the air through an air pump and capture dust-containing images through a preset camera, specifically including: performing dust sampling at a preset position through an air pump and inputting the dust-containing airflow into a transparent rectangular chamber; starting a small fan, an LED light, and an air pump, and when the transparent rectangular chamber is evenly filled with dust, starting the preset camera to capture the dust-containing image.

[0104] In one possible embodiment, the image processing module 42 is used to optimize the brightness of the dust-containing image through a deep learning model composed of an attention mechanism, specifically including: taking pixels in the area of uneven brightness distribution in the dust-containing image as attention response areas, and constructing a deep learning model based on the attention response areas, the deep learning model including a generator network and a discriminator network, and the generator network introduces a grayscale value loss function during the training process; inputting the first image and the second image into the generator network, and generating a brightness-enhanced image through the generator network for brightness optimization; the first image is an attention image generated by inverting the dust-containing image, and the second image is a low-light image of the dust-containing image obtained by adjusting the LED light source; the first image and the brightness-enhanced image are input into the discriminator network, and the discriminator network distinguishes the authenticity of the brightness-enhanced image through an adversarial mechanism to reversely optimize the deep learning model.

[0105] In a possible implementation, the image processing module 42 is configured to construct a grayscale value loss function using the following formula:

[0106]

[0107] Among them, L GVL is the gray value loss function, m and n represent the size of a single channel, I real represents a dusty image, I att Represents the first image, I n represents the second image, g(I n ,I att ) represents the brightness enhanced image, (G(I n ,I att )-Ireal ) i,j represents the difference Q(·) between the pixel values of the brightness enhanced image and the dust image at the pixel position (i, j) i,j Represents the sum of the three RGB channels.

[0108] In one possible embodiment, the image processing module 42 is used to perform color restoration on the dust-containing image using a color restoration model based on a convolutional neural network, specifically including: converting the low-light image into a first RGB ratio map, and inputting the first RGB ratio map into a color restoration model composed of multiple convolutional layers, wherein the color restoration model introduces a ratio consistency loss function during the training process; outputting learned color information based on the first RGB ratio map through the color restoration model; and enhancing the first RGB ratio map into a second RGB ratio map based on the learned color information to perform color restoration on the dust-containing image.

[0109] In one possible implementation, the image processing module 42 is configured to construct a ratio consistency loss function using the following formula:

[0110]

[0111] Among them, L RCL is the ratio consistency loss function, m and n represent the size of a single channel, ‖·‖1 is the L1 norm, and Q(·) represents E F The sum of the three RGB channels, (E F ) i,j Represents the color information learned by the color restoration model at pixel position (i, j).

[0112] In one possible embodiment, the dust concentration output module 43 is used to output the dust concentration according to the haze image formation model, specifically including: calculating the gradient modulus average value corresponding to each area in the preprocessed dust-containing image through the haze image formation model; calculating the local contrast in the spatial domain according to the gradient modulus average value corresponding to each area; calculating the average peak extinction coefficient according to the local contrast and with a preset error tolerance as a selection condition; calculating the absorbance according to the Lambert-Beer law, and outputting the dust concentration in combination with the average peak extinction coefficient.

[0113] It should be noted that the above embodiments provide devices that implement their functions using only the division of the above functional modules as examples. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0114] This application also provides an electronic device. Figure 5 , Figure 5 5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include: at least one processor 501, at least one communication bus 502, a user interface 503, at least one network interface 504, and a memory 505.

[0115] The communication bus 502 is used to implement the connection and communication between these components.

[0116] The user interface 503 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.

[0117] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0118] The processor 501 may include one or more processing cores. The processor 501 utilizes various interfaces and lines to connect various parts of the entire server, and executes various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 505, as well as calling data stored in the memory 505. Optionally, the processor 501 may be implemented in the form of at least one hardware component selected from digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 501 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 501 and may be implemented separately on a single chip.

[0119] Among them, the memory 505 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 505 may also be optionally at least one storage device located away from the aforementioned processor 501. Reference Figure 5 , as a computer storage medium, the memory 505 may include an operating system, a network communication module, a user interface module, and a xxxxxxxx application.

[0120] exist Figure 5 In the electronic device shown, the user interface 503 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 501 can be used to call the xxxxxxxx application stored in the memory 505. When executed by one or more processors 501, the electronic device executes one or more of the methods described in the above embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that this application is not limited to the described order of actions, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for this application.

[0121] The present application also provides a computer-readable storage medium storing instructions, which, when executed by one or more processors, enable an electronic device to execute one or more of the methods described in the above embodiments.

[0122] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0123] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely schematic, such as the division of units, which is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interface, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0124] Units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0125] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0126] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.

[0127] The above descriptions are merely exemplary embodiments disclosed in this application and are not intended to limit the scope of this application. That is, any equivalent changes and modifications made based on the teachings disclosed in this application are still within the scope of this application.

[0128] This application is intended to cover any modifications, uses or adaptations disclosed in this application, which follow the general principles disclosed in this application and include common knowledge or customary technical means in the technical field not disclosed in this application.

Claims

1. A dust concentration detection method based on extinction coefficient, characterized in that: The method comprises: The dust in the air is extracted by an air pump, and the dust-containing image is captured by a preset camera; performing a preprocessing operation on the dust-laden image, the preprocessing operation comprising optimizing brightness of the dust-laden image using a deep learning model composed of an attention mechanism, restoring color of the dust-laden image using a color restoration model based on a convolutional neural network, and grayscaling the dust-laden image using a preset processing method; The pre-processed dust-containing image is input into a haze image forming model, and dust concentration is output according to the haze image forming model.

2. The method according to claim 1, characterized in that The method of extracting dust from the air by using an air pump and taking dust-containing images by using a preset camera specifically includes: Dust sampling is carried out at a preset position through an air pump, and the dust-laden airflow is input into a transparent rectangular chamber; The small fan, the LED light and the vacuum pump are started, and when the transparent rectangular chamber is evenly filled with dust, the preset camera is started to capture the dust-containing image.

3. The method according to claim 1, characterized in that The brightness optimization of the dust-containing image using a deep learning model composed of an attention mechanism specifically includes: Pixels in an area with uneven brightness distribution in the dust-containing image are used as attention response areas, and the deep learning model is constructed based on the attention response areas. The deep learning model includes a generator network and a discriminator network. The generator network introduces a grayscale value loss function during training; Inputting a first image and a second image into the generator network, and generating a brightness-enhanced image through the generator network for brightness optimization; the first image is an attention image generated by inverting the dust-containing image, and the second image is a low-light image of the dust-containing image obtained by adjusting the LED light source; The first image and the brightness enhanced image are input into the discriminator network, and the discriminator network distinguishes the authenticity of the brightness enhanced image through an adversarial mechanism to reversely optimize the deep learning model.

4. The method according to claim 3, characterized in that The grayscale loss function is constructed by the following formula: Among them, L GVL is the gray value loss function, m and n represent the size of a single channel, I real represents the dusty image, I att represents the first image, I n represents the second image, G(I n ,I att ) represents the brightness enhanced image, (G(I n ,I att )-I real ) i,j represents the difference Q(·) between the pixel values of the brightness enhanced image and the dust-containing image at the pixel position (i, j) i,j Represents the sum of the three RGB channels.

5. The method according to claim 3, characterized in that The color restoration of the dust-containing image using a color restoration model based on a convolutional neural network specifically includes: Converting the low-light image into a first RGB ratio map, and inputting the first RGB ratio map into the color restoration model composed of multiple convolutional layers, wherein the color restoration model introduces a ratio consistency loss function during training; Outputting learned color information through the color restoration model according to the first RGB ratio map; According to the learned color information, the first RGB ratio map is enhanced into a second RGB ratio map to perform color restoration on the dust-laden image.

6. The method according to claim 4, characterized in that The ratio consistency loss function is constructed by the following formula: Among them, L RCL is the ratio consistency loss function, m and n represent the size of a single channel, ‖·‖1 is the L1 norm, and Q(·) represents E F The sum of the three RGB channels, (E F ) i,j represents the color information learned by the color restoration model at the pixel position (i, j).

7. The method according to claim 1, characterized in that Outputting the dust concentration according to the haze image forming model specifically includes: Calculating the average value of the gradient modulus corresponding to each region in the pre-processed dust-containing image by using the haze image formation model; Calculating the local contrast in the spatial domain according to the average value of the gradient modulus corresponding to each region; Calculate the average peak extinction coefficient based on the local contrast and the preset error tolerance; The absorbance is calculated according to the Beer-Lambert law, and the dust concentration is output in combination with the average peak extinction coefficient.

8. A dust concentration detection device based on extinction coefficient, characterized in that: The device includes an image acquisition module, an image processing module and a dust concentration output module, wherein: The image acquisition module is used to extract dust from the air through an air pump and capture dust-containing images through a preset camera; The image processing module is configured to perform a preprocessing operation on the dust-laden image, wherein the preprocessing operation includes optimizing the brightness of the dust-laden image using a deep learning model composed of an attention mechanism, restoring the color of the dust-laden image using a color restoration model based on a convolutional neural network, and grayscaling the dust-laden image using a preset processing method; The dust concentration output module is used to input the pre-processed dust-containing image into a haze image forming model and output dust concentration according to the haze image forming model.

9. An electronic device, characterized in that: The electronic device comprises a processor, a communication bus, a user interface, a network interface and a memory, wherein the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is performed.