Lossless image recognition method and system for eggshell cracks

By constructing and training the eggshell crack detection target model, using the eggshell crack data set to generate feature maps and positioning maps, the subjectivity and accuracy of eggshell crack detection in traditional detection methods are solved, and efficient and accurate non-destructive detection is achieved.

CN119540145AActive Publication Date: 2025-02-28INST OF ANIMAL HUSBANDRY & VETERINARY MEDICINE ANHUI ACAD OF AGRI SCI

Patent Information

Application Number
CN202411477382.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-02-28
Estimated Expiration
2044-10-22

AI Technical Summary

Technical Problem

In the prior art, egg shell crack detection has problems such as strong subjectivity and low accuracy, and traditional detection methods cause damage to eggs, making non-destructive testing impossible.

Method used

By constructing and training the target model of eggshell crack detection, the eggshell crack data set is used to generate feature maps and positioning maps to accurately identify and locate cracks on eggshell shells.

Benefits of technology

It significantly improves the accuracy and efficiency of the detection, realizes non-destructive egg shell crack detection, providing strong support for egg quality inspection and food safety guarantee.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540145A_ABST
    Figure CN119540145A_ABST
Patent Text Reader

Abstract

The invention discloses a lossless image recognition method and system for eggshell cracks. The method comprises the following steps: firstly, obtaining an eggshell crack data set; 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; and finally, obtaining view image data of the target egg of which the crack condition is to be detected, and determining a crack detection result of the target egg to be detected according to the eggshell crack detection target model. According to the method, the eggshell crack detection target model is constructed and trained, so that cracks on the eggshell can be accurately identified and positioned. According to the method, the detection accuracy is greatly improved, the detection efficiency is remarkably improved, and powerful support is provided for egg quality detection and food safety guarantee.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image recognition, and in particular to a method and system for non-destructive image recognition of egg shell cracks. Background Art

[0002] As an important part of our daily diet, the quality and safety of eggs have attracted much attention. During the production, transportation and storage of eggs, cracks may appear on the eggshells due to various reasons, which not only affects the appearance of the eggs, but more importantly, may lead to bacterial invasion, thus affecting the safety of eggs. Therefore, it is of great significance to achieve non-destructive, rapid and accurate detection of cracks in eggshells.

[0003] Traditional methods for detecting eggshell cracks mainly include manual visual inspection and tapping inspection. Manual visual inspection relies on the experience and subjective judgment of the inspectors, which is not only inefficient but also easily affected by human factors, resulting in inaccurate test results. Tapping inspection is to judge whether the eggshell is intact by tapping the egg and listening to the sound. Although this method is easy to operate, it also has the problems of strong subjectivity and low accuracy, and will cause certain damage to the eggs. Therefore, how to perform non-destructive eggshell crack detection has become an urgent problem to be solved. Summary of the invention

[0004] The purpose of the present invention is to provide a non-destructive image recognition method and system for egg shell cracks to solve the deficiencies in the prior art. By constructing and training an egg shell crack detection target model, the method can accurately identify and locate cracks on egg shells. Compared with traditional manual detection methods, this method not only greatly improves the accuracy of detection, but also significantly improves the detection efficiency, providing strong support for egg quality detection and food safety assurance.

[0005] An embodiment of the present application provides a non-destructive image recognition method for egg shell cracks, the method comprising:

[0006] Obtain eggshell crack data set;

[0007] Based on the egg shell crack data set, generate the egg shell crack feature map and egg shell crack location map;

[0008] Constructing an initial model for eggshell crack detection, and training the initial model for eggshell crack detection according to an eggshell crack feature map and an eggshell crack location map to obtain a trained target model for eggshell crack detection;

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

[0010] Optionally, obtaining the egg shell crack data set includes:

[0011] The difference images are obtained by comparing and analyzing several groups of images of cracked eggs and images of crack-free eggs;

[0012] The image segmentation model based on dynamic programming is used to segment the difference image into multiple difference sub-images;

[0013] The crack path search is performed on each difference subgraph to obtain the eggshell crack dataset.

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

[0015] The difference image is input into an image cutting model based on dynamic programming, and a plurality of difference sub-graphs after cutting are output; wherein the image cutting model is obtained by training 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 area in the input difference image; the crack extraction module is used to recognize the egg crack features in the difference area by using a depth recognition algorithm; the image cutting module is used to find the optimal cutting path based on a dynamic programming algorithm to generate a difference sub-graph; the optimal cutting path is determined based on the continuity, shape and size of the egg crack features.

[0016] Optionally, generating an egg shell crack feature map and an egg shell crack location map based on an egg shell crack data set includes:

[0017] Perform crack block segmentation on the egg shell crack dataset to obtain the target crack area image;

[0018] According to the grayscale 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 egg shell crack feature map;

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

[0020] Optionally, the performing of segmenting crack blocks in the egg shell crack data set to obtain a target crack region image includes:

[0021] Gaussian blur processing is performed on each target crack segmentation region in the eggshell crack dataset to obtain an initial crack region set;

[0022] 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.

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

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

[0025] An acquisition module is used to obtain an egg shell crack data set;

[0026] A generation module, used for generating an egg shell crack feature map and an egg shell crack location map based on an egg shell crack data set;

[0027] A construction module is used to construct an initial model for eggshell crack detection, and train the initial model for eggshell crack detection according to an eggshell crack feature map and an eggshell crack location map to obtain a trained target model for eggshell crack detection;

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

[0029] Optionally, the obtaining module includes:

[0030] A first obtaining unit is used to obtain a difference image by comparing and analyzing a plurality of groups of cracked egg images and non-cracked egg images;

[0031] A segmentation unit, used for segmenting the difference image into a plurality of difference sub-images based on a dynamic programming image segmentation model;

[0032] The second obtaining unit is used to perform crack path search on each difference subgraph to obtain the egg shell crack data set.

[0033] Yet another embodiment of the present 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 execute the method described above.

[0034] Yet another embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program is configured to execute the above-mentioned method when running.

[0035] Compared with the prior art, the present invention first obtains an egg shell crack data set; then, based on the egg shell crack data set, generates an egg shell crack feature map and an egg shell crack location map; constructs an initial model for egg shell crack detection, and trains the initial model for egg shell crack detection according to the egg shell crack feature map and the egg shell crack location map to obtain a trained egg shell crack detection target model; finally, obtains the view image data of the target egg to be detected for cracks, and determines the crack detection result of the target egg to be detected according to the egg shell crack detection target model. It can accurately identify and locate cracks on egg shells by constructing and training the egg shell crack detection target model. Compared with traditional manual detection methods, this method not only greatly improves the detection accuracy, but also significantly improves the detection efficiency, providing strong support for egg quality detection and food safety assurance. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A hardware structure block diagram of a computer terminal for a method for lossless image recognition of egg shell cracks provided by an embodiment of the present invention;

[0037] Figure 2 A schematic flow chart of a method for lossless image recognition of egg shell cracks provided by an embodiment of the present invention;

[0038] Figure 3 A schematic structural diagram of a lossless image recognition system for egg shell cracks provided in an embodiment of the present invention. DETAILED DESCRIPTION

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

[0040] An embodiment of the present invention provides a method for lossless image recognition of cracks in egg shells. The method can be applied to electronic devices, such as computer terminals, specifically ordinary computers, tablets, etc.

[0041] The following describes it in detail by taking running on a computer terminal as an example. Figure 1 The hardware structure block diagram of a computer terminal for a method for lossless image recognition of egg shell cracks provided by an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the computer terminal may also include a transmission device 106 for communication functions and an input and output device 108. It can be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0042] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the lossless image recognition method of egg shell cracks in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0043] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0044] See also Figure 2 , Figure 2 A schematic flow chart of a method for lossless image recognition of egg shell cracks provided by an embodiment of the present invention may include the following steps:

[0045] S201: Obtain an eggshell crack dataset.

[0046] Specifically, the egg shell crack dataset can be searched for existing egg shell crack datasets on relevant scientific research platforms or data sharing websites, or by collecting egg shell images of different sources and different crack degrees, and annotating and preprocessing them to form a preset dataset.

[0047] For example, the preset data set can be obtained by using a high-resolution camera or webcam to capture images of eggshells, ensuring that the images contain clear crack features while avoiding the effects of light, shadows and other factors on image quality. The collected images are then annotated to clearly indicate the location and range of the cracks. Furthermore, the collected images can be preprocessed, including denoising, contrast enhancement, and resizing, which helps improve image quality and makes it easier for subsequent detection models to identify crack features.

[0048] In an optional embodiment, obtaining the egg shell crack data set may include:

[0049] 1. Obtain difference images by comparing and analyzing several groups of cracked egg images and non-cracked egg images;

[0050] 2. The image segmentation model based on dynamic programming is used to segment the difference image into multiple difference sub-images;

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

[0052] Specifically, a large number of cracked egg images and crack-free egg images are first collected as the original data set. Then, image processing technology is used to compare and analyze several groups of cracked egg images and crack-free egg images. By comparing the pixel differences between the two, difference images can be obtained. These difference images will highlight the difference between the cracked area and the intact area. In the difference images, the cracked area usually shows obvious changes in pixel values, and these changes can be used to extract crack features, providing a basis for subsequent processing.

[0053] In order to locate and segment the crack area more accurately, an image cutting model based on dynamic programming can be used. This model can use the continuity and shape characteristics of the crack to find the optimal cutting path in the difference image. The difference image is input into the image cutting model. The model will calculate the optimal cutting path according to the dynamic programming algorithm and divide the difference image into multiple difference sub-graphs. Each difference sub-graph may contain a part of the crack area or a complete crack. In each difference sub-graph, the crack path can be further identified. For example, this can be achieved through image processing techniques such as edge detection and morphological processing. By identifying the edge contour and shape characteristics of the crack, the specific location and range of the crack can be determined. Finally, the identified crack path is associated with the corresponding difference sub-graph to form a complete egg shell crack data set. This data set will contain multiple images with crack annotations, and the crack path in each image has been accurately identified and located. After the data set is constructed, it can also be quality evaluated and optimized. This includes checking the accuracy and completeness of the crack annotations and the diversity of the data set. By continuously optimizing the data set, the training effect and generalization ability of the model can be improved.

[0054] The image segmentation model based on dynamic programming segments the difference image into a plurality of difference sub-images, which may include:

[0055] The difference image is input into an image cutting model based on dynamic programming, and a plurality of difference sub-graphs after cutting are output; wherein the image cutting model is obtained by training 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 area in the input difference image; the crack extraction module is used to recognize the egg crack features in the difference area by using a depth recognition algorithm; the image cutting module is used to find the optimal cutting path based on a dynamic programming algorithm to generate a difference sub-graph; the optimal cutting path is determined based on the continuity, shape and size of the egg crack features.

[0056] Specifically, the above image segmentation model is carefully trained based on the dynamic programming algorithm, which aims to efficiently and accurately process the difference image and segment it into multiple difference sub-images containing specific information. The model consists of three core modules: image difference recognition module, crack extraction module and 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 areas in the image, which usually represent cracks or other significant changes on the eggshell. Through advanced image processing techniques such as pixel-level comparison and color space conversion, the module can accurately identify the difference areas in the image and provide key information for subsequent processing.

[0058] The crack extraction module is used to further analyze the areas of difference using a deep recognition algorithm after identifying them, so as to accurately extract the crack features of the egg, which may include the shape, length, width, and direction of the crack. For example, a deep learning model is used for training to learn and identify 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, and stimulates important spatial features by compressing the channel features of the difference region map, thereby improving the learning ability of the image segmentation model for egg crack feature extraction. For example, the input difference region map U = [u 1,1 ,u 2,2 ,...,u i,j ,u H,W ], where u i,j Represents the channel information at the difference region map i, j. The difference region map has S channels and W weights. Sq The 2X2 convolution block is compressed, and the output channel can be 2, and the size of the crack feature map q is H×W, where q can be expressed as q=W Sq ×U, and then the crack feature map q is normalized by the sigmoid function σ(q) to obtain the importance of spatial information at each spatial position (i, j) in the feature map, for example, the value of the kth channel (i, j represent the coordinates of each parameter respectively):

[0060]

[0061] Finally, by calculating the importance of each channel σ(q k ) to enhance the learning of channel features, thereby enhancing important crack space location information.

[0062] The image cutting module is used to find the optimal cutting path based on the dynamic programming algorithm to cut the difference image into multiple difference sub-images. These sub-images will show the crack characteristics more clearly, which is convenient for subsequent analysis and processing. For example, first, a cost matrix is ​​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 cutting path. During the cutting process, the module will consider factors such as the continuity, shape and size of the crack to ensure the accuracy and rationality of the cutting result.

[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, it is necessary to ensure that the cutting path can continuously pass through the crack area to avoid dividing 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 the crack feature information. While ensuring the cutting accuracy, the cutting path should be as smooth as possible to reduce the damage to the image information.

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

[0065] S202: Based on the egg shell crack data set, generate an egg shell crack feature map and an egg shell crack location map.

[0066] Specifically, generating an egg shell crack feature map and an egg shell crack location map based on an egg shell crack data set may include:

[0067] Step 1: Perform crack block segmentation on the egg shell crack dataset to obtain the target crack area image;

[0068] Step 2: According to the grayscale 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 egg shell crack feature map;

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

[0070] Specifically, we can first select images containing cracks from the eggshell crack dataset as the processing object. Then preprocess the image, such as denoising, contrast enhancement, etc., to improve the accuracy of subsequent processing. Use image processing techniques such as threshold segmentation and region growing to segment the crack blocks in the image. The purpose of this step is to extract the target area containing cracks from the entire image and obtain the target crack area image.

[0071] Exemplarily, in the target crack area image, the egg crack can usually be expressed as a change in grayscale value. Therefore, the crack characteristics can be analyzed according to the grayscale value corresponding to the pixel point. In order to remove noise interference in the image, the target crack area image can be subjected to median filtering. Median filtering is a nonlinear filtering technology that can effectively smooth images and remove noise. Similarly, in order to enhance the clarity of the crack features, linear sharpening can also be performed on the filtered image. Linear sharpening makes the crack features more obvious by enhancing the edge information in the image. After median filtering and linear sharpening, an image containing clear crack features can be obtained, i.e., an egg shell crack feature map.

[0072] Cracks in the target crack area image are located using crack edge detection technology, such as Canny edge detection or Sobel edge detection technology. Edge detection can accurately identify edge information in the image, including the edge of the crack. Furthermore, in order to segment and encode the crack curve, the Freeman chain code method can be used. The Freeman chain code is a digital coding method that describes the shape of the curve in the image. By recording the key points on the curve and their direction information, the shape and position of the crack can be accurately described. The crack curve is divided into several segments, each of which is represented by a Freeman chain code, and then each segment is encoded, and its key points and direction information are recorded. 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 in a graphical way, such as using line segments, arrows, etc. to mark the direction and position of the crack.

[0073] In an optional implementation, the performing of crack block segmentation in the egg shell crack data set to obtain a target crack region image may include:

[0074] Gaussian blur processing is performed on each target crack segmentation area in the egg shell crack data set to obtain an initial crack area set; the enhancement coefficient corresponding to the target crack area is determined, and each initial crack area is enhanced to generate a target crack area image.

[0075] Specifically, images containing cracks are selected from the eggshell crack dataset, and the segmentation area of ​​each target crack is determined. Then, each target crack segmentation area is subjected to Gaussian blur processing. Gaussian blur is an image processing technology that achieves the effect of smoothing the image and reducing noise by weighted averaging the pixel values ​​around each pixel in the image. The purpose of this step is to reduce noise interference in the image while retaining the crack features, so as to provide a clearer image for subsequent processing.

[0076] After Gaussian blur processing, a set of images containing preliminary smooth crack areas are obtained, which constitute the initial crack area set. In order to highlight the crack features, each target crack area needs to be enhanced. Before enhancement, it is necessary to first determine the enhancement coefficient corresponding to each crack area. The enhancement coefficient can be dynamically adjusted according to factors such as the degree of crack visibility and the overall brightness of the image to ensure that the enhancement effect can highlight the crack features without causing image distortion. Using the determined enhancement coefficient, each initial crack area is enhanced. The enhancement process can use contrast enhancement, brightness adjustment and other methods to highlight the characteristic information of the crack area. After enhancement, a target crack area image containing clear crack features can be obtained. The target crack area image can serve as the basis for subsequent crack feature extraction, crack location and other processing steps.

[0077] S203: constructing an initial model for eggshell crack detection, and training the initial model for eggshell crack detection according to an eggshell crack feature map and an eggshell crack location map, so as 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, replaces the backbone network with the lightweight network MobileNetV3, and removes the composite extended convolutional layer structure to implement the training strategy of the multi-scale eggshell crack detection initial model.

[0079] Among them, EfficientDet is an excellent target detection model that combines EfficientNet as the backbone network and a series of innovative detection designs to provide efficient and accurate detection results. In order to reduce the computational complexity and memory usage of the model, the backbone network of EfficientDet is replaced from EfficientNet to MobileNetV3. MobileNetV3 is a lightweight network that uses efficient structures such as deep separable convolution and SE (Squeeze-and-Excitation) modules, which can significantly reduce the number of parameters and computational complexity of the model while maintaining high accuracy. On the basis of MobileNetV3, the compound scaling convolution layer (Compound ScalingLayers) structure can be further removed. The compound scaling convolution layer is a structure introduced by the MobileNet series network to improve model performance, but it may increase the complexity and computational complexity of the model in some application scenarios. In the eggshell crack detection task, in order to simplify the model and improve training efficiency, this structure can also be removed.

[0080] In order to improve the model's ability to detect eggshell cracks of different scales, a training dataset containing multi-scale crack images can also be constructed. This can be achieved by scaling and cropping the original image to generate crack images with different scales and resolutions. During the training process, the model is set to accept multi-scale input. This means that in each iteration, the model will receive images of different scales as input and perform crack detection on them, which 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 may need to be adjusted to better reflect the difficulty and importance of detecting cracks of different scales. At the same time, the training strategy, such as learning rate, batch size, number of iterations, etc., can also be adjusted to ensure that the model can effectively learn on the multi-scale training dataset. During the training process, the performance of the model can be monitored regularly, including indicators such as accuracy, recall, and F1 score. At the same time, the performance of the model needs to be evaluated on the validation set to ensure that it can maintain good generalization ability on unseen data.

[0081] S204: Obtaining view image data of a target egg to be detected for cracks, and determining a crack detection result of the target egg to be detected based on an eggshell crack detection target model.

[0082] Specifically, you can use a deep learning framework to load a trained eggshell crack detection target model, then input the preprocessed view image data of the target egg to be detected for cracks into the model, and wait for the model to output the detection results. The eggshell crack detection target model will perform feature extraction and crack detection on the input image and output the detection results. The detection results may include feature information such as the location, size, shape, and a confidence score indicating whether there is a crack.

[0083] Furthermore, the characteristic information of the cracks, such as the position, size and shape, can be analyzed based on the output results of the eggshell crack detection target model. Combined with the confidence score, it is determined whether the egg has cracks. The test results are recorded on a computer or storage device for subsequent query and analysis. The egg number, test time, crack characteristics and other information can also be recorded. According to the test results, appropriate measures or decisions are taken. For example, if a crack is detected, the egg can be marked as a defective product and processed accordingly.

[0084] Through the above steps, by obtaining the view image data of the target egg to be detected for cracks and determining the crack detection result based on the eggshell crack detection target model, it can help improve the efficiency of egg quality inspection and reduce the error rate and cost of manual inspection.

[0085] Another embodiment of the present application provides a non-destructive image recognition system for egg shell cracks, such as Figure 3The structure diagram of a lossless image recognition system for egg shell cracks is shown, and the system comprises:

[0086] An acquisition module 301 is used to obtain an egg shell crack data set;

[0087] A generating module 302 is used to generate an egg shell crack feature map and an egg shell crack location map based on an egg shell crack data set;

[0088] A construction module 303 is used to construct an initial model for eggshell crack detection, and train the initial model for eggshell crack detection according to an eggshell crack feature map and an eggshell crack location map to obtain a trained target model for eggshell crack detection;

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

[0090] The obtaining module 301 specifically includes:

[0091] A first obtaining unit is used to obtain a difference image by comparing and analyzing a plurality of groups of cracked egg images and non-cracked egg images;

[0092] A segmentation unit, used for segmenting the difference image into a plurality of difference sub-images based on a dynamic programming image segmentation model;

[0093] The second obtaining unit is used to perform crack path search on each difference subgraph to obtain the egg shell crack data set.

[0094] Compared with the prior art, the present invention first obtains an egg shell crack data set; then, based on the egg shell crack data set, generates an egg shell crack feature map and an egg shell crack location map; constructs an initial model for egg shell crack detection, and trains the initial model for egg shell crack detection according to the egg shell crack feature map and the egg shell crack location map to obtain a trained egg shell crack detection target model; finally, obtains the view image data of the target egg to be detected for cracks, and determines the crack detection result of the target egg to be detected according to the egg shell crack detection target model. It can accurately identify and locate cracks on egg shells by constructing and training the egg shell crack detection target model. Compared with traditional manual detection methods, this method not only greatly improves the detection accuracy, but also significantly improves the detection efficiency, providing strong support for egg quality detection and food safety assurance.

[0095] An embodiment of the present invention further 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 execute the steps in any one of the above method embodiments.

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

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

[0098] S201: Obtain eggshell crack data set;

[0099] S202: Based on the egg shell crack data set, generate an egg shell crack feature map and an egg shell crack location map;

[0100] S203: constructing an initial model for eggshell crack detection, and training the initial model for eggshell crack detection according to an eggshell crack feature map and an eggshell crack location map, so as to obtain a trained target model for eggshell crack detection;

[0101] S204: Obtaining view image data of a target egg to be detected for cracks, and determining a crack detection result of the target egg to be detected based on an eggshell crack detection target model.

[0102] Compared with the prior art, the present invention first obtains an egg shell crack data set; then, based on the egg shell crack data set, generates an egg shell crack feature map and an egg shell crack location map; constructs an initial model for egg shell crack detection, and trains the initial model for egg shell crack detection according to the egg shell crack feature map and the egg shell crack location map to obtain a trained egg shell crack detection target model; finally, obtains the view image data of the target egg to be detected for cracks, and determines the crack detection result of the target egg to be detected according to the egg shell crack detection target model. It can accurately identify and locate cracks on egg shells by constructing and training the egg shell crack detection target model. Compared with traditional manual detection methods, this method not only greatly improves the detection accuracy, but also significantly improves the detection efficiency, providing strong support for egg quality detection and food safety assurance.

[0103] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

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

[0105] S201: Obtain eggshell crack data set;

[0106] S202: Based on the egg shell crack data set, generate an egg shell crack feature map and an egg shell crack location map;

[0107] S203: constructing an initial model for eggshell crack detection, and training the initial model for eggshell crack detection according to an eggshell crack feature map and an eggshell crack location map, so as to obtain a trained target model for eggshell crack detection;

[0108] S204: Obtaining view image data of a target egg to be detected for cracks, and determining a crack detection result of the target egg to be detected based on an eggshell crack detection target model.

[0109] Specifically, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0110] Compared with the prior art, the present invention first obtains an egg shell crack data set; then, based on the egg shell crack data set, generates an egg shell crack feature map and an egg shell crack location map; constructs an initial model for egg shell crack detection, and trains the initial model for egg shell crack detection according to the egg shell crack feature map and the egg shell crack location map to obtain a trained egg shell crack detection target model; finally, obtains the view image data of the target egg to be detected for cracks, and determines the crack detection result of the target egg to be detected according to the egg shell crack detection target model. It can accurately identify and locate cracks on egg shells by constructing and training the egg shell crack detection target model. Compared with traditional manual detection methods, this method not only greatly improves the detection accuracy, but also significantly improves the detection efficiency, providing strong support for egg quality detection and food safety assurance.

[0111] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0112] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0113] In the several embodiments provided by the present invention, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

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

[0115] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0116] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present 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, and the computer software product is stored in a memory, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present invention. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0117] The embodiments of the present invention are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A non-destructive image recognition method for egg shell cracks, characterized in that: The method comprises: Obtain eggshell crack data set; Based on the egg shell crack data set, generate the egg shell crack feature map and egg shell crack location map; Constructing an initial model for eggshell crack detection, and training the initial model for eggshell crack detection according to an eggshell crack feature map and an eggshell crack location map to obtain a trained target model for eggshell crack detection; Obtain view image data of a target egg to be detected for cracks, and determine a crack detection result of the target egg to be detected based on an eggshell crack detection target model.

2. The method according to claim 1, characterized in that The step of obtaining an egg shell crack data set comprises: The difference images are obtained by comparing and analyzing several groups of images of cracked eggs and images of crack-free eggs; The image cutting model based on dynamic programming cuts the difference image into multiple difference sub-images; The crack path search is performed on each difference subgraph to obtain the eggshell crack dataset.

3. The method according to claim 2, characterized in that The image segmentation model based on dynamic programming segments the difference image into a plurality of difference sub-images, including: The difference image is input into an image cutting model based on dynamic programming, and a plurality of difference sub-graphs after cutting are output; wherein the image cutting model is obtained by training 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 area in the input difference image; the crack extraction module is used to recognize the egg crack features in the difference area by using a depth recognition algorithm; the image cutting module is used to find the optimal cutting path based on a dynamic programming algorithm to generate a difference sub-graph; the optimal cutting path is determined based on the continuity, shape and size of the egg crack features.

4. The method according to claim 3, characterized in that The method of generating an egg shell crack feature map and an egg shell crack location map based on an egg shell crack data set includes: Perform crack block segmentation on the egg shell crack dataset to obtain the target crack area image; According to the grayscale 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 egg shell crack feature map; The crack edge detection technology is used to locate the cracks in the target crack region image, and the Freeman chain code is used to segment and encode the crack curve to determine the eggshell crack location map.

5. The method according to claim 4, characterized in that The execution of the crack block segmentation in the egg shell crack data set to obtain the target crack area image includes: Gaussian blur processing is performed on 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.

6. The method according to claim 5, characterized in that The eggshell crack detection initial model adopts the EfficientDet detection network as the initial model for eggshell crack detection, replaces the backbone network with the lightweight network MobileNetV3, and removes the composite extended convolutional layer structure to implement the training strategy of the multi-scale eggshell crack detection initial model.

7. A non-destructive image recognition system for egg shell cracks, characterized in that: The system comprises: An acquisition module is used to obtain an egg shell crack data set; A generation module, used for generating an egg shell crack feature map and an egg shell crack location map based on an egg shell crack data set; A construction module is used to construct an initial model for eggshell crack detection, and train the initial model for eggshell crack detection according to an eggshell crack feature map and an eggshell crack location map to obtain a trained target model for eggshell crack detection; The determination module is used to obtain the view image data of the target egg to be detected for cracks, and determine the crack detection result of the target egg to be detected based on the eggshell crack detection target model.

8. The system according to claim 7, characterized in that The obtaining module comprises: A first obtaining unit is used to obtain a difference image by comparing and analyzing a plurality of groups of cracked egg images and non-cracked egg images; A segmentation unit, used for segmenting the difference image into a plurality of difference sub-images based on a dynamic programming image segmentation model; The second obtaining unit is used to perform crack path search on each difference subgraph to obtain the egg shell crack data set.

9. An electronic device, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.

10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 6 when executed.

Citation Information

Patent Citations

  • Egg stain detection method and system based on deep learning

    CN114898148A

  • Road crack detection method based on deep learning

    CN116824347A

  • Duck egg quality nondestructive automatic detection method

    CN117350942A

  • Egg microcrack detection method, system and device based on multi-modal fusion and medium

    CN117635583A

  • Image processor in automatic egg inspection method by image processing

    JP2008020223A

Cited By

  • Egg surface crack identification method and system based on machine vision

    CN122223459A

  • A Machine Vision-Based Method and System for Recognizing Cracks on Egg Surface

    CN122223459B