Chinese Journal of Liquid Crystals and Displays, Volume. 39, Issue 2, 168(2024)

Text-to-image method based on XLnet and DMGAN

Zewei ZHAO, Jin CHE*, and Wenhan LÜ
Author Affiliations
  • School of Physics and Electronic and Electrical Engineering,Ningxia University,Yinchuan 750021,China
  • show less
    Figures & Tables(14)
    ECA channel attention mechanism
    Converged network architecture of XLnet-DMGAN
    Flow diagram of text encoder
    Loss change graph of DAMSM semantic consistency training
    Variation curves of IS value
    Variation curves of FID value
    Comparison of generated images
    Generated details of initial image.(a)Initial noise image;(b)Image after full connection and four upsampling;(c)Initial image after ECA channel attention and 3×3 convolution.
    Refined details of the image.(a)64×64 image;(b)128×128 image;(c)256×256 image;(d)Attention weights.
    Generated images from the same text
    • Table 0. [in Chinese]

      View table
      View in Article

      Table 0. [in Chinese]

      算法1 数据预处理方法

      输入:待处理文本text

      输出:分词后每个词在词汇表中的索引token_index

      步骤:

        1.调用XLNetTokenizer 类中的from_pretrained()方法加载token embedding;

        2.基于tokenizer对输入文本text作分词处理;

        3.对分好的词去重,统计词在文本中出现次数;

        4.基于token embedding词表,得到词对应位置索引token_index;

        5.返回词在词汇表中的索引 token_index。

    • Table 0. [in Chinese]

      View table
      View in Article

      Table 0. [in Chinese]

      算法2 构建XLnet模型训练字词向量

      输入:字词索引token_index

      输出:XLNet 模型学习出的字词向量word_embedding步骤:

        1.调用XLNetModel类中from_pretrained()方法加载PyTorch提供的XLNet模型;

        2.初始化XLNet的embedding矩阵embedding_vec;

        3.基于embedding_vec,根据索引token_index值得到字词对应的特征向量word_embedding;

        4.对word_embedding计算加权平均值;

        5.返回模型学习到的字词向量word_embedding。

    • Table 1. Comparison of evaluation indicators

      View table
      View in Article

      Table 1. Comparison of evaluation indicators

      方法评价指标
      ISFID
      StackGAN83.70±0.0435.11
      StackGAN-v293.84±0.0630.30
      AttnGAN104.36±0.0315.38
      MirrorGAN234.56±0.0518.34
      DMGAN114.75±0.0716.09
      DFGAN245.10±0.0414.81
      本文方法5.22±0.1813.31
    • Table 2. Results of ablation experiments

      View table
      View in Article

      Table 2. Results of ablation experiments

      方法评价指标
      ISFID
      DMGAN4.75±0.0716.09
      DMGAN+XLnet5.10±0.2114.55
      DMGAN+ECA4.85±0.0415.67
      DMGAN+XLnet+ECA5.22±0.1813.31
    Tools

    Get Citation

    Copy Citation Text

    Zewei ZHAO, Jin CHE, Wenhan LÜ. Text-to-image method based on XLnet and DMGAN[J]. Chinese Journal of Liquid Crystals and Displays, 2024, 39(2): 168

    Download Citation

    EndNote(RIS)BibTexPlain Text
    Save article for my favorites
    Paper Information

    Category: Research Articles

    Received: Feb. 28, 2023

    Accepted: --

    Published Online: Apr. 24, 2024

    The Author Email: Jin CHE (koalache@126.com)

    DOI:10.37188/CJLCD.2023-0076

    Topics