Development of Classification Method for Determining Chicken Egg Quality Using GLCM-CNN Method

ABSTRACT


INTRODUCTION
The consumption of eggs is one of the essential needs for every family due to the high nutritional value they possess.Eggs are a rich source of protein, vitamins, and important minerals, making them a valuable dietary component for humans [1].
The general classification of egg quality is divided into two main categories: external factors, observed from the shell's perspective, and internal factors.The eggshell is a primary consideration in visual observation as an initial assessment.Meanwhile, for internal factors, illumination can be used, or one can directly inspect and observe the contents.Some conditions on the eggshell that can be identified as defective eggs include cracks and dirt on the shell.Defects on the internal side of the egg are generally manifested by the presence of blood spots.The deterioration of egg quality is a result of defects and can pose a threat to health [2].
Health issues are crucial considerations in the automatic selection and separation of eggs based on their quality, alongside economic considerations [3].The bacterium Salmonella is a dangerous pathogen that could pose a significant threat if it enters the egg.This can happen due to cracks or defects in the eggshell, providing a potential entry point for Salmonella bacteria [4].The task of categorizing eggs has long been carried out by workers, and it is a complex and time-consuming process, often inefficient and frustrating for workers.Numerous studies have been conducted to automate the egg selection process with a focus on improving accuracy.One of the most popular methods is deep learning, where deep learning techniques are employed to classify eggs as either good or defective, ensuring the quality of egg classification [5].
Research related to egg cracks is using a novel method for detecting eggshell cracks based on machine learning.Many proposed methods aim to solve this problem and have gained popularity in the current era.The research conducted in this field aims to address the challenges associated with egg crack detection and classification [6] The method for detecting cracked eggs combines Gray-Level Co-occurrence Matrix (GLCM), wavelet transformation, and other techniques by incorporating Support Vector Machine (SVM) Into artificial neural networks, achieving an accuracy of 96.67% as a method for classifying cracked and intact eggs [7].
The utilization of acoustic signal method generated by rolling eggs on a plate to determine whether they are cracked or intact is performed [8].Meanwhile, the method used is the F-ratio of acoustic signal frequency to evaluate the ability to distinguish cracked eggs from sound, resulting in an accuracy of 96.2% [9].The learning method is constructed using SVM with an accuracy of 94.6%, utilizing One-versus-All, Oneversus-One, and Directed Acyclic Graph classifiers [10].
In 2018, a detection model was implemented utilizing the support vector machine (SVM).Statistical parameter methods within SVM are employed to distinguish between cracked and intact eggs, achieving an accuracy of 93% [4].Other researchers used the Faster Region-based Convolutional Neural Network method to detect damages on eggshells.The evaluation of the test data was conducted using mean average precision (mAP) [11].The Fine-tuned VGG16 method involves the image acquisition process using candle lighting for training and testing the Convolutional Neural Network (CNN) model.The development of the classification block is employed as the model architecture based on the structure of the VGG 16 method.The achieved accuracy is 96.16% [2].
The method for detecting black spots on eggs based on the CNN model GoogLeNet achieved an accuracy of 95.38%.This method utilizes the Inception convolutional module within the GoogLeNet model to extract features related to black spots on eggs [12].The modified CNN model was developed and trained on a dataset of egg images to classify the images into the categories of cracked and intact [13].
However, based on the literature review conducted by the author, encompassing an analysis of 70 articles, it is evident that the methods of data selection and collection employed have not been previously undertaken by researchers, previous research in the field of image processing-based methods has shown accuracies ranging from 93% to 96%.There is a need for further improvement in accuracy to approach the desired goal of 100%, which has not yet been achieved in studies using models such as VGG16 and others.Additionally, there is a lack of research discussing the classification of cracked and intact egg quality using images captured under natural daylight conditions with a specific distance.
Image processing has been widely employed by researchers in various fields, including Environmental Science [14], medical [15], agricultural [16,17] and transportation [18] domains.Previous studies related to eggs have also utilized image processing techniques [19,20].The utilization of image processing is crucial as it enhances image quality, enables noise filtering, facilitates feature extraction, and allows for image and edge enhancement [21].These options can be employed to extract and augment data effectively.
Compared to other studies, this research employs a GLCMbased image processing approach that has been popular and widely used in various domains, such as Recognition and Classification of Apple Leaf Diseases [22] , Plant Disease Classificationc [23], Leather Defect Detection and Classification [24], Apple Sorting [25], Potato Agricultural Product Defects [26], Tomato Leaf Diseases [27], enhancing chestnut quality [28], mango leaf variety classification [29], and Leaf Disease Detection [30].
Other studies utilizing image processing techniques involve RGB image conversion to grayscale, texture extraction, and backpropagation neural network classification.Features extracted using the Gray-Level Co-occurrence Matrix (GLCM) is utilized as the method, and a backpropagation artificial neural network serves as its classifier have demonstrated improved accuracy and effectiveness in image detection, achieving a 95% accuracy rate [31].
The aim of this research is to classify and select cracked and intact egg quality using machine learning with a high level of accuracy based on images captured at a specific distance under natural daylight conditions.The images are then extracted using GLCM.The next step involves developing a specific CNN model and training it on the previously extracted images to classify the egg images into the categories of cracked and intact.The performance of this model is then compared with VGG 19, VGG 16, and RESNET 50 models.

LITERATURE REVIEW
The use of acoustic signals was employed in 2015 with a detection rate result of 90%, as research related to egg quality involved placing eggs on a plate and rolling them to obtain images of cracked and intact eggs [8].Wang et al. utilized the F-ratio frequency approach to assess the ability to differentiate cracked eggs based on sound, achieving an accuracy of 96.2% [9].In 2017, Priyadumkol et al. [32] conducted research with similar results, both achieving an accuracy of 94%.
Research utilizing support vector machine (SVM) method to distinguish between cracked and intact eggs based on statistical characteristics was conducted [4].The segmentation approach based on Laplacian of Gaussian evaluated crack properties on illuminated egg images [33].Datta employed the Faster Region-based Convolutional Neural Network for faster processing and evaluated the test data using mean average precision [11].Furthermore, further investigation by Nasiri employed the VGG16 Fine-tuned architecture approach, candle lighting for image acquisition, and training and testing of the CNN model [2].Previous studies also involved hybrid models of sequential multiple image-based convolutional neural network-BiLSTM [3].A modified CNN model was developed and trained on image regions to classify damaged and intact egg images [13].
This study proposes the development of a new method for classifying cracked and intact eggs using a hybrid GLCM-CNN approach, aiming to capture detailed texture features of eggs through the GLCM method.

GLCM
GLCM is a field in image processing where feature extraction plays a crucial role in reducing classification errors.[34].The process of extracting texture information based on the matrix of dependencies and spatial gray levels uses the Gray Level Co-Occurrence Matrix (GLCM) method, where GLCM is one of the most commonly used second-order statistical tools [35].
Both coarse and fine textures can be easily captured in their structure by the Gray Level Co-Occurrence Matrix (GLCM) method.and is applicable to both monochrome and color images.It exhibits flexibility concerning image resolution.On the other hand, Convolutional Neural Networks (CNN) can perform automatic feature extraction, comprehend spatial contexts, share parameters, handle rotations and size variations, and possess transfer learning capabilities.
The texture properties in an image can be examined using GLCM by identifying the frequency of specific pixel value occurrences in pairs and their spatial relationships.The directions of GLCM include different degrees: 135°, 90°, 45°, and 0° [36].Previous studies that utilized GLCM include automatic detection of COVID-19 from chest X-ray images [37], classification of computer graphics images [38], glaucoma classification [34], gray mold detection on strawberry leaves [39], and foreign object classification of rice [40].All of these studies have employed GLCM, a prominent technique used by many researchers.The GLCM feature extraction method involves creating a matrix that represents the frequency of two pixels with specific intensities at a certain distance and orientation angle within the image.Gray-level features of an object that distinguish it from other objects are used for texture-based feature extraction.Contrast, correlation, energy, and homogeneity are among the extracted qualities.

Contrast
The contrast function is used to calculate the level of difference in image depths.The higher the gray-level contrast, the greater the contrast.Conversely, the lower the contrast, the smaller the difference in gray-level between two pixels.Contrast is defined by Eq. ( 1).

Correlation
Correlation indicates the extent to which a reference pixel is related to its neighbors across the image, Correlation is defined by Eq. ( 2).

Energy
The energy value characterizes the level of intensity distribution within an image, represented by Eq. ( 3).

Homogeneity
The homogeneity feature calculates the level of uniformity in an image.A higher homogeneity value indicates an image with a more uniform grayscale level.Homogeneity is calculated using Eq. ( 4), which measures the similarity between two images based on their grayscale level.An image with a higher homogeneity score has a more similar grayscale level throughout.

Deep learning
A popular subset of machine learning in various artificial intelligence domains is deep learning.It leverages abstractions, hierarchical architectures, and high-level characteristics of the learning data.Deep learning, based on neural networks, possesses a unique capability to automatically extract and select optimal features [2].Convolutional neural networks (CNNs) are the most well-known and commonly used group of deep learning algorithms, particularly in the recognition of various patterns, including object detection in digital images.
In Figure 1, it illustrates the correlation between the convolutional neural network, deep learning, machine learning, and artificial intelligence [41].
Deep learning enables computational models with multiple layers of processing to discover data representations with varying levels of abstraction.The state of the art has been significantly enhanced by this technique across various domains, including object identification, speech recognition, and visual object recognition, among others.Deep learning unveils intricate structures within vast datasets through the utilization of the backpropagation technique.This method elucidates how the internal parameters of the machine, responsible for creating representations in each layer, should adjust in response to the representations in the layers above.Fields such as image processing, video processing, speech recognition, and audio processing have experienced notable advancements due to the implementation of deep convolutional networks [42].

Convolutional neural network (CNN)
Traditional machine learning algorithms are now being supplanted by the promising feature extraction technology known as CNN.Unlike conventional machine learning algorithms, which often struggle to extract the most powerful and effective features, CNN demonstrates a remarkable capacity for generalization [43].Recent applications of CNN span various industries, including sidewalk crack detection [44], classification of normal, bacterial, and viral pneumonia [45], face recognition [46], and object recognition [41], significant advancements have been made in these domains, moving in different directions.CNN consists of a stack of layers, with at least one layer attached to each layer.As shown in Figure 2, there are three main layers that compose CNN: the output classification layer, the fully connected layer, and the convolutional layer.
Another significant hidden layer in CNN is the activation layer.It handles complex tasks more effectively.The incorporation of non-linear elements provides flexibility for tackling intricate issues in neural networks.The ReLU activation function is easier to train and yields better results.In addition to ReLU, the sigmoid activation function is also employed in this study.The equation in the ReLU function represents a piecewise linear function where the value produces the input directly if positive and returns zero if negative.
For classification across the entire network, a fully connected layer is employed, serving as the last layer of the CNN.A 1×1 convolution will be utilized if the preceding layer involves a fully connected layer.The use of global convolution hw, representing height (h) and width (w) in the previous convolutional layer, is applied when the fully connected layer acts as the preceding convolutional layer [47].GLCM CNN is a hybrid method that involves detailed texture feature extraction, and the feature data obtained is processed using CNN to achieve classification.
The theoretical expectation of GLCM-CNN is that the model should excel in recognizing patterns within digital images better than either the GLCM or CNN models individually.This is because GLCM-CNN combines the advantages of both models.GLCM can extract crucial features from digital images, such as texture, patterns, and orientation.CNN, on the other hand, can learn relationships between these features to make predictions.Consequently, GLCM-CNN is expected to enhance the accuracy of digital image classification, as evidenced by the findings of this study where the accuracy improved to 98%.

Qualified eggs
High-quality and edible chicken eggs are eggs that have not undergone fortification, cooling, preservation, and hardening processes, and they possess good physical characteristics in terms of shape, smoothness, thickness, completeness, and cleanliness as shown in Table 1.
The consumption of cage color and egg weight is used to classify chicken eggs, with the cage color corresponding to the strain and the weight categorized as small (50 g), medium (50 g to 60 g), and large (> 60 g), respectively [48].

MATERIAL AND METHOD
High-resolution cameras were employed in this research as tools for image acquisition, ensuring that the images maintain a high quality.The computer used has the specification of an Intel (R) Core (TM) i7-10510U CPU @ 1.80GHz 2.30 GHz.
Python is the programming language utilized for computation.It incorporates the 'os' package, allowing it to read various file types and directories.Additionally, numpy and TensorFlow are employed for matrix calculations.For the visualization of training and validation data, matplotlib.pyplot is used to create graphs and represent images.
The egg samples were obtained from local farms and were of varying sizes.They were divided into two classes: cracked eggs and intact eggs.Human experts were involved in determining the criteria for classifying the eggs as intact or cracked.
The research process, as shown in Figure 4, involved several stages.Data collection serves as the initial step, utilizing a digital camera as the tool to capture images distinguishing between cracked and intact eggs.The second step employs deep learning techniques, involving preprocessing followed by the training and testing processes.In other studies, a digital camera was used to capture data of shrimps underwater [49,50], In this research, the egg data was obtained from local chicken farms directly.The areas of cracked and intact eggs are captured entirely by a camera using the following method: a blue-colored plate is placed with an egg on it, and then a camera is positioned above the egg to capture the image.The process of capturing the images can be seen in Figure 5.
The egg images were captured using natural daylight under clear weather conditions to ensure clear image visibility.The collection of image data is based on the camera's distance from the object, which is 15 cm, while the camera's angle with the object is 90 degrees.The image data were categorized into two classes: cracked eggs and whole eggs, each consisting of 1000 images.This large dataset aims to enable the model to learn complex patterns, prevent overfitting, and enhance accuracy.After data collection, the next step involves preprocessing.Gray-scale images were required to extract texture features.RGB to HSV color space conversion was performed [51], followed by GLCM extraction to obtain texture feature values, including contrast, correlation, energy, and homogeneity.The next stages involved downsampling, data augmentation, and the utilization of deep learning methods.

Image pre-processing and data augmentation
In this paper, the GLCM variables employed include contrast to assess image quality and correlation to measure the extent to which pixel intensities in the image correlate with each other.The image size utilized as input for the CNN is 128×128.As for the CNN architecture, It consists of three convolutional layers with 32 filters in the first and second convolutions, while a 3×3 kernel with 64 filters constitutes the third convolution applied in this research.ReLU activation function is applied, the number of iterations (100 epochs) and batch size are set to 10, and the Adam optimization algorithm is used.
RGB follows an additive color model, displaying different colors when additional intensity is given to red (r), green (g), and blue (b) [52].Collecting images is often a costly and challenging process; gathering a limited dataset of images presents its own set of challenges.To address this issue, image augmentation has been established as an effective and efficient strategy [53].
Downsampling is a technique used to generate lowresolution images to reduce the iteration time of image style transfer [54].GLCM is a texture-based feature among various other texture-based feature extractions, standing out in its operation by solely utilizing pixels and identifying pixel combinations [35].
This stage involves introducing the CNN and performing object classification.Data augmentation is applied to generate additional data and enrich the variations of the previous data, which can be used by the CNN as new input parameters with different types.CNN takes RGB-formatted images as input, where the involvement of parameters is significant, it requires a sufficient amount of images and parameters to effectively learn the weights during training without overfitting.In some other research fields, the addition of new images may not be feasible due to the high cost of materials and time-consuming processes.Therefore, researchers create new images with the same labels but using different image processing techniques.Image transformations can be performed by adjusting the color intensity, adding noise, rotating, or resizing the images.
In the current study, the process involves resizing the original images from 1920×1080 pixels to 128×128 pixels.This change in size reduces computation time and maximizes results [55].Additionally, the color is converted to grayscale, as shown in Figure 6.Augmentation techniques such as horizontal flipping, zooming, image rotation, width shift range, height shift range, and shear range are applied to the images as image processing methods to expand the training dataset.
In addition, during the training phase, pixel values normalization of the training images and resizing the original images are automatically performed by the written code.

Training CNN model
After the dataset preparation process, the model training process is conducted.This process begins by creating a CNN model with a 3-layer convolution architecture.In each convolution process, the RELU activation function is used to transform negative values in the matrix [56].This function sets a threshold from zero to infinity.Zero padding is applied for each convolution process, which means zero-valued pixels are added to each side of the input matrix.The resulting maxpooling outputs in the form of a multidimensional array are flattened into a vector.Since the output is a softmax categorization, the loss function used is sparse categorical cross-entropy.The training and validation accuracy on each epoch are also monitored by passing in the metrics argument [57].

Evaluation methods
The performance evaluation method used in this study is the Confusion Matrix, which is commonly employed to assess the performance of a classification model.The Confusion Matrix consists of four types of calculated results: True Positive (TP), False Positive (FP), True Negative (TN), and False Negative (FN).True Positive (TP) represents the number of data instances that are classified as positive class (or the desired label) and actually belong to the positive class.False Positive (FP) represents the number of data instances that are classified as positive class (or the desired label) but actually belong to a different class.True Negative (TN) represents the number of data instances that are classified as negative class (or the undesired label) and actually belong to the negative class.False Negative (FN) represents the number of data instances that are classified as negative class (or the undesired label) but actually belong to a different class.

RESULTS AND DISCUSSION
The process of detecting eggs with cracked and intact classes involves capturing image data using a camera at predefined distances and angles.The training dataset consists of 1.000 images for the cracked class and 1.000 images for the intact class, while the validation dataset consists of 200 images for each class.The data collection process involves using a camera to ensure that all areas of the eggs are captured in the images, and the captured images are stored in a computer for further analysis.
The research model employed in this study is the combination of GLCM (Gray-Level Co-occurrence Matrix) and Deep learning.Prior to the training and testing processes, the image data is preprocessed using GLCM, as depicted in Figure 7.

Figure 7. Images after preprocessing
The original image data of the eggs is divided into smaller images of the same size.Each smaller image is then processed using digital image processing techniques.The next step involves using the processed images as input to generate a feature representation with the aim of enabling the CNN to recognize objects regardless of their position within an image.
This process is performed for all parts of each image using the same filter.Therefore, each part of the image has the same multiplier, which is referred to as weight sharing in the context of neural networks.If there is something interesting present in each image, it will be marked as an object of interest.The results of each smaller image are then stored in a new array.The next step is to reduce the size of the array by using downsampling, specifically max pooling, which involves taking the maximum pixel value within each pooling kernel.This helps to reduce the number of parameters while retaining the most important information from each part.
Once the image has been transformed from a large-sized image to a sufficiently small array, the next step is to input this small array into another neural network.The final neural network will determine whether the image is a match or not.
To differentiate it from the convolutional steps, this can be referred to as a "fully connected" network.
The CNN model used in this study has an architecture consisting of four blocks of convolutional layers.In each convolutional process, the RELU activation function is used to transform negative values in the matrix.This function applies a threshold from zero to infinity.Zero padding is applied in each convolutional process, where pixels with a value of zero are added to each side of the input matrix.
Before the final Dense layers, a Dropout layer is applied with a probability of 0.5.This means that 50% of the values coming into the Dropout layer will be set to zero, helping to prevent overfitting.The Dense layer has 512 units with a relu activation function.The model will output class probabilities for the two classes, "cracked" and "intact" eggs, using softmax.The performance of the classification model will be evaluated using a confusion matrix.
We  The proposed GLCM-CNN architecture GLCM-CNN demonstrates remarkably high accuracy (98%), while RESNET 50 exhibits the lowest accuracy (50%).VGG 19 and VGG 16 fall in between, with GLCM-CNN having the highest precision (98%), indicating the model's excellent ability to identify true positives.RESNET 50 has the lowest precision (25%).Moreover, GLCM-CNN also boasts the highest recall (98%), signifying its exceptional capability to identify the majority of positive instances.RESNET 50 has the lowest recall (50%).GLCM-CNN achieves the highest F1-score (98%), illustrating a well-balanced trade-off between precision and recall.RESNET 50 records the lowest F1-score (33%).The sensitivity of RESNET 50 is notably low (0%), suggesting its ineffectiveness in detecting positive instances, whereas GLCM-CNN achieves the highest sensitivity (96%).All architectures exhibit 100% specificity, indicating their excellent performance in identifying negative instances.GLCM-CNN stands out with high accuracy, precision, recall, and F1-score.RESNET 50 performs poorly overall, especially in detecting positive instances, while VGG 19 and VGG 16 show comparable performance across several metrics, as shown in Table 2.The evaluation of the model commonly used is the confusion matrix [58][59][60][61], The confusion matrix is a method that can provide highly detailed information about the performance of a classification model.It enables the evaluation of the model's performance for each class separately, offering better insights into the model's tendencies to make errors in specific classes.With elements such as True Positive (TP), True Negative (TN), False Positive (FP), and False Negative (FN), various evaluation metrics like accuracy, precision, recall (sensitivity), specificity, and F1-score can be computed.
In Figure 9, it can be observed that the number and average of the confusion matrix for the cracked and intact classes were perfectly classified with an accuracy of 98%.Previous studies on egg classification achieved accuracies of 96% and 96.1% [2,3,9] reported an accuracy of 96.67%, Priyadumkol et al. [32] achieved the best accuracy of 94%, Wu et al. [4] obtained an accuracy of 93%, Botta et al. [13] achieved an accuracy of 95.38%, and Bao et al. [33,62,63] reported classification results with accuracies of 90.1%, 91.0%, and 92.5%, respectively.Therefore, it can be concluded that the modified GLCM-CNN architecture used in this study achieved a higher accuracy of 98%.

Figure 9. GLCM-CNN Confusion matrix cracked and intact
The GLCM-CNN study yields superior results due to several key factors.Firstly, the utilization of GLCM as a feature extraction method provides an in-depth understanding of image texture, enabling discrimination between fine and coarse textures.Secondly, the integration of GLCM with CNN allows for more detailed and automated feature extraction, understanding spatial contexts, and performing rotations and resizing, thereby enhancing the model's ability to classify accurately.
Furthermore, the CNN architecture, designed with convolutional layers and appropriate filters, effectively captures complex patterns in egg images.Data augmentation processes contribute significantly by enhancing the diversity of training data, thereby improving the model's generalization capabilities on test data.
Lastly, the transfer learning capability of CNN enables the model to leverage knowledge learned from extensive previous datasets, thereby enhancing performance on smaller datasets related to eggs.The combination of all these factors results in the GLCM-CNN research outperforming theoretical expectations, providing an effective solution for cracked and intact egg classification.
From the classification process, it can be observed that the GLCM-CNN method achieved the highest accuracy of 0.98.The resulting confusion matrix from the GLCM-CNN method is shown in Figure 9 This research is an interdisciplinary study involving the fields of animal husbandry and computer science.The findings of this research can be utilized by scientists in these fields to expand research on egg quality using artificial intelligence.

CONCLUSIONS
This study successfully classified and selected the quality of cracked and intact eggs using machine learning with a high level of accuracy.The GLCM-CNN-based system developed in this research involved several different stages, including dimensionality transformation, augmentation, downsampling, GLCM processing, and classifier implementation.The method effectively managed the complexity of the system.The hierarchical model used was able to perform the classification task autonomously without requiring background removal.The proposed GLCM-CNN system has proven to be effective in classifying cracked and intact egg images.The developed GLCM-CNN algorithm in this study demonstrated efficiency in sorting eggs with an accuracy rate of 98%, which is higher compared to the VGG 19, VGG 16, and RESNET 50 models.
The development of the hybrid GLCM CNN framework at the theoretical level has a significant impact on the advancement of image processing theory, particularly in the understanding and utilization of texture information for classification purposes.The findings of this study can assist egg farmers in automatically categorizing eggs based on their conditions, distinguishing between those in good condition and those that are cracked.
The limitation of this study is that it can only be conducted on stationary eggs, allowing the entire surface to be visible under sufficient sunlight conditions.When the egg conditions change or when the eggs roll using a conveyor, the camera may not effectively capture the entire image.Consequently, the classification results are expected to decline.Future research can apply the developed method to moving eggs using an automated conveyor and under various lighting conditions, with a larger dataset.
The egg classification model using the GLCM-CNN method exhibits an accuracy of 98%, indicating an excellent overall performance.Notably, the high sensitivity (recall) for cracked eggs, reaching 96%, signifies the model's capability to identify the majority of genuinely cracked eggs.However, the high specificity of 100% indicates that no intact eggs were misclassified as cracked.Despite the high accuracy, particular attention should be given to evaluating the model's quality in detecting intact eggs.This is evident from the precision value of 98%, indicating that a small portion of intact eggs might be misclassified as cracked.The high F1-score of 98% demonstrates a good balance between precision and recall.In conclusion, the GLCM-CNN model performs exceptionally well in classifying cracked and intact eggs.However, attention is needed to mitigate potential errors in detecting intact eggs.This analysis provides a foundation for model improvement and a deeper understanding of the characteristics of egg classification using the GLCM-CNN method.

Figure 2 .
Figure 2. CNN's ArchitectureDownsampling layers serve as feature extractors within CNNs, in addition to the convolutional layers, a feature not present in conventional neural networks.Neurons are only connected to a local part of neurons in the upper layers, known as the local receptive field.A given number of neurons make up each feature map, and all of the neurons' weights are shared by all of the neurons in that feature map.Reducing the interaction between the network's layers, lowering network parameters, and avoiding overfitting are the three main purposes of weight sharing.Generally, During network training, convolution kernels' starting values are randomly generated, and the weights are continually evaluated and changed until appropriate weights are discovered.Downsampling is a special kind of convolution that's also called pooling.As a result, weight sharing, pooling, and local receptive field are CNN's three primary features.CNN consists of a stack of layers, with at least one layer attached to each layer.As shown in Figure2, there are three main layers that compose CNN: the output classification layer, the fully connected layer, and the convolutional layer.Another significant hidden layer in CNN is the activation layer.It handles complex tasks more effectively.The incorporation of non-linear elements provides flexibility for tackling intricate issues in neural networks.The ReLU activation function is easier to train and yields better results.In addition to ReLU, the sigmoid activation function is also employed in this study.The equation in the ReLU function represents a piecewise linear function where the value produces the input directly if positive and returns zero if negative.For classification across the entire network, a fully connected layer is employed, serving as the last layer of the CNN.A 1×1 convolution will be utilized if the preceding layer involves a fully connected layer.The use of global convolution hw, representing height (h) and width (w) in the previous convolutional layer, is applied when the fully connected layer acts as the preceding convolutional layer[47].GLCM CNN is a hybrid method that involves detailed texture feature extraction, and the feature data obtained is processed using CNN to achieve classification.The theoretical expectation of GLCM-CNN is that the model should excel in recognizing patterns within digital images better than either the GLCM or CNN models individually.This is because GLCM-CNN combines the advantages of both models.GLCM can extract crucial features from digital images, such as texture, patterns, and orientation.CNN, on the other hand, can learn relationships between these

Figure 3 (
Figure 3(a) depicts an egg with cracked shell, while Figure 3(b) illustrates an egg with intact shell, representing the challenges associated with damaged or substandard eggs.

Figure 4 .Figure 5 .
Figure 4. Flow of the research process 3.1 Data collection

Figure 6 .
Figure 6.Egg: (a) cracked and (b) intact compared our own modified GLCM-CNN model with other model architectures, including VGG 19, VGG 16, and RESNET 50.Each architecture was trained for 100 epochs, and the resulting training accuracy and validation accuracy are shown in Figure 8.

Figure 8 .
Figure 8. Training and validation accuracy . From this matrix, we can obtain the values of True Positive (TP) in the lower right quadrant of 200, False Positive (FP) in the upper right quadrant of 8, True Negative (TN) in the upper left quadrant of 198, and False Negative (FN) in the lower left quadrant of 0.

Table 1 .
Egg Quality Grade