Next Article in Journal
Efficient Integration of Ultra-low Power Techniques and Energy Harvesting in Self-Sufficient Devices: A Comprehensive Overview of Current Progress and Future Directions
Previous Article in Journal
Comparison of Wireless Continuous Axillary and Core Temperature Measurement after Major Surgery
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Reconstruction of the Chemical Gas Concentration Distribution Using Partial Convolution-Based Image Inpainting

by
Minjae Kang
,
Jungjae Son
,
Byungheon Lee
and
Hyunwoo Nam
*
Chem-Bio Technology Center, Agency for Defense Development, Daejeon 34186, Republic of Korea
*
Author to whom correspondence should be addressed.
Sensors 2024, 24(14), 4470; https://doi.org/10.3390/s24144470
Submission received: 31 May 2024 / Revised: 4 July 2024 / Accepted: 8 July 2024 / Published: 10 July 2024
(This article belongs to the Section Chemical Sensors)

Abstract

:
An interpolation method, which estimates unknown values with constrained information, is based on mathematical calculations. In this study, we addressed interpolation from an image-based perspective and expanded the use of image inpainting to estimate values at unknown points. When chemical gas is dispersed through a chemical attack or terrorism, it is possible to determine the concentration of the gas at each location by utilizing the deployed sensors. By interpolating the concentrations, we can obtain the contours of gas concentration. Accurately distinguishing the contours of a contaminated region from a map enables the optimal response to minimize damage. However, areas with an insufficient number of sensors have less accurate contours than other areas. In order to achieve more accurate contour data, an image inpainting-based method is proposed to enhance reliability by erasing and reconstructing low-accuracy areas in the contour. Partial convolution is used as the machine learning approach for image-inpainting, with the modified loss function for optimization. In order to train the model, we developed a gas diffusion simulation model and generated a gas concentration contour dataset comprising 100,000 contour images. The results of the model were compared to those of Kriging interpolation, one of the conventional spatial interpolation methods, finally demonstrating 13.21% higher accuracy. This suggests that interpolation from an image-based perspective can achieve higher accuracy than numerical interpolation on well-trained data. The proposed method was validated using gas concentration contour data from the verified gas dispersion modeling software Nuclear Biological Chemical Reporting And Modeling System (NBC_RAMS), which was developed by the Agency for Defense Development, South Korea.

1. Introduction

When chemical gas is dispersed in chemical attacks, terrorism, or safety accidents, the gas forms a plume and diffuses in various weather conditions. Since the diffused gas is colorless and odorless, it can cause severe casualties. It is important to determine the extent and concentration of gases to minimize casualties. Chemical sensors can also be used to assess the spread of gas. It is possible to generate a gas concentration contour using the data measured by the sensors. For a rapid response against gas dispersion, it is advantageous to install a large number of detection sensors. However, resources are limited, and the reliability of contours where sensors are relatively scarce is low. Figure 1 shows the difference in the reliability of contours according to the number of sensors. As shown in the figure, the contours generated by an insufficient number of sensors do not accurately reflect the actual environment. Therefore, we proposed a method for enhancing the reliability of these areas by reconstructing inaccurate regions using image inpainting.
Mathematical methods have commonly been used to estimate data for unknown areas using limited information. Spatial interpolation is one of the mathematical estimation methods. The input contour image for our method was also generated using spatial interpolation, and unreliable regions within the image were reconstructed using image inpainting. Unlike other studies aimed at improving the accuracy of interpolation from a mathematical perspective, we addressed the same problem from an image-based perspective.
Recent approaches [1,2,3] to image inpainting are based on generative models such as generative adversarial network (GAN) [4], transformer [5,6,7], and denoising diffusion probabilistic model (DDPM) [8]. These methods demonstrate effective performance in plausible filling by utilizing the strengths of the image processing of each model. However, generative model-based approaches generate only plausible and diverse images of missing regions. Filling the missing region plausibly is not meaningful in this task because the purpose of the reconstruction of concentration contours is to improve accuracy. In this study, a partial convolution [9]—based model was proposed among the various models of image inpainting. Since the gas concentration is continuous and mathematically highly correlated with nearby values, it would be more proper to fill it using nearby values rather than simply filling it plausibly. In contrast to generative models, partial convolution fills in missing regions using the convolution calculation of nearby valid regions. Additionally, image inpainting using partial convolution is robust, even with irregular missing data, allowing for more flexible and rational contour reconstruction. By adding a new loss term and tuning the coefficients of the loss function in [9], the model demonstrated better performance in gas concentration contour reconstruction.
In order to train the model, a contour dataset representing the concentration of a dispersed gas is required. Obtaining a sufficient amount of actual data is restricted by time costs and economic constraints. Therefore, a gas diffusion simulation model was developed to construct the concentration contour dataset. This dataset consisted of contour images, and the simulator was based on a two-dimensional Gaussian distribution. This diffusion simulation model also considered wind effects and particle viscosity to generate realistic image data. After training, the utility of the model was validated using the Nuclear Biological Chemical Reporting And Modeling System (NBC_RAMS) developed by the Agency for Defense Development (ADD), South Korea. NBC_RAMS is capable of utilizing validated mathematical models to simulate the behavior of gas particles accurately. The validation was conducted by comparing the results of the software with those of the reconstructed contours using the proposed model. Consequently, we demonstrated that image inpainting can improve the accuracy of the spatial interpolation of gas concentration distribution.
The main contributions of this paper can be summarized as follows:
  • The proposed model, optimized for gas concentration reconstruction, demonstrates an accuracy that is 13.21% higher than that of conventional spatial interpolation methods. This improvement in accuracy has been validated using reliable software, NBC_RAMS;
  • The enhanced accuracy in identifying gas diffusion allows for a rapid response in scenarios involving the leakage of hazardous gases, thereby enabling prompt action in emergencies to prevent significant casualties;
  • The proposed model improves economic efficiency. In real-world scenarios where the deployment of numerous sensors is impractical, it enables effective situation assessment using a limited number of sensors. Additionally, the model can be applied to various fields involving spatially distributed data.

2. Related Works

2.1. Image Inpainting

Image inpainting is a technique used to plausibly fill an erased space in an image; it is often used to restore the corresponding position after removing specific objects. In its early days, nonlearning methods were proposed and were mainly categorized into diffusion- and patch-based methods. Diffusion methods propagate the information of the valid image regions surrounding the erased area to fill them in. Bertalmio et al. [10] and Ballester et al. [11] introduced the early diffusion method using anisotropy. Chan et al. [12] later modified the total variation denoising model for the inpainting of nontextual images. Other methods introduced by Demanet et al. [13] and Levin et al. [14] use image statistics for diffusion-based image inpainting. While diffusion methods excel at filling small or narrow areas, they struggle with large areas. Patch-based methods operate under the assumption of redundancy and coherence in natural images, where nearby pixels tend to share similar characteristics. Many methods have been proposed to search for patches to fill the erased space. Examples include using structure-based priority for patch searches [15], using Markov random fields [16], and applying nonlocal texture matching and nonlinear filtering [17]. However, these methods also have limitations in effectively filling larger areas.
As deep learning has shown significant potential in image processing, many methods using deep learning techniques have emerged in the field of image inpainting. Specifically, convolutional neural networks (CNNs) and generative models have been widely used for image inpainting tasks. Pathak et al. [18] applied a CNN-based autoencoder architecture to learn the mapping between an input image with missing regions and a complete image. The partial convolution approach [9] fills in the image using a convolution operation only on the valid pixels around the missing region. Yu et al. [19] divided the inpainting process into two steps and utilized gated convolution. Various methods for generating images corresponding to erased regions have been developed using GANs, transformers, and DDPMs. Notably, approaches such as those using adversarial and contextual losses with a conditional GAN [20], as well as methods using CNNs and GANs to predict edge guidance in erased areas for inpainting [21], have been proposed. The method proposed by Wan et al. [3] uses a transformer and CNN to decouple image inpainting into an image structure recovery step (for the transformer) and a resolution upsampling step (for the CNN). Lugmayr et al. utilized DDPM to complete an image using sampled noise, which is a process applicable regardless of the mask shape [2].

2.2. Spatial Interpolation

Spatial interpolation techniques are used to estimate values at unmeasured locations based on known data. Representative methods such as inverse distance weighted (IDW), Kriging, and splines have been extensively compared in many studies.
IDW interpolates by forming a linear combination based on data from unknown regions. Compared to other methods, it has the advantage of being simple and less computational but has the disadvantage of being sensitive to outliers. The Kriging method, similar to IDW, estimates data at an unmeasured location but incorporates a variogram, which measures the spatial correlation between two points and contributes significantly to the Kriging method’s high accuracy. While it offers high accuracy, the Kriging method demands significant computational resources. The spline method performs interpolation using a mathematical function and estimates by fitting the known data into a spline function. It has the advantage of being flexible for complex patterns; however, it has low reliability towards the edge of the estimation region.
Although the suitability of the method differs depending on the specific geographic area and the aspect of data existence, many studies have reported that the accuracy of the Kriging method is high in many fields. Bekele et al. [22] compared the performances of the Kriging method and IDW and demonstrated that the Kriging method generally has high performance. Laslett et al. [23] similarly compared the Kriging and spline methods and demonstrated that Kriging has better accuracy.

3. Materials and Methods

3.1. Dataset

The accuracy of the model in real-world situations depends on how closely the dataset reflects actual environmental conditions. Generating a dataset that mimics real-world situations requires access to sensor-measured concentration values. However, gathering extensive data by dispersing gases in an actual environment is both economically and time-intensive. In order to overcome this challenge, we developed a simulation model that emulates gas diffusion. In this simulation model, gas diffusion follows a two-dimensional Gaussian distribution. Figure 2 illustrates the diffusion process.
Gas diffusion in the simulation model occurred on a two-dimensional grid map, and each gas particle stored the two-dimensional co-ordinate vector of the current position. Once the origin grid of gas diffusion was set, all particle vectors were set in that grid co-ordinate. Subsequently, an equal number of two-dimensional random vectors were sampled from a Gaussian distribution. By adding these sampled vectors to the co-ordinate vectors of the gas particles, each particle moved on the grid, facilitating diffusion. The gas diffusion simulation model also considers the effects of wind. The wind effects were categorized into 16 directions, with corresponding vectors for each direction added to all particles at regular intervals. In reality, wind affects gas particles differently based on concentration. High-concentration areas are less affected by wind compared to low-concentration areas. In order to reflect this viscosity of particles, we multiplied a value from 0.5 to 1 for each wind vector according to the concentration of each grid before adding it. Consequently, a small-magnitude wind vector was added to the co-ordinate vector of the gas particles located in areas with high concentrations. Figure 3a shows the results of the gas diffusion simulation model based on 16-directional winds.
Each image within the dataset was 256 × 256 pixels and was created using the Kriging method, utilizing 49 concentration points from the results of the gas diffusion simulation model. Figure 3b shows a segment of the gas concentration contour dataset created from the simulation results. We also created 100 masks for training. Each mask image has a randomly masked region with a size of 100 × 100 pixels, which is about 15% of the input image. The mask was filled with zeros in the missing regions and ones in the valid regions. Figure 4 shows samples of the mask images.

3.2. Partial Convolution

Partial convolution was adopted to reconstruct the low-reliability areas of the contour. Partial convolution, proposed by Liu et al. in 2018 [9], is an image-inpainting method that utilizes a CNN. In this approach, unlike other convolution-based methods, the convolution filter slides across the image and performs convolution operations solely on the valid pixels not covered by a mask. Consequently, the missing regions of the images are filled in as a result of the operation. In addition, the masks are updated gradually after each partial convolution operation. These differences enable partial convolution-based inpainting to effectively handle irregularly sized masked regions. The update process for the images and masks can be expressed as
x = W T ( X M ) s u m ( 1 ) s u m ( M ) + b if s u m ( M ) > 0 0 otherwise .
m = 1 if s u m ( M ) > 0 0 otherwise .
where W is the convolutional filter, X is the image feature corresponding to the filter’s location, and M is the corresponding feature of the binary mask. 1 has the same shape as the filter, with all the elements being 1, and it is used for calculating the scaling factor. When the filter slides, if there are nonzero pixels in the image, the corresponding regions of the image and mask are updated. Nonzero pixels represent valid regions that were not erased by the mask. As the image passes through the partial convolution layers, all the missing regions in the image and mask are gradually filled progressively from the valid regions.

3.2.1. Network

The proposed model has a UNet-like architecture network [24] composed of partial convolution layers. The encoding layers use convolution operations and activation functions that reduce the dimensions of the image, and the decoding layers use nearest neighbor upsampling to expand the image dimensions. The features extracted from the image during the encoding stage were passed to the decoding layers through the skip links of the UNet architecture. These features were concatenated with the results of the previous decoding block and then forwarded to the next layer. Equations (1) and (2) were applied to the convolution operations in the encoding stage to update the input for the next layer. Consequently, the missing regions in the image are filled, and the mask is updated during encoding. By using the features obtained through the skip links from the encoding stage, the decoding layers can obtain information regarding the missing regions of the image. The U-Net architecture’s ability to effectively extract gas diffusion patterns in the encoding layers and fully utilize the input contour information in the final layer is advantageous for gas contour reconstruction.

3.2.2. Loss Function

The loss function of partial convolution [9] was adjusted for the proposed model’s performance. The coefficients of each loss term were modified, and a new term was added to better fit the model to the task of contour reconstruction. The loss function includes newly defined perceptual loss, two style losses [9], and the total variation loss proposed by Johnson et al. [25]. Additionally, the loss function also includes two L 1 loss terms that compare the masked and unmasked regions with the ground truth. ImageNet-pretrained VGG-16 [26] was used to calculate the perceptual loss and style losses. In order to improve the model’s performance, an SSIM (structural similarity index) [27] loss term was added. SSIM is frequently utilized in learning methods that aim to make images similar since it represents structural similarity at the pixel level between two images. The total loss function consisting of seven terms can be represented as Equation (3), and the results were compared according to various tuning conditions.
L o s s = L v a i l d + 21 L h o l e + 0.05 L p e r c e p t u a l + 30 ( L s t y l e o u t + L s t y l e c o m p ) + 0.1 L t v + L s s i m .

3.3. Loss Tuning

The contour images reconstructed using this model are represented by discrete colors, where each color represents the gas concentration. Since pixel smoothing is not crucial, the coefficients of the two L s t y l e were reduced to allow the loss to converge better. In addition, due to the critical importance of accuracy in the filled regions for this task, the coefficient of L h o l e , which represents the loss of the filled areas, was increased. As the model is trained to minimize the loss, modifying these coefficients and adding the SSIM loss term helps the model focus more on accurately filling the interior regions to match the training data. We performed a hyperparameter search to determine the coefficients of the loss function, and the tuned model demonstrated a higher mIoU score of 3.24%. The score was calculated only for the regions filled in by the model. The mIoU score can be calculated using Equation (4). OverlapN indicates the number of pixels overlapping with the ground truth for each class, where each class represents 13 different colors for contour representation. The increase in mIoU score through loss tuning demonstrates that the model has become more suitable for gas contour reconstruction.
m I o U = O v e r l a p 1 + O v e r l a p 2 + + O v e r l a p 13 n u m b e r o f p i x e l s × n u m b e r o f c l a s s e s .

4. Results

4.1. Training Process

In order to train the contour reconstruction model, we utilized 100,000 contour images of different origins and wind directions. Each image in the dataset was a 256 × 256 pixels in size, and we partitioned the entire dataset into 70,000 images for training, 15,000 images for validation, and 15,000 images for testing. The mask images used for training were of the same size as the contour images. Figure 5 shows the test results of the trained model.

4.2. Validation

The validation of the model was conducted using a diffusion simulation model and NBC_RAMS. In each case, the ground truth was the concentration contour generated using the two simulation tools. The concentration values of specific points were sampled from the simulation results, and contours were generated using Kriging interpolation and sampled concentrations. These contours tend to have lower accuracy in areas with sparse data coverage. These areas were erased, and the trained model reconstructed the missing regions. The reconstructed contours were then compared to the ground truth. Significant improvement in the contour accuracy after reconstruction is represented in Figure 6.

4.2.1. Diffusion Simulation Model

The simulation results mimicked an actual environment in which a fatal chemical gas is dispersed. It is assumed that 49 sensors are installed in areas with a sufficient number of sensors and 43 sensors are installed in areas without a sufficient number of sensors. From the simulation results, contour images were generated through spatial interpolation using only the concentrations corresponding to the sensor locations. The accuracy in the areas with relatively few sensors was low, and these areas were erased by the mask and filled with the model. The mIoU score between the restored contours and the simulation results was calculated and compared with the contours before restoration. In order to validate the restoration ability of the model, 50 contours with mIoU scores below 65 were defined as restoration targets. The restoration results showed an average score increase of 13.21%, as listed in Table 1.

4.2.2. NBC_RAMS

The validation was performed using a process similar to that of the diffusion simulation model. The NBC_RAMS results were preprocessed to match the format of the training data. Contours were generated using preprocessed data, and the contours of the environments with an insufficient number of sensors were restored using the model. Compared to the results of the diffusion simulation model, NBC_RAMS demonstrated slightly higher accuracy in environments with a shortage of sensors. In this validation, 50 contours with mIoU scores below 70 were defined as the restoration targets. As presented in Table 2, after the restoration of the model, the average score increased by 11.46%.

4.2.3. Contour Reconstruction with Varied Mask Size

The required mask size for reconstruction varies depending on the extent of inaccurate areas in the spatial interpolation results. In order to evaluate the model’s adaptability to different mask sizes, we classified the masks into three categories: small, medium, and large. Small masks cover 15% or less of the entire image, medium masks cover between 15% and 25%, and large masks cover more than 25%. For each category, the 20 contours generated using the two different simulation tools were used as test data. The results, which are presented in Table 3, demonstrate that the mIoU score increases more significantly with larger masks compared to the spatial interpolation results. However, the reconstruction accuracy decreases as the area to be restored increases.

5. Discussion

In this study, we propose a novel method to improve the accuracy of spatial interpolation in gas concentration using image inpainting. By training an image inpainting model with reliable gas diffusion simulation results, we enhanced the accuracy of gas concentration contours by reconstructing the inaccurate regions. The validation using two different simulation tools showed an improvement in accuracy of 13.21% and 11.46% compared to the conventional method: Kriging. The partial convolution model was adopted to reconstruct the erased areas using the valid surrounding values, and the model’s loss function was adjusted to be suitable for gas concentration contour restoration.
Figure 5, which presents the training results, indicates that the model fills in the erased regions of the contour by considering the gas diffusion patterns. The second case from the left shows that the inner region, which was filled based on the surrounding valid areas, closely resembles the ground truth. Additionally, the last case demonstrates that the central regions of the contour are meaningfully filled using the surrounding values. These results suggest that the image inpainting model reconstructs the contour based on gas diffusion patterns rather than merely filling it in a plausible manner.
Figure 6 represents the results of the trained model reconstructing the inaccurate regions within the contour under the assumption of sensor shortage. As the number of sensors decreases, the performance of Kriging interpolation becomes worse. After erasing the unreliable areas of those results, the model reconstructs them, demonstrating improved accuracy. Despite using masks larger than those used for training, the model effectively restores the impaired regions. This demonstrates that partial convolution performs robustly using masks of various sizes, making it suitable for real-world applications.
The proposed model demonstrates notable accuracy improvements in both the validation using simulation tools and the validation using NBC_RAMS. These results indicate that the dataset generated using the simulation tools effectively reflects the gas diffusion patterns. The performance of the proposed model was verified using NBC_RAMS, a verified gas dispersion modeling program. Table 3 represents the results of the model’s adaptability validation for varied mask sizes. When small-sized masks are required, this indicates that the accuracy of spatial interpolation is not significantly low. Therefore, the improvement in accuracy compared to the spatial interpolation results is the lowest. As the mask size increases, the region being reconstructed by the model becomes larger, leading to a greater level of accuracy improvement. However, as the model reconstructs a larger area, the restoration accuracy itself can decrease.
However, the experiments conducted in this study have limitations due to their reliance on simulations. While the model showed good performance in the simulation environment, real-world conditions involve many more variables. In order to minimize the influence of these variables, it is necessary to conduct real gas diffusion experiments and generate concentration contours to compare with the model’s reconstruction results. Therefore, future work may focus on exploring methods to minimize the impact of various variables in real environments. Additionally, the dataset used to train the proposed model does not account for factors such as strong winds or temperature changes due to sunlight, resulting in a lack of diffusion scenarios across various environments. This limitation may introduce biases into the model’s predictions. These biases can be mitigated by developing more accurate simulation tools that consider a wider range of environmental factors. We plan to develop such simulation tools in further studies. Validating the model trained on this enhanced dataset in outdoor environments is expected to significantly improve the model’s reliability.

6. Conclusions

A machine learning-based approach is proposed to improve the reliability of spatial interpolation from an image-based perspective using image inpainting. Consecutive numerical values distributed in a specific environment, such as concentration, temperature, and precipitation, make it challenging to determine the overall pattern. The accuracy of estimating the overall environment is greatly influenced by the amount of available data. In real-world situations, if sensors could be installed infinitely, the proposed method would not be necessary, and accurate situation assessment would be possible using only numerical interpolation. However, resources are limited, and it is impossible to install numerous sensors. The proposed method showed performance that exceeds the accuracy of the existing spatial interpolation methods in situations with a limited number of sensors, making it more desirable in terms of resource requirements. Nevertheless, the proposed method requires spatial interpolation as a prerequisite, thereby resulting in higher computational costs and complexity compared to spatial interpolation alone. However, as it is a method for handling 2D image data, the increment in complexity is not significant. In summary, the proposed method is a valuable approach in situations with limited sensor coverage, offering enhanced accuracy over traditional interpolation techniques while managing resource constraints effectively.
Our model focused on gas concentration and reported a meaningful improvement in accuracy through validation using two simulation tools. Chemical gases are colorless and odorless, making it difficult to understand gas diffusion precisely. In order to understand the diffusion of a gas, we must rely on deployed sensors, and a quick response is impossible with a limited number of sensors. In such scenarios, the proposed method can contribute to a more accurate understanding of the extent of diffusion. This approach can be applied not only to gas concentrations and other numerical values. It also provides economic efficiency by enabling sufficiently accurate situation identification using a limited number of sensors. However, for the precise restoration ability of the image inpainting model, it is essential to first develop realistic and dependable simulation tools. The accuracy of image-based interpolation in various fields can be enhanced by training the model using reliable simulation results.

Author Contributions

Conceptualization, M.K., J.S. and B.L.; methodology, M.K.; software, M.K.; validation, M.K., J.S. and B.L.; formal analysis, M.K.; investigation, M.K., J.S. and B.L.; resources, M.K., J.S. and B.L.; data curation, M.K., J.S. and B.L.; writing—original draft preparation, M.K. and J.S.; writing—review and editing, B.L. and H.N.; visualization, M.K.; supervision, H.N.; project administration, H.N.; funding acquisition, H.N. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Agency for Defense Development funded by the Korean Government (No. 912873001).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available upon request from the corresponding author. The data are not publicly available due to legal restrictions.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Zeng, Y.; Fu, J.; Chao, H.; Guo, B. Aggregated contextual transformations for high-resolution image inpainting. IEEE Trans. Vis. Comput. Graph. 2022, 29, 3266–3280. [Google Scholar] [CrossRef] [PubMed]
  2. Lugmayr, A.; Danelljan, M.; Romero, A.; Yu, F.; Timofte, R.; Van Gool, L. Repaint: Inpainting using denoising diffusion probabilistic models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 11461–11471. [Google Scholar]
  3. Wan, Z.; Zhang, J.; Chen, D.; Liao, J. High-fidelity pluralistic image completion with transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada, 19–25 June 2021; pp. 4692–4701. [Google Scholar]
  4. Goodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Courville, A.; Bengio, Y. Generative adversarial nets. In Proceedings of the Annual Conference on Neural Information Processing Systems 2014, Montreal, QC, Canada, 8–13 December 2014; Volume 27. [Google Scholar]
  5. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention is all you need. In Proceedings of the Annual Conference on Neural Information Processing Systems 2017, Long Beach, CA, USA, 4–9 December 2017; Volume 30. [Google Scholar]
  6. Parmar, N.; Vaswani, A.; Uszkoreit, J.; Kaiser, L.; Shazeer, N.; Ku, A.; Tran, D. Image transformer. In Proceedings of the International Conference on Machine Learning. PMLR, Stockholm, Sweden, 10–15 July 2018; pp. 4055–4064. [Google Scholar]
  7. Chen, M.; Radford, A.; Child, R.; Wu, J.; Jun, H.; Luan, D.; Sutskever, I. Generative pretraining from pixels. In Proceedings of the International Conference on Machine Learning. PMLR, Virtual, 13–18 July 2020; pp. 1691–1703. [Google Scholar]
  8. Ho, J.; Jain, A.; Abbeel, P. Denoising diffusion probabilistic models. In Proceedings of the Thirty-fourth Annual Conference on Neural Information Processing Systems, Online Conference, 6–12 December 2020; Volume 33, pp. 6840–6851. [Google Scholar]
  9. Liu, G.; Reda, F.A.; Shih, K.J.; Wang, T.C.; Tao, A.; Catanzaro, B. Image inpainting for irregular holes using partial convolutions. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 85–100. [Google Scholar]
  10. Bertalmio, M.; Sapiro, G.; Caselles, V.; Ballester, C. Image inpainting. In Proceedings of the 27th Annual Conference on Computer Graphics and Interactive Techniques, New Orleans, LA, USA, 23–28 July 2000; pp. 417–424. [Google Scholar]
  11. Ballester, C.; Bertalmio, M.; Caselles, V.; Sapiro, G.; Verdera, J. Filling-in by joint interpolation of vector fields and gray levels. IEEE Trans. Image Process. 2001, 10, 1200–1211. [Google Scholar] [CrossRef] [PubMed]
  12. Chan, T.F.; Shen, J. Nontexture inpainting by curvature-driven diffusions. J. Vis. Commun. Image Represent. 2001, 12, 436–449. [Google Scholar] [CrossRef]
  13. Demanet, L.; Song, B.; Chan, T. Image inpainting by correspondence maps: A deterministic approach. Appl. Comput. Math. 2003, 1100, 99. [Google Scholar]
  14. Levin; Zomet; Weiss. Learning how to inpaint from global image statistics. In Proceedings of the Ninth IEEE International Conference on Computer Vision, Nice, France, 14–17 October 2003; pp. 305–312. [Google Scholar]
  15. Criminisi, A.; Pérez, P.; Toyama, K. Region filling and object removal by exemplar-based image inpainting. IEEE Trans. Image Process. 2004, 13, 1200–1212. [Google Scholar] [CrossRef] [PubMed]
  16. Ružić, T.; Pižurica, A. Context-aware patch-based image inpainting using Markov random field modeling. IEEE Trans. Image Process. 2014, 24, 444–456. [Google Scholar] [CrossRef] [PubMed]
  17. Ding, D.; Ram, S.; Rodríguez, J.J. Image inpainting using nonlocal texture matching and nonlinear filtering. IEEE Trans. Image Process. 2018, 28, 1705–1719. [Google Scholar] [CrossRef] [PubMed]
  18. Pathak, D.; Krahenbuhl, P.; Donahue, J.; Darrell, T.; Efros, A.A. Context encoders: Feature learning by inpainting. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 2536–2544. [Google Scholar]
  19. Yu, J.; Lin, Z.; Yang, J.; Shen, X.; Lu, X.; Huang, T.S. Free-form image inpainting with gated convolution. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 4471–4480. [Google Scholar]
  20. Yan, Z.; Li, X.; Li, M.; Zuo, W.; Shan, S. Shift-net: Image inpainting via deep feature rearrangement. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 1–17. [Google Scholar]
  21. Nazeri, K.; Ng, E.; Joseph, T.; Qureshi, F.Z.; Ebrahimi, M. Edgeconnect: Generative image inpainting with adversarial edge learning. arXiv 2019, arXiv:1901.00212. [Google Scholar]
  22. Bekele, A.; Downer, R.; Wolcott, M.; Hudnall, W.; Moore, S. Comparative evaluation of spatial prediction methods in a field experiment for mapping soil potassium. Soil Sci. 2003, 168, 15–28. [Google Scholar] [CrossRef]
  23. Laslett, G.M. Kriging and splines: An empirical comparison of their predictive performance in some applications. J. Am. Stat. Assoc. 1994, 89, 391–400. [Google Scholar] [CrossRef]
  24. Ronneberger, O.; Fischer, P.; Brox, T. U-net: Convolutional networks for biomedical image segmentation. In Proceedings of the Medical Image Computing and Computer-Assisted Intervention–MICCAI 2015: 18th International Conference, Munich, Germany, 5–9 October 2015; Proceedings, Part III 18. Springer: Berlin/Heidelberg, Germany, 2015; pp. 234–241. [Google Scholar]
  25. Johnson, J.; Alahi, A.; Fei-Fei, L. Perceptual losses for real-time style transfer and super-resolution. In Proceedings of the Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, 11–14 October 2016; Proceedings, Part II 14. Springer: Berlin/Heidelberg, Germany, 2016; pp. 694–711. [Google Scholar]
  26. Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. arXiv 2014, arXiv:1409.1556. [Google Scholar]
  27. Wang, Z.; Bovik, A.C.; Sheikh, H.R.; Simoncelli, E.P. Image quality assessment: From error visibility to structural similarity. IEEE Trans. Image Process. 2004, 13, 600–612. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Difference in the reliability of contours according to the number of sensors. The pictures on the left are the original contours obtained using the gas diffusion simulator we developed. The middles are the contours created using Kriging interpolation based on a sufficient number of values sampled from the original contours. The pictures on the right are the contours generated based on an insufficient number of values. The black dots represent the positions of chemical sensors. The concentration data on those points are used for Kriging interpolation.
Figure 1. Difference in the reliability of contours according to the number of sensors. The pictures on the left are the original contours obtained using the gas diffusion simulator we developed. The middles are the contours created using Kriging interpolation based on a sufficient number of values sampled from the original contours. The pictures on the right are the contours generated based on an insufficient number of values. The black dots represent the positions of chemical sensors. The concentration data on those points are used for Kriging interpolation.
Sensors 24 04470 g001
Figure 2. (a) Gas diffusion process in the developed simulator. Before diffusion, all gas particles are located at specific co-ordinates. However, as sampled vectors are added, the particles move, resulting in diffusion, as shown in the grid map on the right. (b) Result of the diffusion process.
Figure 2. (a) Gas diffusion process in the developed simulator. Before diffusion, all gas particles are located at specific co-ordinates. However, as sampled vectors are added, the particles move, resulting in diffusion, as shown in the grid map on the right. (b) Result of the diffusion process.
Sensors 24 04470 g002
Figure 3. (a) The results of the gas diffusion simulation model. The shape of the gas diffusion contour varies depending on the wind blowing in 16 directions. (b) The portion of the dataset created from the simulation results. The images below were created using the Kriging method, using 49 concentration points indicated by the black dots in the simulation results above.
Figure 3. (a) The results of the gas diffusion simulation model. The shape of the gas diffusion contour varies depending on the wind blowing in 16 directions. (b) The portion of the dataset created from the simulation results. The images below were created using the Kriging method, using 49 concentration points indicated by the black dots in the simulation results above.
Sensors 24 04470 g003
Figure 4. The portion of the masks for training. Black rectangles are used to mask the different regions of the training data, with their positions varying randomly for each mask. This process removes random areas of the training data, enabling the model to learn from a diverse set of scenarios.
Figure 4. The portion of the masks for training. Black rectangles are used to mask the different regions of the training data, with their positions varying randomly for each mask. This process removes random areas of the training data, enabling the model to learn from a diverse set of scenarios.
Sensors 24 04470 g004
Figure 5. Training results. The pictures in the blue box are part of the test dataset. The reconstructed results of the model for randomly masked input images are presented in the green box.
Figure 5. Training results. The pictures in the blue box are part of the test dataset. The reconstructed results of the model for randomly masked input images are presented in the green box.
Sensors 24 04470 g005
Figure 6. (a) The results of validation using the developed diffusion simulation model. From the left, the simulation result; the spatial interpolation results using only the concentration of a sufficient or insufficient number of black dots; contours with the low-reliability parts erased; and the result filled by the model. (b) The results of validation using the NBC_RAMS. The image and contour representing the results of NBC_RAMS were added on the left, and an image preprocessed to be suitable for the model is shown in the third column from the left. The remaining images represent the same as in (a). The red boxes indicate the regions that were erased and reconstructed.
Figure 6. (a) The results of validation using the developed diffusion simulation model. From the left, the simulation result; the spatial interpolation results using only the concentration of a sufficient or insufficient number of black dots; contours with the low-reliability parts erased; and the result filled by the model. (b) The results of validation using the NBC_RAMS. The image and contour representing the results of NBC_RAMS were added on the left, and an image preprocessed to be suitable for the model is shown in the third column from the left. The remaining images represent the same as in (a). The red boxes indicate the regions that were erased and reconstructed.
Sensors 24 04470 g006
Table 1. Validation results using the diffusion simulation model.
Table 1. Validation results using the diffusion simulation model.
mIoU ScoreΔ Score
Before RestorationAfter Restoration
60.61%73.82%13.21
Table 2. Validation results using NBC_RAMS.
Table 2. Validation results using NBC_RAMS.
mIoU ScoreΔ Score
Before RestorationAfter Restoration
68.61%80.07%11.46
Table 3. Validation results of the model’s adaptability for various mask sizes.
Table 3. Validation results of the model’s adaptability for various mask sizes.
Size of Mask
Small (~15%)Medium (15~25%)Large (25%~)
Mean proportion of masked regions13.88%20.97%28.06%
Δ mIoU Score3.526.0215.14
mIoU Score79.58%80.23%75.57%
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Kang, M.; Son, J.; Lee, B.; Nam, H. Reconstruction of the Chemical Gas Concentration Distribution Using Partial Convolution-Based Image Inpainting. Sensors 2024, 24, 4470. https://doi.org/10.3390/s24144470

AMA Style

Kang M, Son J, Lee B, Nam H. Reconstruction of the Chemical Gas Concentration Distribution Using Partial Convolution-Based Image Inpainting. Sensors. 2024; 24(14):4470. https://doi.org/10.3390/s24144470

Chicago/Turabian Style

Kang, Minjae, Jungjae Son, Byungheon Lee, and Hyunwoo Nam. 2024. "Reconstruction of the Chemical Gas Concentration Distribution Using Partial Convolution-Based Image Inpainting" Sensors 24, no. 14: 4470. https://doi.org/10.3390/s24144470

APA Style

Kang, M., Son, J., Lee, B., & Nam, H. (2024). Reconstruction of the Chemical Gas Concentration Distribution Using Partial Convolution-Based Image Inpainting. Sensors, 24(14), 4470. https://doi.org/10.3390/s24144470

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop