A non-contact spectral identification method for differentiating the gender of embryos inside eggs

Through the non-contact spectral recognition method and combined with the hyperspectral prediction model, the gender of the eggs is dynamically detected, which solves the problem that it is difficult for the existing technology to identify the gender of the eggs in the early stage, and achieves efficient and accurate embryo gender identification, which improves the economic benefits of the chicken farm.

CN119605695BActive Publication Date: 2025-05-30HAINAN GUDEWEI TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510155305.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-05-30
Estimated Expiration
2045-02-12

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently and accurately identify the gender of the embryo within the eggs within 7-14 days of egg incubation, which makes it difficult to sell rooster eggs in early stages, affecting the economic benefits of chicken farms.

Method used

The non-contact spectral recognition method was used to obtain hyperspectral images through color depth clustering on the surface of the egg and dynamically regulate the light intensity, and the peaks of 280nm and 1700nm were extracted, and the gender of the egg embryo was dynamically detected in combination with the hyperspectral prediction model.

Benefits of technology

Early non-contact identification of embryo gender within 7-14 days of egg incubation was achieved, the detection efficiency was improved, and it had significant technological innovation and practical application value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119605695B_ABST
    Figure CN119605695B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence detection, and discloses a non-contact spectral recognition method for identifying the gender of embryos in eggs. A number of eggs with a fertilization and incubation time of 7 days are obtained, and the eggs are clustered according to the color depth on the egg surface to obtain several types of characteristic eggs. According to the categories of the characteristic eggs, hyperspectral images of the fertilization and incubation time from 7 days to 14 days are obtained at fixed time intervals for the characteristic eggs. The 280 nm peak and the 1700 nm peak of the hyperspectral images are extracted to obtain a first data set and a second data set. The gender detection results on the 15th day of the fertilization and incubation time of the characteristic eggs are obtained to obtain the embryo gender of each characteristic egg. The category, the first data set and the second data set of each characteristic egg are used as training samples, and the corresponding embryo gender is used as a sample label to train a hyperspectral prediction model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence detection, and more specifically, it relates to a non-contact spectral identification method for differentiating the gender of embryos in eggs. Background Art

[0002] In the production and operation of chicken farms, usually only a small number of roosters are needed because roosters do not have the ability to continuously produce eggs. However, chicken farms produce a large number of fertilized eggs every day, which consume a large amount of electricity during the hatching process. If roosters are hatched, their economic benefits are much lower than those of hens, making it difficult to recover the costs invested in the hatching process. Therefore, in order to ensure the economic benefits of chicken farms, it is necessary to identify the embryo gender as early as possible, sell the eggs with male embryos, or reduce resource waste.

[0003] From a biological perspective, there are differences in gene expression between eggs with male and female embryos. During the development stage from 7 to 14 days after fertilization, the embryo begins gonadal differentiation and synthesizes specific proteins respectively. Specifically: eggs with male embryos will synthesize HMG17 protein; eggs with female embryos will synthesize FOXL2 protein. Due to the significant differences in the spectral absorption peaks of HMG17 protein and FOXL2 protein, the differentiation of embryo gender can be achieved based on the spectral information of eggs.

[0004] Wavelength range HMG17 (male protein) FOXL2 (female protein) 200 - 400 nm Testosterone-related hormone (HMG17) has strong absorption (peak at 280 nm) Aromatic absorption is weak, and protein molecule absorption is more dispersed 1500 - 2000 nm Vibrational absorption is less Ovary-related hormone (FOXL2) has strong absorption (1700 mm)

[0005] However, the prior art usually starts gender detection after 14 days of embryo development. This is because after 14 days, the embryo development in the egg is nearly complete, and at this time, more significant gender-related protein characteristics, such as SOX9 protein and ERP synthetic protein, can be detected. Although the accuracy of such methods is relatively high, since the chicken embryo is nearly mature at this time, it is difficult to sell the eggs of male chickens. Therefore, how to early identify the embryo gender of eggs through efficient and accurate identification means within 7 - 14 days has become an urgent problem to be solved. Summary of the Invention

[0006] The present invention provides a non-contact spectral identification method for differentiating the gender of embryos in eggs to solve the technical problems raised in the background art.

[0007] The present invention provides a non-contact spectral identification method for differentiating the gender of embryos in eggs, including:

[0008] Step 1, obtain a number of eggs with a fertilization and hatching time of 7 days, and cluster the eggs according to the color depth on the egg surface to obtain several categories of characteristic eggs;

[0009] Step 2: According to the category of the characteristic eggs, obtain hyperspectral images of the characteristic eggs with fertilization and hatching times ranging from 7 days to 14 days at fixed time intervals;

[0010] Step 3: Extract the 280nm peak and 1700nm peak of the hyperspectral images to obtain the first data set and the second data set;

[0011] Step 4: Obtain the gender detection results of the characteristic eggs on the 15th day of fertilization and hatching to obtain the embryo gender of each characteristic egg;

[0012] Step 5: Use the category, the first data set, and the second data set of each characteristic egg as training samples, and use the corresponding embryo gender as the sample label to train a hyperspectral prediction model;

[0013] Step 6: Dynamically detect the target eggs according to a preset rule through the hyperspectral prediction model to obtain the embryo gender of the target eggs.

[0014] Furthermore, cluster the eggs according to the color depth of the egg surface, including:

[0015] Step 7: Place the eggs in circular holes, fixedly install a stepless dimming lamp at the bottom of the circular holes, and adjust the stepless dimming lamp from the minimum output to the maximum output at fixed output intervals;

[0016] Step 8: During Step 7, between every two adjacent outputs of the stepless dimming lamp, place the eggs in the circular holes in sequence and obtain high-definition images of each egg at fixed positions;

[0017] Step 9: Grayscale the high-definition images to obtain the grayscale values of the corresponding eggs. If the grayscale value is less than the preset grayscale threshold, repeat Step 8; if the grayscale value is greater than the preset grayscale threshold, use the egg as a characteristic egg corresponding to the output of the stepless dimming lamp.

[0018] Furthermore, obtain hyperspectral images of the characteristic eggs according to the category of the characteristic eggs, including:

[0019] Adjust the stepless dimming lamp to the corresponding output of the characteristic egg and place the characteristic egg in the circular hole to obtain hyperspectral images of the characteristic egg at fixed time intervals.

[0020] Furthermore, extract the 280nm peak and 1700nm peak of the hyperspectral images, specifically as follows:

[0021] Obtain the band indices corresponding to 280 nm and 1700 nm of the hyperspectral image, and use the hyperspectral data analysis tool to extract the position coordinates of the pixel points in the corresponding bands according to the indices, obtaining a first data set and a second data set. The first data set includes the number and coordinates of the 280 nm peak pixel points with fertilization and hatching times from 7 days to 14 days, and the second data set includes the number and coordinates of the 1700 nm peak pixel points with fertilization and hatching times from 7 days to 14 days.

[0022] Furthermore, train a hyperspectral prediction model, including:

[0023] Based on the number and coordinates of the pixel points with fertilization and hatching times from 7 days to 14 days in the first data set, construct a first vector and a second vector respectively;

[0024] Based on the number and coordinates of the pixel points with fertilization and hatching times from 7 days to 14 days in the second data set, construct a third vector and a fourth vector respectively;

[0025] Combine the first vector, the second vector, the third vector and the fourth vector to obtain a feature vector. Use the feature vector as a training sample, encode the category of the egg by real numbers to obtain an adjustment vector for the hidden layer of the hyperspectral prediction model, and use the corresponding embryo gender as a sample label.

[0026] Furthermore, the hyperspectral prediction model includes an adjustment layer, a hidden layer and a classifier:

[0027] The adjustment layer is used to adjust the feature vector based on the adjustment vector to obtain a standard vector of the feature vector;

[0028] The hidden layer includes a number of hidden units, and the hidden units are used to map the standard vector of the feature vector and output a hidden state;

[0029] The classifier is used to input the hidden state, and the classification space of the classifier represents the maximum gender probability of the embryo of the feature egg;

[0030] The hyperspectral prediction model performs backpropagation update on the custom parameters of the hidden layer by calculating the mean squared error between the maximum gender probability of the embryo and the corresponding sample label.

[0031] Furthermore, the calculation formula of the adjustment layer is as follows:

[0032] ;

[0033] Among them, represents the standard vector, represents the feature vector, represents the dimension of the feature vector, represents the index of the dimension of the feature vector, represents the j-th element in the feature vector, represents the i-th element in the feature vector, represents the weight matrix, represents the number of categories of characteristic eggs, represents the index of the number of categories of characteristic eggs, represents the adjustment vector corresponding to the characteristic eggs of the i-th category, represents the adjustment vector corresponding to the characteristic eggs of the j-th category, represents an orthogonal matrix of size, represents the smoothing coefficient, represents the operation of calculating the Euclidean norm, represents the inverse cosine function, represents the sign function, represents element-wise multiplication, represents the weight parameter, represents the operation of calculating the square of the vector norm length.

[0034] Furthermore, the calculation formula of the hidden layer is as follows:

[0035] ;

[0036] Among them, represents the hidden state, represents the activation function, represents the transposed vector of, represents based on the left diagonal matrix constructed by, represents the hidden layer bias parameter.

[0037] Furthermore, the target eggs are dynamically detected by the hyperspectral prediction model according to preset rules, including:

[0038] Obtain the images of the characteristic eggs of each category without a non-polar dimming lamp, and calculate the average gray value of the images of each category;

[0039] Obtain the image of the target eggs without a non-polar dimming lamp, and calculate the average gray value of the image;

[0040] Calculate the difference between the average gray value of the target eggs and the average gray value of the characteristic eggs of each category, and determine the characteristic eggs of the category corresponding to the smallest difference. Assign the target eggs to the output of the non-polar dimming lamp of the corresponding category to obtain the hyperspectral images of the target eggs with a fertilization and hatching time from 7 days to 14 days, and extract the 280nm peak and the 1700nm peak to obtain the first dataset and the second dataset of the target eggs;

[0041] Add the Relu activation function to the parameters corresponding to the 14th day in the first and second data sets of the target eggs, and input them into the hyperspectral prediction model to obtain the maximum embryo gender probability. If the prediction is accurate, add the Relu activation function to the parameters in the first and second data sets of the target eggs day by day, and cycle to obtain the maximum embryo gender probability until the prediction is incorrect, then obtain the minimum required parameters of the hyperspectral prediction model.

[0042] Obtain the first and second data sets of subsequent target eggs according to the minimum required parameters, and obtain the embryo gender of the subsequent target eggs.

[0043] The beneficial effects of the present invention are as follows: Through the combination of eggshell color preprocessing and the hyperspectral prediction model, early non-contact identification of the gender of embryos inside eggs is realized. First, use eggshell color clustering to dynamically adjust the light intensity to avoid insufficient light penetration or interference with the extraction of key spectral peaks (280nm and 1700nm). Then, extract feature vectors through the hyperspectral prediction model, dynamically calculate the maximum embryo gender probability, and gradually minimize the data requirements to achieve the shortest time verification within 7 to 14 days of incubation. It improves the detection efficiency and has significant technological innovation and practical application value. Description of the Drawings

[0044] Figure 1 It is a flowchart of a non-contact spectral identification method for identifying the gender of embryos inside eggs according to the present invention. Detailed Embodiments

[0045] Now, the subject matter described herein will be discussed with reference to exemplary embodiments. It should be understood that discussing these embodiments is only to enable those skilled in the art to better understand and thus implement the subject matter described herein. Without departing from the scope of protection of the content of this specification, changes can be made to the functions and arrangements of the elements discussed. Each example can omit, substitute, or add various processes or components as needed. Additionally, the features described relative to some examples can also be combined in other examples.

[0046] As Figure 1 shown, a non-contact spectral identification method for identifying the gender of embryos inside eggs includes:

[0047] Step 1, obtain a number of eggs with a fertilization and incubation time of 7 days, and cluster the eggs according to the color depth on the egg surface to obtain several categories of characteristic eggs;

[0048] Step 2, according to the categories of the characteristic eggs, obtain hyperspectral images of the fertilization and incubation time from 7 days to 14 days for the characteristic eggs at fixed time intervals;

[0049] Step 3: Extract the 280nm peak and 1700nm peak of the hyperspectral image to obtain the first data set and the second data set;

[0050] Step 4: Obtain the gender detection result of the characteristic eggs on the 15th day of fertilized incubation to obtain the embryo gender of each characteristic egg;

[0051] Step 5: Use the category, the first data set, and the second data set of each characteristic egg as training samples, and use the corresponding embryo gender as the sample label to train a hyperspectral prediction model;

[0052] Step 6: Dynamically detect the target eggs according to a preset rule through the hyperspectral prediction model to obtain the embryo gender of the target eggs.

[0053] It should be noted that on the 15th day, by dissecting the characteristic eggs, directly observe the gonadal development in the eggs to obtain the embryo gender.

[0054] In an embodiment of the present invention, clustering the eggs according to the color depth of the egg surface includes:

[0055] Step 7: Place the eggs in the circular holes, fixedly install a stepless dimming lamp at the bottom of the circular holes, and adjust the stepless dimming lamp from the minimum output to the maximum output at a fixed output interval;

[0056] Step 8: During Step 7, between every two adjacent outputs of the stepless dimming lamp, place the eggs in the circular holes in sequence and obtain the high-definition images of each egg at a fixed position;

[0057] Step 9: Grayscale the high-definition images to obtain the grayscale values of the corresponding eggs. If the grayscale value is less than the preset grayscale threshold, repeat Step 8; if the grayscale value is greater than the preset grayscale threshold, use the egg as the characteristic egg corresponding to the output of the stepless dimming lamp.

[0058] Specifically, by dynamically adjusting the light intensity of the stepless dimming lamp, effective clustering of the egg color depth is achieved. Since the color depth of the eggshell directly affects the light penetration, a dark eggshell may make it difficult for light to penetrate, while too strong light will introduce interference and affect the accurate extraction of hyperspectral data. Therefore, by gradually increasing the light output, high-definition images of the eggs are obtained at different light intensities, and the images are grayscale processed to obtain the grayscale values of the eggshells. To distinguish eggs with different characteristics, a preset grayscale threshold is set. When the grayscale value of an egg exceeds this threshold, it is considered that the light intensity can effectively penetrate the eggshell, and the light intensity at this time is regarded as suitable for the eggs corresponding to further hyperspectral analysis. In this way, by gradually adjusting the light, obtaining images, and analyzing the grayscale values, effective clustering of eggs with different color depths can be achieved, providing a precise prerequisite for the subsequent extraction and analysis of hyperspectral data. This method can minimize the influence of light intensity on the 280nm and 1700nm wave peaks, improving the detection accuracy and stability of the hyperspectral model.

[0059] For example, there are 3 eggs a, b, and c, and a stepless dimming lamp. When the output of the stepless dimming lamp is 1, the grayscale values of the 3 eggs (the grayscale value is the average grayscale of the egg image) are all less than the preset threshold of 100, so the output of the stepless dimming lamp is adjusted to 3. At this time, the grayscale value of egg a is greater than 100, so egg a is regarded as a characteristic egg and assigned a category. The output of the stepless dimming lamp is adjusted to 5, and then the subsequent eggs b and c are continuously detected. The grayscale values of eggs b and c are both greater than 100, so eggs b and c are characteristic eggs and assigned a category. Thus, the 3 eggs a, b, and c are divided into two characteristic classifications.

[0060] In an embodiment of the present invention, according to the category of the characteristic eggs, hyperspectral images of the characteristic eggs are obtained, including:

[0061] Adjust the stepless dimming lamp to the corresponding output of the characteristic egg, and place the characteristic egg in a circular hole to obtain the hyperspectral image of the characteristic egg at fixed time intervals.

[0062] Specifically, egg a is irradiated with an output of 3 from the stepless dimming lamp, and egg a is irradiated with an output of 5 from the stepless dimming lamp to obtain the corresponding hyperspectral images respectively.

[0063] In an embodiment of the present invention, the 280nm peak and 1700nm peak of the hyperspectral image are extracted as follows:

[0064] Obtain the band indices corresponding to 280 nm and 1700 nm of the hyperspectral image, and use a hyperspectral data analysis tool to extract the position coordinates of the pixel points in the corresponding bands according to the indices, obtaining a first data set and a second data set. The first data set includes the number and coordinates of the 280 nm peak pixel points with fertilization and incubation times from 7 days to 14 days, and the second data set includes the number and coordinates of the 1700 nm peak pixel points with fertilization and incubation times from 7 days to 14 days.

[0065] Specifically, the process of extracting the 280 nm peak and 1700 nm peak of the hyperspectral image is mainly based on analyzing the specific spectral characteristics of the embryo inside the egg using hyperspectral imaging technology. These two spectral peaks are closely related to the characteristic absorption bands of male protein (HMG17) and female protein (FOXL2) respectively. The hyperspectral image covers multiple continuous spectral bands, and each band corresponds to different light reflection or absorption characteristics. In this embodiment, 280 nm and 1700 nm respectively correspond to the spectral absorption peaks of embryo sex-related proteins. Therefore, through the hyperspectral data analysis tool, these two specific bands can be indexed from the hyperspectral data to ensure the pertinence of data extraction. At these two specific bands of 280 nm and 1700 nm, the system will identify the position coordinates of the pixel points related to these two peaks. These pixel points represent the spectral intensity information of specific regions in the hyperspectral image, which helps to quantify the distribution of embryo sex-related proteins in the egg. The first data set includes the number and coordinates of the pixel points detected under the 280 nm peak during the fertilization and incubation times from 7 days to 14 days. These data mainly reflect the absorption characteristics related to male protein (HMG17). The second data set includes the number and coordinates of the pixel points detected under the 1700 nm peak during the fertilization and incubation times from 7 days to 14 days. These data mainly reflect the absorption characteristics related to female protein (FOXL2). Through the quantitative analysis of these two characteristic spectral peaks, the present invention can extract the key spectral information related to the embryo sex and use this data to train a hyperspectral prediction model. Since there are significant differences in the 280 nm and 1700 nm peaks between male and female proteins, by comparing these two data sets, the sex of the embryo inside the egg can be accurately predicted. In addition, as the incubation time progresses (from 7 days to 14 days), the changing trends of the number and coordinates of the pixel points can also provide more stable and reliable input data for the model, thereby improving the prediction accuracy and the efficiency of early identification.

[0066] In an embodiment of the present invention, training a hyperspectral prediction model includes:

[0067] Based on the number and coordinates of the pixel points with fertilization and incubation times from 7 days to 14 days in the first data set, construct a first vector and a second vector respectively;

[0068] Construct a third vector and a fourth vector respectively based on the number of pixels and coordinates with fertilization and hatching times ranging from 7 days to 14 days in the second dataset;

[0069] Merge the first vector, the second vector, the third vector and the fourth vector to obtain a feature vector. Use the feature vector as a training sample. Encode the category of the eggs by real numbers to obtain an adjustment vector for the hidden layer of the hyperspectral prediction model, and use the corresponding embryo gender as a sample label.

[0070] In an embodiment of the present invention, the hyperspectral prediction model includes an adjustment layer, a hidden layer and a classifier:

[0071] The adjustment layer is used to adjust the feature vector based on the adjustment vector to obtain a standard vector of the feature vector;

[0072] The hidden layer includes a number of hidden units, and the hidden units are used to map the standard vector of the feature vector and output a hidden state;

[0073] The classifier is used to input the hidden state, and the classification space of the classifier represents the maximum gender probability of the embryo of the feature eggs;

[0074] The hyperspectral prediction model performs backpropagation update on the custom parameters of the hidden layer by calculating the mean squared error between the maximum gender probability of the embryo and the corresponding sample label.

[0075] Specifically, the process of training the hyperspectral prediction model mainly combines spectral data with machine learning to convert spectral information into feature vectors for the model to learn, thereby achieving accurate prediction of embryo gender. The first dataset contains the number and coordinates of pixel points corresponding to the 280nm peak within 7 to 14 days of fertilization and hatching. The second dataset contains the number and coordinates of pixel points corresponding to the 1700nm peak within 7 to 14 days of fertilization and hatching. These two datasets respectively reflect the spectral characteristics of male protein (HMG17) and female protein (FOXL2). According to the first dataset, the first vector and the second vector are constructed, representing the spectral characteristics of the 280nm peak at different time points respectively. According to the second dataset, the third vector and the fourth vector are constructed, representing the spectral characteristics of the 1700nm peak at different time points respectively. These vectors quantify the spectral characteristics of different time points and different peaks in the hyperspectral image, forming structured data for subsequent model learning. The first vector, the second vector, the third vector, and the fourth vector are combined to form a comprehensive feature vector. This feature vector not only contains the spectral information of the 280nm and 1700nm peaks but also can reflect the changing trends of spectral data at different time points. The feature vector serves as the training sample of the model, representing the overall characteristics of the eggs under hyperspectral data. The category of the eggs generates an adjustment vector for the hidden layer of the model through real number encoding. This vector dynamically adjusts the input features to adapt to the spectral characteristics of different categories of eggs. The sample label is the gender of the embryo, serving as the supervision signal of the model to guide the learning direction of the model. The model is trained by inputting the feature vector and the sample label and using a neural network structure (including an adjustment layer, a hidden layer, and a classifier): Adjustment layer: Adjust the input feature vector according to the category and perform standardization processing. Hidden layer: Extract high-order spectral features by mapping the feature vector. Classifier: Map the output of the hidden layer to the classification space and calculate the maximum gender probability of the embryo. The model continuously optimizes the parameters through backpropagation, ultimately improving the prediction accuracy. By constructing the feature vector and training the hyperspectral prediction model, the present invention effectively associates the spectral characteristics in the hyperspectral image with the embryo gender. The model can utilize the characteristic changes of the 280nm and 1700nm peaks in the spectral data to achieve early identification and efficient prediction of embryo gender, providing accurate technical support for subsequent automated detection.

[0076] In one embodiment of the present invention, the calculation formula of the adjustment layer is as follows:

[0077] ;

[0078] Wherein, represents the standard vector, represents the feature vector, represents the dimension of the feature vector, represents the index of the dimension of the feature vector, Represents the j-th element in the feature vector, Represents the i-th element in the feature vector, Represents the weight matrix, Represents the number of categories of characteristic eggs, Represents the index of the number of categories of characteristic eggs, Represents the adjustment vector corresponding to the characteristic eggs of the i-th category, Represents the adjustment vector corresponding to the characteristic eggs of the j-th category, Represents an orthogonal matrix of size, Represents the smoothing coefficient, Represents the operation of calculating the Euclidean norm, Represents the arccosine function, Represents the sign function, Represents element-wise multiplication, Represents the weight parameter, Represents the operation of calculating the square of the vector norm.

[0079] In an embodiment of the present invention, the calculation formula of the hidden layer is as follows:

[0080] ;

[0081] Wherein, Represents the hidden state, Represents The activation function, Represents The transposed vector of, Represents based on The left diagonal matrix constructed, Represents the hidden layer bias parameter.

[0082] In an embodiment of the present invention, the target eggs are dynamically detected according to a preset rule through a hyperspectral prediction model, including:

[0083] Obtain the images of the characteristic eggs of each category without a non-polar dimming lamp, and calculate the average gray value of the images of each category;

[0084] Obtain the image of the target egg without a non-polar dimming lamp, and calculate the average gray value of the image;

[0085] Calculate the difference between the average gray value of the target egg and the average gray value of the characteristic eggs of each category, and determine the characteristic eggs of the category corresponding to the smallest difference, and assign the target egg to the output of the non-polar dimming lamp of the corresponding category to obtain the hyperspectral image of the target egg with a fertilization and hatching time from 7 days to 14 days, and extract the 280nm peak and the 1700nm peak to obtain the first data set and the second data set of the target egg;

[0086] Add the Relu activation function to the parameters corresponding to the 14th day in the first and second data sets of the target eggs, and input them into the hyperspectral prediction model to obtain the maximum embryo sex probability. If the prediction is accurate, add the Relu activation function to the parameters in the first and second data sets of the target eggs day by day, and cycle to obtain the maximum embryo sex probability until the prediction is incorrect, then obtain the minimum required parameters of the hyperspectral prediction model;

[0087] Obtain the first and second data sets of the subsequent target eggs according to the minimum required parameters, and obtain the embryo sex of the subsequent target eggs.

[0088] Specifically, first, obtain the images of each category of characteristic eggs under non-dimming lighting conditions and calculate their average gray values. The average gray value represents the color depth of the eggshell or the degree of light penetration. At the same time, obtain the image of the target egg under the same conditions and calculate its average gray value. Calculate the difference between the average gray value of the target egg and the average gray value of each category of characteristic eggs. By comparing these differences, determine the category corresponding to the minimum difference, and assign the target egg to the lighting conditions (non-dimming lamp output settings) of this category. This process ensures that the lighting conditions can adapt to eggshells of different color depths and improves the accuracy of subsequent hyperspectral image data collection. According to the assigned lighting output, perform hyperspectral image collection on the target egg from 7 days to 14 days to obtain the first and second data sets of the target egg. The parameters of the 14th day in the first and second data sets of the target egg are processed by the ReLU activation function (used to introduce non-linear features) and then input into the hyperspectral prediction model. The model predicts the sex of the target egg by calculating the maximum embryo sex probability. If the prediction result on the 14th day is accurate, the model will verify the data of the target egg (from the 7th day to the 14th day) day by day, continuously cycle to calculate the maximum sex probability until the prediction result on a certain day is incorrect. At this time, the model will record the minimum data parameters required. When the prediction error occurs, it means that the current data is no longer sufficient for accurate prediction. The model will save the minimum required parameters used in the iteration. These minimum required parameters will be used in the subsequent detection process of the target egg, so as to achieve efficient detection and early sex identification of the subsequent target eggs.

[0089] For example, the system assigns the target egg to a lighting category through average gray value matching. Suppose the average gray value of the target egg is closest to that of category B, and the lighting output is set to the corresponding lighting conditions of category B. Hyperspectral image data of the target egg from day 7 to day 14 are obtained, and the features of the 280nm peak and 1700nm peak are extracted. Spectral feature data on day 14: First dataset (280nm peak): Number of pixel points = 150, coordinate data. Second dataset (1700nm peak): Number of pixel points = 120, coordinate data. ReLU activation: The parameters of these two datasets on day 14 are non-linearly processed through the ReLU activation function and input into the hyperspectral prediction model. Model prediction: The hyperspectral prediction model calculates the maximum gender probability of the embryo: Prediction result: The target egg is female (probability 90%, correct). Model verification day by day: If the prediction on day 14 is accurate, the system will trace back the spectral data of the target egg day by day, from day 13, day 12... to day 7, and conduct prediction verification respectively:

[0090] Day 13: Prediction result: Female (probability 88%).

[0091] Day 12: Prediction result: Female (probability 85%).

[0092] Day 11: Prediction result: Female (probability 82%).

[0093] Day 10: Prediction result: Female (probability 80%).

[0094] Day 9: Prediction result: Incorrect, (probability 65%, less than the preset probability threshold).

[0095] The prediction of the data on day 9 is incorrect, indicating that the data at this time is not sufficient to support the accuracy.

[0096] The system records the data parameters on day 10 as the minimum requirement parameters (i.e., the lowest available data threshold).

[0097] The system uses the data parameters on day 10 as the input requirements for subsequent target egg detection.

[0098] When detecting a new egg, the system only needs to extract the hyperspectral data on day 10 (280nm and 1700nm peaks) to quickly predict the embryo gender, significantly reducing the data acquisition volume and detection time.

[0099] The above describes the embodiments of this example, but this example is not limited to the above specific implementation manners. The above specific implementation manners are only illustrative and not restrictive. Under the inspiration of this example, those of ordinary skill in the art can also make many forms, all of which fall within the protection scope of this example.

Claims

1. A non-contact spectral identification method for identifying the sex of embryos in eggs, characterized in that: include: Step 1, obtaining a number of eggs with a fertilized incubation time of 7 days, and clustering the eggs according to the color depth of the egg surface to obtain several categories of characteristic eggs; Step 2, according to the category of the characteristic eggs, obtaining hyperspectral images of the characteristic eggs with fertilization and incubation time ranging from 7 days to 14 days at fixed time intervals; Step 3, extracting the 280 nm peak and the 1700 nm peak of the hyperspectral image to obtain a first data set and a second data set; Step 4, obtaining the sex detection result of the characteristic egg on the 15th day of fertilization and incubation time, and obtaining the embryo sex of each characteristic egg; Step 5, using the category of each characteristic egg, the first data set and the second data set as training samples, and using the corresponding embryo gender as a sample label to train a hyperspectral prediction model, including: Based on the number and coordinates of pixel points with fertilization and hatching times ranging from 7 days to 14 days in the first data set, a first vector and a second vector are constructed respectively; Based on the number and coordinates of pixel points with fertilization and hatching times ranging from 7 days to 14 days in the second data set, a third vector and a fourth vector are constructed respectively; The first vector, the second vector, the third vector and the fourth vector are combined to obtain a feature vector, the feature vector is used as a training sample, the category of the egg is encoded by real numbers to obtain an adjustment vector of the hidden layer of the hyperspectral prediction model, and the corresponding embryo gender is used as a sample label; An adjustment layer, used for adjusting the feature vector based on the adjustment vector to obtain a standard vector of the feature vector; The hidden layer includes several hidden units, which are used to map the standard vector of the feature vector and output the hidden state; A classifier, which is used to input a hidden state, and the classification space of the classifier represents the maximum probability of embryo sex of the characteristic egg; The hyperspectral prediction model reversely updates the custom parameters of the hidden layer by calculating the mean error variance of the maximum embryo gender probability and the corresponding sample label; The hyperspectral prediction model includes an adjustment layer, a hidden layer, and a classifier; The calculation formula of the adjustment layer is as follows: Among them, V std represents the standard vector, X represents the feature vector, n represents the dimension of the feature vector, j represents the index of the dimension of the feature vector, X j represents the jth element in the feature vector, X i represents the i-th element in the feature vector, W represents the weight matrix, m represents the number of categories of feature eggs, i represents the index of the number of categories of feature eggs, and a i represents the adjustment vector corresponding to the characteristic egg of the i-th category, a j represents the adjustment vector corresponding to the characteristic egg of the jth category, U represents the size of the orthogonal matrix, λ represents the smoothing coefficient, ||·|| represents the operation of obtaining the Euclidean norm, arccos represents the inverse cosine function, sgn represents the sign function, ⊙ represents element-by-element multiplication, α k represents the weight parameter, ||·|| 2 Indicates the operation of obtaining the square of the vector modulus; Step 6: Use the hyperspectral prediction model to dynamically detect the target egg according to preset rules to obtain the embryonic sex of the target egg.

2. The method for identifying the sex of embryos in eggs by non-contact spectral recognition according to claim 1, characterized in that: The eggs were clustered based on the color depth of the egg surface, including: Step a, placing the egg in the circular hole, fixing a stepless dimming lamp at the bottom of the circular hole, and adjusting the stepless dimming lamp from minimum output to maximum output according to a fixed output interval; Step b, during step a, between every two adjacent outputs of the stepless dimming lamp, placing eggs in the circular holes in sequence, and obtaining a high-definition image of each egg at a fixed position; Step c, grayscale the high-definition image to obtain the grayscale value of the corresponding egg. If the grayscale value is less than the preset grayscale threshold, repeat step b; if the grayscale value is greater than the preset grayscale threshold, the egg is used as the characteristic egg corresponding to the output of the stepless dimming lamp.

3. The method for identifying the sex of embryos in eggs by non-contact spectral recognition according to claim 2, characterized in that: According to the category of characteristic eggs, a hyperspectral image is obtained for the characteristic eggs, including: The stepless dimming lamp is adjusted to the corresponding output of the characteristic egg, and the characteristic egg is placed in the circular hole to obtain the hyperspectral image of the characteristic egg at fixed time intervals.

4. The method for identifying the sex of embryos in eggs by non-contact spectral recognition according to claim 3, characterized in that: Extract the 280nm peak and 1700nm peak of the hyperspectral image as follows: The band indexes corresponding to 280nm and 1700nm of the hyperspectral image are obtained, and the position coordinates of the pixel points of the corresponding bands are extracted according to the indexes through a hyperspectral data analysis tool to obtain the first data set and the second data set. The first data set includes the number and coordinates of 280nm peak pixels with fertilization and incubation times ranging from 7 days to 14 days, and the second data set includes the number and coordinates of 1700nm peak pixels with fertilization and incubation times ranging from 7 days to 14 days.

5. The method for identifying the sex of embryos in eggs by non-contact spectral recognition according to claim 4, characterized in that: The calculation formula of the hidden layer is as follows: Among them, h represents the hidden state, sigmoid represents the sigmoid activation function, (V std ) T Indicates V std The transposed vector, S(V std ) indicates that the std The left diagonal matrix constructed, b represents the hidden layer bias parameters.

6. The method for identifying the sex of embryos in eggs by non-contact spectral recognition according to claim 5, characterized in that: The target eggs are dynamically detected according to preset rules through the hyperspectral prediction model, including: Obtain images of non-stepless dimming lights of characteristic eggs of each category, and calculate the average grayscale value of the images of each category; Obtain an image of the target egg under the non-stepless dimming light, and calculate the average gray value of the image; Calculate the difference between the average gray value of the target egg and the average gray value of the characteristic egg of each category, and determine the characteristic egg of the category corresponding to the minimum difference, assign the target egg to the output of the stepless dimming lamp of the corresponding category, so as to obtain the hyperspectral image of the fertilized incubation time of the target egg from 7 days to 14 days, and extract the 280nm peak and the 1700nm peak to obtain the first data set and the second data set of the target egg; The parameters corresponding to the 14th day in the first and second data sets of the target eggs are added with the Relu activation function, and input into the hyperspectral prediction model to obtain the maximum sex probability of the embryo. If the prediction is accurate, the Relu activation function is added to the parameters in the first and second data sets of the target eggs day by day, and the maximum sex probability of the embryo is obtained in a cycle until the prediction is wrong, and the minimum required parameters of the hyperspectral prediction model are obtained; The first data set and the second data set of the subsequent target eggs are obtained according to the minimum required parameters, and the embryo gender of the subsequent target eggs is obtained.

Citation Information

Patent Citations

  • Gender determination method for chicken hatching egg incubation early embryo based on hyperspectral image

    CN104316473A

  • Method and system for detecting sex of early embryo of chicken hatching egg based on hyperspectral technology

    CN116930176A