# Evaluating the FLUX.1 Synthetic Data on YOLOv9 for AI-Powered Poultry Farming
## 3 Materials and Methods
### Experiment Models and Setup  
The experiment was designed to assess the impact of synthetic data generation on the accuracy of AI models used for chicken detection. FLUX.1 is one of the text-to-image models developed by Black Forest Labs. This model generates high-quality images from natural language prompts, utilizing a hybrid architecture that combines multimodal and parallel diffusion transformer blocks scaled to 12 billion parameters [51; 52; 53]. It offers three variants: FLUX.1 [pro] for top performance, FLUX.1 [dev] for non-commercial applications (selected for this research), and FLUX.1 [schnell] for rapid, local development. A subset of 60 real images was used from a poultry farm in Montenegro (Radinovic farm), representing three distinct growth stages of chickens: 20 images of small chickens, 20 of medium-sized chickens, and 20 of large chickens. This selection was designed to diversify the synthetic dataset and improve the model's ability to generalize across different poultry growth stages. As previously noted, FLUX.1 [dev] requires only 10 to 20 real images to generate well-generalized synthetic images. To ensure a balanced dataset, 20 images were used for each class (small, medium, and large chickens), rather than mixing different sizes within a single category. The Replicate platform was used for fine-tuning, running on an H100 GPU with training parameters set at 1000 steps and LoRA rank = 16, following the recommended configurations. For dataset expansion, a fixed trigger word (\"CHICKRAD\") was embedded into the fine-tuning process. This approach ensured that during synthetic image generation, the model consistently produced relevant chicken images while maintaining realism in texture, size, and pose variations. The fine-tuning process was completed in less than 30 min, ensuring the efficient adaptation of the model to poultry-specific features. The training (fine-tuning) cost on this platform was less than EUR 5 [54]. To achieve high-quality synthetic images, several parameters were optimized. The LoRA scale was set to 1.0, balancing the influence of the LoRA model in the generation process [55; 56]. A higher value would strengthen the fine-tuned model's impact, while a lower value would allow the base model to contribute more significantly. The guidance scale was set to 2.5, determining how closely the generated images adhered to the text prompt. Testing different values showed that 2.5 produced the most realistic results, striking the best balance between image diversity and prompt accuracy. The prompt strength parameter, which regulates the degree of influence from the given prompt, was left at its default value of 0.8 since it had minimal impact on image quality. The text prompt used for generation described chickens in a natural farm setting, incorporating variations in color, positioning and depth to introduce greater diversity into the dataset. The entire generation process followed a systematic workflow, detailed in Algorithm 1, ensuring consistency and reproducibility. By integrating real and synthetic data, the extended dataset provided a more balanced and diverse set of images, enhancing the robustness of AI models trained for poultry detection. The optimized FLUX.1 [dev] model successfully generated high-quality realistic images that closely resembled real-world farm conditions, validating the effectiveness of synthetic data augmentation. The total cost for generating over 400 synthetic images was less than EUR 5. Consequently, the overall expense for fine-tuning the FLUX.1 [dev] model and producing a synthetic dataset exceeding 400 images amounted to approximately EUR 10 with H100 GPU on Replicate platform.