# Evaluating the FLUX.1 Synthetic Data on YOLOv9 for AI-Powered Poultry Farming
## 3 Materials and Methods
### Dataset Collection and Annotation  
In our previous research, the real dataset for training AI models in chicken detection was created using images extracted from video recordings taken on farms in Montenegro and Serbia [4]. Approximately 4000 images were manually annotated for detection, later expanded with augmentation to 9000 using Roboflow. The dataset was split into 7550 images for training, 725 for validation, and 725 for testing. To enhance model generalization, data augmentation techniques such as rotation, brightness adjustment, saturation tuning and cropping were applied. The images were collected at different poultry growth stages, across various farms and environmental conditions, ensuring dataset diversity. To enhance dataset diversity and reduce the importance of real data, a synthetic data generation pipeline was implemented. The process began by selecting a balanced subset of real images. In the literature, authors emphasize that 10-20 images are enough to generate sufficiently good data [47]. Once fine-tuned, the model was used to create synthetic images, which were subsequently integrated into the training dataset. For the synthetic data, automatic annotation was integrated using the Grounding DINO model within the Roboflow platform. Grounding DINO is an advanced object detection model that leverages transformer-based detection and grounded pre-training, enabling zero-shot detection, meaning it can recognize objects without prior training on specific classes. In Roboflow, this model automates image annotation, streamlining dataset preparation for computer vision models. Grounding DINO achieved 52.5 mAP on the Common Objects in Context (COCO) zero-shot benchmark, demonstrating its capability to detect objects without additional training on COCO data [43]. This model significantly outperformed manual annotation and surpassed some other zero-shot models, including YOLO-World [48]. Despite these advantages, both models were affected by lighting conditions, object occlusion and image quality. The annotation process involves uploading a dataset, selecting an image and using the Box Prompting (AI labeling) feature, where manually labeling just one object allows the model to predict bounding boxes for others. Adjusting the confidence threshold influences sensitivity--lower values increase object detection coverage but also raise the risk of false positives. This was particularly evident in images affected by lighting conditions and object occlusion, where manual adjustments were necessary. Once predictions are reviewed, annotations can be approved and saved, finalizing the dataset for model training (Figure 4a). Even if the instance segmentation was not the scope of the research, the automatic annotation feature was tested for this task. Object segmentation poses additional challenges, as models may misidentify entire flocks as a single chicken or fail to detect certain ones, especially in high-contrast lighting conditions. In such cases, manual correction is required. Segment Anything Model 2 (SAM2), developed by Meta AI Research, enhances segmentation by integrating image and video segmentation into a single framework, enabling faster predictions and improved generalization without retraining. Using a transformer-based architecture with memory mechanisms, SAM2 processes video content efficiently and has been trained on the largest video segmentation dataset, ensuring high performance [49]. Unlike bounding box annotation, segmentation requires manual interaction, where the user hovers over an object, prompting the model to generate a polygon mask. While this improves accuracy, it is more time-consuming, and Roboflow's Smart Polygon feature remains a paid option for large-scale annotations (Figure 4b). Figure 4: Roboflow dataset auto-labeling: (**a**) object detection (**b**) instance segmentation. Automatic annotation significantly enhances dataset preparation by reducing manual effort, especially in complex tasks like object segmentation.