# Implementing YOLO Convolutional Neural Network for Seed Size Detection
## 4 Materials  
For the purposes of this research, a database containing images of seeds was created [21]. The photos were taken in conditions simulating a real industrial environment, with a dark conveyor belt. The seed photos were captured with iPhone 13 and Samsung S23 mobile phones. The cameras were positioned at a distance of 20 cm to 40 cm from the plane, and the photographs were taken parallel to the plane with a deviation of up to approximately \(5^{\circ}\). A circular LED ring light with adjustable color temperature (cool, neutral, warm) and light intensity was used for illumination. The lamp was set parallel to the plane, with the camera positioned in the center of the ring, minimizing shadows around the irregular objects. During the photography, the ISO digital parameter was manually adjusted, which affected the brightness of the photos and the visibility of the objects.  
The database includes images of different types of seeds: coffee and white beans. The decision to include coffee and white bean seeds in the database was based on a deliberate approach to diversifying the research material. Both types of seeds present different challenges related to their appearance, which is a key aspect of image analysis. Additionally, coffee and white beans are commonly used in various branches of the food industry, highlighting the practical application of the research results. The choice of these two plants allows for the development of a solution that can potentially be used in the context of different products, increasing the versatility of the developed solution.  
To ensure the database serves as a reliable source for training and testing models, it is essential to account for a variety of parameters in the images. In this context, diverse photographic conditions and different arrangements and quantities of seeds are crucial for maintaining the realism and representativeness of the dataset. The variable parameters in the images include:  
Figure 1: A block diagram of the operations performed by the program for detecting the actual width, height, and area of seeds.  
* Number of seeds in the image: A variable number of seeds represents different scenarios, from sparsely to densely packed, allowing the examination of model responses to different object densities.
* Seed arrangement in the image: Various arrangements of seeds, in terms of both distance and orientation, create realistic conditions under which models should operate.  
The newly created database comprises both a training set and a test set. The training set includes 50 images, with 25 for each seed type. Similarly, the test set contains 50 photographs, divided equally with 25 for each type of seed. These images incorporate diverse arrangements and quantities of seeds. Each image includes a 1 PLN coin as a consistent and easy-to-measure reference point for accurate size calculations of the seed areas.  
For each image, the areas containing seeds and information about the seed types were manually annotated using the Labelme 5.5.0 software [22]. The format for recording information about the seed areas is a JSON file. For each image, a file was prepared containing the annotated positions of the seeds, taking into account both the arrangement and the precise outline and type of seeds. Figure 2 shows sample images recorded during the creation of the database. The database has been made available on the website [[https://github.com/koldozima/Seeds_Dataset](https://github.com/koldozima/Seeds_Dataset)]([https://github.com/koldozima/Seeds_Dataset](https://github.com/koldozima/Seeds_Dataset)) (accessed on 11 June 2023).  
Figure 2: Examples of images containing seeds of (**a**) white beans and (**b**) coffee.