# High-Quality Text-to-Image Generation Using High-Detail Feature-Preserving Network
## 4 Experiments  
### Experimental Settings  
1. Implementation Details: To generate an initial feature map, text processing was performed using a bidirectional LSTM text encoder as proposed in [10]. This encoder transformed each textual description into two hidden states representing the forward and backward sentences. Each word also had two corresponding hidden states. These two hidden states for each sentence were concatenated and then input into the initial image generator to create the initial image features. Three image generation stages were conducted to produce images with resolutions of 64 \(\times\) 64, 128 \(\times\) 128, and 256 \(\times\) 256 in sequence. Subsequently, the dynamic network generator proposed in [14] was employed to integrate the hidden states of each word with the initial image features. By employing the training method described in [14], the CUB-Bird dataset parameters were configured as \(\lambda_{1}=1\) and \(\lambda_{2}=5\), while the MS-COCO dataset parameters were configured as \(\lambda_{1}=1\) and \(\lambda_{2}=50\). After generating the initial text-image feature map, 1 \(\times\) 1 filters doubled the number of feature map channels. Then, depth-wise and point-wise convolution were performed using 5 \(\times\) 5 and 1 \(\times\) 1 filters, respectively. Finally, 1 \(\times\) 1 filters were employed to reduce the number of feature map channels to its original value (N\({}_{\text{m}}\) = 128). All networks were trained using the Adam optimizer [39] with a batch size of 16 and a learning rate of 0.0002. The CUB-Bird and MS-COCO datasets were used to train the HDFpNet model for 600 and 200 epochs, respectively. The model training process was conducted using an NVIDIA RTX A5000 card.
2. Dataset: Two public datasets were utilized in this study--the CUB-Bird dataset and the MS-COCO dataset. The CUB-Bird dataset comprises 11,788 images of 200 bird species, with each image being accompanied by ten descriptive sentences. The MS-COCO dataset contains 80,000 training images and 40,000 test images, with each image being associated with five textual annotations.
3. Evaluation: The performance of the HDFpNet model was evaluated through a series of experiments. Initially, the effectiveness of each block within the model was assessed. Subsequently, the performance of the model was compared with that of other state-of-the-art text-to-image generation models. For a task involving the generation of 30,000 images from textual descriptions recorded in a dataset that had not been used for testing other models, the Frechet inception distance (FID) [42] and R-precision indicators were employed to evaluate the model's performance as direct comparisons were not possible. The FID is based on features extracted from the Inception v3 network [44] and is used to calculate the Frechet distance between generated and real-world images. A low FID value indicates that a generated image closely resemblesa real-world image. R-precision evaluates the extent to which a generated image matches the conditions specified in a textual description. Specifically, it employs a query mechanism to determine the relevance of documents retrieved by a system. This study implemented R-precision following the procedures described in [10]. The cosine distance between the global image vector and 100 candidate sentence vectors was calculated. The candidate documents described R real images and 100 randomly selected unmatched samples. In each query, if r results obtained from the first R retrieved documents are relevant, then the R-precision equals r/R. In this study, R was set to 1. The generated images were divided into 10 leaflets for the performance of queries. The obtained scores are presented as means with standard deviations.