Читать книгу Machine Learning Algorithms and Applications - Группа авторов - Страница 35

2.3.4 Predicting Egg Class

Оглавление

The sliding window method is used to generate input images, and a single egg may be represented by many image windows each of size 32 × 32. Euclidean distance equation, , was used to select the egg center by combining all the egg location predictions that fall within a certain user-defined distance limit. (x1, y1) and (x2, y2) are the reference pixel and pixel under consideration. Since the egg diameter is well within the range of 28 to 32 pixels, a distance limit is set that is equal to the radius of the egg, i.e., 16 pixels. Any center locations that fall within this limit are considered to be representing same egg and hence combined to generate single egg location that can be then cropped by using Equations (2.4) to (2.7), where (xa, ya) are the resulting egg location after averaging all predicted egg locations that fall within distance limits. (x, y) pixel is the original location while w, h represents the width and height of the image to be cropped that is equal to 32 pixels. The resulting images are fed into the egg class predictor CNN model, which provides categorical data to distinguish the input image into class HC or UHC. The specification of the egg class predictor CNN model is represented in Table 2.3.

(2.4)

(2.5)

(2.6)

(2.7)

Table 2.2 Specifications of egg location CNN model.

Input image Activation/output Training samples Test samples Validation samples Test loss Validation loss
32 × 32 Regression Center of the egg (x, y) 439 × 103 51.6 × 103 25.8 × 103 0.5488 0.5450

Figure 2.5 CNN training model to predict egg location in terms of pixel values.


Figure 2.6 Result of egg location CNN model.

Table 2.3 Specification of egg class predicator CNN model.

Input image Activation/output Training samples Test samples Validation samples Test loss Accuracy on the test set Accuracy on the validation set
32 × 32 SoftMax 2 class-(0/1) 2.4 × 106 80.2 × 103 30 × 103 0.0077 99.8115% 99.7981%

The overall result of egg classification and counting yields an accuracy greater than 97%, and Figure 2.7 represents the result generated using the proposed method where green dots represent the hatched eggs while red dots represent unhatched eggs. Some of the areas of the images are zoomed and shown separately in Figure 2.7 since the input image is too big to fit in the page and eggs are minuscule to see any features.


Figure 2.7 Result of egg classification generated by the proposed method.

Machine Learning Algorithms and Applications

Подняться наверх