Method for Rapid Identification of Sex of Hatching Eggs Using Optical Sensors
Through optical sensors, the olfactory visual detection of volatile gases in seed eggs has been solved, and efficient, economical and non-destructive gender detection of seed eggs has been achieved.
Patent Information
- Application Number
- CN202411652957.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2044-11-19
AI Technical Summary
It is difficult to achieve early non-destructive gender identification of poultry breeding eggs. The existing methods have problems such as late identification period, damage to breeding eggs, high detection costs, requiring professional operations, cumbersome process, long analysis cycle, and inability to perform visual inspections.
Optical sensors are used to visually detect the volatile gas of the seed egg. By combining the gas-sensitive material with the substrate, an array optical sensor is formed, and the optical signal changes before and after the reaction between the sensing unit and the seed egg gas are collected, and data processing and graph analysis are carried out to determine the gender of the seed egg.
Early non-destructive judgment of breeding egg gender is achieved, which reduces detection cost and time, avoids the impact on breeding egg development, and simplifies the operation process through visual detection.
Smart Images

Figure CN119147514B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of hatching egg detection, and particularly relates to a method for rapidly identifying the sex of hatching eggs by using an optical sensor. Background Art
[0002] In the existing poultry farming, it is necessary to identify the sex of chicken embryos in the early stage of the incubation period. This is not only beneficial for the hatchery to plan the incubation production configuration, but also of great significance for solving animal welfare, saving the incubation cost and the cost of disposing of waste chicks, rationally utilizing the hatching egg resources, and improving the economic benefits of the egg industry.
[0003] At present, the identification of the sex of hatching egg embryos mainly relies on the polymerase chain reaction (PCR) technology. Although this method has a high accuracy rate, it usually has a long operation time and complicated steps, and requires shell-breaking sampling, which will affect the development of chicken embryos to a certain extent and is not suitable for industrial hatching of hatching eggs. In hatcheries, the sex detection is generally carried out by the vent-sexing method, the wing-velocity method, and the plumage-color method at the chick stage. However, this manual detection method mainly relies on human subjective judgment, which is not only time-consuming and has low accuracy, but also requires the chicks to be hatched before identification. In addition, two problems of high production cost and ethical controversy need to be solved. In the past ten years or more, in order to solve the problem of non-destructive sex detection during the hatching period of hatching eggs, researchers have mainly adopted detection methods such as machine vision, spectroscopy, and odor method. Machine vision for detecting hatching eggs mainly focuses on shape recognition and blood-line recognition. However, at present, there is still a controversy among researchers on whether there is a correlation between the egg shape index and the sex of hatching eggs, and the accuracy rate of the method based on blood-line recognition needs to be improved. In addition, the spectroscopy method also has certain drawbacks and is easily interfered by factors such as individual differences of hatching eggs, such as the thickness of the eggshell, the color of the eggshell, and the placement direction of the eggs. And most of the methods using spectroscopy detection require shell-breaking minimally invasive sampling, and the detection time is mainly concentrated in the middle and late stages of incubation. For the sex identification and detection of poultry eggs, there is still a technical blank in this field at present, and non-destructive on-line detection in production has not been realized. Therefore, developing a new method that can realize early, rapid and accurate identification of hatching egg information is a bottleneck problem that needs to be urgently broken through.
[0004] Odors can represent or reflect certain essential properties of substances and are unique in terms of time and space. In recent years, there has been a growing number of research reports on the biochemical information contained or transmitted by odors. For example, seagulls can identify different types of eggs through olfaction, foxes can determine the type and freshness of bird eggs by smell, and zebras and lizards can judge the gender and physiological status of their companions through odor information. Some studies have focused on the biochemical information reflected by the odor of poultry eggs, such as fertilization, development, and parental communication. The results show that the idea of odor detection is feasible, but the detection accuracy and stability still need to be improved. Currently, in gas detection, optical sensors are widely used in real-time on-site gas detection due to their advantages such as high sensitivity, high selectivity, low cost, and small size. The most common optical sensors are based on physical adsorption or chemical interactions between chromophores or fluorophores and analytes, which cause colorimetric or fluorescence changes. Combining array-based sensing technology with novel image recognition technology can generate a composite response pattern as a unique optical "fingerprint" map for any given analyte. However, there is currently little research on using optical sensing technology for non-destructive determination of the early gender of breeding eggs, and this field urgently needs further exploration and development.
[0005] With the rapid development of the Internet of Things and artificial intelligence technologies, the demand for intelligent gas detection is increasing day by day. In recent years, gas sensors have been greatly improved in various aspects such as appearance and performance. The successful application of new materials preparation technologies such as nano, thin film, and thick film technologies provides conditions for gas sensors to achieve new functions, making them gradually develop towards miniaturization, intelligence, portability, flexible wearability, etc. At the same time, machine vision technology combined with the Internet of Things, big data, and deep learning integrates the image feature selection link into the training process, avoiding the problems of unclear image features and difficult extraction, and can better resist noise, achieving precise detection of each component of gas mixtures in intelligent gas detection.
[0006] In summary, the existing technology lacks a method and solution for non-destructive gender identification of poultry breeding eggs in the early stage based on optical methods. Summary of the Invention
[0007] Aiming at the deficiencies in this field, the present invention provides an optical sensor for olfactory visualization detection of volatile gases in poultry breeding eggs and a new method for quickly identifying the gender of breeding eggs in the early stage, overcoming many shortcomings of existing breeding egg gender identification methods, such as late identification period, damage to breeding eggs, high detection cost, requiring professional operation, cumbersome process, long analysis period, and inability to perform visualization detection, etc. The present invention first applies optical sensing technology to the visual recognition of gases in poultry breeding eggs, converts the characteristic information of gases into image information, and thus successfully realizes the early non-destructive determination of the gender of breeding eggs, providing a novel non-destructive detection method for the early gender determination of breeding eggs.
[0008] Specifically, the present invention is realized through the following technical solutions:
[0009] I. An optical sensor for visually detecting the smell of gas:
[0010] The optical sensor includes a substrate and at least two sensing units loaded in the substrate. The sensing unit contains a gas-sensitive material that can react with gas and induce changes in optical signals.
[0011] The gas-sensitive material is used to adsorb gas or interact with gas, causing changes in its own optical properties, including changes in light absorption / reflection characteristics, photoluminescence changes, and color changes, so as to detect the gas composition and concentration.
[0012] The change in photoluminescence is such as the change in fluorescence or phosphorescence.
[0013] Preferably, the gas-sensitive material includes, but is not limited to, chromophores such as dyes, nanoporous materials, gold nanoparticles, etc. that respond to gas with color changes, or fluorescent / phosphorescent groups such as metal-organic frameworks (MOFs), quantum dots, carbon dots, etc. that respond to gas with luminescence characteristics.
[0014] II. A preparation method of an optical sensor:
[0015] The gas-sensitive material is configured into a solution and ultrasonically dispersed or dissolved, and then fixed on the substrate by methods such as dropping, spraying, or printing, and dried to obtain a sensing unit. An array optical sensor is formed by uniformly distributing at least two sensing units on the substrate.
[0016] Specifically, the gas-sensitive material is added to a solvent to form a solution.
[0017] The solvent is water, ethanol, ethylene glycol monomethyl ether, tetrabutylammonium hydroxide, p-toluenesulfonic acid.
[0018] Preferably, the substrate includes, but is not limited to, eggshells, paper-based substrates, polymer substrates (such as polyethylene terephthalate PET, polyvinyl chloride film PVC, polycarbonate film PC, etc.), textile substrates, water / aerogels, etc.
[0019] III. A method for quickly identifying the sex of hatching eggs using an optical sensor:
[0020] The method uses an optical sensor composed of several sensing units to react in the environment near the hatching eggs, or uses the sensor to react with the gas collected from the hatching eggs, and then collects and processes the changes in optical signals before and after placing each sensing unit to analyze and obtain the sex of the hatching eggs.
[0021] The optical sensor performs olfactory visualization detection on the volatile gases of poultry breeding eggs, and thus realizes the sex identification of breeding eggs. The method can be to collect the visual images / spectral data of the optical signal changes of the sensing unit reacting with the egg gas.
[0022] The sensing unit of the optical sensor contains at least two different gas-sensitive materials. The method is to collect the combined optical signal changes of the sensing units of different gas-sensitive materials to form a specific spectrum, and perform analysis and processing on the spectrum, and then judge the type of the detected breeding egg.
[0023] A plurality of sensing units with different gas-sensitive materials are arranged on the same substrate. Visual images or spectral images are collected both before and after the whole substrate reacts with the egg gas, and the difference image or color difference image of the visual images or spectral images before and after reacting with the egg gas is taken as the spectrum.
[0024] When the optical signal change is a color change, natural light or artificial light source irradiates the gas-sensitive material, and the color change of the reflected light is collected by a camera, a camera, etc., and a color difference image is formed as the spectrum by comparing the images collected before and after;
[0025] When the optical signal change is a photoluminescence change, a light source with a specific fixed wavelength is used as the excitation light to irradiate the gas-sensitive material. Here, the light source is, for example, a xenon lamp or a laser, and it emits fluorescence or phosphorescence by affecting the luminescence efficiency, luminescence intensity or luminescence wavelength of the material. Subsequently, the emission spectrum data or image is collected by a spectrometer or a camera, and the difference between the spectral images before and after excitation is compared to generate a color difference image or a difference spectrum image as the spectrum;
[0026] When the optical signal change is a light absorption characteristic change, a gas-sensitive material is irradiated with a light source with a specific fixed wavelength. Here, the light source refers to the range covering ultraviolet to visible light, which causes new absorption peaks to appear, the disappearance of the original absorption peaks or the displacement of the peak positions in the material. The absorption spectrum image is collected by a spectrometer, and the difference between the spectral images before and after excitation is compared to generate a difference spectrum image as the final spectrum.
[0027] When the optical property change is a color change or a photoluminescence change, the collected images are processed in the following way to obtain the spectrum: specifically including perspective transformation, contour detection, region cropping, color analysis and color difference map drawing of the images.
[0028] First, perform perspective transformation on the image. By mapping the four specified points in the upper left, upper right, lower right and lower left of the image to a standard rectangle, the perspective correction is realized to obtain the target image;
[0029] Then, adjust the size of the image with image preprocessing, convert the image to a grayscale image, and then perform Gaussian filtering to reduce noise;
[0030] Subsequently, the Otsu threshold method is used to binarize the image to extract the contours in the image, and all the contours are sorted according to the area of the contours. The largest contour is obtained and approximated to get a quadrilateral, and the quadrilateral represents the optical sensor area in the image;
[0031] Then, after using perspective transformation to convert the detected contour area into a front view, rectangular marks are drawn according to the positions of the sensing units, and multiple regions of interest are cropped out. Each region of interest contains one and only one sensing unit;
[0032] Finally, the average values of the R, G, and B colors of the regions of interest are calculated as the R, G, and B values of the corresponding sensing units within the regions, and a color difference map / difference map is drawn using the R, G, and B values of the sensing units as the spectrum.
[0033] The method specifically includes the following steps:
[0034] Select breeding eggs, perform treatments such as scrubbing and disinfection on the breeding eggs, and then incubate them;
[0035] Place the above optical sensor in the breeding egg environment and fully react with the breeding egg gas; or collect the breeding egg gas and react it with the optical sensor;
[0036] An optical information acquisition system is used to collect the optical signals of the optical sensor before and after the steps;
[0037] Data processing and model establishment: Perform data preprocessing, feature extraction on the collected optical signals, and establish a breeding egg gender recognition model. Then, under known conditions, use the established breeding egg gender recognition model for training;
[0038] Finally, use the trained breeding egg gender recognition model to process the optical signals collected by the optical sensor that reacts with the breeding egg gas in the scene to be measured, and obtain the judgment result of the breeding egg gender.
[0039] The optical signals described include visible light images or spectral images.
[0040] The reaction methods in the steps include contact and non-contact between the optical sensor and the breeding egg;
[0041] The contact type includes, but is not limited to, spraying a gas-sensitive material on the eggshell to directly react the gas-sensitive material with the gas volatilized from the breeding egg, or attaching a flexible sensor to the eggshell surface and reacting it with the gas volatilized from the breeding egg;
[0042] The non-contact type includes, but is not limited to, placing the sensor and the breeding egg in the same chamber, where the gas-sensitive material does not come into contact but reacts with the gas volatilized from the breeding egg, or using a suction pump or a gas sampling bag to first collect the gas volatilized from the breeding egg, and then transporting the collected gas to the optical sensor for reaction.
[0043] The optical information acquisition system in the above steps includes, but is not limited to, industrial camera acquisition systems, smartphones, scanners, microplate readers, fluorescence spectrophotometers, color recognition devices, ultraviolet spectrophotometers, etc., which collect optical / visual signal data of sensors.
[0044] In the above steps, a binary classification discriminant hatching egg gender recognition model is established based on the collected optical signals such as images or spectra. The hatching egg gender recognition model includes, but is not limited to, principal component analysis (PCA), convolutional neural network (CNN), decision tree and random forest, support vector machine (SVM), artificial neural network (ANN), etc.
[0045] The hatching egg gender recognition model is taken as the EfficientNet-B0-CBAM model, which is divided into 9 stages in sequence. The first stage is the backbone network, and the backbone network only uses convolutional modules, specifically consisting only of convolutional modules. The convolutional module is mainly composed of a 3×3 convolutional operation, a connection batch normalization layer with a stride of 2, and a Swish activation function connected in sequence; the 2nd - 8th stages use the CBAM network, and each stage uses a feature extraction module CBAM mainly composed of a channel attention module CAM and a spatial attention module SAM. The 2nd stage consists of one feature extraction module CBAM with a size of 3×3, the 3rd stage consists of two feature extraction modules CBAM with a size of 3×3, the 4th stage consists of two feature extraction modules CBAM with a size of 5×5, the 5th stage consists of three feature extraction modules CBAM with a size of 3×3, the 6th stage consists of three feature extraction modules CBAM with a size of 5×5, the 7th stage consists of four feature extraction modules CBAM with a size of 5×5, and the 8th stage consists of one feature extraction module CBAM with a size of 3×3;
[0046] The feature extraction module CBAM includes a channel attention module CAM and a spatial attention module SAM. The original feature map F input to the feature extraction module CBAM is processed by the channel attention module CAM to obtain a channel feature map Mc, and then the channel feature map Mc and the original feature map F itself are multiplied together to obtain a channel attention map F’. Then, the channel attention map F’ is processed by the spatial attention module SAM to obtain a spatial feature map Ms, and then the spatial feature map Ms and the channel attention map F’ itself are multiplied together to obtain a spatial attention map F’’, which is used as the output of the feature extraction module CBAM;
[0047] The channel attention module CAM includes a max pooling layer, an average pooling layer, and a multi-layer perceptron MLP. The original feature map F is processed by the max pooling layer and the average pooling layer respectively and then input into the multi-layer perceptron MLP to obtain the first global descriptor vector1 and the second global descriptor vector2 respectively. The first global descriptor vector1 and the second global descriptor vector2 are added together and then processed by a convolutional layer to obtain the channel feature map Mc. The spatial attention module SAM includes a max pooling layer and an average pooling layer. The channel attention map F’ is processed by the max pooling layer and the average pooling layer and then connected together, and then processed by a convolutional layer to obtain the spatial feature map Ms. Finally, the ninth stage is composed of a 1×1 convolutional operation, a global average pooling layer, a fully connected layer, and a Softmax activation function connected in sequence.
[0048] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0049] 1. The optical sensor constructed by the present invention has the characteristics of small volume, simple operation, low cost, and high throughput, reduces the dependence on large-scale detection instruments and professional operators, and at the same time reduces the detection cost, and has broad application prospects in on-site detection.
[0050] 2. At present, most detection technologies for sex identification of breeding eggs focus on the middle and late stages of incubation and the hatching stage. The present invention can accurately identify the sex of poultry breeding eggs in the early stage of incubation, overcomes the disadvantages of late identification and damage of the existing breeding egg sex identification methods, successfully makes an early non-destructive determination of the sex of poultry breeding eggs, greatly reduces the economic cost during the incubation process of breeding eggs, and avoids the waste of egg resources and the ethical controversy caused by killing male chicks.
[0051] 3. The optical gas sensor constructed by the present invention forms a specific "fingerprint" map by collecting the optical information changes of the sensing unit before and after contacting different volatile gas molecules by the array sensor, realizes the visualization of the artificial olfactory system, and does not require the use of any professional equipment and can even be qualitatively identified by the naked eye.
[0052] 4. The method for identifying and analyzing the sex of poultry breeding eggs by volatile gases in the present invention is a feasible non-destructive method, overcomes the disadvantage that the existing breeding egg sex identification method needs to sample by breaking the shell of the breeding egg, and reduces the impact on the development of the breeding egg.
[0053] 5. The present invention first combines an optical sensor with machine learning technology to realize the early non-destructive detection and discrimination of the sex information of breeding eggs. Through the application of deep learning technology and the improvement of the model, the images are efficiently classified and recognized, the accuracy and efficiency of the sex determination of breeding eggs are improved, and it has high practical value and broad application prospects, providing new opportunities for the intelligent automation of future poultry breeding egg sex identification.
[0054] 6. For the actual application scenario, the present invention constructs a convolutional neural network model for rapid identification of the sex of hatching eggs. An attention mechanism is introduced in the feature extraction network part, enabling the network to simultaneously focus on the feature information in both the channel and spatial dimensions, suppressing unimportant feature information, strengthening the extraction of deep features of the image, and achieving better results in convolution. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a test tube photo of 36 gas-sensitive dyes prepared in the present invention;
[0056] Figure 2 It is a schematic diagram of the optical sensor prepared in the present invention;
[0057] Figure 3 It is a schematic diagram of the structure and detection principle of the present invention;
[0058] Figure 4 It is a color difference map before and after the optical sensor prepared in the present invention detects the gas of hatching eggs on the 6th day;
[0059] Figure 5 It is a schematic diagram of the EfficientNet-B0 benchmark network structure adopted by the hatching egg sex recognition model constructed in the present invention;
[0060] Figure 6 It is a schematic diagram of the CBAM feature extraction module structure introduced in this embodiment;
[0061] Figure 7 It is a schematic diagram of the overall network topology structure of the hatching egg sex recognition model provided in this embodiment;
[0062] Figure 8 It is a graph of the accuracy rate results of distinguishing male and female hatching eggs on the 6th day of incubation using 2 models in the present invention;
[0063] Figure 9 It is a graph of the results of predicting the sex of hatching eggs in the present invention;
[0064] Figure 10 It is a schematic diagram of the hatching egg tattoo sensor prepared in the present invention;
[0065] Figure 11 It is a schematic diagram of the hatching egg tattoo sensor after image correction in the present invention;
[0066] Figure 12 It is a graph of the discriminant accuracy rate results of 2 models of the hatching egg tattoo sensor in the present invention;
[0067] Figure 13 It is the structure of the laser-cut paper-based sensor designed in the present invention;
[0068] Figure 14 Schematic diagram of the fluorescence array sensor prepared for the present invention;
[0069] Figure 15 Accurate discrimination result diagram of two models of the fluorescence array sensor of the present invention. Specific implementation manners
[0070] The present invention will be further described below through specific embodiments in conjunction with the accompanying drawings, but the present invention is not limited thereto.
[0071] The specifically implemented optical sensor includes a substrate and at least one sensing unit loaded in the substrate, and the sensing unit contains a gas-sensitive material that can react with a gas and induce a change in an optical signal.
[0072] The gas-sensitive material is used to adsorb a gas or interact with a gas, causing a change in the optical properties of the material itself, such as changes in light reflection, absorption, photoluminescence characteristics, etc., which are macroscopically manifested as optical / visual changes of the sensing unit, such as changes in color, fluorescence, phosphorescence, etc. The fluorescence changes include but are not limited to fluorescence enhancement, fluorescence weakening, fluorescence quenching, etc.
[0073] Preferably, the gas-sensitive material includes but is not limited to chromophores that respond to gases with color changes, such as dyes (e.g., pH indicator dyes, redox indicator dyes, solvatochromic dyes, complexometric titration indicator dyes), nanoporous materials, gold nanoparticles, etc., or fluorescence / phosphorophores that respond to gases with luminescence characteristics, such as metal-organic frameworks (MOFs), quantum dots, carbon dots, etc.
[0074] Since the gas-sensitive materials are different, the optical signal changes of each sensing unit under normal conditions will also be different. The optical / visual change is caused by external light incident on the gas-sensitive material, reflected by the gas-sensitive material, and then collected by an optical detection device. The external light can be visible light, ultraviolet light, etc. The optical detection device is a camera, a camera, or a spectrometer.
[0075] In specific implementation, for the preparation, the gas-sensitive material is configured into a solution and then fixed on the substrate by methods such as dropping, spraying, or printing to obtain a sensing unit, and an array optical sensor is formed by the distribution of at least one sensing unit on the substrate.
[0076] Preferably, the substrate includes but is not limited to eggshells, paper-based substrates, polymer substrates (e.g., polyethersulfone resin film PES, polyethylene terephthalate PET, polyvinyl chloride film PVC, polycarbonate film PC, etc.), textile substrates, water / aerogels, etc.
[0077] The shape and size of the optical sensor are not particularly limited and are designed according to needs, such as a 3 cm * 3 cm square, etc.
[0078] For different gases, the optical signal changes of the same sensing unit will be different; for the same gas, the optical signal changes of different sensing units are also not the same.
[0079] The method of the present invention uses an optical sensor composed of several sensing units and places it in the environment near the hatching eggs. It can be arranged closely to the hatching eggs or collect the gases of the hatching eggs and react with the optical sensor. The optical signal changes before and after each sensing unit is placed are input into a computer for processing and analysis to obtain the sex of the hatching eggs, and finally displayed on a display.
[0080] The optical sensor performs olfactory visualization detection on the volatile gases of poultry hatching eggs, and thus realizes the sex identification of hatching eggs. The method can be to collect the visual change images before and after the reaction of the sensing unit with the gases of the hatching eggs.
[0081] The optical sensor contains sensing units with at least two different gas-sensitive materials. The method is to collect the optical signal changes of the sensing units with different gas-sensitive materials and combine them to form a specific spectrum, and analyze and process the spectrum to further judge the type of the detected hatching eggs.
[0082] On the same substrate, multiple sensing units with different gas-sensitive materials are arranged. The gas-sensitive materials contained in each sensing unit are different, and the sensing units corresponding to different gas-sensitive materials are arranged at different positions. The whole substrate is placed near the hatching eggs for reaction or reacts with the collected gases of the hatching eggs. The visual images or spectral images before and after the reaction of the sensor are collected, and the difference image or color difference image of the visual images or spectral images before and after the reaction with the gases of the hatching eggs is taken as the spectrum.
[0083] Specifically, the whole substrate first collects the visual image or spectral image as the first image, and then the visual image or spectral image collected after reacting with the gases of the hatching eggs is used as the second image, and the difference image or color difference image between the first image and the second image is calculated as the spectrum.
[0084] When the optical signal change is a color change, natural light or artificial light source irradiates the gas-sensitive material, and the color change of the reflected light can be collected by a camera, a camera, etc. The color difference image is formed as the spectrum by comparing the images collected before and after;
[0085] When the optical signal change is a photoluminescence change, a light source with a specific wavelength (such as a xenon lamp or a laser) is used as the excitation light to irradiate the gas-sensitive material, and the fluorescence or phosphorescence is emitted by affecting the luminescence efficiency, luminescence intensity or luminescence wavelength of the material. Subsequently, the emission spectrum data or images are collected by a spectrometer or a camera, and the difference between the spectral images before and after excitation is compared, and the color difference image or difference spectrum image is generated as the spectrum;
[0086] When the optical signal changes to a change in light absorption characteristics, irradiating the gas-sensitive material with a light source of a specific wavelength (covering the ultraviolet to visible light range) may cause new absorption peaks to appear in the material, the disappearance of the original absorption peaks, or the displacement of the peak positions. Use a spectrometer to collect the absorption spectrum image and compare the differences in the spectrum images before and after excitation, so as to generate a difference spectrum image as the final spectrum.
[0087] In this way, at least two sensing units contain different gas-sensitive materials, enabling specific detection of gases.
[0088] The specific rapid identification method implemented specifically includes the following steps:
[0089] (1) Select breeding eggs, perform treatments such as scrubbing and disinfection on the breeding eggs and then incubate them;
[0090] The breeding eggs in step (1) are selected as poultry breeding eggs, such as chicken eggs, duck eggs, goose eggs, etc. The incubation conditions can all adopt known standard incubation methods.
[0091] (2) Place the above optical sensor in the breeding egg environment and fully react with the gas emitted by the breeding eggs; or collect the breeding egg gas and react with the optical sensor;
[0092] The reaction methods in step (2) include contact and non-contact between the optical sensor and the breeding eggs:
[0093] The contact method includes, but is not limited to, spraying a gas-sensitive material on the eggshell to directly react the gas-sensitive material with the gas volatilized from the breeding eggs, or attaching a flexible sensor to the eggshell surface and reacting with the gas volatilized from the breeding eggs;
[0094] The non-contact method includes, but is not limited to, placing the sensor and the breeding eggs in the same common chamber, where the gas-sensitive material does not come into contact but senses and reacts with the gas volatilized from the breeding eggs, or using a suction pump or a gas sampling bag to first collect the gas volatilized from the breeding eggs, and then transporting the collected gas to the optical sensor for sensing and reaction, ultimately causing an optical signal change in the gas-sensitive material.
[0095] (3) Use an optical information acquisition system to collect the optical images of the optical sensor both before and after step (2);
[0096] The optical information acquisition system in step (3) includes, but is not limited to, an industrial camera acquisition system, a smartphone, a scanner, an enzyme-labeled instrument, a fluorescence spectrophotometer, a color recognition device, an ultraviolet spectrophotometer, etc. to collect the optical signal data of the sensor.
[0097] The obtained optical signal data includes, but is not limited to, RGB color information, ultraviolet spectrum signal, fluorescence intensity signal, etc.
[0098] (4)Construct a dataset from the above - collected optical images;
[0099] The dataset in step (4) is composed of pre - processed chromatic aberration maps and gender annotation labels for subsequent model training.
[0100] Build a model;
[0101] In step (5), machine learning techniques are used to establish a sex recognition model for hatching eggs' optical signals by using data analysis software including but not limited to Python, Matlab, etc.
[0102] In step (5), a binary - classification sex recognition model for hatching eggs can be established based on the collected optical signals such as images or spectra. Then, under the condition of known egg genders, the recognition model is trained using the method of transfer learning to obtain the model parameters. After the training is completed, the trained weights are saved to obtain the sex recognition model for hatching eggs. This model includes but not limited to principal component analysis (PCA), convolutional neural network (CNN), decision tree and random forest, support vector machine (SVM), artificial neural network (ANN), etc.
[0103] (6) Finally, the trained sex recognition model for hatching eggs is used to process the optical images collected from the optical sensors placed in the hatching - egg environment under the test scenario, and the judgment result of the hatching - egg gender is output through calculation, ultimately realizing non - destructive detection of hatching - egg gender in the early stage of incubation.
[0104] Embodiments of the present invention are as follows: Embodiment 1:
[0105] The sensor substrate is selected as a PES film. The film is cut into rectangular paper substrates with a size of 5.0 mm * 6.0 mm and uniformly arranged in a polytetrafluoroethylene frame plate in a planar array form to obtain a film - array sensor.
[0106] Weigh 4 mg of each of 36 dyes into 36 centrifuge tubes respectively. By adding 1 mL of ethanol and under the condition of ultrasonic treatment, different types of dye solutions as shown are obtained. Figure 1 The 36 dyes are classified according to their chemical structures, including aniline dyes, phenol dyes, azo dyes, aromatic amine dyes, ketone dyes, aldehyde dyes, pyrrole dyes, indole dyes, phthalocyanine dyes, anthraquinone dyes, nitrobenzene dyes, phenolic aldehyde dyes, benzoquinone dyes, carbazole dyes, pyrazole dyes, acid dyes, azoketone dyes, copper phthalocyanine dyes. Such as bromocresol green, methyl red, N, N'-diphenyl - 1, 4 - phenylenediamine, toluidine blue, etc.
[0107] Take 4 μL of each of the above-obtained 36 dye solutions with a pipette and drop them sequentially onto the above PES film substrate, and dry them on a hot plate at 36 °C for 48 hours to obtain the Figure 2 colorimetric sensing array shown below, where each circular dot after the addition of each dye solution serves as a sensing unit.
[0108] The detection process is as Figure 3 shown below. Select the Jinghong No. 1 chicken breeding eggs as the detection samples, wipe and disinfect the sample breeding eggs with 75% ethanol solution, and let them air dry naturally. Among them, the egg weight is 49.82 - 69.72 g, the long axis is 53.13 - 61.81 mm, the short axis is 40.03 - 51.87 mm, and the egg shape index (long axis / short axis) is 1.10 - 1.45. Place each breeding egg in an independent incubator, and the temperature for incubation is 37 - 38 °C, and the humidity is 60 - 70%. Turn the eggs every 90 minutes.
[0109] First, use an industrial camera acquisition system to collect the pre-reaction image data of the above colorimetric sensing array, adjust the camera focal length, aperture size, and object distance, and set the exposure parameter of the industrial camera software to 120 ms. The image acquisition process is carried out in a photographic darkroom with incandescent light conditions. The light source is a 20 - 40W positive white light LED, and the color temperature is 6000 - 7000K to ensure that the collected image information is not affected by environmental light and other factors.
[0110] Subsequently, place the colorimetric sensor and the breeding eggs on the 6th day of the incubation period in an independent incubator near the air chamber of the breeding eggs, so that the sensor makes stable contact with the gas generated during the breathing process of the breeding eggs, and the color of the sensing unit changes. The image after 24 h of reaction is obtained again through an industrial camera.
[0111] Use the Python image processing algorithm to preprocess and denoise the collected colorimetric sensing array images to reduce the computational amount, improve the operation efficiency and computational accuracy, and extract the mean values of the R, G, B (red, green, blue) channels of the image color. The specific method is to perform perspective correction and adjust the fixed size of the image file, then convert it into a grayscale image and perform Gaussian filtering. Use the Otsu threshold method to perform image binarization to extract the contours in the image, and sort them according to the area of the contours. By approximating the largest contour, a quadrilateral is obtained, and this quadrilateral represents the optical sensor area in the image.
[0112] Cut the extracted area into 6*6 small areas according to the position of the sensing unit, and obtain the average R, G, B values of the 12*20 pixel value area in each small area, that is, obtain the R, G, B values representing the color of the sensing unit area.
[0113] Obtain the image data before and after the reaction (i.e., before and after being placed near the hatching eggs) and process it, calculate the differences in the R, G, and B values of each sensing unit. And amplify the differences in the R, G, and B values of each sensing unit (converting from 4 - 19 to 0 - 255), and then plot it into a color difference map as shown in Figure 4 shown.
[0114] After the chicks successfully hatch, identify the true gender of the chicks according to methods such as feather color and vent sexing, and define the color difference maps as the color difference maps of female and male chicks respectively.
[0115] Perform data augmentation processing on the images, randomly adjust the brightness, contrast, and saturation within [-0.2, 0.2] respectively, and convert the images into grayscale images with a probability of 0.5.
[0116] Design and build an EfficientNet - B0 - CBAM model for rapid identification of hatching egg gender. The model uses the EfficientNet - B0 baseline network as the backbone structure and introduces a Convolutional Block Attention Module (CBAM). It retains the advantages of EfficientNet in terms of structure, achieving state - of - the - art accuracy on the ImageNet dataset, and the number of parameters of the network is reduced by an order of magnitude compared to networks such as ResNet50 and InceptionV2. The network structure of EfficientNet - B0 is as shown in Figure 5 shown. Replace the original bottleneck convolution (Mobile inverted Bottleneck Convolution, MBConv) module with a convolutional attention module, and sequentially apply a Channel Attention Module (CAM) and a Spatial Attention Module (SAM). By giving different weights to the information that needs to be emphasized or suppressed, it helps the information flow within the network and has a better effect in convolution. The adopted CBAM structure is as shown in Figure 6 shown.
[0117] Among them, the hatching egg gender recognition model is taken as the EfficientNet - B0 - CBAM model, which is divided into 9 stages in sequence:
[0118] The first stage is the backbone network. The backbone network only uses convolutional modules, specifically consisting only of convolutional modules. The convolutional module is mainly composed of a 3×3 convolutional operation, a connection batch normalization layer with a stride of 2, and a Swish activation function connected in sequence.
[0119] In the 2nd - 8th stages, the CBAM network is adopted. In each stage, a feature extraction module CBAM mainly composed of a channel attention module CAM and a spatial attention module SAM is used. The 2nd stage consists of a feature extraction module CBAM with a size of 3×3. The 3rd stage consists of two feature extraction modules CBAM with a size of 3×3. The 4th stage consists of two feature extraction modules CBAM with a size of 5×5. The 5th stage consists of three feature extraction modules CBAM with a size of 3×3. The 6th stage consists of three feature extraction modules CBAM with a size of 5×5. The 7th stage consists of four feature extraction modules CBAM with a size of 5×5. The 8th stage consists of a feature extraction module CBAM with a size of 3×3.
[0120] The feature extraction module CBAM includes a channel attention module CAM and a spatial attention module SAM. The original feature map F input to the feature extraction module CBAM is processed by the channel attention module CAM to obtain a channel feature map Mc. Then, the channel feature map Mc and the original feature map F itself are multiplied together to obtain a channel attention map F'. This channel feature map Mc is multiplied by the original feature map F, thereby realizing the selective amplification or weakening of different channel features. The channel attention map F' is calculated through a convolutional layer. Then, the channel attention map F' is processed by the spatial attention module SAM to obtain a spatial feature map Ms. Then, the spatial feature map Ms and the channel attention map F' itself are multiplied together to obtain a spatial attention map F'', which is used as the output of the feature extraction module CBAM.
[0121] The channel attention module CAM includes a max - pooling layer, an average - pooling layer, and a multi - layer perceptron MLP. The original feature map F is respectively processed by the max - pooling layer and the average - pooling layer and then input into the multi - layer perceptron MLP to obtain a first global descriptor vector1 and a second global descriptor vector2 respectively. The first global descriptor vector1 and the second global descriptor vector2 are added together and then processed by a convolutional layer to obtain a channel feature map Mc; these two descriptors respectively capture the importance and distribution of different channels in the feature map. Then, these descriptors are passed to a series of convolutional layers, and finally an attention map Mc with the same number of channels as the input feature map is generated.
[0122] The spatial attention module SAM includes a max pooling layer and an average pooling layer. The channel attention map F' is processed by the max pooling layer and the average pooling layer and then connected together, and then processed by a convolutional layer to obtain the spatial feature map Ms. In this process, the average value AvgPool and the maximum value MaxPool at each position in the feature map are first calculated, and then these two statistics are connected and passed to a convolutional layer to generate a single two-dimensional spatial feature map Ms. This attention map Ms is also multiplied by the feature map F' so that the model can focus on the key regions, and the spatial attention map F'' is calculated through the convolutional layer.
[0123] Finally, the 9th stage is composed of a 1×1 convolution operation, a global average pooling layer, a fully connected layer, and a Softmax activation function connected in sequence.
[0124] In this embodiment, the first stage is a 3×3 ordinary convolution with a stride of 2, connected to a batch normalization (BatchNormalization, BN) layer and a Swish activation function; the 2nd - 8th stages use the CBAM module to replace the original MBConv module, and the number of repetitions of this module at each stage corresponds to the layer number Li; the last stage is a 1×1 convolution, global average pooling, and a fully connected layer, and a Softmax activation function can be added for classification. The overall network topology of the model is as Figure 7 shown.
[0125] The method of transfer learning is used for training. It is trained using the ImageNet dataset and then transferred to the improved EfficientNet network and fine-tuned using the sample set. After the training is completed, a model for identifying the gender of breeding eggs is obtained: During the training process, the Adam optimizer is selected to iteratively update the weight parameters of the neural network, and the Softmax classifier is used to output the probability that the image is estimated to be a male breeding egg or a female breeding egg; the loss function used is categorical cross-entropy; after the training is completed, the model weight parameters are saved.
[0126] Among them, the model performance evaluation can adopt the following index parameters, including:
[0127] Accuracy = ( TP + TN ) / ( TP + TN + FP + FN ) × 100%
[0128] Recall = TP / ( TP + FN ) × 100%
[0129] Precision = TP / ( TP +FP ) × 100%
[0130] F1-score = [( Precision -1 + Recall -1 ) / 2] -1 × 100%
[0131] AUC = TP / 2( TP + FN )+ TN / 2( TN + FP )] × 100%
[0132] TP : True Positive, which is judged as a positive sample and is actually a positive sample;
[0133] TN : True Negative, which is judged as a negative sample and is actually a negative sample;
[0134] FP : False Positive, which is judged as a positive sample but is actually a negative sample;
[0135] FN : False Negative, which is judged as a negative sample but is actually a positive sample.
[0136] Accuracy ( Accuracy ): The recognition accuracy of the model on the dataset, that is, the proportion of the number of correctly recognized samples to the total number of samples.
[0137] Recall ( Recall ): It refers to the proportion of the number of samples that are truly positive among the samples predicted as positive by the classifier to the total number of samples that are truly positive.
[0138] Precision ( Precision ): It refers to the proportion of the number of samples that are truly positive among the samples predicted as positive by the classifier to the total number of samples predicted as positive.
[0139] F1-score ( F1-score ): An index used to comprehensively consider precision and recall, which is the harmonic mean of precision and recall.
[0140] Area Under the Curve ( AUC):It is a comprehensive evaluation index related to the ROC curve, which can visually compare and evaluate the performance of classifiers. The closer the ROC curve is to the upper left corner and the larger the area under the curve, the better the performance of the classifier.
[0141] Build the classic VGGNet16 model for feature extraction. Its structure mainly consists of unified convolutional layers and pooling layers. By increasing the depth of the network, it can effectively extract complex features and improve classification performance. Its topological structure consists of 16 layers, including 13 convolutional layers and 3 fully connected layers. The convolutional layers use 3x3 convolutional kernels and ReLU as the activation function. After consecutive convolutional layers, a max pooling layer is connected, and finally, a fully connected layer is connected for classification.
[0142] Divide the defined color difference map dataset into a 70% training set and a 30% test set for training and evaluating the model, and create corresponding data loaders. During the training process, the number of iterations is set to 100, the learning rate is 0.001, and the batch size is 8.
[0143] As Figure 8 shown, use the classic VGGNet16 model and the EfficientNet-B0-CBAM model of the present invention to train and test the color difference map dataset of breeding eggs respectively. The results show that the accuracy of the classic VGGNet16 algorithm is 94.0%, and the accuracy of the breeding egg gender rapid recognition algorithm EfficientNet-B0-CBAM proposed by the present invention is 100.0%, which improves the accuracy and efficiency of early breeding egg gender recognition, and the precision, recall rate, and accuracy of EfficientNet-B0-CBAM are all higher than those of VGGNet16 in the comparative experiment.
[0144] Select the EfficientNet-B0-CBAM model with the best resolution accuracy for male and female breeding eggs for subsequent non-destructive detection of breeding egg gender in the early stage of incubation. As Figure 9 shown, according to the pre-established model, by inputting the color difference map of the colorimetric sensor after reacting with the breeding egg to be measured, the gender of the breeding egg to be measured can be successfully obtained. Example 2:
[0145] Weigh 18 kinds of dye powders on a glass grinding plate respectively, and add gum arabic, ox bile, and glycerin drop by drop, with a mass ratio of 3:2:1:4. At the same time, grind the mixture with a pestle for 15 minutes to obtain different kinds of semi-fluid inks. The 18 selected dyes are classified according to their chemical structures and include indicator classes, amine compounds, metal complexes, and other reagents, such as bromophenol red, bromocresol green, methyl red, diphenylamine, manganese porphyrin, etc.
[0146] Select the eggs of Jinghong No. 1 chicken breed as the test samples, wipe and disinfect the sample eggs with 75% ethanol solution, and air dry them naturally. Among them, the egg weight is 49.82 - 69.72 g, the long axis is 53.13 - 61.81 mm, the short axis is 40.03 - 51.87 mm, and the egg shape index (long axis / short axis) is 1.10 - 1.45.
[0147] Use fiber materials to prepare a 3*6 transfer array stamp. The raised parts of the stamp are all circles with a diameter of 3*3 mm. Use a pipette to coat each circular raised part of the transfer array stamp with the 18 kinds of dye inks obtained in sequence. Then quickly press the stamp soaked with ink in the middle of the clean eggshell of the egg, and place it at room temperature to dry for 3 hours to obtain the Figure 10 egg with a loaded tattoo sensor as shown. Each circular dot formed by dropping each kind of dye ink on the egg serves as a sensing unit.
[0148] Use an industrial camera acquisition system to collect the image data of the above tattoo eggs before the sensor reacts. Adjust the camera focal length, aperture size, and object distance, and set the exposure parameter of the industrial camera software to 120 ms. The image acquisition process is carried out in a photographic darkroom with incandescent light conditions. The light source is a 20 - 40W positive white light LED, and the color temperature is 6000 - 7000K to ensure that the collected image information is not affected by environmental light and other factors.
[0149] Place each tattoo egg in an independent incubator. The incubation temperature is 37 - 38°C, and the humidity is 60 - 70%. Turn the eggs once every 90 minutes. Make the tattoo sensor come into stable contact with the gas generated during the breathing process of the eggs, and the color of the sensing unit changes. The image of the tattoo eggs after 3 days of continuous reaction is obtained again through an industrial camera.
[0150] Use the Python image processing algorithm to preprocess and denoise the collected tattoo sensor array images to reduce the computational amount, improve the operation efficiency and computational accuracy, and extract the color R, G, B features of the images. The specific method is as follows: First, correct the image of the egg arc distortion collected. The distortion coefficients are k1 = 0.1, k2 = 0.02, k3 = 0.003. Then perform mapping calculations to ensure that the center point (cx, cy) is correctly calculated, ensure that there is appropriate distortion correction around the center point after mapping, and finally ensure that the output image size is the same as the input image through slicing to avoid blanks in the boundary part. Output the Figure 11 corrected tattoo egg image as shown.
[0151] Adjust the corrected image file to a fixed size, and ensure that the distance from the left wireframe edge to the center point of the first circular dye ink is the same. Subsequently, convert the image to a grayscale image and perform Gaussian filtering. Use the Otsu threshold method for image binarization to obtain the contours of the image, and sort them according to the area of the contours. Approximate the largest contour to obtain a quadrilateral, which represents the optical sensor area in the image. Crop the extracted area into 3*6 small areas according to the positions of the sensing units, and obtain the average R, G, and B colors of the square areas with a width and height of 12 pixels in each small area, that is, obtain the R, G, and B values representing the color of the area.
[0152] Obtain the image data before and after the reaction and process it, calculate the differences in the R, G, and B values of each sensing unit. And amplify the differences in the R, G, and B values of each sensing unit (converted from 4 - 19 to 0 - 255), and then plot them as a color difference map.
[0153] After the chicks successfully hatch, identify the true gender of the chicks according to methods such as feather color and vent sexing, and define the color difference maps as the color difference maps of female and male chicks respectively.
[0154] Perform data augmentation processing on the image, randomly adjust the brightness, contrast, and saturation within [-0.2, 0.2] respectively, and convert the image to a grayscale image with a probability of 0.5.
[0155] Design and build an EfficientNet - B0 - CBAM model for rapid sex identification of hatching eggs. Use the EfficientNet - B0 benchmark network as the backbone structure and introduce the CBAM module, that is, apply the CAM module and the SAM module in sequence. By giving different weights to the information that needs to be emphasized or suppressed, it helps the information flow within the network and extracts deeper feature information in the convolution. The feature map output by the image after passing through the CBAM module is classified through the fully connected layer and activation function in the classification network to output the sex identification result corresponding to the hatching egg sample image. For details, see Example 1.
[0156] Build the classic model VGGNet16, for details, see Example 1.
[0157] Divide the defined color difference map dataset into a 70% training set and a 30% test set for training and evaluating the model, and create the corresponding data loaders. During the training process, set the number of iterations to 100, the learning rate to 0.001, and the batch size to 8.
[0158] Use the classic model VGGNet16 and the EfficientNet - B0 - CBAM model of the present invention to train and test the hatching egg color difference map dataset respectively, and the results are as Figure 12As shown in the figure, the accuracy rate of the efficient egg gender rapid recognition algorithm EfficientNet-B0-CBAM proposed by the present invention is 93.0%, while the accuracy rate of the classical model VGGNet16 algorithm is 86.0%. The present invention improves the accuracy and efficiency of early egg gender recognition, and the precision rate, recall rate and accuracy rate of EfficientNet-B0-CBAM are all higher than those of VGGNet16 in the comparative experiment. Select EfficientNet-B0-CBAM as the optimal model for subsequent non-destructive prediction of the gender of early incubated eggs. Example 3:
[0159] Use the laser cutting method to cut the PES film substrate. First, use computer-aided design software to design the engraving path and parameters. Place the PES paper-based material on the laser engraving system workbench, and set the laser engraving system according to the designed engraving parameters. Among them: select the vector mode, laser power 5.0%, engraving speed 45%, PPI 750. Finally, a rectangular sensor substrate with a size of 27.6 mm * 30.8 mm is obtained, with a total of 9 sensing units evenly distributed in a 3 * 3 pattern inside, and the size of each single sensing unit is a rectangle of 2.9 mm * 3.5 mm. Under the same operation, a square sensor substrate with a size of 13 mm * 13 mm can be obtained, with 9 circular sensing units with a diameter of 3 mm evenly distributed inside. The design of the sensor substrate is as Figure 13 shown, including a sensing area, a connection area and an isolation area.
[0160] Weigh 4 mg of each of 9 fluorescent materials into 9 centrifuge tubes respectively, and obtain 9 solutions or suspensions by adding 1 mL of ethanol under ultrasonic conditions. The 9 fluorescent sensing substances include amine dyes, phthalocyanine dyes, aldehyde dyes, nitrate dyes. Such as Lissamine Green, Diphenylamine, Thymol Blue, etc.
[0161] Take 4 μL of each of the obtained 9 fluorescent sensing solutions by a pipette and drop them sequentially on the sensing area of the above-mentioned sensor substrate, and dry and stabilize them on a heating plate at 36 °C for 48 hours. Under ultraviolet excitation light of 365 nm, a fluorescent sensing array as Figure 14 shown (the figure takes the internal circular sensing unit as an example) is obtained.
[0162] Select Jinghong No. 1 chicken eggs as the detection samples, wipe and disinfect the sample eggs with 75% ethanol solution, and air dry them naturally. Among them, the egg weight is 49.82 - 69.72 g, the long axis is 53.13 - 61.81 mm, the short axis is 40.03 - 51.87 mm, and the egg shape index (long axis / short axis) is 1.10 - 1.45. Place each egg in an independent incubator, and the incubation conditions are a temperature of 37 - 38 °C and a humidity of 60 - 70%, and turn the eggs every 90 minutes.
[0163] An industrial camera acquisition system is used to acquire the pre-reaction image data of the above fluorescence sensing array. The camera focal length, aperture size, and object distance are adjusted, and the exposure parameter of the industrial camera software is set to 120 ms. The image acquisition process is carried out in a photographic dark box equipped with 365 nm ultraviolet excitation light to ensure that the acquired image information is not affected by environmental light and other factors.
[0164] The fluorescence sensor is placed in the chamber of a separately incubated hatching egg on the 5th day of the incubation period, and is suspended near the air chamber of the hatching egg, so that the sensor makes stable contact with the gas generated during the breathing process of the hatching egg. The color of the sensing unit changes, and the image of the sensor after 24 h of reaction is obtained again through the industrial camera.
[0165] Use Python image processing algorithms to preprocess and denoise the acquired fluorescence sensing array images to reduce the computational amount, improve the operation efficiency and computational accuracy, and extract the mean values of the color R, G, B (red, green, blue) channels of the images. The specific method is to perform perspective correction and adjust the fixed size on the image file, then convert it into a grayscale image and perform Gaussian filtering. Use the Otsu threshold method to perform image binarization to extract the contours in the image, and sort them according to the area of the contours. By approximating the largest contour, a quadrilateral is obtained, and this quadrilateral represents the area of the optical sensor in the image. The extracted area is cut into 3*3 small areas according to the position of the sensing unit, and the R, G, B color averages of the 12*12 pixel value areas in each small area are obtained, that is, the R, G, B values representing the color of the sensing unit area are obtained.
[0166] Obtain the image data before and after the reaction and process them, calculate the differences in the R, G, B values of each sensing unit. And amplify the differences in the R, G, B values of each sensing unit (converted from 4 - 19 to 0 - 255), and then draw them into a color difference map.
[0167] After the chicks successfully hatch out of the shell, distinguish the true gender of the chicks according to methods such as feather color and vent sexing, and define the color difference maps as the color difference maps of female and male chicks respectively.
[0168] Perform data augmentation processing on the images, randomly adjust the brightness, contrast, and saturation within [-0.2, 0.2] respectively, and convert the image into a grayscale image with a probability of 0.5.
[0169] Design and build an EfficientNet-B0-CBAM model for rapid identification of the sex of hatching eggs. The EfficientNet-B0 baseline network is used as the backbone structure, and the CBAM module is introduced, that is, the CAM module and the SAM module are applied in sequence. By giving different weights to the information that needs to be emphasized or suppressed, it helps the information flow within the network and extracts deeper feature information in the convolution. The feature map output after the image passes through the CBAM module is classified through the fully connected layer and activation function in the classification network to output the sex identification result corresponding to the hatching egg sample image. For details, see Example 1.
[0170] Build the classic model VGGNet16. For details, see Example 1.
[0171] Divide the defined color difference map dataset into a 70% training set and a 30% test set for training and evaluating the model, and create corresponding data loaders. During the training process, the number of iterations is set to 100, the learning rate is 0.001, and the batch size is 8.
[0172] Use the classic model VGGNet16 and the EfficientNet-B0-CBAM model of the present invention to train and test the hatching egg color difference map dataset respectively. The results are as Figure 15 shown. The accuracy of the hatching egg sex rapid identification algorithm EfficientNet-B0-CBAM proposed by the present invention is 96.0%, while the accuracy of the classic model VGGNet16 algorithm is 90.0%. The present invention improves the accuracy and efficiency of early sex identification of hatching eggs, and the precision, recall rate and accuracy of EfficientNet-B0-CBAM are all higher than those of VGGNet16 in the comparative experiment. Select EfficientNet-B0-CBAM as the optimal model for subsequent non-destructive prediction of the sex of hatching eggs in the early stage of incubation.
[0173] The above embodiments are only used to illustrate the present invention and do not limit the technical solutions described in the present invention; therefore, although this specification has described the present invention in detail with reference to the above embodiments, those of ordinary skill in the art should understand that the present invention can still be modified or equivalently replaced; and all technical solutions and their improvements that do not depart from the spirit and scope of the present invention shall be covered within the scope of the claims of the present invention.
Claims
1. A method for rapid identification of the sex of breeding eggs using an optical sensor, characterized in that: The method uses an optical sensor mainly composed of several sensor units to be placed in the environment near the breeding eggs for reaction, or uses the sensor to react with the collected breeding egg gas, and then collects the visual signal changes before and after the placement of each sensor unit for processing and analysis to obtain the sex of the breeding eggs; The optical sensor comprises a substrate and at least two sensing units loaded in the substrate, wherein the sensing units contain gas-sensitive materials that can react with gas and induce changes in visual signals; The gas-sensitive material is used to adsorb gas or interact with gas, causing changes in the visual properties of the material, including color changes, so as to detect gas composition and concentration; The gas-sensitive materials include, but are not limited to, dyes, nanoporous materials, chromophores of gold nanoparticles that respond to gases with color changes, or fluorescent / phosphorescent groups of metal organic frameworks, quantum dots, and carbon dots that respond to gases with luminescent characteristics; The optical sensor comprises at least two sensing units of different gas-sensitive materials, and the method collects visual changes of the sensing units of different gas-sensitive materials and combines them to form a specific spectrum, analyzes and processes the spectrum, and then determines the type of the detected eggs; Arrange multiple sensing units with different gas-sensitive materials on the same substrate, collect visual images before and after the entire substrate is placed near the breeding eggs, and take the difference map or color difference map of the visual images before and after the substrate is placed near the breeding eggs as a spectrum; The collected images are processed in the following way to obtain the atlas: First, the image is transformed into a perspective by mapping the four designated points of the upper left, upper right, lower right and lower left in the image into a standard rectangle, thereby achieving perspective correction to obtain the target image. Then, the image is resized by image preprocessing, the image is converted into a grayscale image, and then Gaussian filtering is performed to reduce noise; Then, the image is binarized using the Otsu threshold method to extract the contours in the image, and all contours are sorted according to their areas, the largest contour is obtained and approximated to obtain a quadrilateral, which represents the optical sensor area in the image; Then, after the detected contour area is converted into a front view by using perspective transformation, a rectangular mark is drawn according to the position of the sensor unit and multiple regions of interest are cut out, each region of interest contains only one sensor unit; Finally, the color averages of R, G, and B in the region of interest are calculated as the R, G, and B values of the corresponding sensing units in the region, and the color difference map / difference map is drawn using the R, G, and B values of the sensing units as a spectrum; The method specifically comprises the following steps: (1) Select breeding eggs, clean and disinfect them and put them into incubation; (2) placing the optical sensor in the egg environment and allowing it to fully react with the egg gas, or collecting the egg gas to react with the optical sensor; (3) using an optical information acquisition system to collect visual signals from the optical sensor before and after step (2); (4) Data processing and model building: Data preprocessing, feature extraction and egg sex recognition model building are performed on the collected visual signals, and then the established egg sex recognition model is used for training under known conditions; (5) Finally, the trained egg sex recognition model is used to process the visual signals collected from the optical sensor placed in the egg environment in the test scenario to obtain the egg sex judgment result; The reaction mode in step (2) includes contact mode and non-contact mode between the optical sensor and the eggs; The contact type includes but is not limited to spraying gas-sensitive materials on eggshells to allow the gas-sensitive materials to directly react with the gas volatilized from the eggs, or attaching flexible sensors to the surface of eggshells to react with the gas volatilized from the eggs; Non-contact methods include but are not limited to placing the sensor and the eggs in the same chamber, and the gas-sensitive material does not come into contact with the gas emitted by the eggs but reacts with the gas; The egg sex recognition model is divided into 9 stages that are carried out in sequence. The first stage is a backbone network, which only uses a convolution module. The convolution module is mainly composed of a 3×3 convolution operation, a batch normalization layer with a step size of 2, and a Swish activation function connected in sequence; The CBAM network is used in the 2nd to 8th stages. Each stage uses a feature extraction module CBAM mainly composed of a channel attention module CAM and a spatial attention module SAM. The 2nd stage consists of a feature extraction module CBAM with a size of 3×3, the 3rd stage consists of two feature extraction modules CBAM with a size of 3×3, the 4th stage consists of two feature extraction modules CBAM with a size of 5×5, the 5th stage consists of three feature extraction modules CBAM with a size of 3×3, the 6th stage consists of three feature extraction modules CBAM with a size of 5×5, the 7th stage consists of four feature extraction modules CBAM with a size of 5×5, and the 8th stage consists of a feature extraction module CBAM with a size of 3×3. The feature extraction module CBAM includes a channel attention module CAM and a spatial attention module SAM. The original feature map F input to the feature extraction module CBAM is processed by the channel attention module CAM to obtain a channel feature map Mc. The channel feature map Mc and the input original feature map F are multiplied together to obtain a channel attention map F'. The channel attention map F' is processed by the spatial attention module SAM to obtain a spatial feature map Ms. The spatial feature map Ms and the channel attention map F' are multiplied together to obtain a spatial attention map F'', which is used as the output of the feature extraction module CBAM. The channel attention module CAM includes a maximum pooling layer, an average pooling layer and a multi-layer perceptron MLP. The original feature map F is processed by the maximum pooling layer and the average pooling layer respectively and input into the multi-layer perceptron MLP to obtain the first global descriptor vector1 and the second global descriptor vector2 respectively. The first global descriptor vector1 and the second global descriptor vector2 are added, and then the convolution layer is processed to obtain the channel feature map Mc. The spatial attention module SAM includes a maximum pooling layer and an average pooling layer. The channel attention map F' is connected after being processed by the maximum pooling layer and the average pooling layer, and then processed by the convolution layer to obtain the spatial feature map Ms; The last 9th stage is composed of a 1×1 convolution operation, a global average pooling layer, a fully connected layer, and a Softmax activation function.
2. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 1, characterized in that: The optical sensor is an array optical sensor, which is formed by fixing the gas sensitive material on the substrate by dripping, spraying or printing to obtain a sensing unit, and then at least two sensing units are distributed on the substrate.
3. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 2, characterized in that: The substrates include, but are not limited to, eggshells, paper-based substrates, polymer substrates, textile substrates, water / aerogels.
4. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 1, characterized in that: When the optical property changes into color change, natural light or artificial light source is irradiated onto the gas-sensitive material, and the color change of the reflected light is collected by a camera or a camera, and a color difference diagram is formed as a spectrum by comparing the images collected before and after; When the optical property change is a photoluminescence change, a light source with a fixed wavelength is used as an excitation light to irradiate the gas-sensitive material, and the material is made to emit fluorescence or phosphorescence by affecting its luminous efficiency, luminous intensity or luminous wavelength. Subsequently, a spectrometer or a camera collects emission spectrum data or images, compares the differences in spectral images before and after excitation, and generates a color difference diagram or a difference spectrum diagram as a spectrum. When the optical property changes into a change in light absorption characteristics, the gas-sensitive material is irradiated with a light source of a fixed wavelength, causing a new absorption peak to appear in the material, the disappearance of the original absorption peak, or the displacement of the peak position. The absorption spectrum image is collected using a spectrometer, and the difference in the spectrum images before and after excitation is compared to generate a difference spectrum diagram as the final spectrum.
5. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 1, characterized in that: The optical information acquisition system in step (3) includes but is not limited to an industrial camera acquisition system, a smart phone, a scanner, an ELISA reader, a fluorescence spectrophotometer, a color recognition device, and an ultraviolet spectrophotometer to collect the optical / visual signal data of the sensor.
6. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 1, characterized in that: In the step (4), a binary classification model for identifying the sex of breeding eggs is established based on the collected images or spectral optical signals. The model for identifying the sex of breeding eggs includes but is not limited to principal component analysis, convolutional neural network, decision tree and random forest, support vector machine, and artificial neural network.
Citation Information
Patent Citations
Bird egg freshness detection device and method by utilizing volatile matter
CN101419212A
Slightly decayed fruit quick identification method based on smell spectral imaging technology
CN105241821A
System and method for in ovo sexing of avian embryos
US20190174726A1