1. Introduction
Free range systems can improve the welfare of laying hens [
1]. In these no-cage housing systems, hens can move freely and manifest their natural behaviors. Nevertheless, some problems that can reduce their welfare and productivity can happen. For example, the access to environmental resources can be partially limited by social interactions [
2]. As a consequence, the feeding of hens can be not stable and their productivity can result to be lower [
3]. In addition, damaging behaviors, such as cannibalism and piling, or negative events, such as bone fractures, parasites, and diseases can be observed more frequently than in conventional housing systems [
4].
In order to reach a real improvement of the hens’ welfare, by the use of these alternative rearing systems, the study of their laying performances and behaviors is necessary. Through these data, as collected in a real scenario, it can be possible to: (1) select a commercial strain that shows to be more suitable for this kind of rearing systems [
5,
6,
7]; (2) improve the design of these alternative systems in order to make them appropriate to the needs of hens [
2]; and (3) identify a set of best practices in order to assist farmers in the management of these housing systems [
7].
With this purpose, many systems have been developed for the monitoring of laying hens in a free range environmental [
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23]. Within all of these systems, the Funnel Nest Box (FNB), as developed by Thurner et al. [
8], is the most cited device. This system is based on the use of Radio Frequency Identification (RFID) technology. An RFID antenna is positioned in the floor of the nest. A visit of the nest is recorded through the reading of a transponder tightened to the hen’ leg. The duration of a nest visit is continuously updated until the transponder is in the reading area of the RFID antenna. Each egg laid is collected in a tube and detected by a sensor. Through the information of the hen’ transponder and egg laid, an “egg-to-hen” assignment can be built and recorded by the system. All of these data, combined with the number of nest visits and the duration of the nest occupations, allow for the system to figure out the behavior and productivity of the hens of the flock. Another system for the monitoring of laying hens was developed by Burel et al. [
11]. Also, this system is based on the use of the RFID technology, but, in this case, an antenna is positioned at the nest entrance and each hen wears two transponders, one in its neck and the other one in its leg. Through the sequence of transponder readings, the system detects the entry or the exit of a hen from the nest. The difference between the two timestamps allows to calculate the nest visit durations. Furthermore, each egg laid is collected through an “egg-collector”, detected by an “egg-detector” and linked to the corresponding hen through the merging of all these data.
When a system for the monitoring of laying performances and behaviors of hens is adopted, a double occupation of the nest can occur up to the 32% of the nest occupations, depending on the number of hens per single nest that are used for the experiment [
18]. These events can affect the correctness of data collected and therefore the accuracy of the monitoring system. Different strategies have been developed to limit these unfavorable cases. For example, in the system developed by Burel et al. [
11], the nest is narrowed in order to prevent that more than one hen is in the nest in the same time. In the system developed by Marx et al. [
10], a trap device is adopted in order to block the nest entrance when a hen is in the nest, avoiding that other hens may enter. A similar device is used in the FNB, as developed by Thurner et al. [
8]. The floor of the nest can move. When a hen enters in the nest, the floor rotates. The rotation locks the trap and it avoids that other hens can enter in the nest while it is already occupied. However, all of these strategies do not completely avoid a double occupation of the nest. A concurrent entry, of the nest, of more than one hen, can always happen. Furthermore, the presence of trap devices can modify the behaviors of hens [
11], and thus limits the accuracy of data collected. Therefore, a different strategy should be selected in order to manage these events when they occur.
In this direction, an improved FNB has been developed and described by Icken et al. in 2013 [
18]. This system has a double tilting floor. When a hen enters in the nest, the floor makes a first rotation in order to lock the nest entrance. If two hens enter the nest in the same time, the resulting weight on the nest floor is greater. As a consequence, the nest floor is forced to make a second rotation that activates a sensor and a corresponding alarm. In this way, the system is able to detect a double occupation of the nest and thus improves the accuracy of data collected. However, in field tests, this system showed to detect the 60% of the double nest occupations occurred [
24]. Furthermore, it requires many mechanical and electronic components for each nest box that can increase costs, and thus to limit experiments curried out with a large flock.
A different solution to detect a double nest occupation through a system for the monitoring of laying performances and behaviors of hens has been tested by our research group in 2015 [
25]. This “nest usage sensor” is based on the use of a common webcam and collects images, from the black colored interior of the nest, when one or more hens enter in the box. The algorithm, as implemented by a dedicated software routine, requires to count the number of colored pixels of each image. When this number is higher than a specific threshold, the sensor sends an alarm to the monitoring system. Results obtained in field tests showed that the sensor was able to detect up to 94.6% of the double nest occupations occurred during an oviposition [
25]. Nevertheless, some false-negative cases were observed mainly due to low light conditions and/or shadows that affected the count of colored pixels in the images evaluated. In addition, when more than two hens entered in the nest, the sensor detected a double nest occupation, but no information about the real number of hens in the nest were available. In order to overcome these issues some different technologies should be considered, such as the infrared (IR) spectrum and the image pattern recognition.
A body, which has a temperature higher than the absolute zero, emits electromagnetic radiation in the IR spectrum. The relationship between the energy emitted, the wave length of this radiation and the temperature of the body is mathematically described by the Planck, Wien, and Stefan-Boltzmann laws [
26]. This radiation can be detected through a thermo-camera and used to build a thermografic image where the intensity of each pixel, or of a set of them, is proportional to the originally temperature of the body observed. Furthermore, when the body has an higher temperature than the background where it is positioned, its shape, in the thermografic image, can result to be easily identifiable despite low light conditions, dark, or when possible shadows are visible. Therefore, the adoption of a thermo-camera could be a valid support to overcome the above cited issues in the detection of a double nest occupation. Furthermore, a thermografic image could be investigated performing image pattern recognition in order to detect, in automatic, a specific object inside it. This technique of analysis is generally used to carry out quality controls of industrial processes, even though different examples can be observed in many applications of machine vision. Image pattern recognition can be performed when a template is identified. This is a physical model of the object that is necessary to search in the image evaluated. More than one object can be in the same image and all objects can be detected by the procedure even though they are rotated, in part distorted, or they have different dimensions due to a different distance from the shooting point. This technique, therefore, could be a possible way to figure out how many hens are in the nest in case of a multiple occupation.
Infrared spectrum and image pattern recognition are technologies that have been partially investigated in poultry researches. Thermografic images, in detail, have been mainly tested to improve poultry’ welfare [
27,
28,
29]. Yahav et al. [
30], for example, evaluating data from a thermo-camera, measured the body surface temperature of chickens in order to calculate heat loss by radiation and convection. The authors proved that climate-control systems, welfare, and performance of the flocks could be improved by the evaluation of physiological state of chicken, in different environmental conditions, performed through thermografic images. Ferreiera et al. [
29], studying the loss of sensible heat in young broilers fed with different dietary energy levels found that IR technology allowed for improving productivity and welfare of animals through the recording of the variations of the young broilers’ surface temperature. Baracho et al. [
27], measuring the broilers’ surface temperature, through the use of thermografic images, in relationship with the heat distribution of their houses found important variations due to the week of grow-out and sector of broilers’ house. In this way, the authors were able to demonstrate that broilers were suffered a thermal distress. Also, techniques of image pattern recognition have been studied in poultry researches by some authors with interesting results [
31,
32,
33,
34]. For example, Nakarmi et al. [
32] used some image processing procedures to identify and track hens in the experimental pen where a system, based on a three-dimensional (3D) vision camera and a grid of twenty RFID antennas, were installed. Through these image procedures, the authors were able to study the behavior of hens and to analyze the effects due by different housing designs and management. Wang et al. [
33], instead, evaluating different software algorithms to track a singular hen in a flock of laying hens, found that an algorithm, based on the Hybrid Support Vector Machine, could be a valid method to study the behavior of hens without the need of additional sensors. Kashiha et al. [
34], investigating the performance of image analysis found that a system, made by four cameras mounted on the top of four interconnected sections of an experimental cage, was able to track laying hens with good results if compared with the human ability to detect animals. Finally, also, our research group tested these technologies in a commercial organic egg production farm [
35,
36]. The resulting monitoring system allowed for detecting the possible presence of hens in the inner part of an housing system permitting to project possible ozone treatments, in a safe mode both for animals and workers, and consequently, to achieve a possible reduction of levels of atmospheric ammonia and bacterial load in eggs production farms, with a particular focus on those that produce organic eggs. However, even though these technologies have proved to be useful in the monitoring of laying hens activities, they have never been considered for the developing of a “nest usage sensor” able to count the number of hens in a nest, and thus to improve the accuracy of data collected in studies on laying performance and behavior of hens.
The aim of the present study was therefore the development and testing of a “nest usage sensor” based on the use of a thermo-camera and the performing of image pattern recognition. The targets to reach with this new device were: a better detection of double nest occupations and the count of the number of hens that were in the nest in case of a multiple occupation. These targets were selected in order to improve the accuracy of the data collected in the monitoring of laying performances and behaviors of hens reared in a free-range housing system.
3. Results
When field tests were performed, room temperature was always in the range 13–21 °C, with a mean value of circa 18 °C. Some shifts of the mean floor temperature, adopted to build the BCTs, were investigated. They were shifts of 1, 3, and 5 °C. A set of thermografic images was used to setup the “nest-usage-sensor”. For each of them, the resulting number of CP was calculated according to each shift of the mean floor temperature evaluated. The significance of the mean values of CPs between real cases of single and multiple nest occupation were checked performing an ANOVA statistical procedure. Results obtained are reported in
Table 1.
Mean values of CPs, calculated on thermografic images of single and multiple occupations, showed a significant difference for each shift of the mean floor temperature investigated, as reported in
Table 1. Therefore, possible detection performances, at different cutoff levels, were studied in terms of sensitivity and specificity reached by the sensor. Results obtained, imposing sensitivity to of at least 80%, are reported in
Table 2, for each temperature shift considered.
In the same step of the sensor setup procedure (step A), also the templates, necessary to perform the image pattern recognitions, were investigated for each shift of the mean floor temperature studied. They were templates of elliptical or triangular shape. The results found are shown in
Table 3. Furthermore, confidence intervals and significance of the means, evaluated by a
t-Test of Student (statistical analysis tool: R ver. 3.3.0 [
46]-package
stats ver. 3.3.0, procedure
t-test) are also reported in the table.
In a second step of the sensor setup procedure (step B) carried out on the same set of thermografic images, the detection performances of the “nest-usage-sensor” were calculated always in terms of sensitivity and specificity. The sensor performances were evaluated for each mean floor temperature shift investigated, adopting: (a) as MNOT value, a cutoff level that was in accordance with the results reported in
Table 2; and (b) for the image pattern recognition procedure, a template that was in accordance with the results reported in
Table 3. The results that were observed are reported in
Table 4.
The best detection performances, in terms of sensitivity, and, specificity, was reached by the “nest-usage-sensor” with a shift of the mean floor temperature equal to 5 degrees, as shown in the table. As a consequences, in the field tests that followed, the “nest-usage-sensor”, and the experimental nesting system, were setup with the parameters: (a) a shift of the mean floor temperature of 5 °C for the calculation of the BCTs; (b) a MNOT equal to 796 pixels in order to classify possible cases of multiple occupation of the nest; and (c) a template of a triangular shape and sizes of 43 × 33 pixels for the performing of the pattern recognition procedures.
In field tests, which were carried out to evaluate the detection performances of the “nest-usage-sensor” in a real scenario, data collected by the experimental nesting system were considered. During field tests, eggs productivity of the hens of the experimental group was not different in mean if compared with the average farm productivity. In details, the eggs laid by hens were 184. Of these eggs, 178 (96.7% of the total amount of eggs laid) were deposed in the nest were while six (3.3%) were deposed outside of the nest. The “egg-to-hen” assignments done by the experimental nesting system were 122 (68.5% of the total amount of eggs laid inside a nest), while for 56 eggs (31.5%), the assignment of the egg to a specific hen of the experimental group was not possible. The reasons of these failures were: (a) eggs blocked in the nest (two eggs, 1.1%) or in the collection tube (by broken eggs-two eggs, 1.1%); (b) eggs not detected by the photo cells (one egg, 0.6%); and (c) eggs that were uncertain (51 eggs, 27.2%), because a multiple occupation of the nest was been detected by the sensor.
In a final step of the sensor evaluation, all ovipositions were studied. Data stored in the log files were compared with video recordings acquired daily from the nest. The results of all these comparisons were classify as: TP, FP, TN, and FN (
Figure 5). Results obtained are shown in the following table (
Table 5).
On the basis of the results reported in
Table 5, sensitivity and specificity of the “nest-usage-sensor” were calculated and considered as its performances in the detection of a multiple occupation of the nest. In details, they were: a sensitivity of 95.7% and a specificity of 95.4%. Therefore, only two cases of multiple occupation of the nest, happened during field tests, were not correctly detected by the sensor. In addition, also its ability to count the number of hens that were in the nest during a multiple occupation was investigated through a similar procedure. The results that were obtained are reported in
Table 6.
With the results obtained, and reported in
Table 6, sensitivity and specificity of the sensor were calculated. In detail, they were: a sensitivity of 73.8% and a specificity of 94.9% in case of a double occupation of the nest; and, a sensitivity of 80% and a specificity of 94.8% in case of a triple occupation of the nest.
4. Discussion
The sensor under test showed an improvement in the detection performance of a multiple nest occupation if compared with a similar sensor that we developed in a previous study [
25] (that had a sensitivity of 94.6%, and a specificity of 94.8% vs. a sensitivity of 95.7%, and a specificity of 95.4% reached by the new developed sensor). The previous sensor was based on the evaluation of images acquired in the visible spectrum. A double occupation of the nest was detected when the number of pixels, that had a color different from the nest’ interior, overcame a specific threshold. Possible shadows, due to the sun and/or specific light conditions, showed to affect the reliability of the sensor developed. The present sensor overcame this issue as it was, in general, expected. Thermografic images, in fact, allow for easily recognizing the contour of a body that has a temperature higher than the background where it is positioned. In addition, potential shadows do not generally affect this recognition. This feature was confirmed in our tests, and it was the main reason at the basis of the improvements that were reached by the new “nest-usage-sensor” that was tested.
Furthermore, the previous sensor was not able to identify how many hens were in the nest during a multiple occupation. The present sensor, instead, was specifically developed to achieve this result. This allowed improving the accuracy of data collected. Therefore, with this new sensor, a better knowledge of hen’ behaviors in the use of free range system resources could be reached. Pattern recognition technique, applied to thermografic images, was the main reason of the result obtained. However, also the setup of the monitoring system improved the correctness of data collected. In fact, it required to store a “laying hen record” only when a new hen was detected by the monitoring system, imposing therefore to evaluate more than one thermografic image before classify a case. As a consequence, the global detection performance of the system resulted to be high.
Finally, also this new sensor allowed for detecting a multiple occupation of a nest reaching a good accuracy in the monitoring of laying hens without the need of any further mechanical part, like as example a trap device. The construction of the nest, in recording systems, like the FNB [
8], could be—as a consequence—simplified and during field tests, data could be collected without affect the natural behavior of hens. Therefore, a better knowledge of hens behavior, reared in free range hosing systems, could be achieved and better results, in terms of: selection of commercial strain; improvement of the design of these alternative systems; identification of a set of best practices in order to assist farmers in the management of these housing systems, should be obtained, with a possible increase also of the hens’ welfare.
However, some multiple occupations of the nest were difficult to detect. They were due to the number of hens that were in the nest in the same time or by the position of one of them on the border of the nest (i.e., with its head immediately outside of the nest). In these cases, not all the hens were “visible” to the sensor, and thus immediately identifiable. However, a high number of hens in the nest were observed basically in the first days of the test curried out. Therefore, if the experimental nesting system had been available to hens more than a week before the start of the tests, probably these unfavorable events would have been fewer. Furthermore, during the definition of the experimental group, a high density of hens was chosen in order to have a bigger chance to have a multiple occupations of the nest. Therefore, with a lower density of hens in the flock, as required by the EU Council Directive, or a bigger number of nests, these negative events should result to be less frequent. Finally, the position of the sensor could be changed in order to also monitor the entrance of the nest. With this set-up, also the hens that could stay on the border of the nest could be better controlled and detected.
More in general, image analysis, and image pattern recognition, confirmed to be a valid way for the monitoring of hens [
35,
36]. Furthermore, thermografic images allowed for collecting useful information on the laying performance and behavior of animals. However, to collect thermografic images, a thermo-camera must be used. Commercial thermo-cameras are still costly devices and their performances can be affected by the environmental conditions where they are used. Dust and dirt, which are generally present in the buildings where the hens are reared, can be a possible source of issues. However, some additional technical devices could be adopted in order to limit these possible problems. For example, compressed air could be sprayed on thermo-camera lenses at the beginning of monitoring activities, or at specific interval of times, through a nozzle that was mounted close to the infrared device. This should limit the deposition of dust and/or of dirt. In addition, a commercial device to shield the camera could be adopted. These devices have a cover positioned in front of the thermo-camera lenses. The cover can be moved through a pneumatic system, allowing for acquiring thermografic images, when necessary, and protect lenses in the remaining interval of times. Furthermore, to reduce costs, specific setups of the monitoring system could be considered. For example, a thermo-camera could be mounted on a track and moved around one or two axes. When considering that software subroutine of the “nest usage sensor” can perform one evaluation cycle for each second, it could be used to control more than one nest. Therefore, this solution could allow splitting the cost of a thermo-camera on more nests and consequently to limit the general cost required to build a monitoring system addressed to studies, or to monitor, a large flocks.