P ROJECT OF AUTONOMOUS WORKSTATION FEEDING FLEDGING BIRDS

 The article describes project of autonomous workstation capable of feeding fledging birds. During the breeding season animal rescue centers are experiencing huge overload of patients and up to 20% of patients are birds. Despite small size they demand as much care as other animals – in case of fledging birds main need is frequent feeding which is impossible to cover by working staff. Designed workstation is meant to solve this problem and decrease mortality of sick or immature animals.


ISSUE
The subject of this paper is the design of an autonomous robot for feeding fledglings. At first, it is important to explain the difference between terms "nestling" and "fledgling". Among birds there are "altricial species", so birds that at the time of birth are not self-reliant and must spend some time in a nest where they are fed by their parents [1]. When their vision, feathers, and basic motor skills are sufficiently developed, little birds attempt to leave the nest by themselves in order to become self-reliant. At the same time, their parents monitor and feed them. Also, little birds disperse moving in various directions, which naturally minimizes the risk of death of the entire clutch. Cats (including domestic, going-out cats), other predators and random factors constitute the most frequent threat. The breeding season of the most popular small birds in Poland is between April and August (depending on the number of clutches).
Provisions of law do not exhaustively specify the matter of accountability for helping wildlife, which happens to be an object of issue between local authorities and centres or persons concerned with animal welfare. The Act on the Protection of Nature specifies only the obligation of looking after an animal in a life-threatening situation (for example when an animal was hit by a car) [2]. However, in accordance with the Act on the Protection of Animals, wildlife is a national treasure, which implies the obligation of intervention, including rehabilitation and reintroduction [2,3].
In a breeding season, a single wildlife rehabilitation centre accepts on average 450 animals, including 100 fledglings. Each of them requires feeding at least every two hours, and for some species this procedure is required also at night. In practice, it is impossible to handle by a centre team that consists of several persons.
Ease of feeding is a relative, empirically determined parameter. Some species, such as starlings, sit still and quietly when parents are not around, which is their natural defence against potential predators. When influenced by audible stimuli or light disturbances, they become active by tweeting, opening the bill, and searching for their parents. Fledglings do it also of their own choosing, naturally, when they are very hungry. This behaviour facilitates feeding, therefore everyone is able to do it without an extensive training. The activity concerns dropping food and a few water droplets until a bird calms down and stops reacting to stimuli. On the other hand there are swifts that are similar to swallows in terms of their physical appearance and way of living. This species neither follows food, nor opens the bill, so in order to feed it, one must skillfully grab it, forcefully open the bill (in a way that will not break it), and insert food into its oesophagus that is located asymmetrically, on the right side. Very often, swifts spit the entire amount of food after a few minutes of feeding. Unfortunately, humans are not able to replace true mother, and raising little animals in the artificial life environment has been tested only for livestock.
On the basis of the described issue, the idea of creating a robot that would make feeding automated was born.

I. SCOPE OF WORK
The process of designing a robot consists of the development of a mechanical part, robot's control system, dedicated algorithm for the animal behaviour analysis, and the creation of the main application for connecting these components. In order to address the issue, it is necessary to use a camera, and therefore the use of the computer vision algorithms is required as well.
The mechanical part consists in the choice of robot and food dispenser. The control system must properly operate chosen motors, sensors, and other actuating elements, and also, in accordance with the chosen protocol, properly communicate with the main application. It was established in the design that both mentioned parts would not be designed from scratch -ready-made, dedicated units were applied.
The main application must properly control the entire system on the basis of programmed data and information derived from the camera. Robot for feeding birds should be able to position above a bird and deliver two types of food: mealworms (insects) and water.
Since no ready-made algorithm was found for detecting birds in a way that would enable the performance of the described activity, the algorithm had to be created from scratch, and as there are various types of image analysis algorithm available, the comparison of several types was carried out. The project also provides for a graphical interface, with the use of which a user can change programme parameters and read the collected data. Figure 1 presents a diagram of the entire system; elements that are described in detail in the paper are marked in blue. Other parts were ready-made units, used in accordance with existing licences.

III. ROBOT AND FOOD DISPENSER
When choosing a robot, the main criteria were: movement in three dimensions, and operating space for safe operation above the animal.
Among ready-made solutions, two main types may be distinguished: • Arm.
• Cartesian robot. It was decided that the cartesian robot would be applied due to the following reasons: • lower price.
• high operating precision.
• easier modification of the final actuating element. The attempt to install the food dispenser on an arm would pose a risk of overloading.
• clearly structured software for controlling movements of the robot.
• large enough operating space. By virtue of the final recipient and usage, the robot should be possibly cheap, easy to use, durable (resistant to e.g. inadvertent fall) and safe to operate. In these terms a cartesian robot surpassed an arm, and at the same time it met the set requirements.
Stepper motors are responsible for movements of the cartesian robot. Their operating precision strongly exceeds the demand -0.005 mm with regard to 1 mm -however, safety is also an important aspect. The movement must be precise in order not to hurt a fledgling.
Having the base on which a container with a fledgling and actuating elements for positioning the robot may be placed, it should be extended with a food dispenser. A readymade design was used [4], which allows for the delivery of solid food and water. Due to this, the following elements were added to the system: • servo-drive for controlling the food dispenser, • IR beam interruption sensor, • water pump, • water level sensor. When a container with a bird is already placed in the operating space, two parameters must be determined: its localisation and status -open bill or closed bill, in order to decide on whether the robot should deliver food or not. This part was performed with the use of a camera installed on a food dispenser, dedicated computer vision algorithm (specifically -object detection type), and the main programme that on the basis of the results of the analysis communicates with a dedicated control system and forces the operation of actuating elements.
In a simplified manner, the cycle of controlling the robot operation is as follows: 1. Detection of fledglings. 2. Localisation, determination of the coordinates. 3. Robot positioning. 4. Feeding.
If there are a lot of birds, the programme operates iteratively and repeats the sequence for every single bird.
In order to perform the detection and localisation procedures, as well as to determine whether the bird's bill is open or closed, computer vision algorithms have been applied. Available solutions of different complexity levels were compared: easy, based on colours and movement detection, Haar Cascades algorithm, and neural networks. Convolutional neural networks are a special type of networks, dedicated to detecting objects in an image. In spite of a higher level of complexity, they guarantee the highest precision (of nearly 100%), the recognition of various labels and the speed of operation that enables the real-time analysis, therefore it was decided that these networks would be applied. The potential of further development of the algorithm is also an important argument that advocates the use of these networks. Trained neural network may be further developed and extended by new labels that allow for e.g. distinguishing species, detecting diseases, and even determining patterns of behaviour. Such feature provides potential not only for the automation of animals care, but also for the research into animals.
The computing power of available computers increases along with neural capacity, therefore devices that operate them are continually smaller, cheaper, and more available. Since the ready-made algorithm that performs the abovementioned objectives did not exist, it was necessary to choose a type of network and train it with the use of own dataset. It was decided that a tuning method would be applied, which means that only the correction of parameters of already trained network with the use of certain dataset (most frequently COCO dataset -Common Objects in Context) is required to be performed and adjusted to own dataset. Such a solution is much faster than training a network from scratch, and it guarantees equally high effectiveness.
For network training it was necessary to prepare set of pictures of what camera may see, and label each one of them defining points of a bounding boxes containing objects to detect. It was performed with the use of the Roboflow tool. The tool was used since it allows for importing data in various formats, convenient marking of pictures, initial editing and augmentation, and exporting to various formats. New dataset was created, and around 221 previously prepared pictures that were exported from film frames recorded while feeding, were imported into the dataset. Next, each picture was manually marked with two labels: "starling -open" and "starling -closed". It is a good practise to add more detailed labels from the very beginning, as there is always a possibility to generalize them in further work, while making them more detailed is connected with another revision of the entire dataset.
Next -before the export of a dataset -as part of initial processing, the automatic orientation of data was set and all sizes were converted into 416 x 234 pixels (proportion 16:9). As part of the augmentation of data, only 3 rotations were set as the bird may be seen in every orientation. No additional image noise and light editing features were set as input data were themselves characterised by wide variety in these terms. The augmentation allowed for the increase in number of pictures from 221 to 531. The proportion of the division into training, validating, and testing datasets was 70%, 20%, and 10%. Such prepared data are ready for being exported and introduced into the algorithm that trains the network.
It should be noted that in the field of machine learning, to which convolutional neural networks belong, a dataset is of strategic significance. The algorithm, regardless of its accuracy, will be as effective as properly and comprehensively the said dataset will be prepared.
The adjustment mechanism was applied in the process of training. Architecture MobileNetSSDv2, that was developed by a Google team in 2019, was used as the core network [6]. This architecture was chosen since it is relatively new and is assumed to be applied in small or mobile devices with limited computing power, and such a computer operates the robot being described. The effects of an exemplary detection are presented in Figure 6. Within this design the use of algorithms for tracking objects were taken into consideration as well. The fledgling in the picture is specific enough and not too mobile, so the use of such an algorithm may significantly save computing power. In this way, the detection may be performed within the first few seconds before feeding, and later on the detected objects will only need to be tracked. It also allows for the identification of a certain fledgling over time.
OpenCV library provides a wide range of such algorithms, and three of them are recommended for working with networks [4,7]: • CSRT (Discriminative Correlation Filter Tracker with Channel and Spatial Reliability) -high efficiency at the cost of lower amount of FPS. • KCF (Kernelized Correlation Filters) -high amount of FPS at the cost of lower accuracy. • MOSSE (Minimum Output Sum of Squared Error)faster but less accurate than previous algorithms. The design puts more emphasis on accuracy than speed, therefore it was decided that CSRT algorithm would be applied.
The described algorithms are controlled by a single board computer (SBC) Raspberry Pi 4B. Its computing power allows for the performance of the task, the operation of peripheral devices, and providing the user with a graphical interface, and simultaneously, due to its popularity, it is a stable and easy to programme solution. It is also a cheap solution, which in the case of commercialisation of the design translates into the final price.

V. MAIN PROGRAM
Apart from the object detection and tracking algorithms, the main programme needed to be created as on the basis of the results provided by the neural network or tracking algorithm, it controls the operation of the robot. The main programme is also responsible for the communication with the user by means of the graphical interface that allows for: • defining containers and number of fledglings, • starting and stopping the robot, • previewing the camera image in various modes: with or without the visualisation of the analysis.
The computer provides the graphical interface in a local network, so every connected person, under the particular IP address, is able to find the control panel that enables defining containers with fledglings and monitoring the process of feeding.

VI. DEDICATED/UNIVERSAL CONTROL SYSTEM
In order to enable the communication between the SBC and actuating elements of the robot, the dedicated control system was applied [8].
The main programme communicates with it in two situations: 1. Positioning of the robot -forcing the movement so that a food dispenser is placed above the bill. 2. Delivery of food -controlling the food dispenser if the bill is open. Chosen, dedicated control system allows for the operation of all actuating elements and the analysis of digital signals. It also provides API (application programming interface) in Python language that enables a smooth integration with the main programme on the SBC.
In addition, the system allows for power supply to the SBC, stepper motors, and water pump.

VII. SUMMARY
Mechanical, electronic, and programming elements were chosen or programmed in the design in order to solve a certain issue. Modern technologies significantly help increasing the life quality of not only people, but also animals. At a time when human interference in a natural environment is increasing, the environment is not only being changed, but it also frequently causes negative effects, such as animal health risk, disability, and death. Wildlife rehabilitation centres attempt to minimize these effects, however the scale of their action is frequently too small. In this case, new technologies may help by improving work, minimizing mortality of animals, and helping with the reintroduction, which eventually bring benefits for both a natural environment and humans.