Animal Detection in Farm Lands IEEE
Animal Detection in Farm Lands IEEE
Animal Detection in Farm Lands IEEE
Abstract—We have developed a field monitoring system temperature, humidity, and quantity of solar radiation, as
(http://kansatu.net) using network-connected cameras and well as fixed-point images of agricultural crops, and images
sensors installed in apple trees to support the hands-on taken by network-connected cameras equipped with infrared
agriculture curriculum of an elementary school. The system motion sensors. The system has been in place seven years
enables to collects and stores a variety of images taken by since 2011, during which time, there have been years in
network-connected cameras equipped with infrared motion which more than approximately 50,000 images were
sensors. Agricultural works and animals are photographed in collected. In addition, a vast amount of environmental data,
these images. The system has been in place seven years since recorded in 1- or 2-min intervals, has been accumulated.
2011, during which time, there have been years in which more
However, the reality is that these data have not been used
than approximately 50,000 images were collected. However,
effectively [1].
these data have not been used effectively to learn agricultural
works. On the other side, in recent years, damage to Meanwhile, Japanese agriculture is faced with an aging
agricultural crops by wild animals has been increasing. From farming population and is struggling to secure new farmers
these backgrounds, our ultimate goal is to utilize the images to take over farm operations. The number of individuals
captured by motion sensor-equipped network cameras to engaged in agriculture is declining from year to year.
develop countermeasures to prevent wild animals from According to a survey conducted in 2015, 63.5% of the
damaging agricultural crops and to educate and cultivate farming population was aged 65 or older, with mean age
future farmers. In this study, we proposed a method that being 66.4 years[2]. In addition, in recent years, damage to
employs image analysis technology and the date and time of agricultural crops by wild animals has been increasing.
image capture to automatically classify images acquired by the According to a report from the Ministry of Agriculture,
motion sensor network cameras by type of agricultural work Forestry and Fisheries (MAFF), the damage to agricultural
and animal. We also developed a method for automatically crops caused by birds and wild animals in 2012 was
classifying the type of agricultural work. We evaluated the substantial, amounting to an estimated 23 billion JPY.
accuracy of the developed method by comparing the results of Damage caused by birds and wild animals is also a problem
automated classification with the results of manual in Iwate Prefecture, which is the field site of this study.
classification. The recall of the proposed method exceeded 90% Against this background, our ultimate goal is to utilize
for all three types of agricultural work tested, which was equal the images captured by motion sensor-equipped network
to or greater than the classification accuracy achieved with
cameras (hereinafter called “motion-triggered images”) to
manual classification.
develop countermeasures to prevent wild animals from
Keywords-field monitoring system; motion sensor camera; damaging agricultural crops and to educate and cultivate
image processing; agricultural information future farmers. As a first step towards this goal, in this study,
we propose a method that employs image analysis
technology and the date and time of image capture to
I. INTRODUCTION automatically classify images acquired by the motion sensor
In recent years, considerable advances have been made in network cameras installed in the field by type of agricultural
the research and development of commercial field work and animal. If the captured images can be
monitoring systems. However, the use of this technology has automatically classified by type of agricultural work or
been limited to environmental monitoring in greenhouse animal, they can then be used as training materials and to
production and quality control of agricultural products. develop animal deterrence methods.
Moving into a different area of application, we have
developed a field monitoring system (http://kansatu.net) II. CONCEPT OF THE SYSTEM USING MOTION SENSOR
using cameras and sensors installed in outdoor apple trees to IMAGES
support the hands-on agriculture curriculum of an elementary
school. The system, which enables the young students to A. Previous Research
observe the trees and fruit from inside the classroom, collects In a previous study, two network cameras (BB-SW174W,
and stores a variety of environmental data, including Panasonic) and a mobile Wi-Fi router (Wi-Fi Station N-01H,
103
B. Overview of Automated Image Analysis Sensor-detected image input
search through all captured images. In that case, the amount (5) Determination based on
time-of-year (April to
(6) Animal
of effort required is the same as when the metadata system is December)
identification
not used. To ensure that that is not the case, we must make Add work type corresponding to
image capture date as metadata
Add animal type as
100%) when the user searches agricultural work images. Output to agricultural work
image DB broken down by
Output to sensor-
detected animal image
Output to DB of images without
people or animals
It is generally accepted that there is a tradeoff between work type DB
recall and precision. For this reason, if the recall is 100%, Figure 2. Procedure for automatically classifying motion-triggered images.
the precision is expected to be low. Accordingly, in this
study, we investigate methods to minimize the number of
irrelevant images (i.e., improve precision) while ensuring TABLE III. ANNUAL SCHEDULE FOR MAIN AGRICULTURAL WORK
that all relevant images are found (recall of 100%). Work category Work period
104
that each type of agricultural work is performed. The table
was created based on interviews with apple growers in Shiwa,
Iwate Prefecture, which is the study site. From the table, it is
evident that no work other than pruning is performed from
A. First frame B. Second frame C. Third frame
January to March. Accordingly, “pruning” is added as
metadata to motion-triggered images captured from January
to March.
Interframe difference for frame B No. of days 3 or more per 2 or less per day
detected day
AB differential ∩ BC differential = interframe difference for frame B Agricultural 122 122 0
work
Figure 3. Example of the interframe differential method to detect presence No agricultural 64 4 60
of a person. work
Total 186 126 60
(4) If the differential area does not exceed the threshold of
0.5 for any of the n-2 image triplets, the metadata added 4) Determination based on crop changes
is “other.” Regarding work in which apples are directly handled—
Substantial interframe differences are used to determine this includes harvest, flower thinning and fruit thinning, and
presence of environmental change outdoors. The images are leaf thinning/fruit rotation, the type of work is determined by
then subjected to labeling process (labeling classes used by evaluating changes in RGB values of the captured images.
the Imura Laboratory) [4], and a determination is made For example, the apple-colored area (red, in this study) in
whether images exist for which the maximum differential time-lapse images decreases dramatically after harvest since
area exceeds the threshold value. In this case, the threshold is are no longer present. Similarly, the flower-colored are
set to 0.5, based on the value where presence or absence of (white, in this study) decreases dramatically after flower
people or animals could be determined even when dust or thinning. For this reason, the day on which the greatest
water droplets were present on the camera lens. Images change (decrease) in red area is observed is determined to be
captured at night are classified as animal images, and images the harvest day, and the day on which the greatest change
capture during the day are classified as agricultural work (decrease) in white area is observed is determined to be the
images. An example of the interframe differential method flower thinning day.
used to detect the presence of a person is shown in Fig. 3. 5) Determination based on equipment and tools
2) Determination based on the motion sensor trigger Motion-triggered images captured during agricultural
count work also show the equipment and tools used. Thus, it is
Among the images identified by the interframe possible to determine the type of work being performed by
differential method as containing agricultural workers, there identifying the equipment or tools present. Determination
are cases in which workers are simply passing through or are based on equipment and tools utilizes the template matching
checking the camera but are not performing any agricultural algorithm of OpenCV (ver.2.4.1) to match captured images
work. Workers who are in the area for purposes other than with pre-trained images. We selected OpenCV because it
agricultural work tend to stay only a short period of time. was found that similar images were captured for a given type
Accordingly, a determination can be made that a person is of work, owing to the fact that the images are taken from a
not performing agricultural work based on the number of fixed position and the fact that machine-based work is
times the motion sensor is triggered. In such cases, the generally performed in the same direction along the same
metadata added is “other.” path.
The results of an analysis to determine the relationship In this determination method, the equipment to be
between presence/absence of agricultural work and motion identified includes an agricultural chemical sprayer and a
sensor trigger count in motion-triggered images captured in riding lawnmower. Images identified as containing these
FY2013 are shown in Table 4. On days when some type of machines were assigned “Insect pest control” and “Weed
agricultural work is being performed, the trigger count is management,” respectively, as metadata. In addition, as it
three or higher. Accordingly, in cases where the trigger count was found that the angle from which these machines were
in a given day is two or less, a determination can be made captured differed depending on the camera direction seven
that agricultural work is not being performed, and the template images were prepared for each piece of equipment.
metadata added is “other.” Examples of template images for the agricultural chemical
3) Determination based on time of year (January to sprayer are shown in Fig. 4. Images of the same equipment
March) captured from various angles in different years were used as
Most apple-related agricultural work—which includes template images to improve detection accuracy. Furthermore,
pruning, flower thinning, leaf thinning and fruit rotation, because the motion sensor cameras are installed outdoors,
harvest, and laying of reflective sheets—is performed at the captured images are not necessarily clear since there is a
specific times of the year. Table 3 shows the time of year possibility of rain or dust being on the lens. Accordingly, the
105
template matching threshold was adjusted and, in the end, set during agricultural work from among all motion-triggered
to 0.6, as this value was found to provide the highest images. The image analysis methods developed include
matching accuracy. An example of an image identified as template matching using OpenCV, frame differential
containing the agricultural chemical sprayer is shown in Fig. analysis using labeling.h [4], and RGB analysis using C/C++.
5.
V. EXPERIMENT
A. Experiment Overview
We performed an experiment to evaluate the agricultural
work classification accuracy of the proposed methods ((1) to
(5) in Fig. 1). In the experiment, we compared the results of
manual classification and automated classification using the
proposed method. The target images were images showing
three representative types of agricultural work, namely weed
management, insect pest control, and pruning. The test image
pool consisted of 22,321 motion-triggered images captured
in FY2013 that were identified as containing agricultural
work of the types listed in Table 2.
The procedure for manual classification was as follows:
First, all motion-triggered images were separated into folders
on the PC desktop based on image capture date.
Figure 4. Four representative template images for the chemical sprayer. Classification was performed by 11 students in the Faculty of
Software and Information Science and the Graduate School
of Software and Information Science of Iwate Prefectural
University (3 second-year, 5 third-year, and 2 fourth-year
undergraduate students and 1 graduate student). The
classifiers first identified images showing pruning, followed
by all images showing insect pest control, and finally all
images showing weed management. The students were asked
to check all images on the desktop and then to determine the
type of work carried out each day. They were then asked to
copy all images captured on a given day identified as
showing a certain type of agricultural work to a different
folder on the desktop labeled with the work type. The
amount of time required to perform this work was calculated.
In addition, the recall, precision, and F-value (harmonic
mean of the recall and precision) were calculated for manual
classification using the equations below.
Figure 5. Example of an image of the chemical sprayer identified by
template matching.
106
night. Although this analysis takes several minutes to types of work in order of pruning, pest insect control, and
perform, metadata will have already been added to the weed management. The amount of time required to do these
images by the time the user uses the system, so the time tasks varied due to the classifiers’ fatigue and familiarity
required for the proposed method (Tables 5 to 7) is with the task, resulting in less time being required to classify
considered 0. Tables 5 to 7 indicate that the time required for images of insect pest control and weed management.
manual classification varied by classifier and by type of The recall of the proposed method exceeded 90% and
agricultural work. Although most of classifiers required tended to be higher than the recall for manual classification.
between 30 min and 1 h to extract images for one type of In contrast, the precision was on the order of 30 to 40% and
work, one classifier took 2 h. tended to be lower than the precision for manual
Two classifiers achieved a recall of 100% for pruning. classification. The latter result is likely due to the assignment
However, in all other cases, the recall was less than 100%. In of multiple work types as metadata using the determination
this experiment, the classifiers were asked to identify three method based on time of year ((5) in Fig. 2).
Pruning
No. of correctly Precision (%) Recall (%)
Time required Total no. of pruning No. of images
Classifier classified F-value
(min) images (A) classified (B) (A∩B /B) (A∩B /A)
images (A∩B)
1 75 566 995 566 56.9 100 0.73
2 49 566 2250 553 24.6 97.7 0.39
3 70 566 1742 566 32.5 100 0.49
4 48 566 1660 551 33.2 97.3 0.5
5 60 566 206 87 42.2 15.4 0.23
6 120 566 1111 410 36.9 72.4 0.49
7 87 566 621 194 31.2 34.3 0.33
8 73 566 1941 531 27.4 93.8 0.42
9 98 566 889 439 49.4 77.6 0.6
10 103 566 2758 528 19.1 93.3 0.32
11 35 566 588 309 52.6 54.6 0.54
Proposed
0 566 1806 566 31.3 100 0.47
method
107
TABLE VII. RESULTS OF THE EVALUATION EXPERIMENT (WEED MANAGEMENT)
Weed management
No. of correctly Precision (%) Recall (%)
Time required Total no. of weed No. of images
Classifier classified F-value
(min) management (A) classified (B) (A∩B /B) (A∩B /A)
images (A∩B)
1 41 78 106 68 64.2 87.2 0.74
2 43 78 193 65 33.7 83.3 0.48
3 26 78 128 64 50 82.1 0.62
4 33 78 648 43 6.6 55.1 0.12
5 60 78 66 64 97 82.1 0.89
6 12 78 35 19 54.3 24.4 0.34
7 30 78 238 17 7.1 21.8 0.11
8 28 78 638 23 3.6 29.5 0.06
9 76 78 842 50 5.9 64.1 0.11
10 31 78 712 46 6.5 59 0.12
11 30 78 81 41 50.6 52.6 0.52
Proposed
0 78 164 72 43.9 92.3 0.6
method
In addition, because there is a tradeoff between the recall exceeded 90% for all three types of agricultural work tested
and the precision, an F-value was calculated and compared to (weed management, insect pest control, and pruning), which
those of the manual classification performed by the 11 was equal to or greater than the classification accuracy
classifiers. The F-value for the proposed method was fourth achieved with manual classification.
highest for weed management, second highest for insect pest Going forward, we plan to investigate methods for
control, and seventh highest for pruning. In the case of determining animal type and, as indicated in Section 2 and
pruning, the desired recall of 100% was achieved. Fig. 1, to develop a support system for creating training
Classification of weed management and insect pest control materials and an adaptive animal deterrence system. In the
relies on the aforementioned template matching. Some of the future, we will explore how the proposed method can be
images were not clear due dust particles or rain drops on the used to support career education and new farmers and other
camera lens. Accordingly, the agricultural chemical sprayer countermeasures to the aging farming population and
and riding lawnmower could not be identified in all cases, shortage of new farmers.
resulting in a recall less than 100%. Even for case of manual
classification, the recall was less than 100% because some of ACKNOWLEDGMENT
the unclear images could not be classified visually even by a This work was supported by the Telecommunications
human classifier. Except for classifier 5, the recall for weed Advancement Foundation in Japan.
management was higher for the proposed method than for
manual classification. REFERENCES
[1] Masanori Takagi, Shohei Yoshida, Takemichi Nakamura, Keizo
VI. CONCLUSIONS Yamada, Jun Sasaki, Study on Automatic Recording Method of
The objective of this study was to develop a system for Agricultural Work for Learning Materials in Elementary School, IPSJ,
SSS2012, pp.233-240(2012)
automatically classifying images of agricultural work and
[2] Ministry of Agriculture, Forestry and
animals captured by infrared motion sensor network cameras Fisherieshttp://www.maff.go.jp/j/tokei/sihyo/data/08.html( confirmed
installed in the field. We proposed a method that employs on Feb. 15, 2019)
both image analysis technology and information on the date [3] Midori box [green box] https://info.midori-cloud.net/( confirmed
and time of image capture. We also developed a method for on Feb. 15, 2019)
automatically classifying the type of agricultural work. We [4] Masataka Imura, labeling classes from http://imura-
evaluated the accuracy of the proposed method by comparing lab.org/products/labeling/ (confirmed on Feb. 5, 2018)
the results of automated classification with the results of
manual classification. The recall of the proposed method
108