Ancient Painting Inpainting Based on Multi-Layer Feature Enhancement and Frequency Perception
Abstract
:1. Introduction
- (1)
- Innovative Deep Semantic Feature: ExtractionWe introduce a Residual Pyramid Encoder (RPE) network tailored for extracting deep semantic features from ancient paintings. This network innovatively combines a deep feature extraction module with channel attention mechanisms, significantly enhancing the processing of image details and facilitating the identification and reconstruction of missing image segments.
- (2)
- Detail and Texture Feature Reconstruction: We propose a Frequency-Aware Mechanism (FAM) that employs a frequency attention module to capture high-frequency perceptual features. By strategically integrating skip connections between low- and high-frequency components, FAM reconstructs the intricate details and textures of ancient paintings, effectively addressing the common challenge of high-frequency detail loss in image painting.
- (3)
- Dual Discriminator for Semantic Consistency: To ensure the restored image preserves the semantic integrity of the original in both global structure and local details, we present a dual discriminator approach. This mechanism guarantees semantic consistency across the entire image and local regions during the inpainting process, reducing boundary discontinuities and blur.
- (4)
- Empirical Validation and Generalization: Our experimental and visualization results, conducted on both the proposed ancient painting dataset and the Huaniao dataset, as well as the publicly available CelebAHQ dataset, demonstrate that our method surpasses competitive image inpainting methods, exhibiting robust generalization capabilities.
2. Related Work
2.1. Ancient Painting Inpainting
2.2. Generative Adversarial Networks
3. Methods
3.1. MFGAN Architecture
3.2. Multi-Layer Residual Pyramid Generator
3.2.1. Residual Pyramid Encoder
3.2.2. Frequency-Aware Mechanism
3.3. Multi-Layer Decoder
3.4. Dual Discriminator
3.5. Loss Function
4. Experimental Setup
4.1. Datasets
4.2. Experimental Setup
4.3. Evaluation Metrics
5. Experiments
5.1. Experiments on Ancient Painting Dataset
5.1.1. Quantitative Comparison
5.1.2. Qualitative Comparison
5.2. Experiments on the Huaniao Painting Dataset
5.2.1. Quantitative Comparison
5.2.2. Qualitative Comparison
5.3. Experiments on CelebAHQ Dataset
5.4. Ablation Study
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Sun, Z.; Lei, Y.; Wu, X. Chinese Ancient Paintings Inpainting Based on Edge Guidance and Multi-Scale Residual Blocks. Electronics 2024, 13, 1212. [Google Scholar] [CrossRef]
- Moreira, F.; Queiroz, A.; Aronson, J. inpainting principles applied to cultural ancients. J. Nat. Conserv. 2006, 14, 217–224. [Google Scholar]
- Skokanov, H.; Slach, T.; Havlıek, M.; Halas, P.; Divek, J.; Pinlerov, Z.; Kouteck, T.; Ebesta, J.; Kallabov, E. Ancient painting in the Research of ancient Changes. J. Anc. Ecol. 2021, 14, 110–127. [Google Scholar]
- Chen, X.; You, S.; Tezcan, K.; Konukoglu, E. Unsupervised lesion detection via image inpainting with a normative prior. Med. Image Anal. 2020, 64, 101713. [Google Scholar]
- Yin, X.; Zhou, S. Image Structure-Preserving Denoising Based on Difference Curvature Driven Fractional Nonlinear Diffusion. Math. Probl. Eng. 2015, 2015, 930984. [Google Scholar]
- Yang, L.; Zhang, Z.; Song, Y.; Hong, S.; Xu, R.; Zhao, Y.; Zhang, W.; Cui, B.; Yang, M. Diffusion models: A comprehensive survey of methods and applications. ACM Comput. Surv. 2023, 56, 1–39. [Google Scholar]
- 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]
- Amudha, J.; Pradeepa, N.; Sudhakar, R. A survey on digital image inpainting. Procedia Eng. 2012, 38, 2378–2382. [Google Scholar]
- Mathew, A.; Amudha, P.; Sivakumari, S. Deep learning techniques: An overview. In Advanced Machine Learning Technologies and Applications: Proceedings of AMLTA 2020; Springer: Berlin/Heidelberg, Germany, 2021; pp. 599–608. [Google Scholar]
- Liang, J.; Cao, J.; Sun, G.; Zhang, K.; Van Gool, L.; Timofte, R. Swinir: Image inpainting using swin transformer. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada, 10–17 October 2021; pp. 1833–1844. [Google Scholar]
- Banham, M.; Katsaggelos, A. Digital image inpainting. IEEE Signal Process. Mag. 1997, 14, 24–41. [Google Scholar]
- Goodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Courville, A.; Bengio, Y. Generative adversarial networks. Commun. ACM 2020, 63, 139–144. [Google Scholar]
- Ding, X.; Wang, Y.; Xu, Z.; Welch, W.; Wang, Z. Ccgan: Continuous conditional generative adversarial networks for image generation. In Proceedings of the International Conference on Learning Representations, Virtual Event, 3–7 May 2021. [Google Scholar]
- Xue, A. End-to-end ancient painting creation using generative adversarial networks. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, Virtual Event, 5–9 January 2021; pp. 3863–3871. [Google Scholar]
- Yang, R.; Yang, H.; Zhao, M.; Jia, R.; Wu, X.; Zhang, Y. Special perceptual parsing for Chinese ancient painting scene understanding: A semantic segmentation approach. Neural Comput. Appl. 2024, 36, 5231–5249. [Google Scholar]
- Peng, X.; Peng, S.; Hu, Q.; Peng, J.; Wang, J.; Liu, X.; Fan, J. Contour-enhanced CycleGAN framework for style transfer from scenery photos to Chinese ancient paintings. Neural Comput. Appl. 2022, 34, 18075–18096. [Google Scholar]
- Zha, Z.; Yuan, X.; Zhou, J.; Zhu, C.; Wen, B. Image inpainting via simultaneous nonlocal self-similarity priors. IEEE Trans. Image Process. 2020, 29, 8561–8576. [Google Scholar]
- Deng, X.; Dragotti, P. Deep convolutional neural network for multi-modal image inpainting and fusion. IEEE Trans. Pattern Anal. Mach. Intell. 2020, 43, 3333–3348. [Google Scholar]
- Zamir, S.; Arora, A.; Khan, S.; Hayat, M.; Khan, F.; Yang, M.; Shao, L. Multi-stage progressive image inpainting. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 14821–14831. [Google Scholar]
- Alzubaidi, L.; Zhang, J.; Humaidi, A.; Al-Dujaili, A.; Duan, Y.; Al-Shamma, O.; Santamarıa, J.; Fadhel, M.; Al-Amidie, M.; Farhan, L. Review of deep learning: Concepts, CNN architectures, challenges, applications, future directions. J. Big Data 2021, 8, 1–74. [Google Scholar]
- Jabbar, A.; Li, X.; Omar, B. A survey on generative adversarial networks: Variants, applications, and training. ACM Comput. Surv. (CSUR) 2021, 54, 1–49. [Google Scholar]
- Sherstinsky, A. Fundamentals of recurrent neural network (RNN) and long short-term memory (LSTM) network. Phys. D Nonlinear Phenom. 2020, 404, 132306. [Google Scholar]
- Dutta, S.; Basarab, A.; Georgeot, B.; Kouamé, D. DIVA: Deep unfolded network from quantum interactive patches for image restoration. Pattern Recognit. 2024, 155, 110676. [Google Scholar]
- Zhao, L.; Ji, B.Y.; Xing, W.; Lin, H.Z.; Lin, Z.J. Ancient painting inpainting algorithm based on multi-channel encoder and dual attention. J. Comput. Res. Dev. 2023, 50, 334–341. [Google Scholar]
- Zhou, Z.H.; Liu, X.R.; Shang, J.Y.; Huang, J.C.; Li, Z.H.; Jia, H.P. Inpainting digital Dunhuang murals with structure-guided deep network. ACM J. Comput. Cult. Herit. 2022, 15, 77. [Google Scholar]
- Deng, X.C.; Yu, Y. Ancient mural inpainting via structure information guided two-branch model. Herit. Sci. 2023, 11, 131. [Google Scholar]
- Baasch, G.; Rousseau, G.; Evins, R. A Conditional Generative adversarial Network for energy use in multiple buildings using scarce data. Energy AI 2021, 5, 100087. [Google Scholar]
- Zamir, S.; Arora, A.; Khan, S.; Hayat, M.; Khan, F.; Yang, M.; Shao, L. Learning enriched features for fast image inpainting and enhancement. IEEE Trans. Pattern Anal. Mach. Intell. 2022, 45, 1934–1948. [Google Scholar]
- Yan, L.; Zhao, M.; Liu, S.; Shi, S.; Chen, J. Cascaded transformer U-net for image inpainting. Signal Process. 2023, 206, 108902. [Google Scholar]
- Han, K.; Xiao, A.; Wu, E.; Guo, J.; Xu, C.; Wang, Y. Transformer in transformer. Adv. Neural Inf. Process. Syst. 2021, 34, 15908–15919. [Google Scholar]
- Salah, E.; Amine, K.; Redouane, K.; Fares, K. A Fourier transform based audio watermarking algorithm. Appl. Acoust. 2021, 172. [Google Scholar]
- Wang, Q.; Ma, Y.; Zhao, K.; Tian, Y. A comprehensive survey of loss functions in machine learning. Ann. Data Sci. 2020, 9, 187–212. [Google Scholar]
- Karras, T.; Aila, T.; Laine, S.; Lehtinen, J. Progressive growing of gans for improved quality, stability, and variation. arXiv 2017, arXiv:1710.10196. [Google Scholar]
- Brunet, D.; Vrscay, E.; Wang, Z. On the mathematical properties of the structural similarity index. IEEE Trans. Image Process. 2011, 21, 1488–1499. [Google Scholar]
- Talebi, H.; Milanfar, P. Learned perceptual image enhancement. In Proceedings of the 2018 IEEE International Conference on Computational Photography (ICCP), Pittsburgh, PA, USA, 4–6 May 2018; pp. 1–13. [Google Scholar]
- Zheng, C.X.; Cham, T.J.; Cai, J.F. Pluralistic image completion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 16–17 June 2019; pp. 1438–1447. [Google Scholar]
- Li, J.Y.; Wang, N.; Zhang, L.F.; Du, B.; Tao, D.C. Recurrent feature reasoning for image inpainting. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 7760–7768. [Google Scholar]
- 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]
- Jain, J.; Zhou, Y.; Yu, N. Keys to better image inpainting: Structure and texture go hand in hand. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, Waikoloa, HI, USA, 2–7 January 2023; pp. 208–217. [Google Scholar]
Layer | Kernel | Stride | Output Channels | Activation Function |
---|---|---|---|---|
Conv | 5 × 5 | 2 | 64 | ReLU |
Conv | 5 × 5 | 2 | 128 | ReLU |
Conv | 5 × 5 | 2 | 256 | ReLU |
Conv | 5 × 5 | 2 | 512 | ReLU |
Conv | 5 × 5 | 2 | 512 | ReLU |
FC | - | - | 1024 | Sigmoid |
Layer | Kernel | Stride | Output Channels | Activation Function |
---|---|---|---|---|
Conv | 5 × 5 | 2 | 64 | ReLU |
Conv | 5 × 5 | 2 | 128 | ReLU |
Conv | 5 × 5 | 2 | 256 | ReLU |
Conv | 5 × 5 | 2 | 512 | ReLU |
FC | - | - | 1024 | Sigmoid |
Model | PSNR↑ | SSIM↑ | MSE↓ | LPIPS↓ |
---|---|---|---|---|
PI [36] | 32.41 | 0.892 | 0.0009 | 0.0762 |
RFR [37] | 33.42 | 0.921 | 0.0008 | 0.0720 |
EC [38] | 33.53 | 0.913 | 0.0007 | 0.0523 |
FcF [39] | 33.72 | 0.914 | 0.0008 | 0.0532 |
MFGAN (Ours) | 34.59 | 0.929 | 0.0006 | 0.0512 |
Model | PSNR↑ | SSIM↑ | MSE↓ | LPIPS↓ |
---|---|---|---|---|
PI [36] | 19.15 | 0.723 | 0.0182 | 0.1896 |
RFR [37] | 20.12 | 0.745 | 0.0151 | 0.1637 |
EC [38] | 19.52 | 0.724 | 0.0154 | 0.1756 |
FcF [39] | 21.34 | 0.793 | 0.0095 | 0.1874 |
MFGAN (Ours) | 22.85 | 0.835 | 0.0042 | 0.0976 |
Model | PSNR↑ | SSIM↑ | MSE↓ | LPIPS↓ |
---|---|---|---|---|
PI [36] | 20.29 | 0.773 | 0.0171 | 0.1357 |
RFR [37] | 21.26 | 0.783 | 0.0142 | 0.1105 |
EC [38] | 21.48 | 0.817 | 0.0129 | 0.0842 |
FcF [39] | 22.28 | 0.834 | 0.0075 | 0.0714 |
MFGAN (Ours) | 23.52 | 0.855 | 0.0054 | 0.0534 |
Model | PSNR↑ | SSIM↑ | MSE↓ | LPIPS↓ |
---|---|---|---|---|
Baseline | 18.78 | 0.746 | 0.0068 | 0.2071 |
w/o RFE | 21.05 | 0.786 | 0.0052 | 0.1301 |
w/o MD | 21.32 | 0.753 | 0.0054 | 0.1221 |
w/o FAM | 20.76 | 0.812 | 0.0051 | 0.1201 |
w/o DD | 20.73 | 0.801 | 0.0049 | 0.1015 |
MFGAN (Ours) | 22.85 | 0.835 | 0.0042 | 0.0976 |
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. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Liu, X.; Wan, J.; Wang, N.; Wang, Y. Ancient Painting Inpainting Based on Multi-Layer Feature Enhancement and Frequency Perception. Electronics 2024, 13, 3309. https://doi.org/10.3390/electronics13163309
Liu X, Wan J, Wang N, Wang Y. Ancient Painting Inpainting Based on Multi-Layer Feature Enhancement and Frequency Perception. Electronics. 2024; 13(16):3309. https://doi.org/10.3390/electronics13163309
Chicago/Turabian StyleLiu, Xiaotong, Jin Wan, Nan Wang, and Yuting Wang. 2024. "Ancient Painting Inpainting Based on Multi-Layer Feature Enhancement and Frequency Perception" Electronics 13, no. 16: 3309. https://doi.org/10.3390/electronics13163309
APA StyleLiu, X., Wan, J., Wang, N., & Wang, Y. (2024). Ancient Painting Inpainting Based on Multi-Layer Feature Enhancement and Frequency Perception. Electronics, 13(16), 3309. https://doi.org/10.3390/electronics13163309