Method for quickly identifying sex of hatching egg by using optical sensor

Through optical sensors and machine learning technology, gas-sensitive materials react with breeding eggs to form a map, realizing the lossless identification of early gender of poultry breeding eggs, solving the problems of late identification and damage in the existing technology, reducing detection costs and ethical disputes .

CN119147514AActive Publication Date: 2024-12-17ZHEJIANG UNIV

Patent Information

Application Number
CN202411652957.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2024-12-17
Estimated Expiration
2044-11-19

AI Technical Summary

Technical Problem

The prior art lacks a gas sensor based on optical methods for 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 personnel to operate, and cumbersome processes.

Method used

Optical sensors are used to visually detect the volatile gases of poultry breeding eggs through olfactory sense of olfactory visualization, and optical signal changes are caused by gas-sensitive materials reacting with gas, forming a map for analysis, and combining machine learning technology to achieve early non-destructive judgment of breeding egg gender.

Benefits of technology

It realizes early accurate and non-destructive judgment of breeding egg gender, reduces testing costs and dependence on professionals, improves testing efficiency, and avoids waste of breeding egg resources and ethical disputes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119147514A_ABST
    Figure CN119147514A_ABST
Patent Text Reader

Abstract

The invention discloses a method for quickly identifying the sex of a hatching egg by using an optical sensor. According to the method, an optical sensor mainly composed of a plurality of sensing units is placed in the environment near the hatching eggs for reaction, or the sensor is used for reacting with collected hatching egg gas, and then optical signal changes before and after the sensing units are placed are collected for processing and analysis to obtain the sex of the hatching eggs. Each sensing unit comprises a gas-sensitive material capable of generating optical response with gas, the gas-sensitive material is prepared into a solution, the solution is ultrasonically dispersed or dissolved and then fixed on a substrate to obtain the sensing units, and a plurality of sensing units are distributed to form the array type optical sensor. The method provided by the invention overcomes the defects of late identification and damage of the existing hatching egg sex identification method, and successfully carries out early lossless determination on the poultry hatching egg sex.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of breeding egg detection, and in particular to a method for quickly identifying the sex of breeding eggs by using an optical sensor. Background Art

[0002] In existing poultry farming, it is necessary to conduct sex identification of chicken embryos in the early incubation period. This is not only conducive to the hatchery factory to plan the hatching production configuration, but also has great significance for solving animal welfare, saving hatching costs and waste chick disposal costs, rationally utilizing breeding egg resources, and improving the economic benefits of the poultry egg industry.

[0003] At present, the identification of the sex of egg embryos mainly relies on polymerase chain reaction (PCR) technology. Although this method has a high accuracy rate, it usually takes a long time to operate and has complicated steps. It also requires shell breaking and sampling, which affects the development of chicken embryos to a certain extent and is not suitable for industrial hatching of eggs. Hatcheries generally use the anus turning method, feather speed method and feather color method for sex detection in the chick stage. However, this manual detection method mainly relies on human subjective judgment. It is not only time-consuming and inaccurate, but also requires the chicks to be hatched before identification. In addition, it is necessary to solve the two problems of high production costs and ethical disputes. In the past ten years, in order to solve the problem of non-destructive sex detection during the hatching period of eggs, researchers have mainly used machine vision, spectral technology, odor method and other detection methods. Machine vision detection of eggs is mainly for appearance recognition and blood line recognition. However, researchers are still controversial about whether there is a correlation between egg shape index and egg sex, and the accuracy of the method based on blood line recognition needs to be improved. In addition, the spectral method also has certain disadvantages and is easily affected by individual differences in eggs, such as eggshell thickness, eggshell color, and egg placement direction. Moreover, most of the spectral detection methods require minimally invasive sampling of egg shells, and the detection time is mainly concentrated in the middle and late stages of incubation. There is still a technical gap in the field of egg sex identification detection at this stage, and non-destructive online detection in production has not yet been achieved. Therefore, the development of a new method that can achieve rapid and accurate early identification of egg information is a bottleneck problem that needs to be broken through.

[0004] Odor can represent or reflect certain essential properties of a substance and is unique in time and space. In recent years, there has been an increasing number of research reports on the biochemical information contained or transmitted by odors, such as seagulls being able to identify different types of eggs by smell, foxes being able to judge the type and freshness of bird eggs by smell, and zebras and lizards being able to judge the gender and physiological state of their companions by odor information. Some studies have focused on the biochemical information reflected by the odor of poultry eggs, such as fertilization, development, and parent-child communication. The results show that the idea of ​​odor detection is feasible, but the detection accuracy and stability still need to be improved. At present, 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 interaction between chromophores or fluorophores and analytes, causing colorimetric or fluorescence changes. Combining array-based sensing technology with novel image recognition technology, for any given analyte, a composite response pattern can be generated as a unique optical "fingerprint" map. However, there is currently little research on the use of optical sensing technology to non-destructively determine the sex of early hatching eggs, and this area 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 made great improvements in appearance, performance and other aspects. The successful application of new materials such as nano, thin film, and thick film technologies has provided conditions for gas sensors to realize new functions, making them gradually develop in the direction of miniaturization, intelligence, portability, flexibility and wearability. At the same time, machine vision technology is combined with the Internet of Things, big data and deep learning, and the image feature selection link is integrated into the training process, avoiding the problem of unclear image features and difficult extraction. At the same time, it can better resist noise and realize accurate detection of each component of the gas mixture in terms of intelligent gas detection.

[0006] In summary, the prior art lacks a method and solution for non-destructive sex identification of poultry eggs at an early stage using a gas sensor based on an optical method. Summary of the invention

[0007] In view of the shortcomings in the art, the present invention provides an optical sensor for olfactory visual detection of volatile gases in poultry eggs and a new method for rapid early identification of the sex of eggs, which overcomes many shortcomings of existing methods for identifying the sex of eggs, such as late identification period, damage to eggs, high detection cost, professional operation, cumbersome process, long analysis cycle, and inability to perform visual detection. The present invention applies optical sensing technology to the visual identification of poultry egg gases for the first time, converts the characteristic information of the gas into image information, thereby successfully realizing the early non-destructive determination of the sex of eggs, and provides a novel non-destructive detection method for early sex determination of eggs.

[0008] Specifically, the present invention is implemented through the following technical solutions: 1. An optical sensor for olfactory visual detection of gas: 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 optical signals.

[0009] The gas-sensitive material is used to adsorb gas or interact with gas, causing changes in the optical properties of the material itself, including changes in light absorption / reflection characteristics, photoluminescence, and color, thereby detecting gas composition and concentration.

[0010] The photoluminescence change is, for example, a change in fluorescence or phosphorescence.

[0011] 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 luminescent properties.

[0012] 2. A method for preparing an optical sensor: The gas-sensitive material is configured into a solution and ultrasonically dispersed or dissolved, and then fixed on a substrate by dripping, spraying or printing, and dried to obtain a sensing unit. At least two sensing units are evenly distributed on the substrate to form an array optical sensor.

[0013] Specifically, the gas-sensitive material is added into a solvent to form a solution.

[0014] The solvent is water, ethanol, ethylene glycol methyl ether, tetrabutylammonium hydroxide and p-toluenesulfonic acid.

[0015] Preferably, the substrate includes but is not limited to eggshell, paper-based substrate, polymer substrate (polyethylene terephthalate PET, polyvinyl chloride film PVC, polycarbonate film PC, etc.), textile substrate, water / aerogel, etc.

[0016] 3. A method for rapid identification of the sex of eggs using optical sensors: The method adopts an optical sensor composed of several sensing units and is 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 optical signal changes before and after the placement of each sensing unit for processing and analysis to obtain the sex of the breeding eggs.

[0017] The optical sensor performs olfactory visual detection of volatile gases in poultry eggs, thereby achieving egg sex identification. The method may be to collect visual images / spectral data of optical signal changes in the reaction between the sensor unit and the egg gas.

[0018] The optical sensor comprises at least two sensing units of different gas-sensitive materials. The method collects the optical signal 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 breeding eggs.

[0019] Arrange multiple sensing units with different gas-sensitive materials on the same substrate, collect visual images or spectral images of the entire substrate before and after the reaction with the breeding egg gas, and take the difference map or color difference map of the visual images or spectral images before and after the reaction with the breeding egg gas as the spectrum.

[0020] When the optical signal changes to color, 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, etc., and a color difference diagram is formed as a spectrum by comparing the images collected before and after; When the optical signal changes to photoluminescence, a light source with a specific fixed wavelength is used as an excitation light to irradiate the gas-sensitive material. Here, the light source is such as a xenon lamp or a laser, which affects the luminous efficiency, luminous intensity or luminous wavelength of the material to cause it to emit fluorescence or phosphorescence. Subsequently, a spectrometer or a camera collects emission spectrum data or images, compares the spectral image differences before and after excitation, and generates a color difference map or a difference spectrum map as a spectrum. When the optical signal changes into a change in light absorption characteristics, the gas-sensitive material is irradiated by a light source with a specific fixed wavelength. Here, the light source refers to the range of ultraviolet to visible light, which causes 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 by a spectrometer, and the difference in the spectrum images before and after excitation is compared to generate a difference spectrum graph as the final spectrum.

[0021] When the change in optical properties is a color change or a photoluminescence change, the collected image is processed in the following manner to obtain a map: specifically including perspective transformation of the image, contour detection, region cropping, color analysis, and color difference map drawing.

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

[0023] The method specifically comprises the following steps: Select breeding eggs, clean and disinfect them and put them into incubation; Place the optical sensor in the egg environment to fully react with the egg gas; or collect the egg gas to react with the optical sensor; An optical information acquisition system is used to collect optical signals from the optical sensor before and after the step; Data processing and model building: Data preprocessing, feature extraction and egg sex recognition model building are performed on the collected optical signals, and then the established egg sex recognition model is used for training under known conditions; Finally, the trained egg sex recognition model is used to process the optical signals collected by the optical sensor that reacts with the egg gas in the test scenario to obtain the egg sex judgment result.

[0024] The optical signal includes a visible light image or a spectrum image.

[0025] The reaction mode in the step includes contact type and non-contact type between the optical sensor and the breeding egg; 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; The non-contact method includes but is not limited to placing the sensor and the breeding eggs in the same chamber, the gas-sensitive material does not contact but reacts with the gas volatilized from the breeding eggs, or using a vacuum 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 reaction.

[0026] The optical information acquisition system in the step includes but is not limited to industrial camera acquisition system, smart phone, scanner, microplate reader, fluorescence spectrophotometer, color recognition equipment, ultraviolet spectrophotometer, etc. to collect optical / visual signal data of the sensor.

[0027] In the step, a binary classification model for identifying the sex of breeding eggs is established based on the collected optical signals such as images or spectra. The model for identifying the sex of breeding eggs 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.

[0028] The breeding egg sex recognition model is taken as the EfficientNet-B0-CBAM model, which is divided into 9 stages performed in sequence. The first stage is a backbone network, and the backbone network only uses a convolution module, specifically only consists of a convolution module, and the convolution module is mainly composed of a 3×3 convolution operation, a connection batch normalization layer with a step size of 2, and a Swish activation function connected in sequence; the second to eighth stages use a 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 second stage is composed of a feature extraction module CBAM with a size of 3×3, the third stage is composed of two feature extraction modules CBAM with a size of 3×3, the fourth stage is composed of two feature extraction modules CBAM with a size of 5×5, the fifth stage is composed of three feature extraction modules CBAM with a size of 3×3, the sixth stage is composed of three feature extraction modules CBAM with a size of 5×5, the seventh stage is composed of four feature extraction modules CBAM with a size of 5×5, and the eighth stage is composed 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 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, 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 connected in sequence.

[0029] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. The optical sensor constructed by the present invention has the characteristics of small size, simple operation, low cost and high throughput, which reduces the dependence on large-scale detection instruments and professional operators, while reducing the detection cost, and has broad application prospects in on-site detection.

[0030] 2. Currently, 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 stages of incubation, overcoming the shortcomings of existing breeding egg sex identification methods of late identification and loss, and successfully performing early non-destructive sex determination of poultry breeding eggs, greatly reducing the economic cost of the breeding egg incubation process, avoiding the waste of poultry egg resources and the ethical controversy caused by killing male chicks.

[0031] 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 the array sensor contacts different volatile gas molecules, thereby realizing the visualization of the artificial olfactory system. It does not require the use of any professional equipment and can even be qualitatively identified by the naked eye.

[0032] 4. The present invention is a feasible non-destructive method for identifying and analyzing the sex of poultry eggs by volatile gases, which overcomes the disadvantage of the existing methods for identifying the sex of eggs that require breaking the shells for sampling, and reduces the impact on the development of eggs.

[0033] 5. This invention combines optical sensors with machine learning technology for the first time to achieve early non-destructive detection and discrimination of egg sex information. Through the application of deep learning technology and the improvement of the model, images are efficiently classified and identified, which improves the accuracy and efficiency of egg sex determination. It has high practical value and broad application prospects, and provides new opportunities for the intelligent automation of poultry egg sex identification in the future.

[0034] 6. Aiming at practical application scenarios, the present invention constructs a convolutional neural network model for rapid identification of the sex of breeding eggs, introduces an attention mechanism in the feature extraction network part, so that the network simultaneously pays attention to the feature information in both channel and spatial dimensions, suppresses unimportant feature information, strengthens the extraction of deep features of the image, and achieves better results in convolution. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 The figures are test tube photographs of 36 gas-sensitive dyes prepared in the present invention; Figure 2 Schematic diagram of the optical sensor prepared in the present invention; Figure 3 It is a schematic diagram of the structure and detection principle of the present invention; Figure 4 The color difference diagram of the optical sensor prepared by the present invention before and after detecting the gas of the 6th day breeding eggs; Figure 5 A schematic diagram of the EfficientNet-B0 benchmark network structure used in the egg sex recognition model constructed by the present invention; Figure 6 Schematic diagram of the structure of the CBAM feature extraction module introduced in this embodiment; Figure 7 This is a schematic diagram of the overall network topology of the breeding egg sex recognition model provided in this embodiment; Figure 8 This is a graph showing the accuracy of sex differentiation of hatching eggs on the sixth day of incubation using two models in the present invention; Fig. 9 It is the result diagram of predicting the sex of breeding eggs of the present invention; Fig.10 A schematic diagram of a seed egg tattoo sensor prepared by the present invention; Fig.11 This is a schematic diagram of the egg tattoo sensor after image correction of the present invention; Fig.12 This is a graph showing the accuracy of two models of the egg tattoo sensor of the present invention; Fig.13 Laser-cut paper-based sensor structures designed for the present invention; Fig.14 A schematic diagram of a fluorescent array sensor prepared by the present invention; Fig.15 This is a diagram showing accurate results of distinguishing two models of the fluorescence array sensor of the present invention. DETAILED DESCRIPTION

[0036] The present invention is further described below through specific embodiments in conjunction with the accompanying drawings, but the present invention is not limited thereto.

[0037] The optical sensor specifically implemented includes a substrate and at least one sensing unit loaded in the substrate, wherein the sensing unit contains a gas-sensitive material that can react with gas and induce a change in an optical signal.

[0038] Gas-sensitive materials are used to adsorb gases or interact with gases, causing changes in the optical properties of the materials themselves, such as changes in light reflection, absorption, and photoluminescence characteristics, which are manifested in the macroscopic optical / visual changes of the sensing unit, such as changes in color, fluorescence, phosphorescence, etc. Fluorescence changes include but are not limited to fluorescence enhancement, fluorescence attenuation, and fluorescence quenching.

[0039] Preferably, the gas-sensitive materials include but are not limited to dyes (such as pH indicator dyes, redox indicator dyes, solvatochromic dyes, complexometric titration indicator dyes), nanoporous materials, gold nanoparticles and other chromophores that respond to gases by changing color, or metal organic frameworks (MOFs), quantum dots, carbon dots and other fluorescent / phosphorescent groups that respond to gases by producing luminescent properties.

[0040] Different gas-sensitive materials will cause different optical signal changes in each sensor unit under normal conditions. Optical / visual changes are caused by external light incident on the gas-sensitive material, reflected by the gas-sensitive material, and then collected by the optical detection equipment. External light can be visible light, ultraviolet light, etc. Optical detection equipment includes cameras, cameras, and spectrometers.

[0041] In a specific implementation, for preparation, the gas-sensitive material is configured into a solution and fixed on a substrate by dripping, spraying or printing to obtain a sensing unit, and at least one sensing unit is distributed on the substrate to form an array optical sensor.

[0042] Preferably, the substrate includes but is not limited to eggshell, paper-based substrate, polymer substrate (such as polyethersulfone resin film PES, polyethylene terephthalate PET, polyvinyl chloride film PVC, polycarbonate film PC, etc.), textile substrate, water / aerogel, etc.

[0043] The shape and size of the optical sensor are not particularly limited and can be designed according to needs, such as a 3 cm*3 cm square.

[0044] For different gases, the optical signal changes of the same sensor unit will be different; for the same gas, the optical signal changes of different sensor units will also be different.

[0045] The method of the present invention uses an optical sensor composed of a plurality of sensing units and is placed in an environment near the breeding eggs. The optical sensor can be placed close to the breeding eggs, or the breeding egg gas can be collected to react with the optical sensor. The optical signal changes before and after the placement of each sensing unit are collected and input into a computer for processing and analysis to obtain the sex of the breeding eggs, and finally displayed on a display.

[0046] The optical sensor performs olfactory visual detection of volatile gases of poultry eggs, thereby realizing the sex identification of the eggs. The method can be to collect a visual change diagram before and after the reaction between the sensor unit and the egg gas.

[0047] The optical sensor includes at least two sensing units made of different gas-sensitive materials. The method collects the optical signal changes of the sensing units of different gas-sensitive materials and combines them to form a specific spectrum. The spectrum is analyzed and processed to determine the type of the detected eggs.

[0048] Arrange multiple sensor units with different gas-sensitive materials on the same substrate, the gas-sensitive materials contained in each sensor unit, and the sensor units corresponding to different gas-sensitive materials are arranged in different positions, and the entire substrate is placed near the breeding eggs for reaction, or reacts with the collected breeding egg gas, and collects visual images or spectral images before and after the sensor reaction, and takes the difference map or color difference map of the visual images or spectral images before and after the breeding egg gas reaction as a spectrum.

[0049] Specifically, a visual image or a spectral image of the entire substrate is first collected as a first image, and then a visual image or a spectral image collected after the reaction with the egg gas is collected as a second image, and a difference map or a color difference map between the first image and the second image is calculated as a spectrum.

[0050] When the optical signal changes to color, natural light or artificial light source is irradiated onto the gas-sensitive material, and the color change of the reflected light can be collected by a camera, etc., and a color difference diagram is formed as a spectrum by comparing the images collected before and after; When the optical signal changes to photoluminescence, a light source of a specific wavelength (such as a xenon lamp or a laser) is used as an excitation light to illuminate the gas-sensitive material, causing it to emit fluorescence or phosphorescence by affecting the luminous efficiency, luminous intensity or luminous wavelength of the material. 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 map or a difference spectrum map as a spectrum. 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 the material to have a new absorption peak, 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 image before and after excitation is compared to generate a difference spectrum map as the final map.

[0051] In this way, at least two sensing units contain different gas-sensitive materials, thereby enabling specific detection of gas.

[0052] The specific implementation of the rapid identification method specifically includes the following steps: (1) Selecting breeding eggs, cleaning and disinfecting the eggs and incubating them; The breeding eggs in step (1) are poultry breeding eggs, such as chicken eggs, duck eggs, goose eggs, etc. The incubation conditions can adopt known standard incubation methods.

[0053] (2) placing the optical sensor in the environment of the eggs to fully react with the gas emitted by the eggs; or collecting the gas from the eggs to react with the optical sensor; The reaction methods in step (2) include contact type and non-contact type between the optical sensor and the egg: 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; The non-contact method includes but is not limited to placing the sensor and the breeding eggs in the same chamber, the gas-sensitive material is not in contact with the gas emitted by the breeding eggs but senses and reacts, or using a vacuum pump or a gas sampling bag to first collect the gas emitted by the breeding eggs, and then transporting the collected gas to the optical sensor for sensing and reaction, ultimately causing the gas-sensitive material to produce an optical signal change.

[0054] (3) using an optical information acquisition system to acquire optical images of the optical sensor before and after performing step (2); The optical information acquisition system in step (3) includes but is not limited to industrial camera acquisition systems, smart phones, scanners, microplate readers, fluorescence spectrophotometers, color recognition equipment, ultraviolet spectrophotometers, etc. for collecting optical signal data of sensors.

[0055] The obtained optical signal data includes but is not limited to RGB color information, ultraviolet spectrum signal, fluorescence intensity signal, etc.

[0056] (4) constructing a data set for the optical images collected above; The dataset in step (4) consists of preprocessed color difference images and gender labels, which are used for subsequent model training.

[0057] Build a model; In step (5), machine learning technology is used to establish a breeding egg sex recognition model based on breeding egg optical signals using data analysis software including but not limited to Python, Matlab, etc.

[0058] In step (5), a binary classification model for identifying the sex of eggs can be established based on the collected images or optical signals such as spectra, and then the model can be trained using a transfer learning method under the condition that the sex of the eggs is known to obtain the parameters of the model. After the training is completed, the training weights are saved to obtain the model for identifying the sex of eggs. The 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.

[0059] (6) Finally, the trained egg sex recognition model is used to process the optical images collected by the optical sensor placed in the egg environment in the test scenario, and the judgment result of the egg sex is output through calculation, thus realizing the non-destructive detection of the egg sex in the early stage of incubation.

[0060] Embodiments of the present invention are as follows: Embodiment 1:

[0061] The sensor substrate is made of PES film, which is cut into rectangular paper bases with a size of 5.0 mm*6.0 mm and evenly arranged in a planar array on a polytetrafluoroethylene frame plate to obtain a membrane array sensor.

[0062] Weigh 4 mg of each of the 36 dyes into 36 centrifuge tubes, add 1 mL of ethanol, and obtain the following under ultrasonic conditions: Figure 1 Different types of dye solutions are shown. 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 dyes, benzoquinone dyes, carbazole dyes, pyrazole dyes, acid dyes, azoketone dyes, and copper phthalocyanine dyes. Such as bromocresol green, methyl red, N, N'-diphenyl-1, 4-phenylenediamine, toluidine blue, etc.

[0063] 4 μL of the 36 dye solutions obtained above were taken by pipette and dropped onto the PES film substrate in sequence, and dried on a heating plate at 36°C for 48 hours to obtain the following: Figure 2 The colorimetric sensing array shown, in which the circular spot after each dye solution is dropped serves as a sensing unit.

[0064] Testing process such as Figure 3As shown, Jinghong No. 1 chicken eggs were selected as test samples, and the sample eggs were scrubbed and disinfected with 75% ethanol solution and naturally air-dried. The egg weight was 49.82-69.72 g, the major axis was 53.13-61.81 mm, the minor axis was 40.03-51.87 mm, and the egg shape index (major axis / minor axis) was 1.10-1.45. Each egg was placed in an independent incubator, and the incubation temperature was 37-38°C, the humidity was 60-70%, and the egg was turned every 90 minutes.

[0065] First, the pre-reaction image data of the colorimetric sensor array is collected using an industrial camera acquisition system, the camera focal length, aperture size, and object distance are adjusted, and the exposure parameters of the industrial camera software are set 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 with a color temperature of 6000-7000K to ensure that the collected image information is not affected by factors such as ambient light.

[0066] Subsequently, the colorimetric sensor and the breeding eggs on the sixth day of incubation were placed in an independent incubator close to the breeding egg's gas chamber, so that the sensor was in stable contact with the gas generated during the breeding egg's respiration process. The color of the sensing unit changed, and the image after 24 hours of reaction was acquired again through the industrial camera.

[0067] The collected colorimetric sensor array images were preprocessed and denoised using Python image processing algorithms to reduce the amount of computation, improve operating efficiency and computational accuracy, and extract the mean of the color R, G, B (red, green, blue) channels of the image. The specific method is to convert the image file into a grayscale image after perspective correction and fixed size adjustment, and perform Gaussian filtering. The image was binarized using the Otsu threshold method to extract the contours in the image and sort them according to their area. By approximating the maximum contour, a quadrilateral was obtained, which represents the optical sensor area in the image.

[0068] The extracted area is cut into 6*6 small areas according to the position of the sensor unit, and the R, G, B color averages of the 12*20 pixel value area in each small area are obtained, that is, an R, G, B value representing the color of the sensor unit area is obtained.

[0069] The image data before and after the reaction (i.e. before and after being placed near the eggs) is obtained and processed, and the difference between the R, G, and B values ​​of each sensor unit is calculated. The difference between the R, G, and B values ​​of each sensor unit is amplified (converted from 4-19 to 0-255), and then plotted as shown below. Figure 4 Color difference diagram shown.

[0070] After the chickens have successfully hatched, their true gender is identified based on feather color, anal inversion, etc., and the color difference diagram is defined as that of female and male chickens respectively.

[0071] The image is augmented by randomly adjusting the brightness, contrast, and saturation between [-0.2, 0.2], and the image is converted to a grayscale image with a probability of 0.5.

[0072] The EfficientNet-B0-CBAM model for rapid egg sex recognition was designed and built. The model uses the EfficientNet-B0 benchmark network as the backbone structure and introduces the Convolutional Block Attention Module (CBAM), which retains the structural advantages of EfficientNet. It achieves state-of-the-art accuracy on the ImageNet dataset, and the network parameters are orders of magnitude smaller than those of ResNet50, InceptionV2 and other networks. The network structure of EfficientNet-B0 is as follows: Figure 5 The convolution attention module is used to replace the original bottleneck convolution (Mobile inverted Bottleneck Convolution, MBConv) module, and the channel attention module (Channel Attention Module, CAM) and the spatial attention module (Spatial Attention Module, SAM) 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 has a better effect in convolution. The CBAM structure used is as follows Figure 6 shown.

[0073] The egg sex recognition model is the EfficientNet-B0-CBAM model, which is divided into 9 stages: The first stage is a backbone network, which only uses convolution modules, specifically only consists of convolution modules, and the convolution modules are mainly composed of 3×3 convolution operations, connected batch normalization layers with a step size of 2, and Swish activation functions connected in sequence.

[0074] The 2nd to 8th stages use the CBAM network, and each stage uses a feature extraction module CBAM which is 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.

[0075] 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 input 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 achieving selective amplification or weakening of different channel features, and the channel attention map F' is calculated through a convolutional layer. The channel attention map F' is then 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.

[0076] 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; these two descriptors respectively capture the importance and distribution of different channels in the feature map. After that, these descriptors are passed to a series of convolution layers, and finally an attention map Mc with the same number of channels as the input feature map is generated.

[0077] 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 process first calculates the average value AvgPool and the maximum value MaxPool of each position in the feature map, and then connects these two statistics and passes them to a convolution layer to generate a single two-dimensional spatial feature map Ms. The attention map Ms is also multiplied by the feature map F', so that the model can focus on the key area, and the spatial attention map F'' is calculated through the convolution layer.

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

[0079] In this embodiment, the first stage is a 3×3 ordinary convolution with a step size of 2, connected to a batch normalization (BN) layer and a Swish activation function; the CBAM module is used to replace the original MBConv module in the 2nd to 8th stages, and the number of times the module is repeated in each stage corresponds to the number of layers 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 follows: Figure 7 shown.

[0080] The transfer learning method was used for training. The ImageNet dataset was used for training and then migrated to the improved EfficientNet network. The sample set was used for fine-tuning. After the training, the egg gender recognition model was obtained: During the training process, the Adam optimizer was used to iteratively update the weight parameters of the neural network based on the training data, and the Softmax classifier was selected to output the probability that the image was estimated to be a male egg or a female egg. The loss function used was classification cross entropy. After the training, the model weight parameters were saved.

[0081] Among them, the following indicator parameters can be used for model performance evaluation, including: Accuracy = ( TP + TN ) / ( TP+TN+FP+FN ) × 100% Recall = TP / ( TP + FN ) × 100% Precision = TP / ( TP + FP ) × 100% F1-score = [( Precision -1 + Recall -1 ) / 2] -1 × 100% AUC = [ TP / 2( TP + FN )+ TN / 2( TN + FP )] × 100% TP : True Positive, which is judged to be a positive sample and is actually a positive sample; TN : True Negative, which is judged as a negative sample and is actually a negative sample; FP : False Positive, which is judged as a positive sample, but is actually a negative sample; FN : False Negative, judged as a negative sample, but in fact it is a positive sample.

[0082] Accuracy( Accuracy ): The recognition accuracy of the model on the data set, that is, the proportion of correctly recognized samples to the total number of samples.

[0083] Recall Recall ): refers to the ratio of the number of samples predicted by the classifier to be positive examples to the number of samples that are truly positive examples.

[0084] Precision( Precision ): refers to the ratio of the number of samples predicted by the classifier to the number of samples predicted to be positive.

[0085] F1 score ( F1-score ): An indicator used to comprehensively consider precision and recall, which is the harmonic mean of precision and recall.

[0086] Area Under the Curve AUC ): It is a comprehensive evaluation index related to the ROC curve, which can be used to intuitively compare and evaluate the performance of the classifier. The closer the ROC curve is to the upper left corner, the larger the area under the curve, and the better the performance of the classifier.

[0087] The classic VGGNet16 model for feature extraction is built. Its structure is mainly composed 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 topology consists of 16 layers, including 13 convolutional layers and 3 fully connected layers. The convolutional layer uses a 3x3 convolution kernel and uses ReLU as the activation function. After continuous convolutional layers, it is followed by a maximum pooling layer and finally connected to a fully connected layer for classification.

[0088] The defined color difference map dataset is divided into 70% training set and 30% test set for training and evaluating the model, and the corresponding data loader is created. During the training process, the number of iterations is set to 100, the learning rate is 0.001, and the batch size is 8.

[0089] like Figure 8 As shown in the figure, the classic model VGGNet16 and the EfficientNet-B0-CBAM model of the present invention are used to train and test the egg color difference map data set. The results show that the accuracy of the classic model VGGNet16 algorithm is 94.0%, and the accuracy of the fast egg gender recognition algorithm EfficientNet-B0-CBAM proposed by the present invention is 100.0%, which improves the accuracy and efficiency of early gender recognition of eggs, and the precision, recall and accuracy of EfficientNet-B0-CBAM are higher than those of VGGNet16 in the comparative experiment.

[0090] The EfficientNet-B0-CBAM model with the best accuracy in distinguishing male and female eggs was selected for non-destructive detection of the sex of eggs in the early stage of subsequent incubation. Fig. 9 As shown, according to the pre-established model, the sex of the tested eggs is successfully obtained by inputting the color difference diagram of the colorimetric sensor after reacting with the tested eggs. Embodiment 2:

[0091] Weigh 18 dye powders onto a glass grinding plate, add gum arabic, ox bile and glycerol dropwise, with a mass ratio of 3:2:1:4. Grind the mixture with a pestle for 15 minutes to obtain different types of semi-fluid inks. The 18 selected dyes are classified according to their chemical structures, including indicators, amine compounds, metal complexes and other reagents, such as bromophenol red, bromocresol green, methyl red, diphenylamine, porphyrin manganese, etc.

[0092] Jinghong No. 1 chicken eggs were selected as test samples, and the sample eggs were scrubbed and disinfected with 75% ethanol solution and naturally air-dried. The egg weight was 49.82-69.72 g, the major axis was 53.13-61.81 mm, the minor axis was 40.03-51.87 mm, and the egg shape index (major axis / minor axis) was 1.10-1.45.

[0093] A 3*6 transfer array stamp was prepared using fiber material. The protrusions on the stamp were all 3*3 mm in shape. The 18 dye inks were applied to each circular protrusion of the transfer array stamp in sequence using a pipette. The ink-soaked stamp was then quickly pressed into the middle of a clean egg shell and dried at room temperature for 3 hours to obtain the following: Fig.10 The eggs with tattoo sensors are shown. Each dye ink droplet forms a circular dot on the egg as a sensing unit.

[0094] An industrial camera acquisition system was used to collect the image data of the tattooed eggs before the sensor reaction, and the camera focal length, aperture size, and object distance were adjusted, and the exposure parameters of the industrial camera software were set to 120 ms. The image acquisition process was carried out in a photographic darkroom with incandescent light conditions. The light source was a 20-40W positive white light LED with a color temperature of 6000-7000K to ensure that the collected image information was not affected by factors such as ambient light.

[0095] Each tattooed egg is placed in an independent incubator at a temperature of 37-38°C and a humidity of 60-70%, and the eggs are turned over every 90 minutes. The tattoo sensor is in stable contact with the gas produced during the breathing process of the egg, and the color of the sensor unit changes. After three days of continuous reaction, the image of the tattooed egg is captured again by the industrial camera.

[0096] The collected tattoo sensor array images are preprocessed and denoised using Python image processing algorithms to reduce the amount of computation, improve operating efficiency and computational accuracy, and extract the color R, G, and B features of the image. The specific method is to first correct the collected curvature distortion image of the breeding eggs with distortion coefficients of k1=0.1, k2=0.02, and k3=0.003, and then perform mapping calculations to ensure that the center point (cx, cy) is calculated correctly and that the mapped image has appropriate distortion correction around the center point. Finally, slice the output image to ensure that the size is the same as the input image to avoid blank spaces at the border. The output is as follows: Fig.11 Image of a tattooed egg after correction shown.

[0097] The corrected image file is adjusted to a fixed size, and the distance from the left wireframe edge to the center point of the first circular dye ink is the same. The image is then converted to a grayscale image and Gaussian filtered. The image is binarized using the Otsu threshold method to obtain the image contour and sort it according to the area of ​​the contour. The maximum contour is approximated to obtain a quadrilateral, which represents the optical sensor area in the image. The extracted area is cut into 3*6 small areas according to the position of the sensor unit, and the R, G, and B color averages of the square area with a width and height of 12 pixels in each small area are obtained, that is, an R, G, and B value representing the color of the area is obtained.

[0098] The image data before and after the reaction is obtained and processed, and the difference of the R, G, and B values ​​of each sensor unit is calculated. The difference of the R, G, and B values ​​of each sensor unit is amplified (converted from 4-19 to 0-255), and then drawn into a color difference map.

[0099] After the chickens have successfully hatched, their true gender is identified based on feather color, anal inversion, etc., and the color difference diagram is defined as that of female and male chickens respectively.

[0100] The image is augmented by randomly adjusting the brightness, contrast, and saturation between [-0.2, 0.2], and the image is converted to a grayscale image with a probability of 0.5.

[0101] Design and build an EfficientNet-B0-CBAM model for rapid gender identification of breeding eggs, using the EfficientNet-B0 benchmark network as the backbone structure, and introducing the CBAM module, that is, applying the CAM module and the SAM module in sequence, by giving different weights to the information that needs to be emphasized or suppressed to facilitate the flow of information within the network, extracting deeper feature information in the convolution, and the feature map output by the image after the CBAM module is classified by the fully connected layer and activation function in the classification network to output the gender identification result corresponding to the breeding egg sample image. See Example 1 for details.

[0102] Build the classic model VGGNet16, see Example 1 for details.

[0103] The defined color difference map dataset is divided into 70% training set and 30% test set for training and evaluating the model, and the corresponding data loader is created. During the training process, the number of iterations is set to 100, the learning rate is 0.001, and the batch size is 8.

[0104] The classic model VGGNet16 and the EfficientNet-B0-CBAM model of the present invention were used to train and test the egg color difference image dataset, and the results are as follows: Fig.12As shown in the figure, the accuracy of the fast egg sex recognition algorithm EfficientNet-B0-CBAM proposed by the present invention is 93.0%, while the accuracy of the classic model VGGNet16 algorithm is 86.0%. The present invention improves the accuracy and efficiency of early egg sex recognition, and the precision, recall and accuracy of EfficientNet-B0-CBAM are higher than those of VGGNet16 in the comparative experiment. EfficientNet-B0-CBAM is selected as the optimal model for non-destructive prediction of the sex of early hatching eggs. Embodiment 3:

[0105] The PES film substrate is cut by laser cutting. First, the engraving path and parameters are designed using computer-aided design software. The PES paper-based material is placed on the workbench of the laser engraving system, and the laser engraving system is set according to the designed engraving parameters, including: selecting the vector mode, laser power 5.0%, engraving speed 45%, and PPI 750. Finally, a rectangular sensor substrate with a size of 27.6mm*30.8mm is obtained, with a total of 9 sensor units evenly distributed in a 3*3 shape inside. The size of each single sensor unit is a rectangle of 2.9mm*3.5mm. Under the same operation, a square sensor substrate with a size of 13mm*13mm can be obtained, with 9 evenly distributed circular sensor units with a diameter of 3 mm inside. The design of the sensor substrate is as follows: Fig.13 As shown, it includes a sensing area, a connecting area and an isolation area.

[0106] Weigh 4 mg of each of the 9 materials with fluorescent properties into 9 centrifuge tubes, add 1 mL of ethanol, and obtain 9 solutions or suspensions under ultrasonic conditions. The 9 fluorescent sensing substances include amine dyes, phthalocyanine dyes, aldehyde dyes, and nitrate dyes, such as lissamine green, diphenylamine, and thymol blue.

[0107] 4 μL of each of the nine fluorescent sensing solutions was pipetted and dripped onto the sensing area of ​​the sensor substrate in sequence, and then dried on a heating plate at 36°C for 48 hours to stabilize. Fig.14 The fluorescent sensor array shown (the figure takes the circular sensor unit inside as an example).

[0108] Jinghong No. 1 chicken eggs were selected as test samples, and the sample eggs were scrubbed and disinfected with 75% ethanol solution and naturally air-dried. The egg weight was 49.82-69.72 g, the long axis was 53.13-61.81 mm, the short axis was 40.03-51.87 mm, and the egg shape index (long axis / short axis) was 1.10-1.45. Each egg was placed in an independent incubator, and the incubation temperature was 37-38°C, the humidity was 60-70%, and the egg was turned every 90 minutes.

[0109] An industrial camera acquisition system was used to collect the pre-reaction image data of the above-mentioned fluorescent sensor array, and the camera focal length, aperture size, and object distance were adjusted, and the exposure parameters of the industrial camera software were set to 120 ms. The image acquisition process was carried out in a photographic dark box equipped with 365 nm ultraviolet excitation light to ensure that the collected image information was not affected by factors such as ambient light.

[0110] The fluorescent sensor was placed in an independently incubated egg chamber on the 5th day of incubation and hung near the egg gas chamber so that the sensor was in stable contact with the gas generated during the respiration of the egg. The color of the sensor unit changed and the sensor image was acquired again through an industrial camera 24 hours later.

[0111] The collected fluorescence sensor array images were preprocessed and denoised using Python image processing algorithms to reduce the amount of computation, improve operating efficiency and computational accuracy, and extract the mean of the color R, G, B (red, green, blue) channels of the image. The specific method is to convert the image file into a grayscale image after perspective correction and fixed size adjustment, and perform Gaussian filtering. The image was binarized using the Otsu threshold method to extract the contours in the image and sort them according to the area of ​​the contours. By approximating the maximum contour, a quadrilateral was obtained, which represents the optical sensor area in the image. The extracted area was cut into 3*3 small areas according to the position of the sensor unit, and the R, G, B color averages of the 12*12 pixel value area in each small area were obtained, that is, an R, G, B value representing the color of the sensor unit area was obtained.

[0112] The image data before and after the reaction is obtained and processed, and the difference of the R, G, and B values ​​of each sensor unit is calculated. The difference of the R, G, and B values ​​of each sensor unit is amplified (converted from 4-19 to 0-255), and then drawn into a color difference map.

[0113] After the chickens have successfully hatched, their true gender is identified based on feather color, anal inversion, etc., and the color difference diagram is defined as that of female and male chickens respectively.

[0114] The image is augmented by randomly adjusting the brightness, contrast, and saturation between [-0.2, 0.2], and the image is converted to a grayscale image with a probability of 0.5.

[0115] Design and build an EfficientNet-B0-CBAM model for rapid gender identification of breeding eggs, using the EfficientNet-B0 benchmark network as the backbone structure, and introducing the CBAM module, that is, applying the CAM module and the SAM module in sequence, by giving different weights to the information that needs to be emphasized or suppressed to facilitate the flow of information within the network, extracting deeper feature information in the convolution, and the feature map output by the image after the CBAM module is classified by the fully connected layer and activation function in the classification network to output the gender identification result corresponding to the breeding egg sample image. See Example 1 for details.

[0116] Build the classic model VGGNet16, see Example 1 for details.

[0117] The defined color difference map dataset is divided into 70% training set and 30% test set for training and evaluating the model, and the corresponding data loader is created. During the training process, the number of iterations is set to 100, the learning rate is 0.001, and the batch size is 8.

[0118] The classic model VGGNet16 and the EfficientNet-B0-CBAM model of the present invention were used to train and test the egg color difference image dataset, and the results are as follows: Fig.15 As shown in the figure, the accuracy of the fast egg sex recognition 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 egg sex recognition, and the precision, recall and accuracy of EfficientNet-B0-CBAM are higher than those of VGGNet16 in the comparative experiment. EfficientNet-B0-CBAM is selected as the optimal model for non-destructive prediction of the sex of early hatching eggs.

[0119] The above embodiments are only used to illustrate the present invention and are not intended to limit the technical solutions described in the present invention; therefore, although the present invention has been described in detail in this specification with reference to the above embodiments, it should be understood by those skilled in the art that the present invention may still be modified or replaced by equivalents; and all technical solutions and improvements thereof that do not depart from the spirit and scope of the present invention should be included in 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 adopts an optical sensor mainly composed of several sensor units and is 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 optical signal changes before and after the placement of each sensor unit for processing and analysis to obtain the sex of the breeding eggs.

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 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 optical signals; The gas-sensitive material is used to adsorb gas or interact with gas, causing changes in the optical properties of the material, including changes in light absorption / reflection characteristics, photoluminescence, and color, thereby detecting gas composition and concentration.

3. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 2, characterized in that: The gas-sensitive materials include but are not limited to dyes, nanoporous materials, gold nanoparticles, chromophores that respond to gases by changing color, or metal organic frameworks, quantum dots, carbon dots, fluorescent / phosphorescent groups that respond to gases by producing luminescent properties.

4. 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.

5. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 4, characterized in that: The substrates include, but are not limited to, eggshells, paper-based substrates, polymer substrates, textile substrates, water / aerogels.

6. 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 comprises at least two sensing units of different gas-sensitive materials. The method collects optical 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 breeding eggs.

7. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 6, characterized in that: A plurality of sensing units with different gas-sensitive materials are arranged on the same substrate, and visual images or spectral images are collected before and after the entire substrate is placed near the breeding eggs. The difference map or color difference map of the visual images or spectral images before and after the substrate is placed near the breeding eggs is taken as a spectrum.

8. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 7, 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.

9. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 7, characterized in that: 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 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.

10. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 1, characterized in that: 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 optical 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 of the collected optical signals, and then training using the established egg sex recognition model under known conditions; (5) Finally, the trained egg sex recognition model is used to process the optical signals collected from the optical sensor placed in the egg environment in the test scenario to obtain the egg sex determination result.

11. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 10, characterized in that: 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; The non-contact method includes but is not limited to placing the sensor and the breeding eggs in the same chamber, the gas-sensitive material does not contact but reacts with the gas volatilized from the breeding eggs, or using a vacuum 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 reaction.

12. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 10, 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.

13. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 10, 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.

14. The method for rapid identification of the sex of breeding eggs using an optical sensor according to claim 10, characterized in that: 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.

Citation Information

Patent Citations

  • Bird egg freshness detection device and method by utilizing volatile matter

    CN101419212A

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

    CN104316473A

  • Slightly decayed fruit quick identification method based on smell spectral imaging technology

    CN105241821A

  • Laying hen hatching egg gender optical identification method

    CN114916469A

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

    CN116930176A

Cited By

  • Intelligent verification system for alcohol content of exhaled gas based on image recognition

    CN120195101A

  • An image recognition-based intelligent exhaled gas alcohol content detection system

    CN120195101B

  • Optical sensor, manufacturing method, and method for rapid sex identification of hatching egg using optical sensor

    WO2026107953A1