A method for detecting and grading egg-yolk ratio based on computer vision

Through computer vision-based poultry egg yolk ratio detection and grading devices and methods, combined with multiple sensor data and time series information, the problem of low detection efficiency of poultry egg yolk ratio in the existing technology is solved, and efficient and accurate egg yolk ratio prediction and Grading improves the utilization efficiency and economic benefits of eggs.

CN118566229BActive Publication Date: 2024-10-22SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411037695.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-10-22
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

In the existing technology, the detection efficiency of the yolk ratio of poultry eggs is low and single characteristic data cannot be measured accurately, and there is a lack of efficient and non-destructive screening methods.

Method used

Using computer vision-based egg yolk ratio detection and grading devices and methods, combined with a variety of sensor data and time series information, through data collection, preprocessing, image feature extraction, spectral feature analysis and feature fusion, the least squares support vector machine model is used Regression prediction of egg yolk proportion is carried out, and different levels of poultry eggs are collected through grading units.

Benefits of technology

It achieves efficient and low-cost egg data collection and sorting, improves the accuracy of egg yolk proportion prediction, improves egg utilization efficiency and economic benefits, and reduces labor costs and equipment operation complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118566229B_ABST
    Figure CN118566229B_ABST
Patent Text Reader

Abstract

The present invention discloses a poultry egg yolk ratio detection and grading device and grading method based on computer vision, which belongs to the field of poultry egg processing technology, and solves the technical problems that the detection efficiency of the yolk ratio of some poultry eggs in the prior art is low and the single feature data cannot effectively and accurately realize the determination of the yolk ratio of poultry eggs. It includes a poultry egg input unit, a poultry egg transmission unit, a poultry egg data collection unit, a poultry egg control unit and a poultry egg grading unit; combined with the poultry egg yolk ratio detection and grading method provided by the present invention, it can effectively extract image features and spectral features, and perform feature standardization and fusion, and use different types of data to improve the accuracy of poultry egg yolk ratio prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of poultry egg processing, and in particular to a poultry egg yolk ratio detection and grading method based on computer vision. Background Art

[0002] In the field of poultry breeding, egg yolks are widely considered to be the main source of energy for the development of poultry embryos. The rich fat, protein, vitamins, minerals and other nutrients provide key support for embryonic cell division, tissue growth and organ development, ensuring the healthy and orderly growth and development of the embryo. Studies have found that among eggs of similar size, eggs with a higher yolk ratio usually have a higher chick yield, that is, the ratio of chick weight to egg weight is higher, and chicks with higher chick yields usually show stronger growth performance. At the same time, some studies have pointed out that the yolk ratio is strongly positively correlated with the dry matter content in eggs, and the yolk ratio can be used as an indicator for laying hen breeding. Therefore, improving the yolk ratio is of great significance for poultry breed improvement and breeding.

[0003] In food nutrition, egg yolk contains a variety of vitamins, trace elements, lecithin, choline and α -Essential fatty acid components such as linolenic acid. The lecithin in the egg yolk can promote the regeneration of liver cells and enhance the body's metabolism and immune function; essential fatty acid components, which cannot be synthesized by the human body and must be obtained from the diet, can maintain brain health and reduce the risk of chronic inflammation. A high yolk ratio in poultry eggs indicates a higher nutritional level. For special groups such as children and pregnant women, more nutrients need to be consumed to meet the needs of growth, development and fetal development. Eggs with a high yolk ratio help ensure that they get comprehensive nutritional support during this critical stage. However, egg yolks also contain high cholesterol, and excessive intake may increase the risk of cardiovascular disease. For patients with high cholesterol or coronary heart disease, consuming too much cholesterol may aggravate the condition and is not good for health. Eggs with a low yolk ratio are suitable for those who need to limit cholesterol intake. Therefore, testing and grading poultry eggs with different yolk content levels allows consumers to make targeted choices based on their own nutritional needs.

[0004] In the processing industry, egg yolk is the main raw material for condiments such as mayonnaise and egg yolk powder. Selecting poultry eggs with a high yolk ratio as raw materials can help improve the utilization efficiency and production capacity of poultry eggs, thereby increasing the output value of the egg product processing industry and bringing higher economic benefits to production companies. At the same time, in the salted duck egg processing industry, egg yolk is the main source of flavor for salted duck eggs, so the size of the egg yolk ratio directly affects the taste and mouthfeel of salted duck eggs. A larger proportion of egg yolk usually makes salted duck eggs more salty and rich in flavor. Manufacturers can choose poultry eggs with different egg yolk ratios for processing according to market demand and consumer tastes to meet different taste preferences.

[0005] At present, there are few studies on the detection of the yolk ratio in poultry eggs and there are some problems. For example, the research with the publication number CN116519641A establishes a light transmission model of different colors and varieties of eggs according to tissue transmittance, and obtains the light intensity of different band spectra reaching the internal materials of the eggs through the light transmission model, and then uses image processing to map the yolk morphology. However, the image information obtained by this method can only judge the proportion of yolk area pixels in the whole egg area pixels in a two-dimensional plane, and it is impossible to effectively estimate the proportion of yolk in the whole poultry egg. At the same time, the modeling of this method only relies on theoretical formulas, and the feature information is not rich enough, lacking good generalization ability. The research with the publication number CN113984692A uses a quality index prediction model established by egg spectrometer information to output quality index values ​​such as ovalbumin content, egg mucin content, Haff value, pH value and yolk index. This method can predict the component content of some substances in the egg through spectral data regression, but only relies on spectral curve information to realize the prediction of the content of some substances, and the final fitting effect is general. At the same time, for detecting the yolk ratio, there is still a lack of more obvious spatial features to achieve a higher accuracy prediction.

[0006] Other researchers have used CT (computed tomography) to measure the yolk ratio of breeding eggs in vivo. By analyzing and extracting the obtained egg images, the boundaries between the eggshell and the egg white, the boundaries between the egg white and the yolk, and the volume of the yolk and its ratio to the volume of the whole egg are calculated. This method requires a relatively high radiation dose to withstand the blocking effect of the eggshell on X-rays, so as to obtain a clear image. The imaging speed is slow, and most importantly, it will introduce contamination and change the quality of food.

[0007] Therefore, efficient and lossless screening of eggs with different yolk ratios is of great significance to the fields of poultry breeding, food nutrition and egg product processing industries. Summary of the invention

[0008] The purpose of the present invention is to provide a poultry egg yolk ratio detection and grading device and a grading method based on computer vision, so as to solve the technical problems in the prior art that the detection efficiency of the yolk ratio of some poultry eggs is low and a single feature data cannot effectively and accurately realize the determination of the yolk ratio of poultry eggs.

[0009] To achieve the above object, the present invention provides the following technical solutions:

[0010] The present invention provides a poultry egg yolk ratio detection and grading device based on computer vision, comprising a poultry egg input unit, a poultry egg transmission unit, a poultry egg data collection unit, a poultry egg control unit and a poultry egg grading unit;

[0011] The egg input unit comprises an outer shell 1, a transmission assembly 1 and a conveying roller; the conveying roller is used to support and stabilize the eggs and automatically arrange the eggs by rotating the roller; a rolling channel 1 is also provided at the end of the egg input unit; the transmission assembly 1 is used to drive the conveying roller and convey the eggs to the rolling channel 1; the end of the rolling channel 1 is connected to the egg conveying unit;

[0012] The poultry egg conveying unit comprises a second outer shell, a second transmission assembly, a baffle, a halogen light source and a perforated conveyor belt; the perforated conveyor belt is evenly provided with a plurality of holes, the holes are used to place poultry eggs, and the halogen light source acts on the poultry eggs through the holes;

[0013] The poultry egg data collection unit is arranged above the halogen lamp light source, and is used to collect poultry egg position information, poultry egg light transmission image information and poultry egg spectrum information, and transmit the poultry egg position information, poultry egg light transmission image information and poultry egg spectrum information to the poultry egg control unit;

[0014] The poultry egg grading unit is connected to the poultry egg data collection unit and the poultry egg control unit respectively, and is used for classifying and collecting poultry eggs of different grades.

[0015] Optionally or preferably, the poultry egg data collection unit includes a collection box, an entrance photoelectric sensor, an exit photoelectric sensor, a control storage middleware, an industrial camera, a spectral device and a photosensor;

[0016] The entrance photoelectric sensor and the exit photoelectric sensor are respectively located at the egg entrance position and the egg exit position of the collection box, and are electrically connected to the control storage middleware;

[0017] The industrial camera is located on one side of the collection box and is used to collect light-transmitting image information of poultry eggs;

[0018] The spectral device is located at the other side of the collection box and is used to collect spectral information of poultry eggs.

[0019] Optionally or preferably, the poultry and egg control unit is adjacent to the end of the collection box, and the poultry and egg control unit includes: a camera control storage module, a spectral device control storage module, a core processing module and a display screen;

[0020] The industrial camera is electrically connected to the camera control storage module; the spectral device is electrically connected to the spectral device control storage module;

[0021] The display screen, the photosensor, the control storage middleware, the camera control storage module and the spectral device control storage module are electrically connected to the core processing module respectively.

[0022] Optionally or preferably, the egg grading unit comprises a plurality of egg picking components;

[0023] The egg picking assembly comprises a photoelectric sensor, a mechanical push rod, a second rolling channel and an egg holding platform;

[0024] The photoelectric sensor and the mechanical push rod are electrically connected to the control storage middleware respectively; the core processing module realizes data reading of the photoelectric sensor and control of the mechanical push rod through the control storage middleware.

[0025] The method for detecting and grading egg yolk ratio based on computer vision comprises the following steps:

[0026] S1, data collection, collecting light transmission image information and spectrum information of poultry eggs through a poultry egg data collection unit;

[0027] S2, data preprocessing, performing data preprocessing on the above collected information to obtain image data and spectral data;

[0028] S3, image data analysis and processing, analyzing and processing the image data, and obtaining egg image features F img ;

[0029] S4, spectral data analysis and processing, analyzing and processing the spectral data, and obtaining the spectral curve characteristics of poultry eggs F spe ;

[0030] S5, standardization processing and feature fusion, the egg image features F img Spectral curve characteristics of poultry eggs F spe Perform standardization, and then fuse the data features of different modes to obtain the fused features F fusion ;

[0031] S6, model training, the fused features F fusion As the input of the least squares support vector machine model LS-SVM, it is used to calculate the egg yolk ratio of poultry eggs. p Regression prediction task and output the prediction result;

[0032] S7, completing the egg grading, grading the eggs with different yolk ratios according to the egg yolk ratio prediction results, and classifying and collecting the eggs with different levels of yolk ratios through the egg grading unit.

[0033] Optionally or preferably, the method for collecting the light transmission image information and the spectral information of the poultry eggs in S1 is:

[0034] When the light sensor detects low light intensity, the entrance photoelectric sensor detects the arrival signal of the current egg and the exit photoelectric sensor detects the departure signal of the previous egg or there is no departure signal of the previous egg, the egg control unit controls the industrial camera and the spectral device to collect the light transmission image information of the egg and the spectral information of the egg for multiple times;

[0035] When the exit photoelectric sensor detects the exit signal of the current poultry egg, the current poultry egg information at the head of the data collection queue is deleted, and the poultry egg information is added to the tail of the data collection queue.

[0036] Optionally or preferably, the method for data preprocessing in S2 comprises the following steps:

[0037] S21, according to the data collection queue, processing the poultry egg data information at the head of the data collection queue;

[0038] S22, mapping the image data and spectral data of the poultry eggs according to the order of collection time and setting the same ID number;

[0039] S23, cropping the image to reduce redundant information in the image;

[0040] S24, the image quality of the collected image data is evaluated by using the Tenengrad evaluation function, and the image quality of each image is evaluated by comparing the Ten The best quality image is selected and matched with the spectral data of the same ID number:

[0041]

[0042]

[0043]

[0044] in, n is the total number of pixels in the image, S ( x , y ) indicates a point ( x , y ), G x , G y is the Sobel convolution kernel.

[0045] Optionally or preferably, the method for analyzing and processing the image data in S3 comprises the following steps:

[0046] S31, using an improved DenseNet121 network as a feature extraction network to extract features from egg images;

[0047] S32, extract shallow features from the input egg image through a convolution layer and a pooling layer, introduce the CBAM module after the pooling layer, and adjust the weights of the channel and spatial information in an adaptive manner by calculating the channel attention and spatial attention, so that the model can extract low-level features more specifically;

[0048] S33, using 4 densely connected modules and 3 transition layers to extract high-level features of egg images, and achieve effective reuse of shallow and deep features;

[0049] S34: Outputting egg image features according to the low-level features and high-level features F img ;

[0050] The method for analyzing and processing spectral data in S4 comprises the following steps:

[0051] S41, preprocessing the spectral data using the MSC-SG algorithm, including the following steps:

[0052] S411, using the MSC multivariate scattering correction algorithm to reduce the noise of the spectral data, and calculating the mean of all spectral data as the ideal spectrum:

[0053]

[0054] in D M is the average value of all spectral samples, m is the number of spectral samples, D i For the i Spectral samples;

[0055] S412, performing a univariate linear regression on each spectral sample and the spectral sample average value, solving the least squares problem and obtaining the baseline translation and offset of each sample;

[0056]

[0057] in, k i is the offset, b i is the baseline shift;

[0058] S413, obtaining the corrected first i The spectrum samples are represented as D i MSC :

[0059]

[0060] S414, using the Savitzky-Golay algorithm to smooth the data by fitting a local polynomial in the data;

[0061] S42, using ResNet50 as the basic network to extract features from the generated spectral curve image;

[0062] S421, after the initial convolution layer and pooling layer, the preliminary abstraction and dimensionality reduction of the spectral image are achieved;

[0063] S422, based on the residual structure of ResNet50, a series of residual blocks and multiple convolutional layers included in each residual block are used to extract the spectral curve layer by layer to capture the abstract features in the spectral curve;

[0064] S43, integrating the spatial information of the spectral curve and outputting the characteristics of the spectral curve of poultry eggs F spe .

[0065] Optionally or preferably, in S5, different modalities are fused and obtained F fusion The method is:

[0066] The egg image features F img Spectral curve characteristics of poultry eggs F spe Fusion is performed to obtain the fused features F fusion ;

[0067]

[0068] in W is the fusion weight.

[0069] Optionally or preferably, the method for grading poultry eggs with different yolk ratios in S7 is:

[0070]

[0071] in, L ( p ) indicates different proportions p The corresponding level, when the egg yolk ratio p When the egg yolk ratio is less than 30%, the level is low, that is, low egg yolk ratio; when the egg yolk ratio of poultry eggs is 30%≤ p When the yolk ratio is less than 35%, the level is mid, that is, medium yolk ratio; when the yolk ratio of poultry eggs is p When it is >35%, the level is high, that is, high yolk ratio;

[0072] The method for the poultry egg grading unit to classify and collect poultry eggs with different levels of yolk ratio is as follows:

[0073] Multiple egg picking components are used to classify and collect poultry eggs of different grades; when the poultry eggs of corresponding grades are conveyed to the poultry egg grading unit through a perforated conveyor belt, the core processing module starts the mechanical push rod of the corresponding egg picking component and picks the poultry eggs into rolling channel two, and the poultry eggs enter the egg receiving platform of corresponding grade through rolling channel two.

[0074] Based on the above technical solution, the present invention can at least produce the following technical effects:

[0075] (1) The egg-yolk ratio detection and grading device based on computer vision provided by the present invention can effectively combine the data and time series information of multiple sensors to collect egg data in a short time. Its collection strategy and device design enable low-cost and lossless data collection of eggs.

[0076] It can also effectively utilize sensor data to sort poultry eggs into platforms with different content levels. The subdivision of poultry eggs improves the utilization efficiency and economic benefits of poultry eggs. It realizes automated production by effectively coordinating and controlling the operations between different devices and efficiently processing the transmission and analysis of poultry egg data based on the queue structure. Its assembly line automation coordination control strategy reduces labor costs, improves production efficiency, reduces the complexity of equipment operation and management, and reduces the risk of human error.

[0077] (2) The computer vision-based poultry egg yolk ratio detection and grading method provided by the present invention can effectively extract image features and spectral features, and perform feature standardization and fusion, and use different types of data to improve the accuracy of poultry egg yolk ratio prediction; its optimized model structure and efficient calculation strategy enable it to complete the prediction of poultry egg yolk ratio in a shorter time, which is more in line with actual application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1 It is a schematic diagram of the overall structure of the egg yolk ratio detection and grading device based on computer vision of the present invention;

[0079] Figure 2 It is a structural schematic diagram of a poultry egg input unit in a poultry egg yolk ratio detection and grading device based on computer vision of the present invention;

[0080] Figure 3 It is a structural schematic diagram of a poultry egg conveying unit in a poultry egg yolk ratio detection and grading device based on computer vision of the present invention;

[0081] Figure 4It is a structural schematic diagram of a poultry egg data acquisition unit in a poultry egg yolk ratio detection and grading device based on computer vision of the present invention;

[0082] Figure 5 It is a structural schematic diagram of a poultry egg control unit in a poultry egg yolk ratio detection and grading device based on computer vision of the present invention;

[0083] Figure 6 It is a structural schematic diagram of a poultry egg grading unit in a poultry egg yolk ratio detection and grading device based on computer vision of the present invention;

[0084] Figure 7 It is a flow chart of the method for detecting and grading egg yolk ratio based on computer vision of the present invention;

[0085] Figure 8 It is a control flow chart of a poultry egg data acquisition unit in a poultry egg yolk ratio detection and grading method based on computer vision of the present invention;

[0086] Fig. 9 It is an implementation flow chart of the algorithm for non-destructive determination of egg yolk ratio in the method for detecting and grading egg yolk ratio based on computer vision of the present invention;

[0087] Fig.10 The present invention is a control flow chart of a poultry egg grading unit in a poultry egg yolk ratio detection and grading method based on computer vision.

[0088] In the figure: 10, egg input unit; 11, outer shell 1; 12, transmission component 1; 13, conveying roller; 14, rolling channel 1;

[0089] 20. Egg conveying unit; 21. Second outer shell; 22. Second transmission component; 23. Baffle; 24. Perforated conveyor belt; 25. Halogen lamp light source;

[0090] 30. Poultry egg data collection unit; 31. Collection box; 32. Entrance photoelectric sensor; 33. Exit photoelectric sensor; 34. Control storage middleware; 35. Industrial camera; 36. Spectral equipment; 37. Photosensitive sensor;

[0091] 40. Poultry and egg control unit; 41. Camera control storage module; 42. Spectral device control storage module; 43. Core processing module; 44. Display screen;

[0092] 50. Egg grading unit; 51. Photoelectric sensor; 52. Mechanical push rod; 53. Rolling channel 2; 54. Egg holding platform. DETAILED DESCRIPTION

[0093] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention; it is obvious that the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments, and all other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making creative work belong to the scope of protection of the present invention.

[0094] Embodiment 1

[0095] See also Figures 1 to 6 A poultry egg yolk ratio detection and grading device based on computer vision includes a poultry egg input unit 10, a poultry egg transmission unit 20, a poultry egg data acquisition unit 30, a poultry egg control unit 40 and a poultry egg grading unit 50, which together form a poultry egg yolk ratio detection and grading assembly line operation device.

[0096] See also Figure 2 Specifically, the egg input unit 10 includes an outer shell 11, a transmission component 12 disposed in the outer shell 11, and three rows of conveying rollers 13 disposed on the transmission component 12.

[0097] In this embodiment, the transmission assembly 12 may be a transmission structure composed of a driving wheel, a driven wheel and a transmission chain, and a plurality of conveying rollers 13 are arranged on the transmission chain and move with the transmission chain; in addition, grooves for supporting and stabilizing eggs are formed on the conveying rollers 13, and the eggs can be automatically sorted with the rotation of the conveying rollers 13. A rolling channel 14 is arranged at the end of the egg input unit 10, and the eggs are conveyed to the rolling channel 14 under the action of the transmission assembly 12 and the conveying rollers 13, and the eggs are rolled to the egg conveying unit 20 under the guidance of the rolling channel 14.

[0098] See also Figure 3 In this embodiment, the egg conveying unit 20 includes an outer shell 21, a transmission component 22, a baffle 23, a halogen lamp light source 25 and a perforated conveyor belt 24; the structure of the transmission component 22 is similar to that of the transmission component 12, both of which are driven by a driving wheel and a driven wheel, the difference being that the transmission component 22 also includes a perforated conveyor belt 24.

[0099] The perforated conveyor belt 24 is evenly provided with a plurality of holes for placing and fixing eggs. The halogen lamp light source 25 can irradiate the eggs through the holes and cooperate with the egg data collection unit 30 to collect data.

[0100] See also Figure 4In this embodiment, the poultry egg data collection unit 30 is arranged directly above the halogen lamp light source 25, and includes a collection box 31 and an entrance photoelectric sensor 32, an exit photoelectric sensor 33, a control storage middleware 34, an industrial camera 35, a spectral device 36 and a photosensor 37 respectively arranged in the collection box 31.

[0101] The entrance photoelectric sensor 32 and the exit photoelectric sensor 33 are respectively arranged at the egg entrance and the egg exit of the collection box 31 , and are electrically connected to the control storage middleware 34 via a USB data cable.

[0102] The industrial camera 35 is arranged on the left side of the collection box 31 to collect the light-transmitting image of the eggs; the spectral device 36 is arranged on the right and upper side of the collection box 31 to collect the spectral information of the eggs; and the industrial camera 35 and the spectral device 36 are electrically connected to the egg control unit 40 respectively.

[0103] See also Figure 5 In this embodiment, the egg control unit 40 is connected to the end of the collection box 31, and includes a camera control storage module 41, a spectral device control storage module 42, a core processing module 43 and an LED display screen 44; specifically, the above-mentioned industrial camera 35 is electrically connected to the camera control storage module 41 through a USB data line to realize data feedback and operation control of the industrial camera 35; the spectral device 36 is electrically connected to the spectral device control storage module 42 through a USB data line to complete the data feedback and operation control of the spectral device 36; then the camera control storage module 41 and the spectral device control storage module 42 are electrically connected to the core processing module 43 through the USB data line respectively, and the core processing module 43 realizes control and data processing.

[0104] In addition, the display screen 44, the photosensor 37 and the control storage middleware 34 are electrically connected to the core processing module 43 respectively, so as to realize the data transmission and operation control of the entrance photoelectric sensor 32 and the exit photoelectric sensor 33 in the poultry and egg data collection unit 30; finally, the core processing module 43 displays the processing results through the LED display screen.

[0105] See also Figure 6 In this embodiment, the egg grading unit 50 is arranged at the end of the transmission component 22, which includes three egg picking components, which are used to classify and collect eggs of different grades respectively; each egg picking component includes a photoelectric sensor 51, a mechanical push rod 52, a rolling channel 53 and an egg receiving platform 54.

[0106] The photoelectric sensor 51 and the mechanical push rod 52 are connected to the control storage middleware 34 via a USB data cable, so that the core processing module 43 can complete the control of the photoelectric sensor 51 and the mechanical push rod 52 through the control storage middleware 34, and then control the egg removal components of different levels according to the processing results and timing information. Once the poultry eggs are correctly identified, they will be pushed into the rolling channel 2 53 by the mechanical push rod 52 of the egg removal component at the same level and enter the egg holding platform 54 for collection.

[0107] Embodiment 2

[0108] See also Figures 7 to 10 This embodiment provides a poultry egg yolk ratio detection and grading method based on computer vision based on the poultry egg yolk ratio detection and grading device of embodiment 1, comprising the following steps:

[0109] S1, data collection, collecting light transmission image information and spectrum information of poultry eggs through the poultry egg data collection unit 30;

[0110] In this embodiment, a photosensor 37 is further provided in the collection box 31 for monitoring the optical fiber intensity. In actual operation, the core processing module 43 can receive data from the entrance photoelectric sensor 32, the exit photoelectric sensor 33 and the photosensor 37. When the eggs are normally transmitted, the arrival signal of the eggs (i.e., the signal detected by the entrance photoelectric sensor 32) and the departure signal (i.e., the signal detected by the exit photoelectric sensor 33) appear in pairs. Therefore, only when the photosensor 37 detects low light intensity, the entrance photoelectric sensor 32 detects the arrival signal of the current egg and the exit photoelectric sensor 33 detects the departure signal of the previous egg or there is no departure signal of the previous egg, the egg control unit 40 controls the industrial camera 35 and the spectral device 36 to collect the light-transmitting image information of the eggs and the spectral information of the eggs respectively. When the exit photoelectric sensor 33 detects the departure signal of the current egg, the current egg information at the head of the data collection queue is deleted, and the egg information is added at the end of the data collection queue.

[0111] In order to improve the fault tolerance of data acquisition and prevent problems such as blurred camera images during assembly line operations, and at the same time, appropriate repeated acquisition can avoid excessive impact on the efficiency of subsequent data analysis, in this embodiment, the industrial camera 35 and the spectral device 36 will continuously collect 6 sets of data, and the collected data will be processed and analyzed by the core processing module 43.

[0112] S2, data preprocessing, performing data preprocessing on the above collected information to obtain image data and spectral data;

[0113] The above method for data preprocessing of the collected information comprises the following steps:

[0114] S21, according to the data collection queue, preferentially processing the poultry egg data information at the head of the data collection queue;

[0115] S22, the egg image data and spectral data in the order of acquisition time data mapping and set the same ID number, such as egg_[num]_img_1, egg_[num]_spe_1;

[0116] S23, cropping the image to reduce redundant information in the image;

[0117] Because higher-resolution cameras can capture more pixels when taking images, they provide more details and information, but at the same time, the image files they produce are larger, taking up more storage space, and consuming more resources during subsequent processing and transmission, which affects data processing efficiency.

[0118] Therefore, the image needs to be cropped and reduced first, and the 7008×4672 pixel image taken by the original camera is reduced to 300×200 pixels. Cropping the image helps reduce redundant information and ensures that the main body of the image is focused on the eggs themselves, while reducing the image helps to increase the image transmission and processing speed.

[0119] S24, the image quality of the collected image data is evaluated by using the Tenengrad evaluation function, and the image quality of each image is evaluated by comparing the Ten The image with the best quality (highest clarity) is selected and matched with the spectral data of the same ID number for subsequent data analysis:

[0120]

[0121]

[0122] in, n is the total number of pixels in the image, S ( x , y ) indicates a point ( x , y ), where the Sobel convolution kernel is G x , G y , respectively defined as:

[0123]

[0124]

[0125] S3, image data analysis and processing, analyzing and processing the image data, and obtaining egg image features Fimg ;

[0126] The above method for analyzing and processing image data comprises the following steps:

[0127] S31, using an improved DenseNet121 network as a feature extraction network to extract features from egg images;

[0128] S32, extract shallow features from the input egg image through a convolution layer and a pooling layer. After the pooling layer, introduce the CBAM module to adjust the weights of the channel and spatial information in an adaptive manner by calculating the channel attention and spatial attention, so that the model can more specifically extract low-level features, such as the edge and texture of the egg, which helps to better capture the shape and structure of the yolk. At the same time, it can also enhance the channel information related to the yolk, so that the network can pay attention to the position of the yolk earlier;

[0129] S33, using 4 densely connected modules and 3 transition layers to extract high-level features of egg images, and achieve effective reuse of shallow and deep features;

[0130] In this embodiment, the CBAM module is introduced again after DenseBlock4 and placed at a deeper level of the network, which helps the model better capture the high-level and abstract features of egg images. Because this position corresponds to the later stage of the network, the resolution of the feature map is relatively low. The introduction of the CBAM module can increase the focus on important features.

[0131] S34: Outputting egg image features according to the low-level features and high-level features F img ; These features have been adjusted and enhanced by the attention module to better meet the feature extraction requirements of poultry egg images.

[0132] S4, spectral data analysis and processing, analyzing and processing the spectral data, and obtaining the spectral curve characteristics of poultry eggs F spe ;

[0133] The above method for analyzing and processing spectral data comprises the following steps:

[0134] S41, preprocessing the spectral data using the MSC-SG algorithm, including the following steps:

[0135] S411, using the MSC multivariate scattering correction algorithm to reduce the noise of the spectral data, and calculating the mean of all spectral data as the ideal spectrum:

[0136]

[0137] in DM is the average value of all spectral samples, m is the number of spectral samples, D i For the i Spectral samples;

[0138] S412, performing a univariate linear regression on each spectral sample and the spectral sample average value, solving the least squares problem and obtaining the baseline translation and offset of each sample;

[0139]

[0140] in, k i is the offset, b i is the baseline shift;

[0141] S413, obtaining the corrected first i The spectrum samples are represented as D i MSC :

[0142]

[0143] S414, using the Savitzky-Golay algorithm to smooth the data by fitting a local polynomial in the data;

[0144] Specifically, at each data point x i At , construct a length of n =2 m +1, the window contains the data points around the data point, that is, ( x i-m , …, x i-1 , x i , x i+1 ,…, x i+m ), the value corresponding to each data point is ( y i-m , …, y i-1 , y i , y i+1 ,…, y i+m ); At the same time, a polynomial is fitted to the data points in the window, and a p Polynomial of degree:

[0145]

[0146] in a 0, a 1, a 2, ..., a p are the coefficients of the polynomial;

[0147] Convert the above system of equations into matrix expressions:

[0148]

[0149]

[0150]

[0151]

[0152] Among them, the vector y Represents the value of a data point; each row of the matrix X corresponds to a polynomial representation of a data point; vector a is a ( p +1)×1 column vector, representing the polynomial coefficients;

[0153] vector y After smoothing The value calculation formula is:

[0154]

[0155] in , B is the smoothing coefficient matrix, and only X The matrix determines B The matrix is Order matrix; this algorithm sets the SG filter window length parameter to 5 and the polynomial degree parameter p is 3.

[0156] S42, after preprocessing the spectral data, the generated spectral curve image is used as the basic network to extract features, including the following steps:

[0157] S421, after the initial convolution layer and pooling layer, the preliminary abstraction and dimensionality reduction of the spectral image are achieved;

[0158] S422, based on the residual structure of ResNet50, through a series of residual blocks and multiple convolutional layers included in each residual block, the spectral curve is extracted layer by layer to capture the abstract features in the spectral curve; it helps the network to more effectively capture the abstract features in the spectral curve, including information such as peaks and troughs in the spectrum;

[0159] In the process of feature extraction, the residual connection of ResNet50 allows information to be directly transferred across layers, which can alleviate the gradient vanishing problem and improve the effectiveness of feature capture. In addition, ResNet50 uses a global average pooling layer to perform an average pooling operation on the feature map to integrate the spatial information of the entire spectral curve.

[0160] S43, integrating the spatial information of the spectral curve and outputting the characteristics of the spectral curve of poultry eggs F spe .

[0161] S5, standardization processing and feature fusion, the egg image features F img Spectral curve characteristics of poultry eggs F spe Perform standardization, and then fuse the data features of different modes to obtain the fused features F fusion ;

[0162] The above mentioned methods fuse different modalities and obtain F fusion The method is:

[0163] The egg image features F img Spectral curve characteristics of poultry eggs F spe Fusion is performed to obtain the fused features F fusion ;

[0164]

[0165] in W is the fusion weight.

[0166] S6, model training, the fused features F fusion As the input of the least squares support vector machine model LS-SVM, it is used to calculate the egg yolk ratio of poultry eggs. p The model automatically integrates the weights during the training process. W The optimization is performed to comprehensively consider the relationship between image and spectral features and provide a prediction result of yolk ratio.

[0167] S7, completing the egg grading, grading the eggs with different yolk ratios according to the egg yolk ratio prediction result, and classifying and collecting the eggs with different levels of yolk ratios through the egg grading unit 50;

[0168] The above method for grading poultry eggs with different yolk ratios is as follows:

[0169]

[0170] in, L ( p ) indicates different proportions p The corresponding level, when the egg yolk ratio p When the egg yolk ratio is less than 30%, the level is low, that is, low egg yolk ratio; when the egg yolk ratio of poultry eggs is 30%≤ p When the yolk ratio is less than 35%, the level is mid, that is, medium yolk ratio; when the yolk ratio of poultry eggs is p When it is >35%, the level is high, that is, high yolk ratio;

[0171] The method for the poultry egg grading unit 50 to classify and collect poultry eggs with different levels of yolk ratio is as follows:

[0172] Multiple egg picking components are used to classify and collect poultry eggs of different grades; when the poultry eggs of the corresponding grade are conveyed to the poultry egg grading unit 50 through the perforated conveyor belt 24, the core processing module 43 starts the mechanical push rod 52 of the corresponding egg picking component and picks the poultry eggs into the rolling channel 2 53. The poultry eggs pass through the rolling channel 2 53 and enter the egg receiving platform 54 of the corresponding grade.

[0173] It should be noted that the egg removal component will only work if the following conditions are met at the same time:

[0174] Condition 1: All photoelectric sensor trigger signals before the target egg culling unit are recorded within all specified timer times.

[0175] Condition 2: The photoelectric sensor trigger signal of the target egg-removing unit is recorded within the specified timer time.

[0176] The timer time of the eggs passing through the egg-removing components of different levels is directly calculated and generated by the core processing module 43 according to the perforated conveyor belt 24 and the conveyor belt hole spacing. As long as one of the conditions one and two is not satisfied, the core processing module 43 will immediately delete the egg information at the head of the egg grading queue, that is, the egg information of the egg removal operation that will be performed at present. In this way, it can be ensured that when a fault (such as egg loss) occurs after the egg data processing and before the egg grading, other eggs will not be wrongly classified into different levels. When the eggs pass through the photoelectric sensor 51 in the egg-removing component of the corresponding level, the core processing module 43 records the trigger signal, and waits for the eggs to move to the front of the mechanical push rod 52 under the movement of the conveyor belt. The core processing module 43 will start the mechanical push rod 52 of the egg-removing component to remove the eggs into the rolling channel 2 53, and enter the egg-bearing platform 54 of the egg-removing component of this level through the rolling channel 2 53. If the trigger signal is not recorded, it means that the eggs have not arrived yet, and then a circular waiting is performed.

[0177] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "provided with", "mounted / connected", "connected", etc. should be understood in a broad sense. For example, "connected" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0178] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for detecting and grading egg yolk ratio based on computer vision, characterized in that: A poultry egg yolk ratio detection and grading device based on computer vision is used to detect and grade poultry eggs according to their yolk ratio. The poultry egg yolk ratio detection and grading device based on computer vision comprises an egg input unit (10), an egg transmission unit (20), an egg data collection unit (30), an egg control unit (40) and an egg grading unit (50); The egg input unit (10) comprises an outer shell (11), a transmission assembly (12) and a conveying roller (13); the conveying roller (13) is used to support and stabilize the eggs and to automatically sort the eggs by rotating the roller; a rolling channel (14) is also provided at the end of the egg input unit (10); the transmission assembly (12) is used to drive the conveying roller (13) and convey the eggs to the rolling channel (14); the end of the rolling channel (14) is connected to the egg conveying unit (20); The poultry egg conveying unit (20) comprises a second outer shell (21), a second transmission assembly (22), a baffle (23), a halogen lamp light source (25) and a perforated conveyor belt (24); a plurality of holes are evenly distributed on the perforated conveyor belt (24), the holes are used to place poultry eggs, and the halogen lamp light source (25) acts on the poultry eggs through the holes; The poultry egg data collection unit (30) is arranged above the halogen lamp light source (25), and is used to collect poultry egg position information, poultry egg light transmission image information and poultry egg spectrum information, and transmit the poultry egg position information, poultry egg light transmission image information and poultry egg spectrum information to the poultry egg control unit (40); The poultry egg grading unit (50) is connected to the poultry egg data collection unit (30) and the poultry egg control unit (40) respectively, and is used to classify and collect poultry eggs of different grades; The egg yolk ratio detection and grading method based on computer vision includes the following steps: S1, data collection, collecting light transmission image information and spectral information of poultry eggs through a poultry egg data collection unit (30); S2, data preprocessing, performing data preprocessing on the above collected information to obtain image data and spectral data; S3, image data analysis and processing, analyzing and processing the image data, and obtaining egg image features F img ; S4, spectral data analysis and processing, analyzing and processing the spectral data, and obtaining the spectral curve characteristics of poultry eggs F spe ; S5, standardization processing and feature fusion, the egg image features F img Spectral curve characteristics of poultry eggs F spe Perform standardization, and then fuse the data features of different modes to obtain the fused features F fusion ; S6, model training, the fused features F fusion As the input of the least squares support vector machine model LS-SVM, it is used to calculate the egg yolk ratio of poultry eggs. p Regression prediction task and output the prediction result; S7, completing the egg grading, grading the eggs with different yolk ratios according to the egg yolk ratio prediction result, and collecting the eggs with different levels of yolk ratios by classification through the egg grading unit (50).

2. The method for detecting and grading egg yolk ratio based on computer vision according to claim 1, characterized in that: The poultry egg data collection unit (30) comprises a collection box (31), an entrance photoelectric sensor (32), an exit photoelectric sensor (33), a control storage middleware (34), an industrial camera (35), a spectral device (36) and a photosensitive sensor (37); The entrance photoelectric sensor (32) and the exit photoelectric sensor (33) are respectively located at the egg entrance position and the egg exit position of the collection box (31), and are electrically connected to the control storage middleware (34); The industrial camera (35) is located on one side of the collection box (31) and is used to collect light-transmitting image information of poultry eggs; The spectral device (36) is located on the other side of the collection box (31) and is used to collect spectral information of poultry eggs.

3. The method for detecting and grading egg yolk ratio based on computer vision according to claim 2, characterized in that: The poultry and egg control unit (40) is adjacent to the end of the collection box (31), and the poultry and egg control unit (40) comprises: a camera control storage module (41), a spectral device control storage module (42), a core processing module (43) and a display screen (44); The industrial camera (35) is electrically connected to the camera control storage module (41); the spectral device (36) is electrically connected to the spectral device control storage module (42); The display screen (44), the photosensor (37), the control storage middleware (34), the camera control storage module (41) and the spectral device control storage module (42) are electrically connected to the core processing module (43) respectively.

4. The method for detecting and grading egg yolk ratio based on computer vision according to claim 3, characterized in that: The poultry egg grading unit (50) comprises a plurality of egg picking components; The egg picking assembly comprises a photoelectric sensor (51), a mechanical push rod (52), a second rolling channel (53) and an egg receiving platform (54); The photoelectric sensor (51) and the mechanical push rod (52) are electrically connected to the control storage middleware (34) respectively; the core processing module (43) reads data from the photoelectric sensor (51) and controls the mechanical push rod (52) through the control storage middleware (34).

5. The method for detecting and grading egg yolk ratio based on computer vision according to claim 4, characterized in that: The method for collecting the light transmission image information and the spectrum information of the poultry eggs in S1 is: When the light sensor (37) detects low light intensity, the entrance photoelectric sensor (32) detects an arrival signal of the current poultry egg and the exit photoelectric sensor (33) detects a departure signal of the previous poultry egg or a departure signal of no previous poultry egg, the poultry egg control unit (40) controls the industrial camera (35) and the spectral device (36) to respectively collect the light transmission image information of the poultry egg and the spectral information of the poultry egg for multiple times; When the exit photoelectric sensor (33) detects the exit signal of the current poultry egg, the current poultry egg information at the head of the data collection queue is deleted, and the poultry egg information is added to the tail of the data collection queue.

6. The method for detecting and grading egg yolk ratio based on computer vision according to claim 4, characterized in that: The method for data preprocessing in S2 includes the following steps: S21, according to the data collection queue, preferentially processing the poultry egg data information at the head of the data collection queue; S22, mapping the image data and spectral data of the poultry eggs according to the order of collection time and setting the same ID number; S23, cropping the image to reduce redundant information in the image; S24, the image quality of the collected image data is evaluated by using the Tenengrad evaluation function, and the image quality of each image is evaluated by comparing the Ten The best quality image is selected and matched with the spectral data of the same ID number: in, n is the total number of pixels in the image, S ( x , y ) indicates a point ( x , y ), G x , G y is the Sobel convolution kernel.

7. The method for detecting and grading egg yolk ratio based on computer vision according to claim 4, characterized in that: The method for analyzing and processing image data in S3 includes the following steps: S31, using an improved DenseNet121 network as a feature extraction network to extract features from egg images; S32, extract shallow features from the input egg image through a convolution layer and a pooling layer, introduce the CBAM module after the pooling layer, and adjust the weights of the channel and spatial information in an adaptive manner by calculating the channel attention and spatial attention, so that the model can extract low-level features more specifically; S33, using 4 densely connected modules and 3 transition layers to extract high-level features of egg images, and achieve effective reuse of shallow and deep features; S34: Outputting egg image features according to the low-level features and high-level features F img ; The method for analyzing and processing spectral data in S4 comprises the following steps: S41, preprocessing the spectral data using the MSC-SG algorithm, including the following steps: S411, using the MSC multivariate scattering correction algorithm to reduce the noise of the spectral data, and calculating the mean of all spectral data as the ideal spectrum: in D M is the average value of all spectral samples, m is the number of spectral samples, D i For the i Spectral samples; S412, performing a univariate linear regression on each spectral sample and the spectral sample average value, solving the least squares problem and obtaining the baseline translation and offset of each sample; in, k i is the offset, b i is the baseline shift; S413, obtaining the corrected first i The spectrum samples are represented as D i MSC : S414, using the Savitzky-Golay algorithm to smooth the data by fitting a local polynomial in the data; S42, using ResNet50 as the basic network to extract features from the generated spectral curve image; S421, after the initial convolution layer and pooling layer, the preliminary abstraction and dimensionality reduction of the spectral image are achieved; S422, based on the residual structure of ResNet50, a series of residual blocks and multiple convolutional layers included in each residual block are used to extract the spectral curve layer by layer to capture the abstract features in the spectral curve; S43, integrating the spatial information of the spectral curve and outputting the characteristics of the spectral curve of poultry eggs F spe .

8. The method for detecting and grading egg yolk ratio based on computer vision according to claim 4, characterized in that: In S5, different modalities are fused and obtained F fusion The method is: The egg image features F img Spectral curve characteristics of poultry eggs F spe Fusion is performed to obtain the fused features F fusion ; in W is the fusion weight.

9. The method for detecting and grading egg yolk ratio based on computer vision according to claim 4, characterized in that: The method for grading poultry eggs with different yolk ratios in S7 is as follows: in, L ( p ) indicates different proportions p The corresponding level, when the egg yolk ratio p When the egg yolk ratio is less than 30%, the level is low, that is, low egg yolk ratio; when the egg yolk ratio of poultry eggs is 30%≤ p When the yolk ratio is less than 35%, the level is mid, that is, medium yolk ratio; when the yolk ratio of poultry eggs is p When it is >35%, the level is high, that is, high yolk ratio; The method for the poultry egg grading unit (50) to classify and collect poultry eggs with different levels of yolk ratio is as follows: The plurality of egg picking assemblies are respectively used to classify and collect poultry eggs of different grades; when poultry eggs of corresponding grades are conveyed to the poultry egg grading unit (50) via a perforated conveyor belt (24), the core processing module (43) activates the mechanical push rod (52) of the corresponding egg picking assembly and picks the poultry eggs into rolling channel 2 (53), and the poultry eggs pass through rolling channel 2 (53) and enter the egg receiving platform (54) of the corresponding grade.