0% found this document useful (0 votes)
14 views18 pages

Technologies 13 00017

hdhd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views18 pages

Technologies 13 00017

hdhd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Article

Edge or Cloud Architecture: The Applicability of New Data


Processing Methods in Large-Scale Poultry Farming
Gergo Toth 1 , Sandor Szabo 2,3 , Tamas Haidegger 3,4, * and Marta Alexy 1,3,5, *

1 John von Neumann Faculty of Informatics, Óbuda University, Bécsi út 96/b, 1034 Budapest, Hungary
2 Faculty of Electrical Engineering and Informatics, Budapest University of Technology and Economics,
Műegyetem rkp. 3., 1111 Budapest, Hungary
3 University Research and Innovation Center (EKIK), Óbuda University, Bécsi út 96/b.,
1034 Budapest, Hungary
4 Austrian Center for Medical Innovation and Technology, ACMIT Gmbh, Viktor-Kaplan-Str. 2,
2700 Wiener Neustadt, Austria
5 Faculty of Informatics, Eotvos Lorand University, Pazmany Peter Setany 1/c, 1117 Budapest, Hungary
* Correspondence: [email protected] (T.H.); [email protected] (M.A.)

Abstract: As large-scale poultry farming becomes more intensive and concentrated, a


deeper understanding of poultry meat production processes is crucial for achieving maxi-
mum economic and ecological efficiency. The transmission and analysis of data collected
on birds and the farming environment in large-scale production environments using
digital tools on a secure platform are not straightforward. In our on-site research, we
have investigated two architectures, a cloud-based processing architecture and an edge
computing-based one, in large-scale poultry farming circumstances. These results un-
derscore the effectiveness of combining edge and cloud-based solutions to overcome the
distinct challenges of precision poultry farming settings. Our system’s dynamic capability,
supported by AWS’s robust cloud infrastructure and on-site edge computing solutions,
ensured comprehensive monitoring and management of agricultural data, leading to more
informed decision-making and improved operational efficiencies. A hybrid approach often
represents the most viable strategy when examining contrasting strengths and weaknesses.
Combining edge and cloud solutions allows for the robustness and immediate response
of edge computing while still leveraging cloud systems’ advanced analytical capabilities
Academic Editor: Sikha Bagui
and scalability.
Received: 30 September 2024
Revised: 7 December 2024 Keywords: IoT; poultry farming; edge computing; cloud architecture
Accepted: 19 December 2024
Published: 1 January 2025

Citation: Toth, G.; Szabo, S.;


Haidegger, T.; Alexy, M. Edge or Cloud 1. Introduction
Architecture: The Applicability of
New Data Processing Methods in
Digitalization of the agri-food sector is a significant challenge, as animal meat pro-
Large-Scale Poultry Farming. cessing has become intensive and concentrated across many sectors [1–3]; a deeper and
Technologies 2025, 13, 17. more detailed understanding of poultry meat production processes is crucial for achieving
https://doi.org/10.3390/ maximum economic and ecological efficiency. The analysis of animal-environment interac-
technologies13010017
tion is supported by precision livestock farming (PLF) solutions [4,5], which involve the
Copyright: © 2025 by the authors. application of info-communication technologies. The transmission and analysis of data
Licensee MDPI, Basel, Switzerland. collected on individual animals and the farming environment in large-scale production
This article is an open access article
environments using digital tools on a secure platform is not straightforward. Large-scale
distributed under the terms and
livestock farming (including poultry production) may occur in rural areas, far from big
conditions of the Creative Commons
Attribution (CC BY) license
cities, where the routine use of info-com devices is not always reliable. At the same time,
(https://creativecommons.org/ there is a growing need and demand for digital solutions that increase production efficiency
licenses/by/4.0/). and minimize the use of human labor. Of the data collection tools available for precision

Technologies 2025, 13, 17 https://doi.org/10.3390/technologies13010017


Technologies 2025, 13, 17 2 of 18

livestock technologies, which can be broadly divided into three categories (sensors, mi-
crophones, and cameras), cameras are the most relevant in large-scale poultry production
to collect individual data from tens of thousands of birds, typically in buildings larger
than 1000 m2 . Cameras are often considered particularly valuable for large-scale poultry
production. They can potentially capture individual data from thousands of birds within
buildings typically larger than 1000 m2 , providing visual insights that complement nu-
merical environmental data. An additional advantage of cameras is their stability and
durability. Cameras can be housed in IP67-rated enclosures more quickly than other sen-
sors, providing robust protection against dust and moisture. This level of durability makes
cameras particularly suitable for the challenging environments found in large-scale poultry
barns, where maintaining consistent sensor performance can be difficult, while recent
advancement in rapid prototyping offers a cost-efficient way to create 3D printed custom
sealed and durable cases [6]. The cameras provide the ability to collect images [7] and
videos, which add to the numerical data collected on the environmental parameters of the
barn (e.g., temperature, humidity, ammonia levels, and airspeed). Data science models can
use the images to estimate individual body weight [8]. In contrast, the analysis of the videos
can be used to monitor the static and dynamic behavior of the birds [9]. In contrast to
numerical data, images and videos are large, and their transmission and analysis place high
demands on the digital infrastructure. Artificial intelligence (AI), machine learning, and
deep learning have become essential R&D tools today, and their applications in agriculture
are increasingly evident. Yet, despite their widespread use in research projects and industry,
most of these ML models and results never reach the actual production environment. The
above statement is supported by a VentureBeat report [10], which showed that 87% of ML
projects never progress beyond the prototype phase. This can be due to several reasons,
ranging from failure to collect adequate data or any data, lack of communication between
team members, or lack of tools and knowledge essential for a scalable, monitorable, and
interpretable system. Almost the smallest part of an ML project is developing the ML model
itself. It is also necessary to emphasize the methodology and development culture that
facilitates fast and efficient decision-making monitoring and evaluation of the models. Our
research aims to bridge this gap and provide practical insights into implementing edge and
cloud-based solutions in large-scale poultry farming, thereby contributing to advancing
precision livestock farming. An additional consideration would be the sustainability and
social responsibility aspect of large-scale farming, where producers are being put under
pressure to monitor and assess the ESG-related aspects of their work [11,12].
In our field research, we have investigated two architectures, a cloud-based processing
architecture and an edge computing-based processing architecture, in large-scale poultry
farming circumstances. During the experiment, we used a high-bandwidth internet con-
nection, which allowed us to implement a cloud-based solution and compare the practical
aspects of each approach. Each approach has strengths and weaknesses; cloud-based solu-
tions offer significant computational power and scalability, essential for running complex
machine learning (ML) models and large-scale data analysis, but rely on stable internet
connectivity. Conversely, edge computing supports ML deployment directly on-site, en-
abling real-time processing with lower latency and reduced dependency on the internet,
though limited computational resources constrain it. This paper will explore these two
architectures’ practical differences, benefits, and limitations, focusing on how they support
ML applications for precision livestock farming and enhance data-driven decision-making
in agricultural environments.
Technologies 2025, 13, 17 3 of 18
Technologies 2025, 13, x FOR PEER REVIEW 3 of 18

2. Related Works
Numerousstudies
Numerous studieshave
haveexplored
exploredimaging
imagingtechnologies,
technologies,processing
processingtechniques,
techniques,and and
computationalmodels
computational modelsfor forpoultry
poultryweight
weightestimation
estimationand andmonitoring
monitoringsystems.
systems.Imaging
Imaging
systemsrely
systems relyononvisual
visuallight
light(CCD,
(CCD,CMOS),
CMOS),thermal
thermaland andinfrared
infraredsensors,
sensors,andandadvanced
advanced
modalitieslike
modalities likeMRI
MRIandandCT CT[13].
[13].Image
Imageprocessing
processingisisvitalvitalfor
forenhancing
enhancingaccuracy,
accuracy,with
with
colorspace
color spacetransformations
transformationsto toHSVHSVandandLabLabimproving
improvingobject objectsegmentation,
segmentation, as as demon-
demon-
strated
stratedininsick
sickbroiler
broilerdetection
detectionsystems
systems[14,15].
[14,15].Weight
Weightestimation
estimationapproaches
approachesinclude
include
regression
regressionmodels
models[16],
[16],ANN
ANN[17], [17],and
andSVR
SVRtechniques
techniques[18]. [18].Feature
Featureextraction
extractionisiscritical,
critical,
with
with2D2Dfeatures
featuressuch
suchasasarea
areaandandperimeter
perimeter[19] [19]and
and3D 3Dfeatures
featureslike
likevolume
volumeand andsurface
surface
area
area[18,20,21]
[18,20,21]commonly
commonlyused. used.Anatomical
Anatomicalfeatures
featuressuch suchasascarcass
carcassareas
areashave
havealso
alsobeen
been
employed
employedfor forweight
weightprediction
prediction [22]. Integrating
[22]. Integrating cloud andand
cloud edgeedge
computing introduces
computing scal-
introduces
ability and real-time
scalability processing
and real-time capabilities
processing but poses
capabilities challenges
but poses like latency
challenges and resource
like latency and re-
optimization. These infrastructures
source optimization. are essential
These infrastructures for advancing
are essential poultry weight
for advancing poultryestimation
weight es-
systems
timationbysystems
enablingbydistributed computationcomputation
enabling distributed while addressing whileunique challenges
addressing unique [21,23].
chal-
Despite these advancements, a critical gap remains in ensuring the quality
lenges [21,23]. Despite these advancements, a critical gap remains in ensuring the quality and usability of
data
and collected
usabilityin ofreal-world environments,
data collected in real-worldwhere infrastructurewhere
environments, and operational constraints
infrastructure and op-
significantly influence outcomes. Data collection is inherently challenging
erational constraints significantly influence outcomes. Data collection is inherently chal- due to hardware
contamination, unstable weighing
lenging due to hardware platforms,
contamination, and weighing
unstable animal behaviors that
platforms, hinder
and animal accurate
behav-
measurements
iors that hinder accurate measurements [8,24]. We addressed this gap by focusingthe
[8,24]. We addressed this gap by focusing on methods to maximize on
value of collected
methods data, the
to maximize evenvalue
in theofpresence
collectedofdata,
practical
evenproblems.
in the presence of practical prob-
lems.
3. Materials and Methods
3. Materials and
Our research wasMethods
carried out on a large-scale goose farm in Northern Hungary. The
farm has
Our eight
researchbarnswas measuring
carried out 12onma×large-scale
72 m × 2.5 m. farm
goose The production
in NorthernisHungary.
a two-stage The
type,
farmwith pre-rearing
has eight up to 7 weeks.
barns measuring 12 mAfter
× 72 this
m ×period,
2.5 m. The the geese are placed
production in the stuffing
is a two-stage type,
shed,
with where they stay
pre-rearing up tofor two weeks
7 weeks. Afterbefore being the
this period, transported
geese areto the slaughterhouse.
placed The
in the stuffing shed,
bedding material is chopped wheat straw. After the day-old geese
where they stay for two weeks before being transported to the slaughterhouse. The bed- are received, the litter
straw is supplemented
ding material is chopped with fresh
wheat wheat
straw. straw
After by strawing
the day-old geesetwice a week. the
are received, Thelitter
housing
straw
technology
is supplemented with fresh wheat straw by strawing twice a week. The housinginto
iss fully automated. An automatic feeding system fills the dry feed the
technol-
daily bins
ogy iss of automated.
fully the feedingAn lines. The feed
automatic is then
feeding system filled
fillsinto
the the
dry circular
feed intofeeding
the dailypens
bins
on the feeding lines by a motor at the end of the lines. The water
of the feeding lines. The feed is then filled into the circular feeding pens on the feeding permeability of the
drinking
lines by lines withatvalves
a motor the end is of
adapted to the
the lines. Thegeese’s
waterneeds. Computer-controlled
permeability of the drinkingventilation
lines with
(automatic
valves is adapted to the geese’s needs. Computer-controlled ventilationwith
opening and closing of fans and air inlets), heating technology heat blowers,
(automatic open-
and cooling with cooling pads ensure an age-appropriate housing
ing and closing of fans and air inlets), heating technology with heat blowers, and cooling environment for the
geese (Figures 1 and 2). The density of the birds is ten geese/m 2 . The geese are French
with cooling pads ensure an age-appropriate housing environment for the geese (Figures
Landes geese,
1 and 2). The which
densitycan of reach 6 kgisindividual
the birds ten geese/m body
2. The weight
geeseby arethe end of
French the 7-week
Landes geese,
pre-rearing period.
which can reach 6 kg individual body weight by the end of the 7-week pre-rearing period.

Figure1.1.Scenery
Figure Sceneryatatthe
thebeginning
beginningofofthe
therearing
rearingperiod
periodininlarge-scale
large-scalegeese
geeseproduction.
production.
Technologies 2025,13,
Technologies2025, 13,17x FOR PEER REVIEW 44 of 18
18

Figure2.2.At
Figure Atthe
theend
endof
ofthe
therearing
rearingperiod
periodin
inlarge-scale
large-scalegeese
geeseproduction.
production.

Consideringthe
Considering theharsh
harsh environment
environment (dust,
(dust, insects,
insects, humidity,
humidity, and ammonia)
and ammonia) in a
in a large-
large-scale
scale poultry poultry
farming farming
facilityfacility (inHungary),
(in rural rural Hungary), we used weoutdoor
used outdoor IP67-rated
IP67-rated security secu-
IP
rity IP cameras
cameras in thefor
in the stables stables
imagefor image
data data collection,
collection, equippedequipped
with built-inwithinfrared
built-inillumina-
infrared
illumination,
tion, a fixed dome a fixed domeDS-2CD1123G0E-I
Hikvision Hikvision DS-2CD1123G0E-I
(C) dome IP camera (C) dome (2MP, IPIR30m,
camera2.8(2MP,mm,
IR30m,
POE), and2.8mm, POE), and
a Hikvision a Hikvision DS-2CD2143G2-I
DS-2CD2143G2-I dome IP camera dome (4MP, IP camera (4MP,
StarLight, IR30m,StarLight,
2.8 mm,
IR30m,
POE). The2.8mm,
camera POE). Theoften
vendor camera vendor
offered often offered a vendor-specific
a vendor-specific solution for scanning solution
thefor scan-
camera
ning the
images orcamera
the videoimages
stream.or the video
Still, stream.
we used Still, we used a camera-independent
a camera-independent solution that can be solution
used
that
to can bedata
perform usedcollection
to perform data collection
regardless regardless
of the camera typeofinthe camera
case type in case
it is supported RTSPit is(RFC
sup-
ported
7826: RTSP (RFC
Real-Time 7826: Real-Time
Streaming ProtocolStreaming
Version 2.0). Protocol Version
The weight 2.0).were
data The collected
weight data using werea
collected
bird using a bird
scale consisting of ascale consisting
suspended of a suspended
weighing plate and weighing platecollection
a digital data and a digital
unit. data
The
collection
plate and the unit. The platewere
mechanics andreassembled
the mechanics fromwere reassembled
a Fancom 747 birdfrom a Fancom
scale and the 747ILM.C1bird
scale and
pulling scalethecell.
ILM.C1 pulling scale
The cameras in thecell.
stableThe cameras
were in thetostable
connected a GigabitwereEthernet
connected to a
switch
Gigabit
in the barnEthernet
using switch
Category in the
5e UTPbarnwiring,
using Category
and power 5e was
UTPalso wiring, and power
supplied waswire
over this also
supplied
using PoEover thisover
(Power wireEthernet)
using PoEtechnology.
(Power over TheEthernet)
camerastechnology.
and the scale Thewere
cameras
fixedand the
to the
metal
scale roof
werestructure
fixed to of thethe barn.roof
metal This straight of
structure barthe
load cell This
barn. (sometimes
straightcalled a strain
bar load cell gauge)
(some-
can
timestranslate
called aup to 10kg
strain gauge)of pressure
can translate(force)upinto
to 10kgan electrical
of pressure signal.
(force)Each
intoload cell can
an electrical
measure
signal. Each the load
electrical resistance
cell can measurethat the changes
electricalinresistance
responsethat to, and is proportional
changes in response to, and the
strain (e.g., pressure
is proportional or force)
to, the strainapplied to the bar.
(e.g., pressure or With
force)this gauge,tothe
applied theweight of anthis
bar. With object can
gauge,
be
themeasured
weight ofifan theobject
object’scanweight changesif over
be measured time orweight
the object’s if one needs
changes to sense the presence
over time or if one
of an object
needs to senseby measuring
the presence strain
of an orobject
load applied
by measuringto a surface.
strainEach
or loadstraight bartoload
applied cell is
a surface.
made
Each from
straight an aluminum
bar load cell alloy capable
is made from of an
holding
aluminuma capacity
alloyofcapable
10 kg. These load cells
of holding have
a capacity
four
of 10strain gauges
kg. These loadhooked up infour
cells have a wheatstone
strain gauges bridge formation.
hooked up in aAdditionally,
wheatstone bridgethese load for-
cells offerAdditionally,
mation. an IP66 protection rating
these load andoffer
cells feature two protection
an IP66 M4 and two M5-sized
rating through-holes
and feature two M4
for
andmounting
two M5-sized purposes.
through-holes for mounting purposes.

3.1.
3.1.Edge-Based
Edge-BasedInfrastructure
Infrastructure
3.1.1. Dataset
3.1.1. Dataset
Time stamps were assigned to the collected weight data so that we could later match
Time stamps were assigned to the collected weight data so that we could later match
the data on individual bird weight and camera-made image pairs. The measured weight
the data on individual bird weight and camera-made image pairs. The measured weight
data were transmitted via the RS485 interface to the data acquisition computer, which also
data were transmitted via the RS485 interface to the data acquisition computer, which also
processed the camera images. We used images at 2 MPx resolution. A Raspberry Pi 3b
processed the camera images. We used images at 2 MPx resolution. A Raspberry Pi 3b
microcomputer on a 32 GB SD card and an external 1 TB hard drive captured and stored
microcomputer on a 32 GB SD card and an external 1 TB hard drive captured and stored
the camera images (Figure 3). The data were recorded in weekly rotation, so new data
the camera images (Figure 3). The data were recorded in weekly rotation, so new data
overwrote the oldest data to ensure available storage space. The measured weight data
overwrote the oldest data to ensure available storage space. The measured weight data
were labeled with a timestamp and then uploaded to a central database. The validation of
were labeled with a timestamp and then uploaded to a central database. The validation of
the camera images to be included in the neural network training dataset was performed
the camera images to be included in the neural network training dataset was performed
in several steps. First, those images were selected from the collected ones where exactly
in several steps. First, those images were selected from the collected ones where exactly
ogies 2025, 13, x FOR PEER
Technologies 2025,REVIEW
13, 17 5 of 18 5 of 18

one on
one bird is visible birdtheisscale,
visible onscale
the the scale, theto
appears scale
be atappears to the
rest, and be atbird
rest,isand thescale
on the bird is on the scale
with its entire body. All other images where the birds were
with its entire body. All other images where the birds were not on the measuring platenot on the measuring plate with
with their wholetheir
bodywhole
were body were removed
removed from the database,
from the database, which pictures
which included includedwhere
pictures where a lot
of birds were in one place, the edges of the scale were hidden
a lot of birds were in one place, the edges of the scale were hidden by the birds, the refer-by the birds, the reference
ence point waspoint
wrong,wasor wrong, or there
there were wereonnothe
no birds birds onThese
scale. the scale.
casesThese
were cases
filteredwere filtered during the
during
comparison with
the comparison with the weighted data.the weighted data.

(a) (b) (c)

Figure 3. Different scales


Figure 3. and geese scales
Different imagesand
forgeese
training ((a) many
images geese on
for training ((a)the scale,
many (b) no
geese on geese on (b) no geese on
the scale,
the scale, (c) valid
theimage).
scale, (c) valid image).

The measured The valuesmeasured


that did values thatthe
not match diddevelopment
not match the development
curve of the birdscurve of the birds and
and the
corresponding images were also removed from the cleaned database. Consecutive, iden- Consecutive,
the corresponding images were also removed from the cleaned database.
identical
tical images were averaged.images were that
Images averaged.
did notImages that did not
carry additional carry additional
information were dis-information were
discarded (e.g., images where a bird was permanently
carded (e.g., images where a bird was permanently on the scales). As a result, only those on the scales). As a result, only
those
images that could images
serve that could
as inputs to theserve
feature as extractor
inputs tocomponent
the feature extractor
were left in component
the imagewere left in the
database. image database.
During a singleDuring
10-week a single
cycle,10-week
our study cycle, our study aimplemented
implemented rigorous image a rigorous
collectionimage collection
protocol, capturing images every 10 s from 8 am to 8 pm daily. This schedule was explic- was explicitly
protocol, capturing images every 10 s from 8 am to 8 pm daily. This schedule
chosen towith
itly chosen to coincide coincide with the
the hours hours
when thewhen
stablethe stable
lights lights
were on,were on, ensuring
ensuring that all that all images
were captured in color. The importance of using color
images were captured in color. The importance of using color images stems from their images stems from their suitability for
our post-processing
suitability for our post-processing needs, needs, where
where color
color depth
depth plays
plays aa critical
critical role
roleininaccurately
accu- analyzing
and distinguishing features relevant to our study. This
rately analyzing and distinguishing features relevant to our study. This systematic collec- systematic collection resulted
tion resulted ininapproximately
approximately4320 4320images
imagesdaily,
daily,accumulating
accumulating 302,400
302,400 images
images throughout the study.
through-
When the lights were turned off at night, the camera only
out the study. When the lights were turned off at night, the camera only captured black captured black and white images.
These
and white images. monochrome
These monochrome photos werewere
photos deemed unsuitable
deemed for our
unsuitable processing
for our algorithms, which
processing
require color differentiation to function correctly. Consequently,
algorithms, which require color differentiation to function correctly. Consequently, pic- pictures captured outside
tures captured the 8 amthe
outside to 88 pm
am window were automatically
to 8 pm window discarded.
were automatically This strategic
discarded. approach ensured
This stra-
tegic approach ensured that the data for analyzing geese’s growth and weight dynamics reliable.
that the data for analyzing geese’s growth and weight dynamics was highly
was highly reliable.
3.1.2. Preparation of Mask Dataset
3.1.2. Preparation ofAMask
segmentation
Dataset component was used to process the images, as annotated data were
needed to train the neural network. To reduce the workload of the learning process, we
A segmentation component was used to process the images, as annotated data were
added instance segmentation to the image sorting software, which selected the birds on the
needed to train the neural network. To reduce the workload of the learning process, we
scale. The segmentation represented the polygons containing the scale and the birds. The
added instance segmentation to the image sorting software, which selected the birds on
publicly available LabelMe software [25] was used to generate this, which offered several
the scale. The segmentation represented the polygons containing the scale and the birds.
inclusion shapes, including the polygon with the unique shape. The LabelMe software
The publicly available LabelMe software [25] was used to generate this, which offered
has the additional advantage of supporting the concatenation and conversion of the files
several inclusion shapes, including the polygon with the unique shape. The LabelMe soft-
generated during annotation into more popular formats.
ware has the additional advantage of supporting the concatenation and conversion of the
Figure 4 shows the working process using LabelMe. Because the goose’s shape is
files generated during annotation into more popular formats.
irregular, we used polygon labels for labeling. Figure 4 also shows the visualization results.
Figure 4 shows the working process using LabelMe. Because the goose’s shape is ir-
regular, we used polygon labels for labeling. Figure 4 also shows the visualization results.
x FOR PEER REVIEW 6 of 18
Technologies 2025, 13, 17 6 of 18

It can
Technologies 2025,be
13, seen thatREVIEW
x FOR PEER the two valid pieces of information in the image—the scale and the 6 of 18
It can be seen that the two valid pieces of information in the image—the scale and the
goose—are labeled.goose—are labeled.

It can be seen that the two valid pieces of information in the image—the scale and the
goose—are labeled.

Figure 4. Labeling process


Figure andLabeling
instance
Figure4.4.Labeling
segmentation
process
processand
andinstance
results.
instancesegmentation
segmentationresults.
results.

Finally,
Finally, the mask image
Finally,the
themask
was maskimage
created,
imageaswas created,
shown
was inasFigure
created, asshown
shown 5.ininWe
Figure 5.5.We
obtained
Figure Weobtained two
two pieces
obtained twopieces
pieces
ofofvaluable
valuableinformation
information for
forextracting
extracting feature
feature sets.
sets.AA final
final“.json”
“.json” format
format file
fileand
and “.png”
“.png”
of valuable information for extracting feature sets. A final “.json” format file and “.png”
format
formatmask
maskfilefilewere
weregenerated,
generated,which could
couldbebeapplied
appliedininsubsequent
subsequentfeature
featureextraction
format mask file were generated,
steps. which could bewhich
applied in subsequent feature extraction extraction
steps. Then, we can further extract the feature set based on it in the followingsteps.
Then, we can further extract the feature set based on it in the following steps.
steps. Then, we can further extract the feature set based on it in the following steps.

Figure5.5.The
Figure Theresulting
resultingmask
maskuses
usesthe
theLabelMe
LabelMetool.
tool.

3.1.3.
3.1.3.Preparation
PreparationofofKey
KeyPoint
PointDataset
Dataset
The
Figure 5. The resulting mask
Thegeese
uses ininthe
the
geese thebarn
barnoften
LabelMe tool.moved
often movedduring
duringthe
therecording
recordingand
andare
areinindifferent
differentpostures
postures
during
duringtheir
theirdaily lives,
daily even
lives, even when
when standing
standingstill. To To
still. improve
improve thethe
accuracy
accuracyof the follow-up
of the follow-
3.1.3. Preparation ofmodel
up
Key for
model
Pointweight prediction,
forDataset
weight we have
prediction, annotated
we have a dataset
annotated containing
a dataset critical
containing points
critical of theof
points
goose bodybody
the goose parts.parts.
Geese farmers
Geese are familiar
farmers with with
are familiar manymany typical goosegoose
typical poses, which
poses, we
which
The geese in the
havebarn
we have
often
often often moved
encountered during
on ouron
encountered
the recording
recordings. and
For example,
our recordings.
are in different
geese usually
For example,
postures
have their
geese usually havewings
their
during their daily lives,
spread
wingseven
or when
their
spread necks standing
or theirextended. still. ToThis
improve
This movement
necks extended. the increased
increased
movement accuracy
the number ofofnumber
the the follow-
occupied areas to
of occupied
up model for weight aareas
great extent.
prediction,
to a greatAs
we a result,
have
extent. the masked
Asannotated
a result, area
the a willarea
dataset
masked becontaining
larger
will beand thus notthus
critical
larger and match notthe
points ofactual
match the
weight,
actual resultingresulting
weight, in inaccurate
in modeling.
inaccurate We have We
modeling. annotated
have each of the
annotated following
each of the five key
following
the goose body parts. Geese farmers are familiar with many typical goose poses, which
points on points
five key the goose:
on thethegoose:
tail, the
themiddle of middle
tail, the the body, of the
the neck,
body,the theleft wing,
neck, the and the right
left wing,
we have often encountered on our recordings. For example, geese usually have their and
wing, as shown
the right wing,in
asFigure
shown6.in Figure 6.
wings spread or their necks extended. This movement increased the number of occupied
Thus, even if the goose stretches its neck to increase the area, this does not affect the
areas to a great extent. As a weight
effective result,area.
the The
masked area
left and rightwill beare
wings larger
joinedand thustonot
together form match the width
the lateral
actual weight, resulting
of theingoose’s
inaccurate
body. Itmodeling. We the
does not affect have annotated
effective weight each of the
area even following
if the goose opens its
five key points on the goose: the tail, the middle of the body, the neck, the left wing,used
wings to increase the area. The area formed by fitting the five points can be andlater to
determine the actual effective weight range of the bird. In this way, the accuracy of the
the right wing, as shown in Figure 6.
modeling can be improved. A final “.json” format file is generated, which can be applied
Thus, even if the goose stretches its neck to increase the area, this does not affect the
effective weight area. The left and right wings are joined together to form the lateral width
Technologies 2025, 13, x FOR PEER REVIEW 7 of 18

Technologies 2025, 13, 17 7 of 18


in subsequent feature extraction steps. At the end of this procedure, the training dataset
was established in the edge case.

Figure6.6.Key
Figure Keypoints
pointsofofgeese.
geese.

3.1.4. Feature
Thus, evenExtraction
if the goose stretches its neck to increase the area, this does not affect the
effective
In this part, weThe
weight area. left andthe
employed right wings
Mask are joined
R-CNN together
algorithm to to form
train thethe lateralwe
dataset width
had
ofprepared
the goose’s body. It with
in advance does the
not LabelMe
affect theannotation
effective weight areadataset
tool. The even ifincluded
the goosetheopens its
original
wings to increase the area. The area formed by fitting the five points can
images and the corresponding annotation information. The .json file contained the loca- be used later to
determine the actual
tion and category ofeffective
each markerweight range
point; weofneeded
the bird. In this way,
to convert this the
.jsonaccuracy
file into of the
a .png
modeling can be improved. A final “.json” format file is generated, which
mask file. The dataset was then converted to the COCO format, which the Mask R-CNN can be applied in
subsequent feature extraction steps. At the end of this procedure, the training dataset was
model supports.
established
The nextthe
in stepedge
wascase.
to extract the feature set we were looking for from the images: the
number of animals on the scale and the area occupied. This was accomplished by an in-
3.1.4. Feature Extraction
stance segmentation component that detected the scale and the birds. The area was given
In this
by the part,capturing
polygon we employed the Mask
the detected R-CNN
birds. As a algorithm
last step, we to matched
train the the dataset
weightwemeas-
had
prepared
urementin advance
data along with the LabelMecomputed
the timestamps, annotation tool. The
average dataset
weight andincluded
area as athe originalof
function
images and the corresponding annotation information. The .json
the animals in the image, and performed an outlier filter to delete the erroneous values. file contained the loca-
tion andThecategory
development of each marker point;
of filtering we needed
components to convert
that processed this
the data .json
wasfile into
also a .png
presented,
mask file. The dataset was then converted to the COCO format,
where the aim was to be easily integrated into the pipeline and usable in other machine which the Mask R-CNN
model
visionsupports.
and learning-based projects, being well customizable depending on the task. To
The next
automate the step
datawas to extract
collection the feature
process, the firstset wewas
step were to looking
match the forweight
from thedataimages:
on the
the number of animals on the scale and the area occupied.
image retrieved from the camera with the retrieved image. The operation of the auto- This was accomplished by
an instance segmentation component that detected the scale
mated pipeline was improved by using filter modules that could be loaded separately.and the birds. The area was
given
Therebywerethe polygon capturing
several reasons why therepetitive
detected errors
birds. hadAs ato last
bestep, we matched
detected; the weight
firstly, bias was in-
measurement
troduced intodata thealong the giving
dataset, timestamps, computed
the neural networkaverage
moreweight
chanceand to area
learnasspecific
a function
pat-
ofterns;
the animals in the image, and performed an outlier filter to delete
the network’s generalization ability was degraded, becoming less accurate on data the erroneous values.
Thenot
it had development
seen before,ofminimizing
filtering components
the storage that processed
capacity the data was
requirement. To also presented,
achieve proper
where the aim was to be easily integrated into the pipeline and usable
scalability on a large dataset, the difference hash was used, which had several advantages: in other machine
vision
first, itand
waslearning-based
not sensitive to projects,
different being well customizable
resolutions and aspect ratios;depending second,on the task. To
changing the
automate the data collection process, the first step was to match
contrast did not change the hash value or altered it only slightly, so that hash values of the weight data on the
image retrieved
very similar from were
images the camera
closerwith
to eachtheother
retrieved
and image. The operation
the solution was fast. of Tothe automated
count as many
pipeline was improved by using filter modules that could
repetitive images as possible, the method used grayscale images and did not look be loaded separately. There
for a
were several reasons why repetitive errors had to be detected; firstly, bias was introduced
complete match between hash values, allowing for slight variations.
into the dataset, giving the neural network more chance to learn specific patterns; the
network’s generalization ability was degraded, becoming less accurate on data it had not
Technologies 2025, 13, 17 8 of 18

seen before, minimizing the storage capacity requirement. To achieve proper scalability
on a large dataset, the difference hash was used, which had several advantages: first, it
was not sensitive to different resolutions and aspect ratios; second, changing the contrast
ogies 2025, 13, x FOR PEER REVIEW did not change the hash value or altered it only slightly, so that hash values
8 of 18 of very similar
images were closer to each other and the solution was fast. To count as many repetitive
images as possible, the method used grayscale images and did not look for a complete
match between hash values, allowing for slight variations.
Another approach was to pre-filter the images, i.e., to decide before writing them to
Another approach was to pre-filter the images, i.e., to decide before writing them to
disk whether a given frame had new information. For this purpose, we used a motion
disk whether a given frame had new information. For this purpose, we used a motion
detector. In many cases, the movement of birds or dirt on the camera caused blurred im-
detector. In many cases, the movement of birds or dirt on the camera caused blurred images,
ages, significantly impairing automatic segmentation and manual mask annotation.
significantly impairing automatic segmentation and manual mask annotation. Therefore,
Therefore, we implemented edge detection on the input image since the fewer edges
we implemented edge detection on the input image since the fewer edges found, the more
found, the more likely the image was blurred. We chose a Laplace operator and ran it on
likely the image was blurred. We chose a Laplace operator and ran it on three test images
three test images (Figure 7) over which we superimposed an artificial blur. The first image
(Figure 7) over which we superimposed an artificial blur. The first image remained sharp
remained sharp everywhere, the second blurred on the scale area, and the last blurred
everywhere, the second blurred on the scale area, and the last blurred everywhere.
everywhere.

Figure 7. Application of the Laplace operator on three test images: (1) sharp image, (2) image with
Figure 7. Application of the Laplace operator on three test images: (1) sharp image, (2) image with
blur applied to the scale
blur area,to
applied and
the(3) image
scale with
area, andblur applied
(3) image to the
with blurentire image.
applied to the entire image.

The variance was Theused to determine


variance was usedthetofuzziness
determine metric. A more considerable
the fuzziness metric. A vari-more considerable
ance is relatedvariance
to the number of detected edges, so the smaller the variance, the fuzzier
is related to the number of detected edges, so the smaller the variance, the fuzzier
the image is considered.
the imageIn is the case of edge
considered. computing,
In the thecomputing,
case of edge Python language was selected,
the Python language was selected,
because, in deep learning, big data, and image processing, this language
because, in deep learning, big data, and image processing, this languagehas several li- has several
braries that make the development
libraries that make the much more accessible.
development much moreOneaccessible.
of our primary
One ofinput
our data
primary input data
sources was a set of images from the OpenCV library and Tensorflow and Keras, which
sources was a set of images from the OpenCV library and Tensorflow and Keras, which
contain variouscontain
essential predefined
various machine
essential learning
predefined models.
machine In addition,
learning models.the Inpandas
addition, the pandas
module helpedmodule
us withhelped
data processing, and for annotation, we used the publicly availa-
us with data processing, and for annotation, we used the publicly available
ble LabelMe software.
LabelMe The infrastructure
software. diagram diagram
The infrastructure for the edge
for thesolution can be can
edge solution seenbeinseen in Figure 8.
Figure 8.

Figure 8. Edge infrastructure.


AWS Lifecycle Policies: To manage storage costs, lifecycle policies were configured
contain various
on the S3 essential
buckets. These predefined machine learning
policies automatically models.
transitioned In addition,
older images tothe pandas
lower-cost
module helped us with data processing, and for annotation, we used the publicly availa-
storage classes (S3 Standard-IA, S3 Glacier) based on age, reducing costs while maintain-
Technologies 2025, 13, 17 ble
ing LabelMe software.
access to data whenThe infrastructure diagram for the edge solution can be seen
needed. 9 of in
18
Figure 8.
AWS RDS with PostgreSQL [27]: Amazon RDS was used to host a PostgreSQL data-
base for storing and querying processed log file data. This setup enabled secure, reliable
data storage and supported complex queries for data analysis.
Infrastructure as Code (IaC): We adopted an infrastructure-as-code approach, using
AWS services to manage and provision our cloud resources through code. This method
allowed us to maintain consistency across various deployment environments, reduce
manual configuration errors, and streamline the updating and scaling of our infrastruc-
ture.
AWS Lambda [28]: For data processing, we employed AWS Lambda to implement
code in response to triggers from S3, allowing us to process incoming data files automat-
ically without managing servers. This serverless computing service enables real-time data
processing and seamless data flow management.
AWS SageMaker [29]: We utilized AWS SageMaker to support our machine learning
workflows, including training and deploying models. This fully managed service pro-
vided 8.
Figure a Edge
central platform for all stages of machine learning development, from model
infrastructure.
Figure 8. Edge infrastructure.
building and training to deployment and monitoring, enhancing the efficiency and scala-
3.2. Cloud-Based
bility Solution
of our machine learning efforts.
3.2.1.These
AWS AWSInfrastructure
services collectively supported our goal to manage large-scale data effec-
Our
tively, precision
allowing foragriculture study utilized
dynamic scaling comprehensive
and robust data processingAmazon Web Services
capabilities (AWS)
essential for
cloud services
the success to streamline
of our our data management
precision agriculture andintegrated
initiatives. This processingAWSworkflows (Figureen-
infrastructure 9),
ensuring
sured thatefficient handling
each aspect of ourand
datascalability of extensive
handling—from initialdatasets.
collectionLet
to us introduce
detailed here a
analysis—
concise overview
was optimized forofperformance,
the specific AWS
cost, services employed and their roles in our project:
and scalability.

Figure
Figure 9. Cloud infrastructure.
9. Cloud infrastructure.

AWS S3 [26]: Amazon Simple Storage Service (S3) was used to store two types of data:
log files with scale measurements and images. Separate S3 buckets were assigned to each
data type to improve organization and apply appropriate access controls.
AWS Lifecycle Policies: To manage storage costs, lifecycle policies were configured
on the S3 buckets. These policies automatically transitioned older images to lower-cost
storage classes (S3 Standard-IA, S3 Glacier) based on age, reducing costs while maintaining
access to data when needed.
AWS RDS with PostgreSQL [27]: Amazon RDS was used to host a PostgreSQL database
for storing and querying processed log file data. This setup enabled secure, reliable data
storage and supported complex queries for data analysis.
Infrastructure as Code (IaC): We adopted an infrastructure-as-code approach, using
AWS services to manage and provision our cloud resources through code. This method
allowed us to maintain consistency across various deployment environments, reduce
manual configuration errors, and streamline the updating and scaling of our infrastructure.
Technologies 2025, 13, 17 10 of 18

AWS Lambda [28]: For data processing, we employed AWS Lambda to implement
code in response to triggers from S3, allowing us to process incoming data files automati-
cally without managing servers. This serverless computing service enables real-time data
processing and seamless data flow management.
AWS SageMaker [29]: We utilized AWS SageMaker to support our machine learning
workflows, including training and deploying models. This fully managed service provided
a central platform for all stages of machine learning development, from model building
and training to deployment and monitoring, enhancing the efficiency and scalability of our
machine learning efforts.
These AWS services collectively supported our goal to manage large-scale data effec-
tively, allowing for dynamic scaling and robust data processing capabilities essential for the
success of our precision agriculture initiatives. This integrated AWS infrastructure ensured
that each aspect of our data handling—from initial collection to detailed analysis—was
optimized for performance, cost, and scalability.

3.2.2. Dataset
In the cloud-based implementation of our precision agriculture study, we manually
collected two-hour-long video segments daily over a ten-week cycle using the interface
provided by Hikvision cameras online. This manual process facilitated the verification
of data quality and connectivity while ensuring the operational integrity of the camera
systems. A substantial total of 140 h of video was captured throughout this period.
We meticulously organized our data storage and management strategy using AWS
cloud services to ensure the efficient handling of extensive datasets. We had a log file that
captured the scale information in grams, for which we set up a dedicated AWS S3 bucket
to store these logs systematically. Another separate S3 bucket was explicitly created for
storing videos. To manage costs effectively while dealing with a high volume of data, we
implemented lifecycle policies on the image storage bucket, which helped optimize the
storage costs by transitioning older videos to cheaper storage tools within AWS.
For data cleaning and preprocessing, we developed specialized algorithms container-
ized with Docker [30] to ensure stability, consistency, and reproducibility. The data cleaning
algorithm processed scale readings by averaging multiple entries within the same second
and imputing missing data when necessary, using the average of adjacent values to main-
tain the continuity of the dataset. Following the data cleaning process, we compiled a
sequence of scale readings for each second, each entry marked as either a known value or a
null. Then, we delineated intervals in this sequence that were free of nulls. We computed a
difference sequence within these complete intervals to examine weight changes, an essential
factor for precise weight estimations.
The processed results from the log files were analyzed and stored efficiently for future
access and analysis. For this purpose, we utilized AWS RDS with a PostgreSQL database.
The specific version of PostgreSQL used was configured to fit our requirements for robust
data management and querying capabilities. By storing the processed results in an AWS
RDS database, we ensured that the data were secure, easily retrievable, and manageable,
facilitating complex queries and extensive data analysis.
This automated pipeline, from data storage in S3 to processing via Lambda and storing
results in RDS, underscored our commitment to leveraging cloud technology for efficient,
scalable, and reliable data management.
Regarding the modeling of the growth trajectory of geese, we initially used Gaussian
Process Regression (GPR) with a Radial Basis Function (RBF) kernel [31,32] to create a
continuous, smooth growth curve from the known weekly optimal weight curve (Figure 10).
cient, scalable, and reliable data management.
Regarding the modeling of the growth trajectory of geese, we initially used Gaussian
Process Regression (GPR) with a Radial Basis Function (RBF) kernel [31,32] to create a
Technologies 2025, 13, 17 11 of 18
continuous, smooth growth curve from the known weekly optimal weight curve (Figure
10).

Figure 10. Geese growth estimation using Gaussian Process Regression (GPR) with a Radial Basis
Function (RBF) kernel. The collaborating company provided the data (’x’), representing their expected
growth curve.

Considering the computational intensity of GPR and the sporadic nature of our data,
we opted to execute this model locally rather than in the cloud. This decision allowed
for more direct control over the computing resources and reduced dependencies on cloud
services for this specific task. Once the growth curve was estimated, it was uploaded to
an S3 bucket, making it dynamically accessible to other programs and systems within our
infrastructure. This model provided us with a growth curve and estimated the uncertainty
around these predictions, which was instrumental in setting a flexible yet precise threshold
for detecting significant weight changes. To this end, we expanded the model’s uncertainty
margin by an additional +/−10% to ensure robust detection of actual weight anomalies
due to animal interactions with the scale.
We utilized a difference sequence stored in an AWS RDS database to monitor and
respond to these anomalies. This sequence, representing changes in weight over time,
allowed us to systematically check each measurement against the threshold defined by the
GPR model’s expanded uncertainty margin. By leveraging this approach, our system could
promptly identify and address significant deviations from the expected weight trajectory,
enhancing the reliability and accuracy of our weight monitoring processes. This integration
ensured that the estimated growth curves could be easily incorporated into our broader
analytical framework, augmenting the dynamic capabilities of our system and facilitating
real-time data-driven decision-making.
Once a potential interaction was identified, the exact time of the event was used to
pinpoint and extract the corresponding video segment from the continuous recording. This
segment was then uploaded to an AWS S3 bucket designated for storing video data related
to significant events. Concurrently, the event’s details—such as the time and observed
weight difference—were recorded in an AWS RDS database, establishing a preliminary link
between the weight data and the video.
In our study, we used a detailed approach to image analysis to confirm the presence of
a goose from the collected video segments. Once we identified and cropped these images,
they were fed into a Convolutional Neural Network (CNN) for preliminary classification,
ensuring that only relevant images were processed further. This CNN was explicitly
designed to detect and confirm the presence of a goose. The robustness of this method was
enhanced by leveraging a Support Vector Regression (SVR) mode using features such as
size and shape, cited in research [33], following foundational principles [34] and subsequent
developments [35] in the late 1990s and early 2000s.
Technologies 2025, 13, 17 12 of 18

We selected 752 images paired with precise scale data to train and validate this SVR
model, employing a dynamic difference sequence method. The choice of 752 images was
based on our goal to minimize the dataset size while ensuring the model’s stability. Once
the learning and test results were sufficiently accurate, we determined that additional data
collection was unnecessary and halted the process. This method facilitated the systematic
sampling of images across various growth stages and environmental conditions, capturing
a broad spectrum of weight-influencing features. The dataset was categorized into training
(80%) and validation (20%) subsets to optimize learning and ensure the model’s reliability
on new, unseen data.
Furthermore, our preprocessing techniques enabled us to expand the selected image
set into a dataset of 1214 images, categorized as “goose” or “not goose”, with 605 images
labeled as “not goose”. This dataset was divided into training (70%), validation (20%), and
testing (10%) subsets. Each image was resized to 256 × 256 pixels to standardize inputs
and ensure uniform training conditions. We applied various data augmentation techniques
to enhance the model’s generalization capabilities, including rotation, shifting, shearing,
zooming, and flipping. Our CNN architecture featured complex convolutional layers and
max pooling, culminating in a sigmoid output layer for accurate classification.
To support these machine-learning workflows, we utilized AWS SageMaker, which
provided a robust platform for training, deploying, and monitoring our machine-learning
models. SageMaker’s integration allowed us to easily manage and version control our
machine learning models, deploying them efficiently with minimal downtime and ensuring
that each model version was adequately documented and could be rolled back if necessary.

4. Results
Our study in precision poultry farming utilized a dual-approach data collection and
processing system, focusing on the distinct contributions of edge-based and cloud-based
solutions to monitoring and analyzing geese’s growth and weight. This section details the
outcomes and efficiencies gained from each approach.

4.1. Edge-Based Results


Significant effort was invested into validating and annotating the captured images. Us-
ing the LabelMe software, instance segmentation was applied meticulously to identify and
label images where exactly one goose was visible on the scale. This method ensured that
images with partial visibility or several geese, which could distort the weight data, were
excluded from the dataset. The system was configured to filter out repetitive or unclear im-
ages using advanced motion detection and edge detection algorithms. This process helped
retain only the most transparent and relevant images for further processing. The edge detec-
tion tools were particularly useful in evaluating the quality of images, discarding any that
did not meet the strict criteria necessary for accurate weight estimation. In our edge-based
system, implementing advanced filtering mechanisms during the training data preparation
process proved essential for achieving accurate and reliable model training. Many of these
filtering techniques can be adapted and applied during real-time deployment to maintain
input quality. By incorporating these real-time filters, the system ensures that only clear,
relevant images are processed by the ML model, enhancing real-time analysis accuracy and
maintaining low-latency responses. This dual-purpose filtering application—both during
training and in real-time operation—demonstrates the importance of preprocessing for
consistent system performance. Our edge-based system can handle the inherent variability
of agricultural conditions, ensuring consistent and reliable outputs.
Technologies 2025, 13, 17 13 of 18

4.2. Cloud-Based Solution


In contrast, our cloud-based solution leveraged AWS’s robust infrastructure to stream-
line data handling and processing. As soon as log files containing scale data in grams
were downloaded, they were uploaded to a designated AWS S3 bucket. This setup was
seamlessly integrated with AWS Lambda and configured to detect and process new files as
they arrived automatically. AWS Lambda ensured that log files were handled efficiently
without manual intervention, significantly speeding up the data processing workflow.
The difference sequence method was a pivotal part of our data analysis, employed
to monitor changes in weight as recorded by the scale. This method was particularly
useful in discerning the normal weight fluctuations from those indicating an animal’s direct
interaction with the scale. Each time an animal stepped onto or off the scale, a notable
difference in weight was recorded. By comparing these differences against the adjusted
growth curve, which included an additional 10% margin to account for uncertainty, we
could effectively determine if the observed weight change was within the expected limits.
This automated and integrated approach facilitated real-time monitoring and en-
hanced the accuracy of our weight measurements. We could adjust our data by promptly
identifying instances where an animal’s interaction likely caused a recorded weight change.
This capability was crucial for maintaining high data quality and ensuring that our growth
models remained accurate and reflective of proper animal growth patterns rather than
environmental or operational factors artifacts.
These results underscored the effectiveness of combining edge and cloud-based solu-
tions to overcome the distinct challenges of precision agriculture settings. Our system’s
dynamic capability, supported by AWS’s robust cloud infrastructure and on-site edge
computing solutions, ensured comprehensive monitoring and management of agricultural
data, leading to more informed decision-making and improved operational efficiencies. In
contrast, our cloud-based solution leveraged the extensive capabilities of AWS’s robust
infrastructure to streamline and optimize data handling and processing. Central to this
approach was the automated uploading log files containing weight data in grams to a
designated AWS S3 bucket. This setup was integrated with AWS Lambda and configured
to detect and process new files as they arrived. The seamless automation of data ingestion
and initial processing significantly reduced manual intervention, enhancing the reliability
and speed of data handling. The automated nature of this system ensured a higher level of
consistency and allowed for more efficient resource allocation, ultimately facilitating more
timely insights.
A notable achievement of our cloud-based solution was the successful implementation
of the difference sequence method for practical data analysis. This approach was pivotal
in addressing challenges associated with the stability and reliability of scale readings,
particularly during power outages or interruptions that could shift the scale’s zero point,
resulting in skewed or inaccurate absolute measurements. By focusing on relative changes
rather than absolute values, the difference sequence method maintained the integrity of the
data, providing accurate measurements even when the baseline of the scale was altered.
This breakthrough significantly enhanced the robustness of the data processing pipeline,
allowing it to withstand and adapt to operational inconsistencies without compromising
data quality.
Another strength of our cloud-based solution was the capability to leverage data
involving multiple animals on the scale simultaneously. Traditionally, such data would
have been considered unreliable due to the inability to discern individual weights when
multiple animals were present. However, by analyzing the incremental weight changes
when an animal stepped on or off the scale, our method was able to extract and isolate
individual weight data from complex, multi-animal scenarios. This innovative use of data
Technologies 2025, 13, 17 14 of 18

transformation turned previously unusable datasets into valuable sources of information,


greatly expanding the range and volume of data available for analysis and training.

5. Discussion
Several practical problems occurred with the hanging bird scales that recorded in-
dividual bird weights for learning the algorithm. First, a small circular plate was fitted
to the scale, successfully used in a previous project for ducks [8]. However, in this case,
the scale was unstable due to the heavier birds and the high suspension point, causing
the animals to avoid stepping on the scale. Therefore, measurements were obtained very
rarely and only from smaller specimens. To measure more often, the weighing platform
was repositioned lower, closer to the barn floor, and the measuring area was increased, as
shown in Figure 3. The optimal height had to be identified since the birds would carry the
littering straw to the weighing plate in case of a plate that was too low hanging, causing
inaccurate measurements. Since the weighing plate’s size, material, and shape greatly
influenced the birds’ willingness to step on the scales, the accuracy of the measurement,
different materials, and shapes of weighing plates were tested. They were contaminated at
different rates, and their material and color made it easier or more challenging to detect
and accurately segment birds on the weighing pan.
One major challenge encountered in automated bird weighing systems was the accu-
mulation of feces (guano) and other debris on the weighing platform. These increased the
measured weight data and generated continuous errors that an automatic offset system
had to counter. A promising solution to this challenge involves using automatic weighing
systems such as pan scales. These scales, designed as platforms suspended low above the
litter, measure the weight of individual birds as they step onto them, significantly reducing
the need for active human labor [24].
An innovative approach to increase the frequency of weight measurements involves
placing these scales as obstacles that birds must traverse to access feeders or drinkers.
This strategy leverages the birds’ natural behavior to enhance data collection. Scales
placed within nests (e.g., at the entrance) are particularly effective for laying hens, and
similar techniques have been used in monitoring wild birds [36]. Automatic measure-
ments also mitigate stress on chickens by eliminating the need for manual handling and
human interactions [37]. The real-time accessibility of collected data is crucial for efficient
farm management, enabling farmers to promptly monitor weight increments and address
potential nutritional deficiencies [38,39].
In the context of EDGE computing-based bird weighing, DeepLabCut (DLC) was
initially considered but not used as a final solution due to difficulties in accurately de-
termining the position of body parts during annotation. Instead, the goose mask area
calculated by Mask R-CNN was chosen as the primary feature for weight estimation. Ex-
tended necks in geese posed a problem, as they covered a larger area, negatively impacting
the weight estimation algorithm. To address this, we experimented with two solutions:
first, using DLC to detect the points on the birds’ backs connected to the neck and then
cutting the mask accordingly; second, re-training Mask R-CNN with an annotated dataset
excluding the neck area. The latter approach proved more effective and provided more
accurate annotations.
Despite these advancements, measurement errors were anticipated. The weight of
the measured animals should fall within the lower and upper thresholds of the estimated
curve. Erroneous measurements were filtered out during outlier screening. A critical
component of this process was the manual review of video segments stored in the cloud.
We could accurately pair specific animals with their corresponding weight data by visually
confirming which animal caused anomalies in the difference sequence method. This
Technologies 2025, 13, 17 15 of 18

manual verification enriched our training dataset with precise animal-weight pairings and
provided multiple images from each video segment, offering varied visual data points for
each interaction.
Integrating GPR with the different sequence methods and leveraging cloud storage
and database management significantly enhanced our ability to build a comprehensive
and accurate training dataset. This dataset is essential for training sophisticated models
to predict animal weight changes, improving system accuracy, and understanding animal
behavior related to physical changes over time. Our automated pipeline, which includes
data storage in S3, processing via Lambda, and result storage in RDS, exemplifies our com-
mitment to utilizing cloud technology for efficient, scalable, and reliable data management.
This setup ensures high data integrity and accessibility, which are vital for ongoing analysis
and monitoring in our study.
In the rapidly evolving domain of precision agriculture, integrating technological
solutions for data processing and analysis is crucial. These solutions are categorized into
two distinct approaches: edge and cloud-based. Each has unique benefits and limitations
tailored to farm management.
Edge solutions process and analyze data locally on devices deployed directly in the
field, such as farms or stables. This autonomy allows for real-time analysis without reliance
on broadband wireless or wired internet connections. This is a significant benefit in remote
or rural settings where connectivity may be intermittent or unavailable. Devices in these
scenarios are subjected to more considerable wear and tear than those in more controlled
environments, leading to more frequent failures and the need for robust hardware that can
withstand harsh conditions. Despite these challenges, edge computing facilitates immediate
computational responses, which is critical in environments like agriculture, where timing
and local data processing can directly influence operational decisions.
However, resolution and computational power limitations can hinder the effectiveness
of specific advanced analytical methods. For example, in edge computing-based bird
weighing systems, the use of Deep Lab Cut (DLC) was not viable as the precise positioning
of body parts was challenging due to the small size of the animals and the resolution
constraints. Instead, the Mask R-CNN framework was adapted to exclude the neck and
head in weight estimations to avoid inaccuracies caused by the varying poses of the geese,
illustrating a tailored approach to overcome specific technological hurdles.
On the other hand, cloud-based solutions offer a centralized data processing approach,
where data from multiple edge devices are collected and analyzed using powerful cloud
computing resources. This method supports scalable and complex analytics, such as
machine learning algorithms and large-scale data integrations, which are invaluable for
predictive modeling and advanced decision-making processes. The centralized nature of
cloud computing allows for comprehensive management and more accessible updates,
making it ideal for scenarios where connectivity is reliable and data needs are extensive.

6. Future Works
In future work, we aim to extend the current system by incorporating environmental
parameters inside the barn and external meteorological stations to analyze their effects on
weight estimation, behavior, and potential connections with weight changes. Additionally,
we plan to advance and automate the creation of the learning dataset, particularly by
enhancing the difference sequence method (DSM). This includes developing a more flexible
k-DSM methodology to address cases where changes take longer than one second and
integrating animal tracking to better associate changes with individual animals. Lastly, we
aim to process the entire dataset of videos, currently spanning 2–3 TB, and make it publicly
accessible to facilitate further research and development in the field.
Technologies 2025, 13, 17 16 of 18

7. Conclusions
The growing shortage of human resources in large-scale poultry production, increas-
ingly concentrated production systems, and rising input prices are driving the need for
digital solutions in everyday practice. Although more research results have been published
in the literature in recent years, few computer vision developments have been validated
in large-scale operations that poultry farmers can use in their daily work. Reasons in-
clude properly transmitting and storing large amounts of images and video and securely
returning the information to a visualization platform that farmers can use. The depen-
dency on continuous internet connectivity is a significant limitation, especially in rural
or undeveloped regions lacking telecommunication infrastructure. For instance, in many
African countries, less than 40% of farming households have internet access, and the data
costs remain prohibitively high. This connectivity gap is not just a challenge in developing
nations; a 2023 report by Vodafone UK highlighted that 99.4% of rural constituencies in
Great Britain suffer from inadequate 5G coverage, underscoring a global issue in rural
digital connectivity.
Given these contrasting strengths and weaknesses, a hybrid approach often represents
the most viable strategy. Combining edge and cloud solutions allows for the robustness
and immediate response of edge computing while still leveraging cloud systems’ advanced
analytical capabilities and scalability. This approach supports a more dynamic adaptation
to the diverse needs of modern livestock farming. Additionally, because systems like ours
require regular calibration to ensure accurate and reliable performance, having a robust
infrastructure for training dataset creation is crucial. This ensures that models remain up to
date and capable of handling the variability inherent in livestock environments.
Expanding technologies like 5G could dramatically enhance edge and cloud comput-
ing solutions by providing faster, more reliable internet connections. However, the uneven
rollout of 5G, especially in rural areas, continues to pose challenges. Infrastructure devel-
opments are costly, and the economic return in sparsely populated agricultural regions is
often insufficient to justify the investment by telecommunication companies.
Precision livestock farming is at a transformative juncture, with technological advance-
ments offering unprecedented opportunities to enhance farm management and productivity.
The strategic integration of edge and cloud computing technologies, tailored to specific
local conditions and connectivity landscapes, will be crucial in overcoming current limita-
tions and unlocking the potential of data-driven agriculture globally. As technology and
infrastructure evolve, the agricultural sector must adapt to these changes to maximize food
production and sustainability benefits.

Author Contributions: Conceptualization, M.A., S.S. and G.T.; methodology, S.S. and G.T.; software,
G.T.; validation, S.S. and T.H.; formal analysis, G.T.; investigation, M.A., S.S. and G.T.; resources, M.A.
and S.S.; writing—original draft preparation, G.T., M.A. and S.S.; writing—review and editing, M.A.,
S.S. and T.H.; visualization, G.T.; supervision, M.A. and S.S.; project administration, G.T.; funding
acquisition, M.A. All authors have read and agreed to the published version of the manuscript.

Funding: Marta Alexy’s work was funded by Project TKP2021-NVA-29 and was implemented with
the support provided by the Ministry of Culture and Innovation of Hungary from the National
Research, Development, and Innovation Fund, and Toth Gergo’s work was carried out with the
support provided by the National Research, Development, and Innovation Fund of the Ministry of
Culture and Innovation, financed by project number 2020-1.1.2-PIACI-KFI-2021-00237. T. Haidegger is
a Consolidator Researcher supported by the Distinguished Researcher program of Óbuda University.

Institutional Review Board Statement: Ethical review and approval were not required for this
study under Hungarian regulations, as it involved non-invasive observational research using remote
cameras. The study adhered to all applicable Hungarian laws, including Act XXVIII of 1998 on the
Technologies 2025, 13, 17 17 of 18

Protection and Humane Treatment of Animals, and followed international ethical guidelines for the
ethical treatment of animals.

Informed Consent Statement: Not applicable.

Data Availability Statement: The data utilized in this study are owned by LAB-NYÚL Kft, and access
to the proprietary dataset can be requested by contacting LAB-NYÚL Kft via https://labnyul.hu,
accessed day on 14 October 2024 Access will be subject to approval and may require signing a
data-sharing agreement. In collaboration with LAB-NYÚL Kft, we are working to finalize and legally
validate a curated subset of the dataset (<50 GB) for public release. Once approved, this subset will
be made available via Zenodo under a CC BY 4.0 license to ensure proper attribution and compliance
with legal and ethical standards. In addition, we are preparing a larger dataset designed to extend
the publicly available data. This larger dataset, which will encompass several terabytes, is being
developed in collaboration with LAB-NYÚL Kft to ensure compliance with all legal and ethical
requirements. Once finalized, the dataset will be hosted on Dryad to provide robust storage and
accessibility for the research community.

Conflicts of Interest: The authors declare no conflicts of interest.

References
1. Takács, K.; Mason, A.; Cordova-Lopez, L.E.; Alexy, M.; Galambos, P.; Haidegger, T. Current Safety Legislation of Food Processing
Smart Robot Systems–The Red Meat Sector. Acta Polytech. Hung. 2022, 19, 249–267. [CrossRef]
2. Mason, A.; de Medeiros Esper, I.; Korostynska, O.; Cordova-Lopez, L.E.; Romanov, D.; Pinceková, M.; Bjørnstad, P.H.; Alvseike,
O.; Popov, A.; Smolkin, O.; et al. RoBUTCHER: A novel robotic meat factory cell platform. Int. J. Robot. Res. 2024, 43, 1711–1730.
[CrossRef]
3. Mason, A.; Haidegger, T.; Alvseike, O. Time for change: The case of robotic food processing. IEEE Robot. Autom. Mag. 2023, 30,
116–122. [CrossRef]
4. Berckmans, D. General introduction to precision livestock farming. Anim. Front. 2017, 7, 6–11. [CrossRef]
5. Norton, T.; Chen, C.; Larsen, M.L.V.; Berckmans, D. Review: Precision livestock farming: Building ‘digital representations’ to
bring the animals closer to the farmer. Animal 2019, 13, 3009–3017. [CrossRef]
6. Jaksa, L.; Azamatov, B.; Nazenova, G.; Alontseva, D.; Haidegger, T. State of the art in Medical Additive Manufacturing. Acta
Polytech. Hung. 2023, 20, 8.
7. Okinda, C.; Nyalala, I.; Korohou, T.; Wang, J.; Achieng, T.; Wamalwa, P.; Mang, T.; Shen, M. A review on computer vision systems
in the monitoring of poultry: A welfare perspective. Artif. Intell. Agric. 2020, 4, 184–208. [CrossRef]
8. Szabo, S.; Alexy, M. Practical Aspects of Weight Measurement Using Image Processing Methods in Waterfowl Production.
Agriculture 2022, 12, 1869. [CrossRef]
9. Kristensen, H.H.; Aerts, J.M.; Leroy, T.; Wathes, C.M.; Berckmans, D. We are modeling the dynamic activity of broiler chickens in
response to step-wise changes in light intensity. Appl. Anim. Behav. Sci. 2006, 101, 125–143. [CrossRef]
10. Available online: https://venturebeat.com/ai/why-do-87-of-data-science-projects-never-make-it-into-production/ (accessed
on 13 June 2024).
11. Haidegger, T.; Mai, V.; Mörch, C.M.; Boesl, D.O.; Jacobs, A.; Khamis, A.; Lach, L.; Vanderborght, B. Robotics: Enabler and inhibitor
of the sustainable development goals. Sustain. Prod. Consum. 2023, 43, 422–434. [CrossRef]
12. Bist, R.B.; Bist, K.; Poudel, S.; Subedi, D.; Yang, X.; Paneru, B.; Mani, S.; Wang, D.; Chai, L. Sustainable poultry farming practices:
A critical review of current strategies and future prospects. Poult. Sci. 2024, 104295. [CrossRef]
13. Yu, K.; Ren, J.; Zhao, Y. Principles, developments, and applications of laser-induced breakdown spectroscopy in agriculture: A
review. Artif. Intell. Agric. 2020, 4, 127–139. [CrossRef]
14. Cheng, H.-D.; Jiang, X.H.; Sun, Y.; Wang, J. Color image segmentation: Advances and prospects. Pattern Recognit. 2001, 34,
2259–2281. [CrossRef]
15. Zhuang, X.; Bi, M.; Guo, J.; Wu, S.; Zhang, T. Development of an early warning algorithm to detect sick broilers. Comput. Electron.
Agric. 2018, 144, 102–113. [CrossRef]
16. Mollah, M.B.R.; Hasan, M.A.; Salam, M.A.; Ali, M.A. Digital image analysis to estimate the live weight of broiler. Comput. Electron.
Agric. 2010, 72, 48–52. [CrossRef]
17. Amraei, S.; Mehdizadeh, S.A.; Näas, I.A. Development of a transfer function for weight prediction of live broiler chicken using
machine vision. Eng. Agrícola 2018, 38, 776–782. [CrossRef]
18. Amraei, S.; Mehdizadeh, S.A.; Sallary, S. Application of computer vision and support vector regression for weight prediction of
live broiler chicken. Eng. Agric. Environ. Food 2017, 10, 266–271. [CrossRef]
Technologies 2025, 13, 17 18 of 18

19. Amraei, S.; Mehdizadeh, S.A.; Salari, S. Broiler weight estimation based on machine vision and artificial neural network. Br. Poult.
Sci. 2017, 58, 200–205. [CrossRef] [PubMed]
20. Du, C.-J.; Sun, D.-W. Estimating the surface area and volume of ellipsoidal ham using computer vision. J. Food Eng. 2006, 73,
260–268. [CrossRef]
21. Berckmans, D. Precision livestock farming technologies for welfare management in intensive livestock systems. Rev. Sci. Tech. De
L’office Int. Des Epizoot. 2014, 33, 189–196. [CrossRef] [PubMed]
22. Okinda, C.; Sun, Y.; Nyalala, I.; Korohou, T.; Opiyo, S.; Wang, J.; Shen, M. Egg volume estimation based on image processing and
computer vision. J. Food Eng. 2020, 283, 110041. [CrossRef]
23. Wang, L.; Sun, C.; Li, W.; Ji, Z.; Zhang, X.; Wang, Y.; Lei, P.; Yang, X. Establishment of broiler quality estimation model based on
depth image and BP neural network. Trans. Chin. Soc. Agric. Eng. 2017, 33, 199–205.
24. Chedad, A.; Vranken, E.; Aerts, J.-M.; Berckmans, D. Behaviour of Chickens Towards Automatic Weighing Systems. IFAC Proc.
Vol. 2000, 33, 207–212. [CrossRef]
25. Russell, B.C.; Torralba, A.; Murphy, K.P.; Freeman, W.T. LabelMe: A Database and Web-Based Tool for Image Annotation. Int. J.
Comput. Vis. 2007, 77, 157–173. [CrossRef]
26. Available online: https://aws.amazon.com/s3/ (accessed on 13 November 2024).
27. Available online: https://aws.amazon.com/rds/ (accessed on 13 November 2024).
28. Available online: https://aws.amazon.com/lambda/ (accessed on 13 November 2024).
29. Available online: https://aws.amazon.com/sagemaker/ (accessed on 13 November 2024).
30. Available online: https://www.docker.com/ (accessed on 13 June 2024).
31. Rasmussen, C.E.; Nickisch, H. Gaussian processes for machine learning (GPML) toolbox. J. Mach. Learn. Res. 2010, 11, 3011–3015.
32. Buhmann, M.D. Radial basis functions. Acta Numer. 2000, 9, 1–38. [CrossRef]
33. Mortensen, A.K.; Lisouski, P.; Ahrendt, P. Weight prediction of broiler chickens using 3D computer vision. Comput. Electron. Agric.
2016, 123, 319–326. [CrossRef]
34. Cortes, C.; Vapnik, V. Support-vector network. Mach. Learn. 1995, 20, 273–297. [CrossRef]
35. Vapnik, V. The Nature of Statistical Learning Theory; Springer: Berlin/Heidelberg, Germany, 1995.
36. Larios, D.F.; Rodríguez, C.; Barbancho, J.; Baena, M.; Leal, M.Á.; Marín, J.; León, C.; Bustamante, J. An Automatic Weighting
System for Wild Animals Based in an Artificial Neural Network: How to Weigh Wild Animals without Causing Stress. Sensors
2013, 13, 2862–2883. [CrossRef]
37. Wang, K.; Pan, J.; Rao, X.; Yang, Y.; Wang, F.; Zheng, R.; Ying, Y. An Image-Assisted Rod-Platform Weighing System for Weight
Information Sampling of Broilers. Trans. ASABE 2018, 61, 631–640. [CrossRef]
38. Lee, C.C.; Adom, A.H.; Markom, M.A.; Tan, E.S.M.M. Automated Chicken Weighing System Using Wireless Sensor Network for
Poultry Farmers. IOP Conf. Ser. Mater. Sci. Eng. 2019, 557, 012017. [CrossRef]
39. Lacy, M.P. Broiler Management. In Commercial Chicken Meat and Egg Production; Springer Science + Business Media: New York,
NY, USA, 2002; pp. 829–868.

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual
author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to
people or property resulting from any ideas, methods, instructions or products referred to in the content.

You might also like