You are on page 1of 26

Chapter 4

RESULTS AND DISCUSSIONS

In this chapter, the researchers present the study's analysis and findings.

To support the study's specific questions, data were gathered, collected, and

tabulated. It includes tables that show the findings of the study on the Pig Skin

Diseases Recognition System Using Machine Learning with Thermal Sensor.

The researchers conducted a total of ten trials in order to obtain the most

reliable data. Skin lesion, swine pox, and normal skin images were tested and their

data was tailed using system software. Due to a lack of subjects, we also tested

temperature readings for normal skin images, excluding skin lesions and swine

pox. The necessary tools and equipment were placed in a pig pen during the

examination in Poblacion, Dauis, Bohol, Philippines.

The description of the Pig Skin Diseases Recognition System Using

Machine Learning with Thermal Sensor in terms of preparation, design, procedure

and parts and functions are as follows:

4.1 Software Description

Pig Skin Diseases Recognition System Using Machine Learning with

Thermal Sensor is designed to assist swine farmers by reducing the spread of

livestock-related diseases through early detection of the presence of skin

diseases.
40

4.1.1 Preparation

After approval, the researchers approached the thesis adviser to plan the

project's design, including the entire technical plan. The proposal's success

resulted in the proper preparation of materials required to design the project.

The researchers listed all of the devices and applications required to

complete the project. An organized procedure for selecting suitable sources was

used to avoid unwanted results or malfunction.

4.1.2 Design

The design and application of the Pig Skin Diseases Recognition System

Using Machine Learning with Thermal Sensor was based on the recommendation

and development of a related study called a Method of Skin Disease Detection

Using Image Processing and Machine Learning in Human Skin. The researchers

produced a flow chart and block diagram.

4.1.3 System Rules

Pig Skin Diseases Recognition System Using Machine Learning with

Thermal Sensor is a software application and it is written in Matlab Code. Its

present form is approximately 500 lines of code including the comments.


41

4.1.4 Flowchart Diagram

Figure 2. Flowchart of the Pig Skin Diseases Recognition System


Using Machine Learning with Thermal Sensor
42

A flowchart diagram of the Pig Skin Diseases Recognition System Using

Machine Learning with Thermal Sensor is shown in figure 2, which depicts a

process, system, or computer algorithm. They are used to plan and improve

complex processes in clear, understandable diagrams. The Pig Skin Diseases

Recognition System Using Machine Learning with Thermal Sensor employs

rectangles, ovals, diamonds, and potentially other shapes, as well as connecting

arrows to define flow and sequence. They can range from simple hand-drawn

charts to detailed computer-drawn diagrams of multiple steps and routes. This

flowchart utilized by the researchers for each technical and non-technical

components of the system.


43

4.1.5 Block Diagram

Figure 3. Block Diagram

Figure 3 depicts the block diagram of the Pig Skin Diseases Recognition

System Using Machine Learning with Thermal Sensor. Blocks with lines illustrating
44

their relationships between one another represent the main components or

functions. Block Diagrams use rectangles to represent individual operations.

Straight lines that represent the streams of the process flow connect the blocks.

As a result, it demonstrates a more comprehensive flow of the software application.

4.1.6 Circuit Diagram for Arduino

Figure 4. Humidity and Temperature Sensor Wiring


Diagram

Figure 4 depicts a wiring diagram created with Fritzing to design a humidity and

temperature sensor comprised of DHT11, resistors, an LCD, jumper wires, and an

Arduino Uno. Using the components and wiring connections described above, the

researchers were able to create the Humidity and Temperature Sensor.


45

4.1.7 Procedure

Pig Skin Diseases Recognition System Using Machine Learning with

Thermal Sensor considered a well-developed plan to ensure the system's

performance and functionality. The waterfall with feedback model was used to

advance the software application.

Figure 5 depicts each stage of the waterfall process model as well as the

associated activities conducted. The waterfall model is a traditional model used in

the system development life cycle to create a system in a linear and sequential

manner. The model is called a waterfall because it progresses systematically from

one phase to the next in a downward fashion. This model is divided into phases,

and the output of one phase is used as the input of the next phase. Every phase

must be completed before moving on to the next, and no phases can overlap.

The researchers chose this method because it is simple and

straightforward. It also emphasizes the logical progression of the steps taken

throughout the firmware development cycle.


46

Event Activities

System Requirements • Understanding what needs to be designed and its


purpose, function, and other details is the first step. The
input, output, or final product specifications are
examined and noted in this situation.

System Design • This phase studies the requirement specifications from


the first phase and prepares the system design. System
design aids in defining the overall system architecture
as well as the hardware and system requirements. The
creation of the software code for the upcoming stage
has already begun.

Implementation • The system is initially developed in small programs


known as units with input from the system design, which
are then integrated into the following phase. Unit testing
is the process of creating each unit and evaluating it for
functionality.

Integration and Testing • Following the testing of each unit created during the
implementation phase, the entire system is integrated.
Constant software testing is required to check for bugs
and errors in the designed software. Testing is carried
out to ensure that the client has no issues installing the
software.
47

Deployment of System • Once the product has undergone functional and non-
functional testing, it is either released or deployed in the
customer environment.

Maintenance • This step entails modifying the system or a specific


component to change characteristics or boost
performance. These changes result from either
customer-initiated change requests or flaws found while
the system is being used in real life. The developed
software is regularly maintained and supported for the
client.

Table 4. Software Development Model (Waterfall with Feedback)

The software development model is shown in Table 4. The Software

Development Life Cycle is the process of producing software applications using

standard business procedures. It is usually separated into six to eight steps:

system requirements, system design, implementation, integration and testing, the

deployment of system and lastly the maintenance. In addition, the waterfall method

is shown. The waterfall methodology is a software development life cycle that

places an emphasis on logical step development. Distinct endpoints or goals are

established at each stage of development and cannot be changed after

completion, much like the direction water runs over the brink of a cliff.
48

4.1.8 Operation

Parts of the Graphical Interface

Figure 5. Parts of the Main Graphical Interface

Figure 5 depicts the main graphical user interface (GUI). It has five different

system components. Label 1 contains the heading and the title of the research

project. Label 2 allows to read an image into the workspace, using

the imread command. Images of various pig skin diseases are saved in a file and

stored in an array named. The file imread infers that the graphics file format is

saved. Label 3 allows you to clear the currently loaded image and load another

image. Label 4 displays image data by using the imshow function. Label 5 shows

the output or result of the system's testing of the skin types displayed in label 4.
49

Image Processing (System Output View)

Figure 6. Normal Skin Detected

The graphical user interface for the image being uploaded to the system is

shown in Figure 6. The system dispays that it detects normal pig skin condition. A

series of trials conducted by the researcher during system testing. The system's

output for Normal Skin condition ranges between 60% and 74% accuracy in

determining the type of skin disease. This indicates that if the observed output falls

within the range, the skin condition is considered to be normal.


50

Figure 7. Skin Lesion Detected

Figure 7 displays the results of the system for the pig skin ailment Skin Lesion.

To establish a standard range where the system shows the output for skin lesion

state, the researchers conducted a number of tests. The outcome indicates that

this particular skin problem falls between 74% and 80%. According to this, a skin

lesion is present if the observed output falls within the range.


51

Figure 8. Swine Pox Detected

The graphical user interface for the swine pox disease detection is

displayed in Figure 8. The researchers completed a number of studies and

experiments to determine a typical range where the system displays the output for

swine pox status. The results show that between 80% and 90% of pig skin have

this particular skin issue. This states that if the observed output is within the range,

swine pox is present.


52

Arduino for Thermal Sensing

Figure 9. Temperature and Humidity


53

The application of coding with an Arduino for heat sensing is shown in

Figure 9. The sensor is a DHT11, and the LCD, connecting wires, and breadboard

are also used.

4.1.9 Programming

A programmer's source code is a collection of instructions and statements

written in a computer programming language. A program's source code is

specifically designed to aid the work of computer programmers, who write source

code to specify the actions to be performed by a computer. A compiler then

converts this code into machine language that a computer can understand and

execute. Object code refers to the translated code.

Source Code for Pig Skin Diseases Recognition System Using Machine

Learning with Thermal Sensor

Code Snippets

Figure 10. Download Image Data


54

Figure 10 shows the code snippet for downloading compressed image

dataset to the temporary local folder filename.

Figure 11. Load Pretrained Network

Figure 11 shows the code snippet for loading pretrained network. The

classification accuracy on the ImageNet validation set is the most commonly used

metric for assessing the accuracy of ImageNet-trained networks. ResNet-50 is a

50-layer deep convolutional neural network. A pretrained version of the network


55

trained on over a million images from the ImageNet database can be loaded. The

pretrained network can classify images into 1000 different object categories,

including keyboards, mice, pencils, and various animals. As a result, the network

has learned detailed feature representations for a diverse set of images. The

network accepts 224-by-224 image input.

Figure 12. Prepare Training and Test Sets

Figure 12 depicts code snippets for dividing the datasets into two parts, first

the training set and then the test set.

Figure 13. Extract Training Features Using CNN

Figure 13 shows how to perform a forward pass on each image to extract

features at a specific network layer. This creates an invisible grid overlay on each

image, with the number of cells equal to the extracted features' dimension.
56

Figure 14. Evaluate Classifier

Figure 14 illustrates how the program code executes by first utilizing CNN

to extract test features. After that, the trained classifier will get the CNN image

features, and the results will then be tabulated using a confusion matrix. With the

help of confusion matrix classification accuracy can be computed.


57

Figure 15. Extract Image Features using CNN

Figure 15 shows how the program execute by the help of CNN in extracting

image. The output is now comparing the trained classifier and displays the

predicted label either Normal Skin, Skin Lesion or Swine Pox.

4.1.10 System Features

The primary goal of the Pig Skin Diseases Recognition System Using

Machine Learning with Thermal Sensor is to aid in the late detection of diseases

among pig skin diseases. The researchers developed these key features by

utilizing MATLAB as a programming platform, convolutional neural network (CNN)

as an algorithm to classify skin types, and Arduino uno to test humidity and

temperature using DHT11 sensor.

MATLAB (matrix laboratory) is a platform for solving mathematical and

scientific problems. It is a MathWorks proprietary programming language that


58

allows matrix manipulations +9, functions and data plotting, algorithm

implementation, user interface creation, and interfacing with programs written in

programming languages such as C, C++, Java, and others. The IPT in MATLAB is

a collection of functions that extends the capability of the MATLAB numeric

computing environment. It includes a comprehensive set of reference-standard

algorithms and workflow applications for image processing, analysis, visualization,

and algorithm development.

We have described and applied a general CNN architecture to our system.

A Convolutional Neural Network (CNN) is a powerful deep learning machine

learning technique. CNNs are trained on large datasets of diverse images. CNNs

can learn rich feature representations for a wide range of images from these large

collections. The researchers trained 3 types of datasets: normal skin images, skin

lesion images and swine pox skin images.

Source: https://towardsdatascience.com/a-comprehensive-guide-to-convolutional-neural-
networks-the-eli5-way-3bd2b1164a53

Figure 16. Convolutional Neural Network


59

Figure 16 shows how a convolutional Neural Network CNN works by taking

an image, assigning it some weightage based on the various objects in the image,

and then distinguishing them from one another. This contains a variety of colors

based on the three-color plane of Red, Green, and Blue, also known as RGB. The

various color spaces in which images are found are then identified, such as RGB,

CMYK, Grayscale, and many more. It can be time-consuming to measure the

image dimensions, for example, if the image is parse 8k (*7680x4320*). One of

CNN's useful features is that it reduces the image's dimension to make it easier to

process while still retaining all of its features in one piece. This is done to obtain a

more accurate prediction.


60

Table 5

The Performance Level of Pig Skin Diseases Recognition System through


Machine Learning with Thermal Sensor in Terms of Recognizing Normal Skin

Did the system recognize the normal pig skin condition?


Temperature
(Normal Temperature = 380C – 400C)
Humidity
(RH≤ 80%)
Test No. Expected Output Observed Accuracy
Range (%) Output (%)
1 60 - 74 63.41 Accurate
2 60 - 74 68.29 Accurate
3 60 - 74 69.10 Accurate
4 60 - 74 73.10 Accurate
5 60 - 74 63.40 Accurate
6 60 - 74 74 Accurate
7 60 - 74 73.98 Accurate
8 60 - 74 68.29 Accurate
9 60 - 74 78 Accurate
10 60 - 74 69 Accurate
Overall Accuracy 100%

As for image processing, Table 5 demonstrates that the tool is 100%

accurate and effective in identifying pigs' natural skin. Given that the system can

identify healthy pig skin, which typically has a temperature between 38°C and 40°C

and a humidity level of less than or equal to 80%. Using the confusion matrix

formula, the test reveals that the percentage of pigs with good skin falls between

60 and 74 percent.

Statistical Treatment:

Solving first the total observed output from the table above:

Total observed output = 63.41+68.29+69.10+73.10+63.40+74+73.98 +68.29+78 +69


61

Total observed output = 700.57

Next, calculate the mean by dividing the total observed output by 10:

Mean observed output = 700.57 / 10

Mean observed output = 70.05

Finally, solving the relative error using the formula:


𝑂−𝐸
RE = abs | | x 100%
𝐸

70.05 − 74
RE =| |x 100%
74

RE = 0.05%

With a relative error of 0.05%, the method is hence reliable and accurate

for detecting pig skin disease.

Table 6

The Performance Level of Pig Skin Diseases Recognition System through


Machine Learning with Thermal Sensor in Terms of Recognizing Skin Lesion

Did the system recognize the skin lesion pig skin condition?

Test No. Expected Output Observed Accuracy


Range (%) Output (%)
1 74 - 80 76.42 Accurate
2 74 - 80 75.6 Accurate
3 74 - 80 79.8 Accurate
4 74 - 80 76.1 Accurate
5 74 - 80 77.24 Accurate
6 74 - 80 78.17 Accurate
7 74 - 80 74.8 Accurate
62

8 74 - 80 80 Accurate
9 74 - 80 75.9 Accurate
10 74 - 80 74.8 Accurate
Overall Accuracy 100%

Table 6 demonstrates that the system is 100 percent accurate and useful in

differentiating the skin lesion disease of pigs. According to the system, 74–80% of

skin lesions are present. Since we lacked a test subject, we were unable to

determine and test the temperature or humidity.

Statistical Treatment:

First, solve the total observed output from the table above:

Total observed output = 76.42+75.6 +79.8+76.1+77.24+78.17+74.8+80+75.9+74.8

Total observed output = 768.83

The mean is then calculated by dividing the total observed output by 10:

Mean observed output = 768.83 / 10

Mean observed output = 76.883

Finally, use the formula to solve the relative error:


𝑂−𝐸
RE = abs | | x 100%
𝐸

76.883 − 80
RE = abs | | x 100%
80

RE = 0.03%

The approach is hence accurate for detecting pig skin disease, with a

relative error of 0.03%.


63

Table 7

The Performance Level of Pig Skin Diseases Recognition System through


Machine Learning with Thermal Sensor in Terms of Recognizing Swine Pox

Did the system recognize the swine pox pig skin condition?

Test No. Expected Output Observed Accuracy


Range (%) Output (%)
1 80 - 90 88.54 Accurate
2 80 - 90 89.92 Accurate
3 80 - 90 90 Accurate
4 80 - 90 88.9 Accurate
5 80 - 90 89.29 Accurate
6 80 - 90 89.73 Accurate
7 80 - 90 89.4 Accurate
8 80 - 90 88.73 Accurate
9 80 - 90 88.9 Accurate
10 80 - 90 90 Accurate
Overall Accuracy 100%

According to Table 7, the device is 100 percent accurate and useful in

distinguishing pig swine pox disease. The temperature and humidity are not tested

because a pig with swine pox skin condition is not available. According to the

system, the prevalence of swine pox skin disease is between 80 and 90 percent.

Statistical Treatment:

To begin, solve the total observed output from the previous table:

Total observed output = 88.54+89.92+90+88.9+89.29+89.73+89.4+88.73+88.9

Total observed output = 893.41


64

The mean is then calculated by dividing the total observed output by 10:

Mean observed output = 893.41 /10

Mean observed output = 89.341

Finally, use the formula to solve the relative error:


𝑂−𝐸
RE = abs | | x 100%
𝐸

89.341 − 90
RE =| |x 100%
90

RE = 0.73%

The approach is therefore accurate for detecting pig skin disease, with a

relative error of 0.73%.

As a result, the data calculated in the observation guide yields an accurate

result in diagnosing and identifying various pig skin disorders. As a result, the table

demonstrated that the system can recognize and detect healthy pig skin state. The

relative error is less than 1%. In many cases, this is considered a good

approximation.

You might also like