# Memory-Based Learning and Fusion Attention for Few-Shot Food Image Generation Method
## 5 Experimental Results and Analysis
### Ablation Study  
To validate the effectiveness of each component in the MLA-Diff approach, we conducted ablation experiments on the test set of Mini-food. Our MLA-Diff approach comprises three components: the enhanced CLIP module, Memory module, and image generation module. Firstly, we remove the enhanced CLIP module from MLA-Diff, denoted as \"MLA-Diff without enhanced CLIP module\" in Table 2. Secondly, we eliminate the Memory module from the model, labeled as \"MLA-Diff without Memory module\" in the table. Thirdly, we excluded the attention fusion module and pre-trained diffusion model from the image generation module of our architecture, referred to as \"MLA-Diff without attention fusion module\" and \"MLA-Diff without pre-trained diffusion model\" in Table 2, respectively. A series of ablation experiments are performed on these modified configurations to assess their impact on the overall performance. The results in Table 2 illustrate the effectiveness of each component in the MLA-Diff approach. MLA-Diff without the enhanced CLIP module experienced an increase of 2.287 in FID, which means that the enhanced CLIP module adeptly captures the correspondence between ingredient features and image features. MLA-Diff without the Memory module \begin{table}
\begin{tabular}{c c} \hline \hline
**Architecture** & **FID** \\ \hline MLA-Diff-without enhanced CLIP module & 6.572 \\ MLA-Diff-without Memory module & 6.483 \\ MLA-Diff-without attention fusion module & 6.463 \\ MLA-Diff-without pre-trained diffusion model & 6.344 \\ MLA-Diff & **4.285** \\ \hline \hline \end{tabular} Bold text in the table represents the optimal results.  
\end{table} 
Table 2: Effectiveness of each component in our MLA-Diff approach. Figure 6: Qualitative presentation of food image generation results. exhibited a 2.198 increase in FID, suggesting the contribution of our Memory module in better articulating input textual information. MLA-Diff without the attention fusion module in MLA-Diff led to a 2.178 rise in FID, showcasing that our attention fusion module helps the model better deal with the fine-grained features of the generated images. Additionally, the performance of MLA-Diff without the pre-trained diffusion model saw an improvement of 2.059 in FID, signifying the utility of the pre-trained diffusion model in enhancing the vividness and quality of generated food images. Experimental outcomes on the Mini-food dataset underscore the indispensable role of each component in performance enhancement. Their integration forms our complete MLA-Diff, resulting in optimal performance. To compare the impact of these three types of attention mechanisms on the image generation module, the quality of generated images is measured by FID, LPIPS, and IS; as shown in Table 3, this is in terms of different combinations of the number heads of CmA, MCA, and CoA. From Table 3, it can be seen that the number of CmA is a benefit for significantly improving the performance due to a significant decrease in FID score with the number of heads of CmA increasing from 1 to 4. Specifically, the metrics show significant declines at 4-head CmA compared to 1-head CmA, with reductions of 8.998, 0.067, and 1.708, respectively. Notably, inserting both MCA and CoA when the number heads of CmA reaches 4 leads to significant performance improvements, although there are slight fluctuations in LPIPS and IS. Taking all factors into consideration, it is suitable to select the seventh configuration in Table 3 as the composition of the attention fusion module. Table 4 demonstrates the performance of these models by incorporating the pre-trained diffusion model from Table 3. In Table 4, it can be observed that employing the pre-trained diffusion model can be inductive to enhance the performance of the model to an extent. Especially when employing the pre-trained diffusion model under the seventh attention fusion module configuration, there is significant improvement, with a decrease of 2.059 in FID, a decrease of 0.01 in LPIPS, and an increase of 0.87 in IS.