Underwater Image Generation Method Based on Contrastive Learning with Hard Negative Samples
Image generation is essential to acquire scarce underwater images,and it is typically reliant on paired data.Considering the limitation of practical access to such data distributions in marine environments,a contrastive learning-based generative adversarial network(CL-GAN)is introduced to overcome the constraints of bijection in image domain.However,the model struggles to learn complex content features from noisy images due to the low quality of negative samples resulting from random sampling.To address this issue,a hard negative sample contrastive learning-based feature level GAN(HCFGAN)for underwater image generation is proposed.To improve the quality of negative samples,a hard negative sampling module(HNS)is designed to mine feature similarity between samples.The hard negative samples close to the anchor sample are incorporated into contrastive loss for complex feature learning.To ensure the complexity and comprehensiveness of negative samples,a negative sample generation module(NSG)is constructed.The adversarial training of NSG and HNS ensures the validity of hard negative samples.To enhance feature extraction capability and training stability of the model for underwater fuzzy images,a contextual feature generator and a global feature discriminator are designed.Experiments show that the underwater images generated by HCFGAN exhibit good authenticity and richness with practical value in underwater image generation.