A non-destructive image recognition method and system for cracks in eggshells

By constructing and training an eggshell crack detection model, and using EfficientDet and MobileNetV3 networks to identify and locate eggshell cracks, the efficiency and accuracy problems of traditional detection methods are solved, achieving non-destructive and rapid egg quality detection and food safety assurance.

CN119540145BActive Publication Date: 2026-03-17INST OF ANIMAL HUSBANDRY & VETERINARY MEDICINE ANHUI ACAD OF AGRI SCI
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Traditional manual and tapping methods are inefficient and inaccurate in detecting eggshell cracks. They are also easily affected by human factors and cannot achieve non-destructive, rapid, and accurate detection.

Method used

A target model for detecting eggshell cracks was constructed and trained. By obtaining an eggshell crack dataset, crack feature maps and localization maps were generated. The EfficientDet detection network was combined with the lightweight MobileNetV3 network for multi-scale detection to identify and locate cracks on eggshells.

Benefits of technology

It significantly improves the accuracy and efficiency of eggshell crack detection, provides food safety assurance, and reduces the error rate and cost of manual testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540145B_ABST
    Figure CN119540145B_ABST
Patent Text Reader

Abstract

This invention discloses a non-destructive image recognition method and system for eggshell cracks. The method includes: first, obtaining an eggshell crack dataset; then, generating eggshell crack feature maps and crack location maps based on the eggshell crack dataset; constructing an initial eggshell crack detection model, and training the initial eggshell crack detection model based on the eggshell crack feature maps and crack location maps to obtain a trained eggshell crack detection target model; finally, acquiring view image data of the target egg with the crack to be detected, and determining the crack detection result of the target egg based on the eggshell crack detection target model. By constructing and training the eggshell crack detection target model, it can accurately identify and locate cracks on eggshells. This method not only significantly improves the accuracy of detection but also significantly enhances detection efficiency, providing strong support for egg quality inspection and food safety assurance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image recognition technology, specifically a non-destructive image recognition method and system for eggshell cracks. Background Technology

[0002] Eggs are an important part of our daily diet, and their quality and safety are of great concern. During production, transportation, and storage, eggshells may crack for various reasons. This not only affects the egg's appearance but, more importantly, can lead to bacterial invasion, thus compromising its safety for consumption. Therefore, achieving non-destructive, rapid, and accurate detection of eggshell cracks is of great significance.

[0003] Traditional methods for detecting eggshell cracks mainly include visual inspection and tapping inspection. Visual inspection relies on the inspector's experience and subjective judgment, which is not only inefficient but also easily affected by human factors, leading to inaccurate results. Tapping inspection involves tapping the egg to listen to the sound and determine if the shell is intact. While simple to operate, this method also suffers from high subjectivity, low accuracy, and can damage the egg. Therefore, how to perform non-destructive eggshell crack detection has become a pressing problem. Summary of the Invention

[0004] The purpose of this invention is to provide a non-destructive image recognition method and system for eggshell cracks, addressing the shortcomings of existing technologies. By constructing and training an eggshell crack detection target model, it can accurately identify and locate cracks on eggshells. Compared to traditional manual inspection methods, this method not only significantly improves detection accuracy but also substantially enhances detection efficiency, providing strong support for egg quality inspection and food safety assurance.

[0005] One embodiment of this application provides a non-destructive image recognition method for eggshell cracks, the method comprising:

[0006] Obtain the eggshell crack dataset;

[0007] Based on the eggshell crack dataset, generate eggshell crack feature maps and eggshell crack location maps;

[0008] An initial model for detecting eggshell cracks is constructed, and the initial model is trained based on the eggshell crack feature map and the eggshell crack location map to obtain a trained target model for detecting eggshell cracks.

[0009] Acquire view image data of the target egg with cracks to be detected, and determine the crack detection result of the target egg based on the eggshell crack detection target model.

[0010] Optionally, obtaining the eggshell crack dataset includes:

[0011] By comparing and analyzing several groups of images of cracked eggs with images of eggs without cracks, we obtained difference images;

[0012] The image segmentation model based on dynamic programming segments the difference image into multiple difference sub-images;

[0013] The eggshell crack dataset is obtained by searching the crack path in each difference subgraph.

[0014] Optionally, the image segmentation model based on dynamic programming segments the difference image into multiple difference sub-images, including:

[0015] The difference image is input into a dynamic programming-based image segmentation model, which outputs multiple segmented difference sub-images. The image segmentation model is trained using a dynamic programming algorithm and includes an image difference recognition module, a crack extraction module, and an image segmentation module. The image difference recognition module identifies and processes difference regions in the input difference image. The crack extraction module uses a depth recognition algorithm to identify egg crack features within the difference regions. The image segmentation module uses a dynamic programming algorithm to find the optimal segmentation path to generate the difference sub-images. The optimal segmentation path is determined based on the continuity, shape, and size of the egg crack features.

[0016] Optionally, generating eggshell crack feature maps and eggshell crack location maps based on the eggshell crack dataset includes:

[0017] Perform crack block segmentation on the eggshell crack dataset to obtain the target crack region image;

[0018] Based on the gray values ​​corresponding to the pixels in the target crack region image, median filtering and linear sharpening are performed on the target crack region image to determine the eggshell crack feature map;

[0019] Crack edge detection technology is used to locate the crack in the target crack area image, and Freeman chain code is used to segment and encode the crack curve to determine the eggshell crack location map.

[0020] Optionally, the step of performing crack block segmentation in the eggshell crack dataset to obtain the target crack region image includes:

[0021] Gaussian blurring is applied to each target crack segmentation region in the eggshell crack dataset to obtain an initial set of crack regions;

[0022] Determine the enhancement coefficient corresponding to the target crack region, and enhance each initial crack region to generate an image of the target crack region.

[0023] Optionally, the initial model for eggshell crack detection uses the EfficientDet detection network as the initial model for eggshell crack detection, and replaces the backbone network with the lightweight network MobileNetV3, while removing the composite extended convolutional layer structure, in order to implement a training strategy for the multi-scale eggshell crack detection initial model.

[0024] Another embodiment of this application provides a non-destructive image recognition system for eggshell cracks, the system comprising:

[0025] The module is used to obtain a dataset of eggshell cracks.

[0026] The generation module is used to generate eggshell crack feature maps and eggshell crack location maps based on the eggshell crack dataset;

[0027] The module is used to build an initial model for eggshell crack detection, and to train the initial model for eggshell crack detection based on the eggshell crack feature map and the eggshell crack location map, so as to obtain the trained target model for eggshell crack detection.

[0028] The determination module is used to acquire view image data of the target egg with cracks to be detected, and determine the crack detection result of the target egg based on the eggshell crack detection target model.

[0029] Optionally, the obtaining module includes:

[0030] The first obtaining unit is used to obtain difference images by comparing and analyzing several groups of cracked egg images with uncracked egg images;

[0031] The segmentation unit is used to segment a difference image into multiple difference sub-images based on a dynamic programming-based image segmentation model.

[0032] The second unit is used to find the crack path in each difference subgraph to obtain the eggshell crack dataset.

[0033] Another embodiment of this application provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the methods described above.

[0034] Another embodiment of this application provides a storage medium storing a computer program, wherein the computer program is configured to execute the method described above when running.

[0035] Compared with existing technologies, this invention first obtains a dataset of eggshell cracks; then, based on the eggshell crack dataset, it generates eggshell crack feature maps and eggshell crack location maps; it constructs an initial model for eggshell crack detection, and trains the initial model based on the eggshell crack feature maps and eggshell crack location maps to obtain a trained target model for eggshell crack detection; finally, it acquires view image data of the target egg with the cracks to be detected, and determines the crack detection result of the target egg based on the eggshell crack detection target model. By constructing and training the eggshell crack detection target model, it can accurately identify and locate cracks on eggshells. Compared with traditional manual inspection methods, this method not only significantly improves the accuracy of detection but also significantly enhances the efficiency, providing strong support for egg quality inspection and food safety assurance. Attached Figure Description

[0036] Figure 1 Hardware structure block diagram of a computer terminal for a non-destructive image recognition method for eggshell cracks provided in an embodiment of the present invention;

[0037] Figure 2 A flowchart illustrating a non-destructive image recognition method for eggshell cracks provided in an embodiment of the present invention;

[0038] Figure 3 This is a schematic diagram of the structure of a non-destructive image recognition system for eggshell cracks provided in an embodiment of the present invention. Detailed Implementation

[0039] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0040] This invention provides a non-destructive image recognition method for eggshell cracks. This method can be applied to electronic devices, such as computer terminals, specifically ordinary computers, tablets, etc.

[0041] The following detailed explanation uses a computer terminal as an example. Figure 1 This is a hardware structure block diagram of a computer terminal for a non-destructive image recognition method for eggshell cracks provided in an embodiment of the present invention. Figure 1 As shown, a computer terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. Optionally, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0042] The memory 104 can be used to store software programs and modules for application software, such as the program instructions / modules corresponding to the non-destructive image recognition method for eggshell cracks in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0043] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0044] See Figure 2 , Figure 2 A flowchart illustrating a non-destructive image recognition method for eggshell cracks provided in an embodiment of the present invention may include the following steps:

[0045] S201: Obtain the eggshell crack dataset.

[0046] Specifically, eggshell crack datasets can be found by searching for existing eggshell crack datasets on relevant research platforms or data sharing websites. Alternatively, pre-defined datasets can be created by collecting eggshell images from different sources with varying degrees of cracking, and then annotating and preprocessing them.

[0047] For example, a pre-set dataset can be created by capturing images of eggshells using a high-resolution camera or webcam, ensuring the images contain clear crack features while avoiding the influence of factors such as lighting and shadows on image quality. The collected images are then labeled to clearly indicate the location and extent of the cracks. Further preprocessing of the collected images, including noise reduction, contrast enhancement, and resizing, helps improve image quality and makes it easier for subsequent detection models to identify crack features.

[0048] In one optional implementation, obtaining the eggshell crack dataset may include:

[0049] 1. By comparing and analyzing several groups of images of cracked eggs with images of uncracked eggs, difference images were obtained;

[0050] 2. A dynamic programming-based image segmentation model divides a difference image into multiple difference sub-images;

[0051] 3. Crack path search is performed on each difference subgraph to obtain the eggshell crack dataset.

[0052] Specifically, a large dataset of cracked and uncracked egg images was first collected. Then, image processing techniques were used to compare and analyze several sets of cracked and uncracked egg images. By comparing the pixel differences between the two sets, difference images were obtained. These difference images highlight the differences between cracked and intact areas. In the difference images, cracked areas typically exhibit significant pixel value changes, which can be used to extract crack features, providing a basis for subsequent processing.

[0053] To more accurately locate and segment crack regions, a dynamic programming-based image segmentation model can be employed. This model leverages the continuity and shape features of cracks to find the optimal cutting path within a difference image. The difference image is input into the model, which calculates the optimal cutting path using a dynamic programming algorithm and segments the image into multiple difference sub-images. Each sub-image may contain a portion of the crack region or a complete crack. Within each sub-image, crack paths can be further identified, for example, through image processing techniques such as edge detection and morphological processing. By identifying the crack's edge contour and shape features, the specific location and extent of the crack can be determined. Finally, the identified crack paths are associated with the corresponding difference sub-images to form a complete eggshell crack dataset. This dataset contains multiple images with crack annotations, where the crack paths have been accurately identified and located. After constructing the dataset, quality evaluation and optimization can be performed, including checking the accuracy and completeness of crack annotations and the diversity of the dataset. Continuous optimization of the dataset improves the model's training performance and generalization ability.

[0054] The image segmentation model based on dynamic programming divides the difference image into multiple difference sub-images, which may include:

[0055] The difference image is input into a dynamic programming-based image segmentation model, which outputs multiple segmented difference sub-images. The image segmentation model is trained using a dynamic programming algorithm and includes an image difference recognition module, a crack extraction module, and an image segmentation module. The image difference recognition module identifies and processes difference regions in the input difference image. The crack extraction module uses a depth recognition algorithm to identify egg crack features within the difference regions. The image segmentation module uses a dynamic programming algorithm to find the optimal segmentation path to generate the difference sub-images. The optimal segmentation path is determined based on the continuity, shape, and size of the egg crack features.

[0056] Specifically, the image segmentation model described above is meticulously trained based on a dynamic programming algorithm, aiming to efficiently and accurately process images with differences, segmenting them into multiple sub-images containing specific information. The model consists of three core modules: an image difference recognition module, a crack extraction module, and an image segmentation module.

[0057] The image difference recognition module is responsible for receiving and processing the input difference images. Its main task is to identify and locate the difference regions in the images, which typically represent cracks or other significant changes on an eggshell. Through advanced image processing techniques, such as pixel-level comparison and color space conversion, the module can accurately identify the difference regions in the images, providing crucial information for subsequent processing.

[0058] The crack extraction module is used to further analyze the identified areas of difference using deep learning algorithms to accurately extract the crack features of the egg. These features may include the shape, length, width, and orientation of the crack. For example, a deep learning model can be trained to learn and recognize crack features. By continuously optimizing the model parameters, the accuracy and robustness of crack extraction can be improved.

[0059] For example, the crack extraction module focuses on the spatial dimension. By compressing the channel features of the difference region map, it stimulates important spatial features, thereby improving the learning ability of the image cutting model to extract egg crack features. For example, the input difference region map U = [u 1,1 ,u 2,2 ,...,u i,j ,u H,W ], where u i,j This represents the channel information at points i and j in the difference region map. The difference region map has S channels and W weights. Sq The 2x2 convolutional block is compressed, and the output channel can be 2, with a crack feature map q of size H×W, where q can be expressed as q=W Sq ×U, then the obtained crack feature map q is normalized by the sigmoid function σ(q) to obtain the spatial importance of each spatial location (i,j) in the feature map, for example, the value of the k-th channel (i,j represent the coordinates of each parameter respectively):

[0060]

[0061] Finally, the importance of each channel σ(q) was calculated. k This enhances the learning of channel features, thereby enhancing important spatial location information of cracks.

[0062] The image segmentation module uses a dynamic programming algorithm to find the optimal segmentation path to divide a difference image into multiple difference sub-images. These sub-images more clearly display the crack features, facilitating subsequent analysis and processing. For example, a cost matrix is ​​first constructed based on the crack feature information provided by the crack extraction module; then, the dynamic programming algorithm is used to find the optimal path in the cost matrix, which is the segmentation path. During the segmentation process, the module considers factors such as the continuity, shape, and size of the crack to ensure the accuracy and rationality of the segmentation results.

[0063] It should be noted that the optimal cutting path is determined based on the continuity, shape, and size of the egg crack features. Specifically, the cutting path must ensure that it continuously traverses the crack area, avoiding segmenting the crack into multiple discontinuous parts. The cutting path should also be adjusted according to the specific shape and size of the crack to better preserve its feature information. While ensuring cutting accuracy, the cutting path should be as smooth as possible to minimize damage to image information.

[0064] In summary, the image segmentation model based on dynamic programming, through the collaborative work of its three main modules, can efficiently and accurately process differential images, segmenting them into multiple differential sub-images containing clear crack features. These sub-images will provide strong support for subsequent eggshell crack detection and analysis.

[0065] S202: Based on the eggshell crack dataset, generate eggshell crack feature maps and eggshell crack location maps.

[0066] Specifically, generating eggshell crack feature maps and eggshell crack location maps based on the eggshell crack dataset may include:

[0067] Step 1: Perform crack block segmentation on the eggshell crack dataset to obtain the target crack region image;

[0068] Step 2: Based on the gray values ​​corresponding to the pixels in the target crack region image, perform median filtering and linear sharpening processing on the target crack region image to determine the eggshell crack feature map;

[0069] Step 3: Use crack edge detection technology to locate the crack in the target crack area image, and use Freeman chain code to segment and encode the crack curve to determine the eggshell crack location map.

[0070] Specifically, the process begins by selecting images containing cracks from an eggshell crack dataset as the processing target. Then, the images undergo preprocessing, such as noise reduction and contrast enhancement, to improve the accuracy of subsequent processing. Image processing techniques, such as thresholding and region growing, are then used to segment the cracked areas in the image. The goal of this step is to extract the target region containing the crack from the entire image, obtaining the target cracked region image.

[0071] For example, in an image of the target crack region, an egg crack can typically be represented by changes in grayscale values. Therefore, crack features can be analyzed based on the grayscale values ​​corresponding to each pixel. To remove noise interference from the image, median filtering can be performed on the target crack region image. Median filtering is a non-linear filtering technique that can effectively smooth the image and remove noise. Similarly, to enhance the clarity of the crack features, linear sharpening can be performed on the filtered image. Linear sharpening enhances the edge information in the image, making the crack features more prominent. After median filtering and linear sharpening, an image containing clear crack features, i.e., an eggshell crack feature map, can be obtained.

[0072] Crack edge detection techniques, such as Canny or Sobel edge detection, are used to locate cracks in the target crack area image. Edge detection can accurately identify edge information in the image, including the crack edges. Furthermore, Freeman chain code can be used to segment and encode the crack curve. Freeman chain code is a digital encoding method that describes the shape of a curve in an image. By recording key points and their orientation information on the curve, the shape and location of the crack can be accurately described. The crack curve is divided into several segments, each represented by a Freeman chain code. Then, each segment is encoded, recording its key points and orientation information. Finally, based on the segmentation and encoding results of the Freeman chain code, an eggshell crack location map can be generated. It should be noted that the location map usually displays the location and shape information of the crack graphically, such as using line segments, arrows, etc., to mark the direction and location of the crack.

[0073] In one optional implementation, the step of segmenting cracked regions in the eggshell crack dataset to obtain a target cracked region image may include:

[0074] Gaussian blurring is applied to each target crack segmentation region in the eggshell crack dataset to obtain an initial crack region set; the enhancement coefficient corresponding to the target crack region is determined, and each initial crack region is enhanced to generate a target crack region image.

[0075] Specifically, images containing cracks are selected from the eggshell crack dataset, and the segmented region of each target crack is determined. Then, Gaussian blurring is applied to each segmented region of the target crack. Gaussian blurring is an image processing technique that smooths the image and reduces noise by weighted averaging of the pixel values ​​surrounding each pixel. The purpose of this step is to reduce noise interference in the image while preserving the crack features, providing a clearer image for subsequent processing.

[0076] After Gaussian blurring, a set of images containing initially smoothed crack regions is obtained, forming an initial set of crack regions. To highlight crack features, each target crack region needs to be enhanced. Before enhancement, the enhancement coefficient for each crack region needs to be determined. The enhancement coefficient can be dynamically adjusted based on factors such as crack visibility and overall image brightness to ensure that the enhancement effect highlights crack features without causing image distortion. Using the determined enhancement coefficient, each initial crack region is enhanced. Enhancement can employ methods such as contrast enhancement and brightness adjustment to highlight the feature information of the crack region. After enhancement, target crack region images containing clear crack features are obtained. These target crack region images can serve as the basis for subsequent crack feature extraction and crack localization steps.

[0077] S203: Construct an initial model for eggshell crack detection, and train the initial model based on the eggshell crack feature map and the eggshell crack location map to obtain a trained target model for eggshell crack detection.

[0078] Specifically, the initial model for eggshell crack detection uses the EfficientDet detection network as the initial model for eggshell crack detection, and replaces the backbone network with the lightweight network MobileNetV3. At the same time, the composite extended convolutional layer structure is removed to implement a training strategy for the multi-scale eggshell crack detection initial model.

[0079] EfficientDet is a high-performance object detection model that combines EfficientNet as its backbone with a series of innovative detection designs to provide efficient and accurate detection results. To reduce the model's computational complexity and memory footprint, the backbone of EfficientDet is replaced with MobileNetV3. MobileNetV3 is a lightweight network that employs efficient structures such as depthwise separable convolutions and Squeeze-and-Excitation (SE) modules, significantly reducing the number of parameters and computational cost while maintaining high accuracy. Further, the Compound Scaling Layers structure can be removed from MobileNetV3. While introduced to improve model performance, Compound Scaling Layers can increase model complexity and computational cost in certain applications. In the eggshell crack detection task, this structure can also be removed to simplify the model and improve training efficiency.

[0080] To improve the model's ability to detect eggshell cracks at different scales, a training dataset containing multi-scale crack images can be constructed. This can be achieved by scaling and cropping the original images to generate crack images with different scales and resolutions. During training, the model is configured to accept multi-scale input. This means that in each iteration, the model receives images of different scales as input and performs crack detection on them. This helps the model learn the characteristics of cracks at different scales, thereby improving its ability to detect multi-scale cracks. For multi-scale detection tasks, the loss function needs to be adjusted to better reflect the detection difficulty and importance of cracks at different scales. Simultaneously, training strategies, such as learning rate, batch size, and number of iterations, can be adjusted to ensure the model can learn effectively on the multi-scale training dataset. During training, the model's performance can be monitored periodically, including metrics such as accuracy, recall, and F1 score. Furthermore, the model's performance needs to be evaluated on the validation set to ensure it maintains good generalization ability on unseen data.

[0081] S204: Acquire the view image data of the target egg with the crack to be detected, and determine the crack detection result of the target egg based on the eggshell crack detection target model.

[0082] Specifically, a pre-trained eggshell crack detection target model can be loaded using a deep learning framework. Then, pre-processed image data of the target egg with the cracks to be detected is input into the model, which then outputs the detection results. The eggshell crack detection target model performs feature extraction and crack detection on the input image and outputs the detection results. The detection results may include feature information such as the location, size, and shape of the crack, as well as a confidence score indicating the presence or absence of a crack.

[0083] Furthermore, based on the output of the eggshell crack detection target model, the characteristic information of the crack, such as its location, size, and shape, can be analyzed. Combined with the confidence score, it can be determined whether the egg has a crack. The detection results are recorded on a computer or storage device for subsequent retrieval and analysis. Information such as the egg's serial number, detection time, and crack characteristics can also be recorded. Based on the detection results, corresponding measures or decisions can be taken. For example, if a crack is detected, the egg can be marked as defective and processed accordingly.

[0084] By taking the above steps, acquiring visual image data of the target egg with cracks to be detected, and determining the crack detection results based on the eggshell crack detection target model, we can improve the efficiency of egg quality inspection and reduce the error rate and cost of manual inspection.

[0085] Another embodiment of this application provides a non-destructive image recognition system for eggshell cracks, such as... Figure 3The diagram shows a structural schematic of a non-destructive image recognition system for eggshell cracks. The system includes:

[0086] Module 301 is used to obtain the eggshell crack dataset;

[0087] The generation module 302 is used to generate eggshell crack feature maps and eggshell crack location maps based on the eggshell crack dataset;

[0088] The construction module 303 is used to construct an initial model for eggshell crack detection, and to train the initial model for eggshell crack detection based on the eggshell crack feature map and the eggshell crack location map, so as to obtain a trained target model for eggshell crack detection.

[0089] The determination module 304 is used to acquire view image data of the target egg with cracks to be detected, and determine the crack detection result of the target egg based on the eggshell crack detection target model.

[0090] The obtaining module 301 specifically includes:

[0091] The first obtaining unit is used to obtain difference images by comparing and analyzing several groups of cracked egg images with uncracked egg images;

[0092] The segmentation unit is used to segment a difference image into multiple difference sub-images based on a dynamic programming-based image segmentation model.

[0093] The second unit is used to find the crack path in each difference subgraph to obtain the eggshell crack dataset.

[0094] Compared with existing technologies, this invention first obtains a dataset of eggshell cracks; then, based on the eggshell crack dataset, it generates eggshell crack feature maps and eggshell crack location maps; it constructs an initial model for eggshell crack detection, and trains the initial model based on the eggshell crack feature maps and eggshell crack location maps to obtain a trained target model for eggshell crack detection; finally, it acquires view image data of the target egg with the cracks to be detected, and determines the crack detection result of the target egg based on the eggshell crack detection target model. By constructing and training the eggshell crack detection target model, it can accurately identify and locate cracks on eggshells. Compared with traditional manual inspection methods, this method not only significantly improves the accuracy of detection but also significantly enhances the efficiency, providing strong support for egg quality inspection and food safety assurance.

[0095] This invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0096] Specifically, the aforementioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the aforementioned processor, and the input / output device is connected to the aforementioned processor.

[0097] Specifically, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0098] S201: Obtain the eggshell crack dataset;

[0099] S202: Based on the eggshell crack dataset, generate eggshell crack feature map and eggshell crack location map;

[0100] S203: Construct an initial model for eggshell crack detection, and train the initial model based on the eggshell crack feature map and the eggshell crack location map to obtain a trained target model for eggshell crack detection.

[0101] S204: Acquire the view image data of the target egg with the crack to be detected, and determine the crack detection result of the target egg based on the eggshell crack detection target model.

[0102] Compared with existing technologies, this invention first obtains a dataset of eggshell cracks; then, based on the eggshell crack dataset, it generates eggshell crack feature maps and eggshell crack location maps; it constructs an initial model for eggshell crack detection, and trains the initial model based on the eggshell crack feature maps and eggshell crack location maps to obtain a trained target model for eggshell crack detection; finally, it acquires view image data of the target egg with the cracks to be detected, and determines the crack detection result of the target egg based on the eggshell crack detection target model. By constructing and training the eggshell crack detection target model, it can accurately identify and locate cracks on eggshells. Compared with traditional manual inspection methods, this method not only significantly improves the accuracy of detection but also significantly enhances the efficiency, providing strong support for egg quality inspection and food safety assurance.

[0103] This invention also provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.

[0104] Specifically, in this embodiment, the storage medium can be configured to store a computer program for performing the following steps:

[0105] S201: Obtain the eggshell crack dataset;

[0106] S202: Based on the eggshell crack dataset, generate eggshell crack feature map and eggshell crack location map;

[0107] S203: Construct an initial model for eggshell crack detection, and train the initial model based on the eggshell crack feature map and the eggshell crack location map to obtain a trained target model for eggshell crack detection.

[0108] S204: Acquire the view image data of the target egg with the crack to be detected, and determine the crack detection result of the target egg based on the eggshell crack detection target model.

[0109] Specifically, in this embodiment, the storage medium may include, but is not limited to, USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks, and other media capable of storing computer programs.

[0110] Compared with existing technologies, this invention first obtains a dataset of eggshell cracks; then, based on the eggshell crack dataset, it generates eggshell crack feature maps and eggshell crack location maps; it constructs an initial model for eggshell crack detection, and trains the initial model based on the eggshell crack feature maps and eggshell crack location maps to obtain a trained target model for eggshell crack detection; finally, it acquires view image data of the target egg with the cracks to be detected, and determines the crack detection result of the target egg based on the eggshell crack detection target model. By constructing and training the eggshell crack detection target model, it can accurately identify and locate cracks on eggshells. Compared with traditional manual inspection methods, this method not only significantly improves the accuracy of detection but also significantly enhances the efficiency, providing strong support for egg quality inspection and food safety assurance.

[0111] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0112] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0113] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.

[0114] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0115] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0116] If the aforementioned integrated units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0117] The embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A non-destructive image recognition method for cracks in eggshells of chicken eggs, characterized in that, The method comprises: obtaining an eggshell crack data set; wherein obtaining the eggshell crack data set comprises obtaining a difference image by comparative analysis of a plurality of groups of cracked egg images and uncracked egg images, cutting the difference image into a plurality of difference sub-images based on a dynamic programming-based image cutting model, and obtaining the eggshell crack data set by performing crack path searching on each difference sub-image; wherein the dynamic programming-based image cutting model cuts the difference image into a plurality of difference sub-images, comprising: inputting the difference image into the dynamic programming-based image cutting model, and outputting the cut difference sub-images; wherein the image cutting model is trained based on a dynamic programming algorithm, and the image cutting model comprises an image difference recognition module, a crack extraction module, and an image cutting module; the image difference recognition module is used to recognize and process the difference regions in the input difference image; the crack extraction module is used to identify the egg crack features in the difference regions by using a deep recognition algorithm; the image cutting module is used to find an optimal cutting path based on a dynamic programming algorithm to generate a difference sub-image; and the optimal cutting path is determined based on the continuity, shape and size of the egg crack features; based on the eggshell crack data set, generating an eggshell crack feature map and an eggshell crack positioning map; constructing an eggshell crack detection initial model, and training the eggshell crack detection initial model according to the eggshell crack feature map and the eggshell crack positioning map to obtain a trained eggshell crack detection target model; obtaining a view image data of a target egg to be detected for crack condition, and determining a crack detection result of the target egg to be detected according to the eggshell crack detection target model.

2. The method of claim 1, wherein, The method comprises: performing crack block segmentation on the eggshell crack data set to obtain a target crack region image; performing median filtering and linear sharpening processing on the target crack region image according to the gray value corresponding to the pixel points in the target crack region image to determine an eggshell crack feature map; using a crack edge detection technology to position the cracks of the target crack region image, and using a Freeman chain code to segment and encode the crack curve to determine an eggshell crack positioning map.

3. The method of claim 2, wherein, The method comprises: performing Gaussian blur processing on each target crack segmentation region in the eggshell crack data set to obtain an initial crack region set; determining an enhancement coefficient corresponding to the target crack segmentation region, and enhancing each initial crack region to generate a target crack region image.

4. The method of claim 3, wherein, The eggshell crack detection initial model uses an EfficientDet detection network as an initial model for eggshell crack detection, replaces the backbone network with a lightweight network MobileNetV3, and removes the compound expansion convolution layer structure to implement a training strategy for a multi-scale eggshell crack detection initial model.

5. A non-destructive image recognition system for cracks in eggshells of chicken eggs, characterized in that The system comprises: The obtaining module is configured to obtain an eggshell crack dataset; wherein the obtaining of the eggshell crack dataset comprises: obtaining difference images by comparative analysis of a plurality of groups of egg images with cracks and egg images without cracks, cutting the difference images into a plurality of difference sub-images based on a dynamic programming-based image cutting model, and obtaining the eggshell crack dataset by crack path searching on each difference sub-image; wherein the cutting of the difference images into the plurality of difference sub-images based on the dynamic programming-based image cutting model comprises: inputting the difference images into the dynamic programming-based image cutting model, and outputting the plurality of cut difference sub-images; wherein the image cutting model is trained based on a dynamic programming algorithm, and the image cutting model comprises an image difference recognition module, a crack extraction module, and an image cutting module; the image difference recognition module is configured to recognize and process difference regions in the input difference images; the crack extraction module is configured to identify egg crack features in the difference regions by using a deep recognition algorithm; and the image cutting module is configured to find an optimal cutting path based on a dynamic programming algorithm to generate difference sub-images; and the optimal cutting path is determined based on continuity, shape, and size of the egg crack features; The generating module is configured to generate an eggshell crack feature map and an eggshell crack positioning map based on the eggshell crack dataset; The constructing module is configured to construct an eggshell crack detection initial model, and train the eggshell crack detection initial model according to the eggshell crack feature map and the eggshell crack positioning map, to obtain a trained eggshell crack detection target model; The determining module is configured to acquire view image data of a target egg to be detected in a crack condition, and determine a crack detection result of the target egg to be detected according to the eggshell crack detection target model.

6. An electronic device comprising a memory and a processor, characterized in that The memory stores a computer program, and the processor is configured to run the computer program to execute the method in any one of claims 1 to 4.

7. A storage medium, characterized by The storage medium stores a computer program, and the computer program is configured to execute the method in any one of claims 1 to 4 when running.

Citation Information

Patent Citations

  • Egg stain detection method and system based on deep learning

    CN114898148A

  • Road crack detection method based on deep learning

    CN116824347A