Vision based Eggshell Crack Detection System for Segregation

DOI : 10.17577/IJERTCONV10IS08054

Download Full-Text PDF Cite this Publication

Text Only Version

Vision based Eggshell Crack Detection System for Segregation

Nithish K*

Department of Mechanical Engineering Sri Venkateswara College of Engineering Sriperambudur, India.

Jagan Shrinivasan R Department of Mechanical Engineering Sri Venkateswara College of Engineering

Sriperambudur, India.

Prashanna Rangan R Department of Mechanical Engineering Sri Venkateswara College of Engineering

Sriperambudur, India.

Arul Kumar M

Department of Mechanical Engineering Sri Venkateswara College of Engineering Sriperambudur, India.

Abstract Now a days in food preserving industry, it creates lot of difficulties to find the cracked or damaged eggs. There are various methods for detecting crack or damaged eggs, but at present all processes can be done manually. Thus, the current method is very tedious process and low in efficiency, poor precision while finding the cracked eggs. In this research work, deals with the problems in existing method while detecting the cracked eggs, which can be eliminated by using Image Processing Techniques through OpenCV. In this system we will be achieving automatic detecting and eliminating cracked eggs using image processing technique. With the implementation of image processing techniques, Efficiency and accuracy while finding the eggs can be improved while the labor intensity is reduced greatly. Technology is enhanced, thus resulting in relatively less complexity in prediction-based models. Cracked eggs were detected using the ESP-32Cam module and are sent to the could for data logging for enabling future manipulations.

Keywords Image Processing Techniques, Egg crack detection, ESP-32Cam, OpenCV


    Increased population in the twenty-first century leads to a significant growth in egg consumers (Eggetarian). There is a huge demand for eggs in the market since most people are switching from vegetarian to eggetarian diets. To suit the demands of the egg industry, the eggs will be preserved for a few days. When preserving eggs, a number of elements come into play in order to keep their high quality. As a result, numerous industries have altered their usual egg transportation, processing, and production. With the use of engineering concepts and technologies, this project intends to raise the egg production rate and quality by identifying the crack of the egg (product) from the entire production.

    The requirement for egg is becoming increasingly important as biological strength and vitamin levels rise. However, the egg's exterior shell was easily broken by external causes as well as manual manipulation. Once the egg shell has been fractured owing to environmental causes or incorrect handling, external microorganisms from the outer environment will quickly penetrate the egg shell through the crack. As a result, the egg's decomposition is accelerated, resulting in a reduction in amount. This will alter the odour of the workplace and necessitate additional cleaning efforts. Signal processing is used to obtain a nice image and extract some valuable information from it, with both the input as well

    the output being an image or output being the characteristics/features related with the image. Image processing is a rapidly emerging technology at the moment. Image processing is defined as the process of importing an image using image acquisition tools, then analysing and changing the output, with the end result being a changed image or report based on image analysis.

    Ching-Wei Cheng et al. mentioned said that Eggshell cracks affect not just egg preservation period, but also the success rate of end-processed products [1]. The resonant inspection hypothesis was used in this study (RI). The use of a support vector machine (SVM) technique to more accurately identify eggshell fractures was examined. The findings demonstrated that utilising a microphone as a sensor to compare the resonance frequency and amplitude allowed non cracked eggs to be discriminated from broken eggs. It is vital to identify surface cracks efficiently in order to manage the egg's surface accuracy and quality. Traditional manual visual inspection [2] and other methods, on the other hand, are not suitable for large-scale use due to subjective human variables such as staff experience and level. This study studies the basic idea of computer image recognition, then investigates the usage of computer image recognition in surface crack detection and gives specific implementation instructions based on this. Few eggs contain stripe markings that are not broken on the eggshell [3]. Eggs with stripe markings mimic cracks when crack detection is done with candling. According to studies, moderate stripes on eggshells have a impact on egg quality, hence such eggs should be spared from being misclassified as broken.

    According to Chen Hoaran et al. [4] Gray scale conversion, median filtering, linear sharpening, threshold segmentation, and other methods are used to extract the feature parameters of an egg crack picture, and a support vector machine model is created, which is then utilised to identify and detect eggs. The findings of the experiments reveal that the model can differentiate intact eggs from broken eggs, with a detection accuracy of 98.75 percent for fractured eggs. An improved anisotropic diffusion filter and the double thresholding technique are used [5] to morphologically segregate crack pixels from the background in an attempt to improve inspection performance. In this scenario, a unique feature extraction approach based on the Radon transform is created, while classification is done using a multiclass Support

    Vector Machine (SVM). The suggested framework functions effectively on eggs from the same or separate chicken houses, with sensitivity and specificity averaging 89.2 percent and

    94.6 percent, respectively, according to experimental data. However, while evaluating different types of broken eggs, the performance dropped marginally, with false positives ranging from 3 to 11% due to the high degree of resemblance between groups.

    Images were identified using DCNNs [6], which categorised them with 99 percent accuracy. The network correctly recognised roughly 86 percent of broken photos in transfer learning mode. These findings indicate that DCNN approaches for image-based concrete damage identification have a lot of potential. This technique may be used to identify egg cracks. The research in [7] contributes to the field of eggshell crack feature selection and comparison of acoustic responses of eggs following stimulation. This approach achieves a classification accuracy of 99.2 percent utilising a neural network with features reduction, and features reduction aids in the simplification of recognition algorithms and the reduction of computations in on-line systems. In [8] An off- line machine vision system based on a constantly rotating egg and a modified pressure chamber is presented. The findings showed that combining the difference of Gaussian and median features produced the greatest accuracy of 94 percent with the lowest false negative rate of 0.0166. Three accelerated vibration sensors were placed on separate orientations of shell eggs in this study. Vibration sensors [9] were used to capture signals via impaction on different parts of shell eggs. Each vibration sensor's characteristics and their accompanying correlation data were examined. With an accuracy of 95.38 percent, the suggested CNN model in [10] outperformed the SVM models in categorising photos of eggs.

    This study [11] recommends two ways to enhance the Canny detector: To begin, suitable thresholds are chosen using the adaptie Otsu threshold. The missing edges are then recovered using a novel form of the ant colony optimization (ACO) technique. The algorithm's complexity makes it more precise. The picture defogging algorithm[12] based on dark prior is the most typical of several approaches of image restoration based on its physical imaging model. After defogging, the algorithm has an excellent defogging impact and great image clarity. Results of this study [13] showed that egg shell cracks reduced incubation parameters and chick quality. Negative effects of hairline cracks were more pronounced compared to star cracks.

    Right now, the method implemented to detect the crack leads to detection of optical properties, dynamics testing, vibration characteristics and detection of acoustic characteristics. With the help of detecting optical properties, the detection accuracy and efficiency can hardly be determined at the same time and if there is presence of stain or sticky materials, such as feathers, the computer recognition accuracy will be reduced. The examination is carried out by using dynamics characteristics, a variety of factors need to be considered, processing an egg drop experiment yields different factors which are listed as drop height, cushion material type, material thickness and different parts must be considered. Acceleration vibration sensors are implemented to hold up the multiple directions on the surface of the shell of

    the egg and analyse the cracked eggshell region. Acoustic properties help in detecting a non-destructive parameter, whose detection accuracy and efficiency is relatively high, moreover research at home and abroad is quite a few.


    The experimental analysis is made using ESP-32 Cam, which has a built-in 0.3MP camera that is embedded to the main controller having built-in WiFi and Bluetooth for transferring data to the peer devices. The controller is capable of running micro-python and C codes of which we utilized the micro-python coding for using OpenCV for carrying out Image Processing. The software application OpenCV using micro python is used for data analysis and visualization which makes use of all the array structures and convert to and from the NumPy array. The OpenCV uses a set of data structures to process the image. An image is n x m matrix of pixels, where n represents rows and m resembles columns. OpenCV reads colour images in BGR format. Every pixel represents measurement of property in a scene measured over a finite area. Fig. 1 elucidates the entire process flow of the proposed methodology

    Fig. 1. Process flow of the experimental setup

    The basic OpenCV commands were made used in this work since the ESP-32Cam hardware has a limited memory and microSD card will be used only for storing the dataset and runtime buffer data the code has to be optimized enough to facilitate the controller to process the images without time lag. The image processing techniques adapted in this system are as depicted in Fig. 2. Basic predefined functions like imread, BGR2GRAY, Canny were used for acquiring, converting and feature extraction from the image.

    Fig. 2. Image Processing techniques adapted

    1. Image recognition and interpretation

      The analysis of image is classified into 3 categories [11] from low-level to advanced based on intelligence and complexity of the image processing done. Low-level processing where no intelligence is required, intermediate processing is the category where image segmentation takes place and intelligence is implemented, and in advance processing high level intelligence is used to perform interpretation with the lack of theory(information) but has to follow a specific formulate way for the interpretation process. In OpenCV- python color image is read in BGR format so color

      conversion is required when using the image in other library or toolsets. In order to enable high level processing to happen the images are converted into grayscale and post which the preprocessing like erosion and dilation are made. One key reason to do it after grayscale conversion is to eliminate loss of data.

    2. Egg edge detection

      There are basically 2 types of edge detection operators, one is gradient-based operator and gaussian-based operator. The gradient based operator process only calculates first-order derivations in the digital image. Some of the gradient based operators are prewitt operator, sobel operator, etc. On the other hand the edge detection operator is Gaussian based operator which processes the digital image and calculates second order derivations, popular Gaussian based operators are canny edge detection and Laplacian of gaussian. After trials, this setup utilized Canny edge detection technique to find the contour edges of the egg.

    3. Image segmentation and structural processing

      The edge processed by canny edge detection algorithm is famous for its smooth and accurate image. Such images are popularly used for image segmentation. It uses mathematical structure to calculate local gradient and final edge link. The benefit of using canny edge detection algorithm is because noise can be removed by using 5×5 Gaussian filter. The threshold of the hysteresis is used to identify whether an edge is true or not. The structural processing is done using mathematical morphology where structure pixel is constructed and image is formed by filling the region and connecting the regions.

    4. Eggshell crack segmentation

      The step of pattern recognition in which the essential signal features must be identified from all other additional or undesirable information is called feature extraction. It must also be done with the goal of producing a compact and interpretable outcome dataset from the raw natural signals. It usually happens in between pre-processing and classification steps, and it usually entails a domain shift from the raw bio signals via mathematical changes.

    5. Image Recognition

    Linear Filtering is a technique for removing noise from a signal. It's a digital image processing approach that involves processing time-varying input data and creating linear output signals. Fast Defogging Image Recognition Algorithm Based on Bilateral Hybrid Filtering By combining directed filtering with median filtering, a bilateral hybrid filtering approach is suggested in [12], which may effectively increase the resilience and transmittance of defogging pictures. As a result, the suggested technique minimises the computational complexity of defogging picture detection while also shortening the image execution time. The defogging impact and speed are both encouraging, with the picture recognition rate reaching 98.8% after defogging.

    a. Vertical crack

    b. Horizontal crack

    c. Point crack

    d. Hair crack

    e. Hair line crack

    f. Star crack

    Fig. 3. Various crack formation in the surface of egg

    The various crack formation in the egg surface [13] is as shown in the Fig. 3. These base images are taken as the main templates with which the categorization happens in run-time.


    The images acquired for detecting the cracks will not be saved to the microSD card and the features acquired or learned from the detected images will be converted to templates and will be stored in the respective datasets in order to enhance the accuracy level. Through this novel approach the accuracy in predicting the models will get improved with minimal memory utilization and hence a nominal size of microSD card will be sufficient for a longer duration. The image of egg with various crack openings were displayed in Fig. 3 which would aid us to develop an algorithm for predicting the defective ones.

    The ESP-32Cam is programmed with micro python codes for predicting the various cracks in the egg that comes down the conveyor. A piston arrangement is placed adjacent to the conveyor whose solenoid coil is triggered by the ESP-32Cam as and when a cracked egg is detected. The module is connected through WiFi and the data are logged continually and pushed to the cloud for future analysis. A microSD card is inserted into the ESP module that stores the template dataset and acts as a medium for buffer storage for processing the image data.

    The aforesaid programme was put to the test using five distinct scenarios, each of which included different types of cracks such as edge cracks, hair line cracks, point cracks, vertical cracks, and horizontal cracks. The methodology made

    use of a novel approach that stores the acquired images features that are at intermediate stage from the template images based on the matching percentage with a particular category of the template and with which the template count keeps increasing in order to improve the run-time accuracy of the built system.


Technology is enhanced, thus resulting in relatively less complexity in prediction based models. In the food processing industry, finding cracked eggs is a critical task. At the moment, the most common way for identifying cracked eggs is by hand, which is not only time consuming but also inefficient and inaccurate. As a result, developing a detection method to eradicate cracked eggs is necessary and substantial.

The goal of this project is to create an automated vision- based detection system for cracking eggs. Cracked eggs are detected in the conveyor using this system. Images are taken and interpreted using OpenCV in the first step of this project, with the help of colour coding. In order to detect all forms of cracks, different variables are considered by the analysis system. Cracked eggs were recognised without error every time during the experiment. The next challenge is to integrate it in hardware, and this model shows that if it is done in hardware, the above-mentioned issues will be adequately mitigated.


No potential conflict of interest was reported by the authors.


We thank our colleagues from Department of Mechanical Engineering, Sri Venkateswara College of Engineering who provided insight and expertise that greatly assisted in the research and python coding.


Nithish K is now an undergraduate candidate in Department of Mechanical Engineering, Sri Venkateswara College of Engineering, India, email: His research area includes Artificial Intelligence, Robotics, Automation and IoT. He has presented his findings in 2 National Conferences.

Prashanna Rangan R is now a master candidate in Department of Industrial Automation and Robotics, Sri Venkateswara College of Engineering, India, email: He received his Bachelors degree in Mechatronics engineering from Kongu Engineering College, India in 2019. His research area includes, Robotics, Human assistive devices, PLC automation, Machine Vision system and IoT. He has published his Research findings in 11 International Journals. He has presented his research findings in 9 International and 5 National Conferences.

Jagan Shrinivasan R is now a master candidate in Department of Industrial Automation and Robotics, Sri Venkateswara College of Engineering, India. He received his Bachelors degree in Mechanical engineering from Rajalakshmi Engineering College, India in 2020. His research area includes, PLC, SCADA, Automation, Robotics. He has presented his findings in 1 National Conference.

Arul Kumar M is currently Assistant professor in Department of Mechanical Engineering, Sri Venkateswara College of Engineering, India. He received his Masters degree in Computer Aided Design from Sri Venkateswara College of Engineering, India in 2013. His research area includes CAD, Mechatronics, Robotics, Composite Materials. He has published his Research findings in 4 International Journals. He has presented his research findings in 10 International/National Conferences.


[1] C. W. Cheng, P. H. Feng, J. H. Xie, and Y. K. Weng, Eggshell crack detection and egg classification using resonance and support vector machine methods, Applied Engineering in Agriculture, vol. 35, no. 1, pp. 2330, 2019, doi: 10.13031/aea.12749.

[2] R. Bai, D. Men, L. Yu, and D. Wang, Research on Surface Crack Detection Based on Computer Image Recognition, in Journal of Physics: Conference Series, Aug. 2021, vol. 1992, no. 3. doi: 10.1088/1742-6596/1992/3/032029.

[3] A. K. Datta, B. Botta, and S. S. Reddy Gattam, Damage detection on chicken eggshells using Faster R-CNN, 2019. doi: 10.13031/aim.201901244.

[4] C. Haoran, H. E. Chuchu, J. Minlan, and L. I. U. Xiaoxiao, Egg crack detection based on support vector machine, in Proceedings – 2020 International Conference on Intelligent Computing and Human- Computer Interaction, ICHCI 2020, Dec. 2020, pp. 8083. doi: 10.1109/ICHCI51889.2020.00025.

[5] M. H. Abdullah, S. Nashat, S. A. Anwar, and M. Z. Abdullah, A framework for crack detection of fresh poultry eggs at visible radiation, Computers and Electronics in Agriculture, vol. 141, pp. 81 95, Sep. 2017, doi: 10.1016/j.compag.2017.07.006.

[6] S. Dorafshan, R. J. Thomas, and M. Maguire, Comparison of deep convolutional neural networks and edge detectors for image-based crack detection in concrete, Construction and Building Materials, vol. 186, pp. 10311045, Oct. 2018, doi:


[7] H. Wang, J. Mao, J. Zhang, H. Jiang, and J. Wang, Acoustic feature extraction and optimization of crack detection for eggshell, Journal of Food Engineering, vol. 171, pp. 240247, Feb. 2016, doi: 10.1016/j.jfoodeng.2015.10.030.

[8] J. Priyadumkol, C. Kittichaikarn, and S. Thainimit, Crack detection on unwashed eggs using image processing, Journal of Food Engineering, vol. 209, pp. 7682, Sep. 2017, doi: 10.1016/j.jfoodeng.2017.04.015.

[9] H. Lin, P. T. Xu, L. Sun, X. kun Bi, J. wen Zhao, and J. rong Cai, Identification of eggshell crack using multiple vibration sensors and correlative information analysis, Journal of Food Process Engineering, vol. 41, no. 8, Dec. 2018, doi: 10.1111/jfpe.12894.

[10] B. Botta, S. S. R. Gattam, and A. K. Datta, Eggshell crack detection using deep convolutional neural networks, Journal of Food Engineering, vol. 315, Feb. 2022, doi: 10.1016/j.jfoodeng.2021.110798.

[11] K. Benhamza and H. Seridi, Canny edge detector improvement using an intelligent ants routing, Evolving Systems, vol. 12, no. 2, pp. 397 406, Jun. 2021, doi: 10.1007/s12530-019-09299-0.

[12] W. Liang, J. Long, K. C. Li, J. Xu, N. Ma, and X. Lei, A Fast Defogging Image Recognition Algorithm Based on Bilateral Hybrid Filtering, ACM Transactions on Multimedia Computing, Communications and Applications, vol. 17, no. 2, Jun. 2021, doi: 10.1145/3391297.

[13] A. Salahi, The influence of egg shell crack types on hatchability and chick quality, 2011, doi: 10.13140/2.1.3441.2481.

[14] Mathivanan, S., K. M. Arunraja, and M. Viswanath. "Experimental Investigation on Aluminum Metal Matrix Composite." International Journal of Engineering Research & Technology, ISSN (2018): 2278- 0181.

[15] Yasin, J., Selvakumar, S., Kumar, P. M., Sundaresan, R., & Arunraja,

K. M. (2022). Experimental study of TiN, TiAlN and TiSiN coated high speed steel tool. Materials Today: Proceedings.

[16] , Ponmurugan, M., M. Ravikumar, R. Selvendran, C. Merlin Medona, and K. M. Arunraja. "A review on energy conserving materials for passive cooling in buildings." Materials Today: Proceedings (2022).