Documente Academic
Documente Profesional
Documente Cultură
by
Marimar L. Auditor
Chaos Jeremy C. Pichay
Rinna Andrea B. Roxas
Don Albert U. Tejada
cycle. Furthermore, existing electronic methods in this nature proves to be expensive for pig
owners to own and maintain.
Digital image processing proves to be the avenue for answers to the problems of different
industries nowadays. Its applications, particularly color comparison and pattern recognition, are
highly used in matters regarding effective monitoring and surveillance. Characteristics of a
certain image such as hue, saturation, intensity, and resolution are taken into consideration in
contrast to a number of reference images. It will then be synthesized further to have its aspects
noted and compared for similarities and differences. Certain inferences can be singled out into
suggested truths regarding the made observations.
It is undeniable that uncertainty in sows fertility cycle presents heavy revenue losses as
well as waste in productivity and time. The margin for error found in mere physical observation
and the luxurious price of ultrasound equipment do not help in maximizing the return profit of
the pig business. In hope of finding a viable alternative for these methods, this paper supports the
use of a pictorial scan of a sows vulva to determine its fertile period through digital image
processing. Since a pig in fertile state shows a noticeable swelling accompanied with redness of
her vulva, its comparison to the wide selection of vulvas will help in determining its progress
into estrus state. The implementation of this project also eliminates the use of expensive medical
tests.
The intention of this research is to create a vulva analyzer using image comparing system
capable of identifying the key differences in vulva swell of fertile and infertile pigs. More
specifically, this research aims to: (1) design a vulva analyzer which is capable of capturing and
processing vulva swell and redness parameters based on an image database (2) perform
calibrations to the implemented algorithms (3) identify what the monitored vulva swell and
redness suggests after being processed by the system.
This study would be significant for individuals who are new in the pig industry. Using
image processing, they can accurately assess and determine pigs fertility without involving
extensive and expensive examinations. Also, this would help in the elimination of other expenses
such as frequent consultation with experts and veterinarians.
The proposed project relies greatly on the physical observations depicted in the pictorial
scan that may be subjected to some irregularities such as illness-induced swelling and mild
discoloration. These will prevent an entirely accurate reading that cascades into an erroneous
output. Also, this device does not cater to pigs that do not exhibit vulva swell and redness prior to
estrus. These are often referred to as Silent Heaters. Furthermore, the image database will only
include vulva images of swine. This suggests that the project does not extend to other gestating
farm animals as well as any other breed of swine except for Large White pigs.
Chapter II
REVIEW OF RELATED LITERATURE
This chapter deals with the review and analysis that are pertinent to the study. Related
literatures are given below, that will give a broader knowledge and more background about
determining the fertility state of swine through digital image processing.
Large White
Large Whites are the particular breed of swine commonly found in Philippine farms.
These pigs are usually described with rather quaint bearing, erect ears, somewhat concave facial
structures, pinkish white complexion, long deep sides, and large physical statures. From the
breeds first introduction into the industry, it is prized mainly on its capability to produce bacon.
Estrous Cycle
An estrous cycle is the reproductive cycle that usually manifests in female mammals for a
certain period of time. With regards to swine, it occurs within a span of averages 21 days but can
also range from 17 to 25 days. The first day of standing heat records the females initial
receptiveness to the male and its tendency to remain steady when mounted. This stage of estrus is
referred to as day 0. The cycles progression of two or three days indicates that the female is
sexually receptive [2].
The management and understanding of the reproductive cycle in swine is vital since
estrus is often referred to starting point of herd generation. Behavioral estrus lasts 2-3 days, and
ovulation occurs near the end of behavioral estrus. The knowledge on the occurrence of estrus
and its detection further extends to the decision of inseminating the prospectively fertile female
pig 12-26 hours after initial signs of standing heat. This is for the purpose of depositing hog
sperm cells before ovulation that ensures a high rate of conception and low repeat breeders [3].
Vulva
In swine breeding, one of the most closely observed parts of swine are their vulva prior to
the start of the estrous cycle. The vulva is the external portion of the reproductive tract. It often
becomes red from its normal pinkish white color and noticeably swollen at the onset of standing
heat. This swelling is usually more pronounced in gilts than in sows [4]. A gilt is a female swine
not having farrowed yet. On the other hand, a sow has farrowed off-springs and consequently
experienced estrus for a number of times already. With this comparison, the repetition of giving
birth is determined to be reducing the swelling of the vulva.
filtered using a Sobel kernel horizontally and vertically to get the corresponding derivatives.
After deriving the gradient magnitude and direction, removing unwanted pixels that stray from
the needed edge from the images full scan. This is achieved when every pixel is checked if it
resides as a local maximum in its surroundings in the gradients direction. Once the image is
checked if it is a local maximum or not, the output will then reveal a binary image with thin
edges. To further tune out the unneeded edges, the minVal and maxVal threshold values are
established. This convention identifies those above the maxVal point to be retained while those
below the minVal are discarded. However, if the said pixels were connected to a true edge, then
they are also considered a part of the edges.
FM Transformation
The Fourier-Mellin (FM) transformation is an image registration technique which allows
translation, rotation, and scaling of coordinate values of an image for a more precise image
matching. It considers an input of image outline from the output of a Canny Edge detector, using
the concept of overlapping images and similarity ratio.
MatLab
MatLab is the high-level language and interactive environment used by millions of
engineers and scientists worldwide. It lets you explore and visualize ideas and collaborate across
disciplines including signal and image processing, communications, control systems, and
computational finance.
With that being said, MatLab will be incorporated with the raspberry pi, to process the
snapped image from the device.
Chapter 3
METHODOLOGY
Canny Edge
Image of Vulva
Detector
PROCESS
Image Retrieval
Via USB cable
Fourier Mellin
Transformation
Recursive Algorithm
Image Comparison
OUTPUT
Fertility State of Gilts
Laptop Screen (GUI)
Fig 3.1 Conceptual Diagram
Figure 3.1 shows the conceptual diagram of the system. It is composed of three major
blocks which are the input block, the process block and the output block. The description of each
blocks are as follows:
1. INPUT
1.1 Image Acquisition
Through the use of a smartphone camera, the front view image of a vulva sample
will be taken. Four image processing techniques will be applied in order to determine the
fertility state of gilts.
1.2. Image Retrieval
After the image has been acquired through the use of a smartphone camera, the
researchers will now proceed on retrieving the image from the phones memory by
connecting it to the laptop with use of a USB cable.
2. PROCESS
2.1 Image Processing
Once the Graphical User Interface run, the image that will be stored from the
smartphone will be processed for image processing.
2.1.1 Canny Edge Detection
This algorithm will focus on removing the part of the picture that is
unnecessary and will highlight part of the image where the program will focus.
The raw picture will undergo noise reduction using a 5x5 Gaussian filter and will
then be subjected to finding its intensity gradient. Edge gradient and direction for
each pixel will be computed using the following equations [7]:
Edge Gradient(G)= G2x +G2y
Angle ()=tan 1
Gy
Gx
( )
(1)
(2)
Where Gx is the first derivative in the horizontal direction and Gy is the first
derivative in the vertical direction which would detect the edges in a blurred
image.
Since gradient direction is perpendicular to edges, it is approximated to
one of the four angles corresponding to vertical, horizontal, and two diagonal
directions. Then, every pixel is checked if it is found as a local maximum in its
region, as shown in the image below:
Fig. 3.2 is used as a basis if points are found in the local maximum.
Because the edge is normal to the gradient direction, point A is examined with
regards to points B and C. If it forms a local maximum, it goes through the next
stage. Otherwise, it will be suppressed and be held at zero. The image will then be
subjected to hysteresis thresholding.
Hysteresis thresholding determines the true edge and the fake edge. In
order to do this, a minimum and a maximum threshold value are established.
Edges lying above the maximum threshold value will already be classified as
true edges while those falling below the minimum threshold value are nonedges. However, pixels that are found between the threshold values and also
connected to true edges are considered true as well. Otherwise, they are
discarded.
2.1.2 FM Transformation
The outlines of the input vulvar image and the first reference image are
both extracted using the canny edge detection process. The first reference image is
obtained from the systems database. The two outlines are then subjected to FM
transformation technique [8]. This method plots both outlines onto a uniform
coordinate space. It also includes the use of Discrete Fourier transformation
(DFT), log-polar transformation (LPT), and phase correlation methods.
DFT is applied to both outlines. The resulting values will undergo logpolar transformation. An arbitrary point (x,y) will have a corresponding LPT (r,)
representation solved using:
( xx ) +( y y )
2
r =log 10
(3)
=tan
y y c
xx c
(4)
Where xc and yc are the centers respective abscissa and ordinate, r is the
radial distance from the center, and is the rotational angle.
After getting the LPT representation, the phase-correlation method is used
to estimate the relative translation between the images through the use of the Fast
Fourier Domain approach. Because of the different vulva sizes in the database,
proper scaling and rotation must be applied. These parameters are derived in
solving cross-power spectrum. It is defined by:
F F1
F F1
R=F
(5)
( x , y )=argmax (x , y) {R }
Where
y
F1
is a complex conjugate of
(6)
F , x
is the scale.
In order to compensate for the differences of the captured image to
relatively bigger and smaller vulvar picture, a specific similarity range is defined.
This is to identify the closest basis for the swelling of the vulva.
Now, the difference between the two outlines will be determined using the
overlapping similarity ratio given by the equation:
similarity ( A , B )=
T ( A B)
x 100
T ( A B)
(7)
(8)
I iR, jI Bi , j > RB
(9)
are red, green and blue components of i-th, i,j j-th pixel of image I and
and are predefined coefficients. Eq. (8) set up limitations for the minimal values of
pixel components. Eq. (9) formalizes dependences between pixel components for pigs
vulva. Generally, a color recognition is based on two types of restrictions:
First restriction is based on (8) and (9). These equations provides good results in
good lighting conditions, however it is not good in low-contrast images. To solve this
problem, sufficient lighting will be implemented when taking the pictures.
R
{1,(I Gi , j 0.85 I Ri , j)&0,otherwise
, j 0.9 I i , j ), if ( I i , j > I i , j > I i , j )
Ci , j
( I i (eqn.
The second restriction is the threshold value
10) which is defined by the user.
(10)
RGB model is represented by a 3-dimensional cube with red, green and blue at
the corners on each axis and HSI color space, hue, saturation and intensity are three
properties used to describe color. The hue (IH) is represented as angle 0, varying from 0
to 360. Saturation (IS) corresponds to the radius, varying from 0 to 1. Intensities (II)
vary along Z axis. The transform from (R, G, B) to (H, S, I) [5] is
(11)
Where
R
i, j
I iH, j
I
I iH, j ( HR HR)
&
0.7) &
I
H
HR
HR
(12)
(
)
I
I
i, j
( i , j 0.95 )
I iI, j 0.05
1,
if
I iS, j and I iI, j are hue, saturation and intensity components of
HR
HR
and
CiR, j
HR
HR
image C.
Color segmentation parameters were made sensitive in order to detect as much
candidate regions as possible. All false candidates will be filtered out on the next stages.
Region of interest must be in ellipse shape.
Figure 3.2 was provided to serve as a substitute to show what will happen to the
vulvar image after color segmentation
Four-neighborhood checks the four pixels that surround the pixel of the region of
interest namely the upper, lower, left and right pixels that are adjacent to it. On the other
hand, Eight-neighborhood checks the eight pixels that surround the pixel of the region of
interest namely the upper, lower, left and right and left and right diagonal pixels that are
adjacent to it.
Once the candidate regions are determined, the area of the region of interest will
be computed and formalized by this formula:
n
B[i , j]
i=1 j=1
m=number of columns
B[i,j] = coordinate of the pixel of candidate region
The computation of the area of the candidate regions will help in the elimination
of undesired images.
3. OUTPUT
After executing the processing of the inputs, the system will output the fertility state of
the gilt. If the intensity of the filtered region is less than the range of intensities from the database
but not equal to 0, a statement NOT FERTILE will be projected onto the Graphical User
Interface as a form of output. Otherwise, FERTILE
consisting
edge
has
intensity
gradients
values. This
discarded in
FM
Transformation
The FM transformation is expected to compare the outlines of an input vulvar
image and a vulvar image from the system database. It is expected that the similarity
values to be determined should be between 0% and 100%. The values are recorded in the
table below:
Similarity Value
( 0 S 100 )
Projected Output
(Fertile or Not Fertile)
1
2
3
4
5
6
7
8
9
10
Since a pigs vulva can swell three to four times its normal size when fertile, the
likelihood of fertility based on the captured image depends greatly on the solved
similarity value S. It is suggested that once similarity is within the range between 0% and
33.33%, the image is that of a fertile pigs vulva. Otherwise, the image will be that of a
non-fertile pigs vulva. The result will then be compared to the HSI-derived values.
Canny Edge
Detection
FM Transformation
Not Fertile
YES
Color
Segmentation
Recursive
Algorithm
NO
Not Fertile
YES
Fertile
TESTING
Accuracy of the system is verified through successful insemination resulting to swine
pregnancy. Based on the combinations of the possible outputs and their authenticity, two cases
can be derived, namely: 1.) pigs determined fertile and became pregnant; and 2.) pigs determined
fertile but did not become pregnant. Two fertility cycles will be observed for testing the systems
reliability. The findings are recorded in the table below:
Determined Fertility
(Fertile or Not Fertile)
Pregnancy Result
(Pregnant or Not Pregnant)
1
2
3
4
5
6
7
8
9
10
Determined Fertility
(Fertile or Not Fertile)
1
2
3
4
5
6
7
8
9
10
BIBLIOGRAPHY
Pregnancy Result
(Pregnant or Not Pregnant)
[1] Briggs, Hilton M. 1983. International Pig Breed Encyclopedia. Elanco Animal Health
[2] Almond, Glen. The Swine Ai Book : A Field and Laboratory Technicians' Guide to Artificial
Insemination in Swine. Mini Tube of America, Inc. 1994
[3]Pitcher,
P.
(1997).
Estrus
in
Swine.
http://cal.vet.upenn.edu/projects/swine/bio/fem/estr/hm.html
Retrieved
from
[4] Diekman, M. & Singleton, W. Reproductive Physiology and Anatomy of the Sow. Retrieved
from http://www.ansc.purdue.edu/swine/porkpage/repro/physiol/reppaper.htm
[5] S. E. Umbaugh, Computer Imaging: Digital Image Analysis and processing, CRC Press,
76-78. 2001
[7]Green,
Bill
(2002).
Canny
Edge
Detection
Tutorial,
Retrieved
http://dasl.mem.drexel.edu/alumni/bGreen/www.pages.drexel.edu/_weg22/can_tut.html
from