Optical sensor, manufacturing method, and method for rapid sex identification of hatching egg using optical sensor
By using optical sensors and machine learning technology to perform olfactory visualization detection of volatile gases in hatching eggs, the problem of sex identification of hatching eggs in existing technologies has been solved, enabling early, non-destructive, and accurate sex determination of hatching eggs, reducing detection costs and simplifying the operation process.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- ZHEJIANG UNIV
- Filing Date
- 2024-12-31
- Publication Date
- 2026-05-28
AI Technical Summary
Current technology lacks a method for non-destructive sex identification in the early stages of poultry hatching eggs. Existing methods suffer from problems such as late identification period, damage to hatching eggs, high testing costs, the need for professional personnel to operate, cumbersome process, and inability to perform visual detection.
An optical sensor is used to visually detect the volatile gases emitted by hatching eggs. The gas-sensitive material in the optical sensor reacts with the gases in the hatching eggs, and the changes in optical signals are collected to form a specific spectrum. Combined with machine learning technology, the sex of the hatching eggs is identified, achieving early non-destructive determination.
It enables early, non-destructive determination of the sex of hatching eggs, reduces testing costs, simplifies the operation process, and improves the accuracy and efficiency of identification, thus possessing broad application prospects.
Smart Images

Figure CN2024144427_28052026_PF_FP_ABST
Abstract
Description
Optical sensor, preparation method, and method for rapid sex identification of hatching eggs using the sensor Technical Field
[0001] This invention relates to the field of gas detection technology, specifically to an optical sensor for visual olfactory detection, its preparation method, and a method for rapid sex identification of hatching eggs using the sensor. Background Technology
[0002] China is a major producer and consumer of eggs, with a total output of 29.38 million tons, ranking first in the world for many consecutive years. During the incubation of hatching eggs, the sex of the chicks is closely related to economic benefits, with a male-to-female embryo ratio of approximately 1:1. However, because male chicks do not lay eggs and have little meat, they lack economic value. Therefore, most male chicks are slaughtered or ground up for feed shortly after hatching. Globally, over 7 billion male chicks are culled annually through carbon dioxide asphyxiation or immersion culling. This not only increases labor costs and causes significant economic losses but also results in the underutilization of poultry egg resources and violates animal welfare regulations. Furthermore, in the broiler industry, due to significant differences in growth rate, feed conversion rate, and meat quality between roosters and hens, separating males and females for rearing is beneficial for precise broiler feeding, reducing resource waste, improving farming efficiency, and enhancing the overall competitiveness of the broiler industry. Therefore, it is necessary to sex chicken embryos in the early stages of incubation. This is not only beneficial for hatcheries to plan their incubation and production, but also of great significance for addressing animal welfare, saving incubation costs and waste chick disposal expenses, making rational use of hatching egg resources, and improving the economic benefits of the poultry egg industry.
[0003] Currently, the identification of embryonic sex in hatching eggs mainly relies on polymerase chain reaction (PCR) technology. While this method boasts high accuracy, it is typically time-consuming and cumbersome, requiring hatching and sampling, which can negatively impact embryonic development and makes it unsuitable for industrial hatching. Hatcheries commonly use methods like venting, feather speed, and feather color analysis for sex detection during the chick stage. However, these manual methods rely heavily on subjective human judgment, are time-consuming and inaccurate, and require waiting until the chicks hatch before identification. Furthermore, they face challenges related to high production costs and ethical controversies. Over the past decade, researchers have primarily employed machine vision, spectroscopy, and odor analysis to address the challenge of non-destructive sex detection during hatching. Machine vision primarily focuses on morphological and bloodline identification; however, the correlation between egg shape index and sex remains controversial, and the accuracy of bloodline identification methods needs improvement. Spectroscopy also has drawbacks, being susceptible to individual differences in eggs, such as shell thickness, shell color, and egg orientation. Furthermore, most methods utilizing spectral detection require minimally invasive sampling by breaking the shell, and the detection time is mainly concentrated in the mid-to-late stages of incubation. Currently, there is a technological gap in the field of sex identification of avian eggs, and non-destructive online detection in production has not yet been achieved. Therefore, developing a new method that can achieve rapid and accurate early identification of hatching egg information is a bottleneck problem that urgently needs to be overcome.
[0004] Odor can represent or reflect certain essential properties of a substance and is unique in time and space. In recent years, research reports on the biochemical information contained or transmitted by odor have been increasing. For example, seagulls can identify different types of eggs through smell, foxes can determine the type and freshness of bird eggs by smell, and zebras and lizards can determine the sex and physiological state of their companions through odor information. Some studies have focused on the biochemical information reflected in 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 the 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 can generate a composite response pattern as a unique optical "fingerprint" spectrum for any given analyte. However, there are currently almost no studies using optical sensing technology to non-destructively determine the sex of hatching eggs in the early stages, and this field urgently needs further exploration and development.
[0005] With the rapid development of IoT and AI technologies, the demand for intelligent gas detection is increasing daily. In recent years, gas sensors have seen significant improvements in appearance, performance, and other aspects. The successful application of new materials such as nanotechnology, thin film technology, and thick film technology has provided conditions for gas sensors to achieve new functions, gradually leading to miniaturization, intelligence, portability, and flexible wearable designs. Simultaneously, the combination of machine vision technology with IoT, big data, and deep learning integrates image feature selection into the training process, avoiding the problems of unclear image features and difficulty in extraction. It also better resists noise, enabling accurate detection of each component in gas mixtures in intelligent gas detection.
[0006] In summary, the existing technology lacks a method and solution for non-destructive sex identification of poultry hatching eggs using optical-based gas sensors. Summary of the Invention
[0007] To address the shortcomings of existing methods, this invention provides an optical sensor for the visual detection of volatile gases in poultry hatching eggs and a novel method for early and rapid sex determination of hatching eggs. This overcomes many drawbacks of existing methods for sex determination, such as late identification, damage to the eggs, high testing costs, requirement for professional personnel, cumbersome process, long analysis cycle, and inability to perform visual detection. This invention is the first to apply optical sensing technology to the visual identification of gases in poultry hatching eggs, converting the characteristic information of the gases into image information, thereby successfully achieving early and non-destructive sex determination of hatching eggs and providing a novel non-destructive testing method for early sex determination of hatching eggs.
[0008] Specifically, the present invention is achieved through the following technical solutions:
[0009] I. An optical sensor for visual olfactory detection of gases:
[0010] The optical sensor includes a substrate and at least two sensing units mounted within the substrate, wherein the sensing units contain a gas-sensitive material capable of reacting with a gas and inducing changes in the optical signal.
[0011] The gas-sensitive material is used to adsorb gases or interact with gases, causing changes in the material's optical properties, including changes in light absorption / reflection characteristics, photoluminescence, and color, thereby detecting the gas composition and concentration.
[0012] The photoluminescence changes include changes in fluorescence or phosphorescence.
[0013] Preferably, the gas-sensitive material includes, but is not limited to, chromophores such as dyes, nanoporous materials, and gold nanoparticles that respond to color changes in gases, or fluorescent / phosphorescent groups such as metal-organic frameworks (MOFs), quantum dots, and carbon dots that respond to luminescence in gases.
[0014] II. A method for fabricating an optical sensor:
[0015] The gas-sensitive material is prepared into a solution and ultrasonically dispersed or dissolved. Then, it is fixed on a substrate by methods such as dripping, spraying or printing, and dried to obtain a sensing unit. At least two sensing units are uniformly distributed on the substrate to form an array optical sensor.
[0016] Specifically, the gas-sensitive material is added to a solvent to prepare a solution.
[0017] The solvents are water, ethanol, ethylene glycol methyl ether, tetrabutylammonium hydroxide, and p-toluenesulfonic acid.
[0018] Preferably, the substrate includes, but is not limited to, eggshells, paper-based substrates, polymer substrates (polyethylene terephthalate PET, polyvinyl chloride film PVC, polycarbonate film PC, etc.), textile substrates, water / aerogel, etc.
[0019] III. A method for rapid sex identification of hatching eggs using an optical sensor:
[0020] The method uses an optical sensor composed of several sensing units placed in the environment near the hatching egg to react, or uses a sensor to react with the collected hatching egg gas. Then, the changes in optical signals before and after the placement of each sensing unit are collected, processed and analyzed to obtain the sex of the hatching egg.
[0021] The optical sensor performs olfactory visualization detection of volatile gases in poultry hatching eggs, thereby enabling sex identification of the eggs. The method can involve acquiring visual images / spectral data of optical signal changes in the reaction between the sensing unit and the hatching egg gases.
[0022] The optical sensor contains sensing units of at least two different gas-sensitive materials. The method collects the changes in optical signals of the sensing units of different gas-sensitive materials and combines them to form a specific spectrum. The spectrum is then analyzed and processed to determine the type of the egg being tested.
[0023] Multiple sensing units with different gas-sensitive materials are arranged on the same substrate. Visual or spectral images are collected before and after the entire substrate reacts with the eggs. The difference or color difference map between the visual or spectral images before and after the reaction with the eggs is taken as the spectrum.
[0024] When the optical signal changes into a color change, natural light or artificial light source shines on the gas-sensitive material, and the color change of the reflected light is captured by a camera, etc. By comparing the images captured before and after, a color difference map is formed as a spectrum.
[0025] When the optical signal changes into photoluminescence, 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 such as a xenon lamp or a laser. By affecting the luminous efficiency, luminous intensity, or luminous wavelength of the material, it causes the material to emit fluorescence or phosphorescence. Subsequently, the emission spectrum data or images are collected by a spectrometer or camera. The differences in the spectral images before and after excitation are compared and a color difference map or difference spectrum map is generated as a spectrum.
[0026] When the optical signal changes into a change in light absorption characteristics, the gas-sensitive material is irradiated with a light source of a specific fixed wavelength (the light source here refers to the range of ultraviolet to visible light), causing the material to exhibit new absorption peaks, the disappearance of existing absorption peaks, or a shift in peak position. An absorption spectrum image is acquired using a spectrometer, and the difference between the spectral images before and after excitation is compared to generate a difference spectrum as the final spectrum.
[0027] When optical property changes manifest as color changes or photoluminescence changes, the acquired images are processed in the following ways to obtain a spectrum: specifically, this includes perspective transformation, contour detection, region cropping, color analysis, and color difference map drawing.
[0028] First, a perspective transformation is performed on the image by mapping four specified points in the image—upper left, upper right, lower right, and lower left—to a standard rectangle, thereby achieving perspective correction and obtaining the target image.
[0029] Next, the image size is adjusted using image preprocessing, the image is converted to grayscale, and then Gaussian filtering is performed to reduce noise;
[0030] Then, the Otsu thresholding method is used to binarize the image to extract the contours in the image. All contours are sorted according to their area, and the largest contour is obtained and approximated to obtain a quadrilateral, which represents the optical sensor area in the image.
[0031] Then, after converting the detected contour region into a front view using perspective transformation, rectangular markers are drawn according to the position of the sensing unit, and multiple regions of interest are cropped out. Each region of interest contains only one sensing unit.
[0032] Finally, the average values of R, G, and B in the region of interest are calculated as the R, G, and B values of the corresponding sensing unit within the region. A color difference map / difference map is then drawn using the R, G, and B values of the sensing unit as a spectrum.
[0033] The method specifically includes the following steps:
[0034] Select hatching eggs, clean and disinfect them, and then incubate them.
[0035] Place the aforementioned optical sensor in the environment of the hatching eggs to allow it to fully react with the gases emitted by the hatching eggs; or collect the gases emitted by the hatching eggs and allow them to react with the optical sensor.
[0036] An optical information acquisition system is used to acquire optical signals from the optical sensor before and after each step.
[0037] Data processing and model building: The collected optical signals are preprocessed, features are extracted, and a hatching egg sex identification model is built. Then, the established hatching egg sex identification model is trained under known conditions.
[0038] 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 determination result.
[0039] The optical signal includes a visible light image or a spectral image.
[0040] The reaction methods in the steps include contact between the optical sensor and the hatching egg, and non-contact reaction.
[0041] Contact-type methods include, but are not limited to, spraying gas-sensitive materials onto the eggshell so that the gas-sensitive materials react directly with the gases emitted by the hatching egg, or attaching flexible sensors to the surface of the eggshell and reacting with the gases emitted by the hatching egg.
[0042] Non-contact methods include, but are not limited to, placing the sensor and the hatching egg in the same chamber, where the gas-sensitive material does not come into contact with the egg but reacts with the gas emitted by the egg, or using a vacuum pump or gas sampling bag to first collect the gas emitted by the egg and then transport the collected gas to the optical sensor for reaction.
[0043] The optical information acquisition system in the steps mentioned includes, but is not limited to, industrial camera acquisition systems, smartphones, scanners, ELISA readers, fluorescence spectrophotometers, color recognition devices, ultraviolet spectrophotometers, etc., for acquiring optical / visual signal data from sensors.
[0044] In the aforementioned steps, a binary classification model for identifying the sex of hatching eggs is established based on the collected images or optical signals such as spectra. The model for identifying the sex of hatching 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.
[0045] The egg sex identification model adopted is the EfficientNet-BO-CBAM model, which is divided into 9 stages in sequence. The first stage is the backbone network, which only uses convolutional modules. Specifically, the convolutional module is mainly composed of 3×3 convolution operations, connected batch normalization layers with a stride of 2, and Swish activation functions connected in sequence. The second to eighth stages use the CBAM network. Each stage uses a feature extraction module CBAM mainly composed of channel attention module CAM and spatial attention module SAM. The second stage consists of one 3×3 feature extraction module CBAM, the third stage consists of two 3×3 feature extraction modules CBAM, the fourth stage consists of two 5×5 feature extraction modules CBAM, the fifth stage consists of three 3×3 feature extraction modules CBAM, the sixth stage consists of three 5×5 feature extraction modules CBAM, the seventh stage consists of four 5×5 feature extraction modules CBAM, and the eighth stage consists of one 3×3 feature extraction module CBAM.
[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. The channel feature map Mc and the original input feature map F itself are then multiplied together to obtain a channel attention map F'. The channel attention map F' is then 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' itself are then 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 multilayer perceptron (MLP). The original feature map F is processed by the max pooling layer and the average pooling layer, and then input into the MLP to obtain a first global descriptor vector1 and a second global descriptor vector2. 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, then concatenated, and then processed by a convolutional layer to obtain the spatial feature map Ms. Finally, the ninth 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.
[0048] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0049] 1. The optical sensor constructed by this invention has the characteristics of small size, simple operation, low cost and high throughput, which reduces the dependence on large detection instruments and professional operators, while reducing detection costs, and has broad application prospects in field detection.
[0050] 2. Currently, most detection technologies for sex determination of hatching eggs focus on the middle and late stages of incubation and the hatching period. This invention can accurately determine the sex of poultry hatching eggs in the early stages of incubation, overcoming the shortcomings of existing methods that involve late identification and damage. It successfully determines the sex of poultry hatching eggs in the early stages without damage, significantly reducing the economic cost of hatching eggs and avoiding the waste of poultry egg resources and ethical controversies caused by killing male chicks.
[0051] 3. The optical gas sensor constructed in this invention forms a specific "fingerprint" pattern by collecting the changes in optical information of the sensing units before and after the array sensor comes into contact with different volatile gas molecules, thereby realizing the visualization of the artificial olfactory system. It does not require any professional equipment and can even be qualitatively identified by the naked eye.
[0052] 4. The present invention provides a feasible and non-destructive method for identifying the sex of poultry hatching eggs by using volatile gases. This method overcomes the shortcomings of existing methods for identifying the sex of hatching eggs, which require breaking the shells to collect samples, thus reducing the impact on the development of the hatching eggs.
[0053] 5. This invention is the first to combine optical sensors with machine learning technology to achieve early non-destructive detection and determination of sex information in fertilized eggs. Through the application of deep learning technology and improvements to the model, images are efficiently classified and recognized, improving the accuracy and efficiency of sex determination of fertilized eggs. It has high practical value and broad application prospects, providing new opportunities for the intelligent automation of sex identification of poultry fertilized eggs in the future.
[0054] 6. This invention constructs a convolutional neural network model for rapid identification of the sex of hatching eggs, targeting practical application scenarios. An attention mechanism is introduced into the feature extraction network, enabling the network to focus on feature information in both channel and spatial dimensions, suppressing unimportant feature information, enhancing the extraction of deep image features, and achieving better results in convolution. Attached Figure Description
[0055] Figure 1 shows test tube photographs of the 36 gas-sensitive dyes prepared in this invention;
[0056] Figure 2 is a schematic diagram of the optical sensor prepared in this invention;
[0057] Figure 3 is a schematic diagram of the structure and detection principle of the present invention;
[0058] Figure 4 shows the color difference before and after the optical sensor prepared in this invention detects gas in the hatching eggs on day 6;
[0059] Figure 5 is a schematic diagram of the EfficientNet-B0 baseline network structure used in the egg sex identification model constructed in this invention;
[0060] Figure 6 is a schematic diagram of the CBAM feature extraction module introduced in this embodiment;
[0061] Figure 7 is a schematic diagram of the overall network topology of the egg sex identification model provided in this embodiment;
[0062] Figure 8 shows the accuracy results of using two models to distinguish between male and female eggs on the 6th day of incubation in this invention;
[0063] Figure 9 shows the results of the present invention in predicting the sex of hatching eggs;
[0064] Figure 10 is a schematic diagram of the egg tattoo sensor prepared according to the present invention;
[0065] Figure 11 is a schematic diagram of the seed egg tattoo sensor after image correction according to the present invention;
[0066] Figure 12 shows the accuracy results of two models of the seed egg tattoo sensor of the present invention.
[0067] Figure 13 shows the structure of the laser-cut paper-based sensor designed in this invention;
[0068] Figure 14 is a schematic diagram of the fluorescence array sensor prepared in this invention;
[0069] Figure 15 shows the accuracy results of two models of the fluorescence array sensor of the present invention. Detailed Implementation
[0070] The present invention will be further described below with reference to specific embodiments and accompanying drawings, but this does not limit the present invention.
[0071] The specific implementation of the optical sensor includes a substrate and at least one sensing unit mounted in the substrate, the sensing unit comprising a gas-sensitive material capable of reacting with a gas and inducing changes in optical signals.
[0072] Gas-sensitive materials are used to adsorb gases or interact with gases, causing changes in the material's optical properties, such as changes in light reflection, absorption, and photoluminescence. These changes manifest macroscopically as optical / visual changes in the sensing unit, such as changes in color, fluorescence, and phosphorescence. Fluorescence changes include, but are not limited to, fluorescence enhancement, fluorescence depletion, and fluorescence quenching.
[0073] Preferably, the gas-sensitive material includes, but is not limited to, dyes (such as pH indicator dyes, redox indicator dyes, solvation color-changing dyes, complexation titration indicator dyes), nanoporous materials, gold nanoparticles and other chromophores that respond to color changes in gases, or fluorescent / phosphorescent groups such as metal-organic frameworks (MOFs), quantum dots, carbon dots and other luminescent properties that respond to gases.
[0074] Different gas-sensitive materials will result in different changes in the optical signals of each sensing unit under normal conditions. Optical / visual changes occur when external light strikes the gas-sensitive material, is reflected by the material, and is then detected by optical detection devices. External light can be visible light, ultraviolet light, etc. Optical detection devices include cameras, camcorders, and spectrometers.
[0075] In specific implementation, for preparation, the gas-sensitive material is prepared into a solution and then fixed on the substrate by methods such as dripping, spraying or printing to obtain a sensing unit. At least one sensing unit is distributed on the substrate to form an array optical sensor.
[0076] Preferably, the substrate includes, but is not limited to, eggshells, paper-based substrates, polymer substrates (such as 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 can be designed according to needs, such as a 3 cm x 3 cm square.
[0078] The optical signal changes of the same sensing unit will be different for different gases; and for the same gas, the optical signal changes of different sensing units will also be different.
[0079] This invention employs an optical sensor composed of several sensing units, placed in the environment near the hatching egg. The sensor can be positioned close to the egg or collect gas from the egg, which then reacts with the optical sensor. The changes in optical signals before and after the placement of each sensing unit are collected and input into a computer for processing and analysis to determine the sex of the egg. The results are then displayed on a monitor.
[0080] Optical sensors are used to visually detect the volatile gases emitted from poultry hatching eggs, thereby enabling sex identification. One method involves collecting visual changes in the sensor unit before and after the reaction with the hatching egg's gases.
[0081] The optical sensor contains sensing units of at least two different gas-sensitive materials. The method collects the changes in optical signals of sensing units of different gas-sensitive materials and combines them to form a specific spectrum. The spectrum is then analyzed and processed to determine the type of the egg being tested.
[0082] Multiple sensing units with different gas-sensitive materials are arranged on the same substrate. Each sensing unit contains a gas-sensitive material, and the sensing units corresponding to different gas-sensitive materials are arranged at different positions. The entire substrate is placed near the hatching egg to react, or reacts with the collected hatching egg gas. Visual images or spectral images are collected before and after the sensor reaction. The difference map or color difference map of the visual images or spectral images before and after the reaction with the hatching egg gas is taken as the spectrum.
[0083] Specifically, a visual image or spectral image is first acquired on the entire substrate as the first image, and then a visual image or spectral image is acquired after reacting with the eggs with gas as the second image. The difference map or color difference map between the first image and the second image is calculated as the spectrum.
[0084] When the optical signal changes into a color change, natural light or artificial light source shines on the gas-sensitive material, and the color change of the reflected light can be captured by cameras, etc. By comparing the images captured before and after, a color difference map is formed as a spectrum.
[0085] When the optical signal changes into a photoluminescence change, a light source of a specific wavelength (such as a xenon lamp or laser) is used as the excitation light to irradiate the gas-sensitive material. By affecting the material's luminescence efficiency, luminescence intensity, or emission wavelength, it emits fluorescence or phosphorescence. Subsequently, a spectrometer or camera collects the emission spectrum data or images, compares the differences in the spectral images before and after excitation, and generates a color difference map or difference spectrum map as a spectrum.
[0086] When an optical signal changes into a change in light absorption characteristics, irradiating a gas-sensitive material with a light source of a specific wavelength (covering the ultraviolet to visible light range) may cause the material to exhibit new absorption peaks, the disappearance of existing absorption peaks, or a shift in peak position. Absorption spectrum images are acquired using a spectrometer, and the differences between the spectral images before and after excitation are compared to generate a difference spectrum as the final spectrum.
[0087] This way, at least two sensing units contain different gas-sensitive materials, enabling the specific detection of gases.
[0088] The specific rapid identification method implemented includes the following steps:
[0089] (1) Select hatching eggs, clean and disinfect them, and then put them into the incubator;
[0090] In step (1), poultry eggs are selected for hatching, such as chicken eggs, duck eggs, and goose eggs. Known standard hatching methods can be used for incubation conditions.
[0091] (2) Place the above-mentioned optical sensor in the environment of the hatching egg and allow it to fully react with the gas emitted by the hatching egg; or collect the gas from the hatching egg and react with the optical sensor.
[0092] The reaction methods in step (2) include contact-type and non-contact-type optical sensors with hatching eggs:
[0093] Contact-type methods include, but are not limited to, spraying gas-sensitive materials onto the eggshell so that the gas-sensitive materials react directly with the gases emitted by the hatching egg, or attaching flexible sensors to the surface of the eggshell and reacting with the gases emitted by the hatching egg.
[0094] Non-contact methods include, but are not limited to, placing the sensor and the hatching egg in the same chamber, where the gas-sensitive material does not come into contact with the egg but senses and reacts to the gas emitted by the egg, or using a vacuum pump or gas sampling bag to first collect the gas emitted by the egg, and then delivering the collected gas to an optical sensor for sensing and reaction, ultimately causing the gas-sensitive material to produce a change in optical signal.
[0095] (3) An optical information acquisition system is used to acquire optical images of the optical sensor before and after step (2);
[0096] The optical information acquisition system in step (3) includes, but is not limited to, industrial camera acquisition systems, smartphones, scanners, enzyme-linked immunosorbent assay (ELISA) readers, fluorescence spectrophotometers, color recognition devices, ultraviolet spectrophotometers, etc., to acquire optical signal data from sensors.
[0097] The obtained optical signal data includes, but is not limited to, RGB color information, ultraviolet spectral signals, and fluorescence intensity signals.
[0098] (4) Construct a dataset from the optical images acquired above;
[0099] The dataset in step (4) consists of preprocessed color difference maps and gender labels, which are used for subsequent model training.
[0100] Build the model;
[0101] In step (5), machine learning technology is used to establish a model for sex identification of hatching eggs by using data analysis software including but not limited to Python and Matlab, based on the optical signals of hatching eggs.
[0102] In step (5), a binary classification model for identifying the sex of hatching eggs can be established based on the collected images or optical signals such as spectra. Then, under the condition that the sex of the hatching eggs is known, the model is trained using transfer learning to obtain the model parameters. After training, the training weights are saved to obtain the hatching egg sex identification model. This 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.
[0103] (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 under the test scenario, and the sex of the egg is determined by calculation. This achieves non-destructive detection of egg sex in the early stage of incubation.
[0104] The embodiments of the present invention are as follows: Example 1:
[0105] The sensor substrate is a PES film. The film is cut into rectangular paper bases with a size of 5.0 mm * 6.0 mm and arranged evenly in a planar array in a polytetrafluoroethylene frame plate to obtain a film array sensor.
[0106] 4 mg of each of 36 dyes was weighed into 36 centrifuge tubes. 1 mL of ethanol was added, and the solutions were sonicated to obtain the different dye solutions shown in Figure 1. The 36 dyes, classified according to their chemical structure, include aniline dyes, phenolic 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, azo ketone dyes, and copper phthalocyanine dyes. Examples include bromocresol green, methyl red, N,N'-diphenyl-1,4-phenylenediamine, and toluidine blue.
[0107] The 36 dye solutions obtained above were each taken in 4 μL and sequentially added to the PES thin film substrate using a pipette. After drying at 36°C on a heating plate for 48 hours, the colorimetric sensor array shown in Figure 2 was obtained, where each circular dot after the addition of a dye solution served as a sensing unit.
[0108] The testing procedure is shown in Figure 3. Jinghong No. 1 chicken hatching eggs were selected as the test samples. The eggs were disinfected by wiping with 75% ethanol solution and then air-dried. The egg weight ranged from 49.82 to 69.72 g, with a major axis of 53.13 to 61.81 mm, a minor axis of 40.03 to 51.87 mm, and an egg shape index (major axis / minor axis) of 1.10 to 1.45. Each egg was placed in an independent incubator at a temperature of 37-38℃ and a humidity of 60-70%, with the eggs turned every 90 minutes.
[0109] First, an industrial camera acquisition system was used to acquire the pre-reaction image data of the aforementioned colorimetric sensor array. The camera's focal length, aperture, 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 lighting conditions. The light source was a 20-40W pure white LED with a color temperature of 6000-7000K to ensure that the acquired image information was not affected by ambient light or other factors.
[0110] The colorimetric sensor was then placed in a separate incubator near the air cell of the hatching egg on day 6 of incubation, allowing the sensor to make stable contact with the gas produced during the egg's respiration. The color of the sensing unit changed, and the image was captured again by an industrial camera 24 hours later.
[0111] Python image processing algorithms are used to preprocess and denoise the acquired colorimetric sensor array images to reduce computational load and improve efficiency and accuracy. The mean values of the R, G, and B (red, green, blue) channels of the image are extracted. Specifically, the image file is converted to grayscale after viewpoint correction and fixed-size adjustment, and then Gaussian filtering is applied. Otsu's thresholding method is used for image binarization to extract contours, which are then sorted according to their area. By approximating the largest contour, a quadrilateral is obtained, representing the optical sensor region in the image.
[0112] The extracted region is cropped into 6*6 small regions according to the position of the sensing unit. The average R, G, B color values of 12*20 pixels in each small region are obtained, which gives an R, G, B value representing the color of the sensing unit region.
[0113] Image data before and after the reaction (i.e., before and after being placed near the hatching eggs) were acquired and processed to calculate the differences in R, G, and B values for each sensing unit. The differences in R, G, and B values for each sensing unit were then amplified (converted from 4-19 to 0-255) and subsequently plotted as a color difference map as shown in Figure 4.
[0114] After the chickens successfully hatch, their true sex is determined by methods such as feather color and venting, and the color difference maps are defined as color difference maps for female and male chickens respectively.
[0115] The image is augmented by randomly adjusting its brightness, contrast, and saturation to between -0.2 and 0.2, and converting it to grayscale with a probability of 0.5.
[0116] An EfficientNet-B0-CBAM model for rapid sex identification of hatching eggs was designed and built. The model uses the EfficientNet-B0 baseline network as its backbone and introduces a Convolutional Block Attention Module (CBAM), retaining the structural advantages of EfficientNet. It achieves state-of-the-art accuracy on the ImageNet dataset, and the number of network parameters is reduced by orders of magnitude compared to networks such as ResNet50 and InceptionV2. The network structure of EfficientNet-B0 is shown in Figure 5. The original Mobile Inverted Bottleneck Convolution (MBConv) module is replaced with a Convolutional Attention Module, followed by a Channel Attention Module (CAM) and a Spatial Attention Module (SAM). By assigning different weights to information that needs to be emphasized or suppressed, the information flow within the network is improved, resulting in better performance in convolutions. The CBAM structure used is shown in Figure 6.
[0117] The egg sex identification model is the EfficientNet-B0-CBAM model, which consists of nine sequential stages:
[0118] The first stage is the backbone network, which uses only convolutional modules. Specifically, the backbone network consists only of convolutional modules, which are mainly composed of 3×3 convolution operations, connected batch normalization layers with a stride of 2, and Swish activation functions connected in sequence.
[0119] Stages 2-8 employ a CBAM network. Each stage uses a CBAM feature extraction module primarily composed of a channel attention module (CAM) and a spatial attention module (SAM). Stage 2 consists of one 3×3 CBAM feature extraction module, Stage 3 consists of two 3×3 CBAM feature extraction modules, Stage 4 consists of two 5×5 CBAM feature extraction modules, Stage 5 consists of three 3×3 CBAM feature extraction modules, Stage 6 consists of three 5×5 CBAM feature extraction modules, Stage 7 consists of four 5×5 CBAM feature extraction modules, and Stage 8 consists of one 3×3 CBAM feature extraction module.
[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 is multiplied together with the original input feature map F to obtain a channel attention map F'. This channel feature map Mc is multiplied by the original feature map F, thereby selectively amplifying or weakening features of different channels. 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. Finally, the spatial feature map Ms is multiplied together with the channel attention map F' 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) comprises a max-pooling layer, an average-pooling layer, and a multilayer 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 MLP to obtain a first global descriptor vector1 and a second global descriptor vector2. 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. These two descriptors capture the importance and distribution of different channels in the feature map, respectively. These descriptors are then passed to a series of convolutional layers, ultimately generating an attention map Mc with the same number of channels as the input feature map.
[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 and average-pooling layers, concatenated, and then processed by a convolutional layer to obtain the spatial feature map Ms. This process first calculates the average value (AvgPool) and maximum value (MaxPool) at each position in the feature map, then concatenates these two statistics and passes them 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', enabling the model to focus on key regions, and the spatial attention map F'' is calculated through the convolutional layer.
[0123] The final 9th stage consists 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, connecting a batch normalization (BN) layer and a Swish activation function; the second to eighth stages use the CBAM module to replace the original MBConv module, and the number of times this 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, which can be equipped with a Softmax activation function for classification. The overall network topology of the model is shown in Figure 7.
[0125] The model was trained using transfer learning on the ImageNet dataset and then transferred to an improved EfficientNet network for fine-tuning with a sample set. After training, a model for identifying the sex of hatching eggs was obtained. During training, 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 estimate the probability that the output image was classified as a male or female hatching egg. The loss function used was classification cross-entropy. After training, the model weight parameters were saved.
[0126] The following metrics can be used to evaluate model performance:
[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, is judged as a positive sample, and in fact is a positive sample;
[0133] TN: True Negative, is judged as a negative sample, and in fact is 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: The accuracy of a model in recognizing data on a dataset, i.e., the proportion of correctly recognized samples out of the total number of samples.
[0137] Recall: The proportion of samples that are actually positive out of all samples that are predicted as positive by the classifier.
[0138] Precision: The proportion of samples that are actually positive out of all samples predicted as positive by the classifier.
[0139] F1 score: A metric used to comprehensively consider precision and recall; it is the harmonic mean of precision and recall.
[0140] Area Under the Curve (AUC): This is a comprehensive evaluation metric related to the ROC curve. It allows for a direct comparison and evaluation of classifier performance. The closer the ROC curve is to the upper left corner, the larger the area under the curve, and the better the classifier's performance.
[0141] We constructed the VGGNet16 model, a classic model for feature extraction. Its structure primarily consists of uniform convolutional and pooling layers. By increasing the network depth, it can effectively extract complex features and improve classification performance. Its topology comprises 16 layers, including 13 convolutional layers and 3 fully connected layers. The convolutional layers use 3x3 kernels and ReLU as the activation function. After successive convolutional layers, a max-pooling layer follows, and finally, a fully connected layer is connected for classification.
[0142] The defined color difference image dataset was divided into a 70% training set and a 30% test set for training and evaluating the model, and a corresponding data loader was created. During training, the number of iterations was set to 100, the learning rate to 0.001, and the batch size to 8.
[0143] As shown in Figure 8, the classic model VGGNet16 and the proposed EfficientNet-B0-CBAM model were used to train and test the egg color difference map dataset, respectively. The results show that the accuracy of the classic model VGGNet16 is 94.0%, while the proposed fast egg sex identification algorithm EfficientNet-B0-CBAM achieves 100.0% accuracy, improving the accuracy and efficiency of early egg sex identification. Furthermore, EfficientNet-B0-CBAM's precision, recall, and accuracy are all higher than those of VGGNet16 in the comparative experiment.
[0144] The EfficientNet-B0-CBAM model, which has the best accuracy in distinguishing between male and female eggs, was selected for non-destructive sex detection of eggs in the early stages of incubation. As shown in Figure 9, based on the pre-established model, the sex of the eggs was successfully obtained by inputting the color difference map of the colorimetric sensor after the eggs reacted with the model. Example 2:
[0145] Eighteen different dye powders were weighed and placed on a glass grinding plate. Gum arabic, ox bile, and glycerin were added dropwise to each powder in a mass ratio of 3:2:1:4. The mixture was then ground with a pestle for 15 minutes to obtain different types of semi-flowable inks. The 18 selected dyes were classified according to their chemical structure into indicators, amine compounds, metal complexes, and other reagents, such as bromophenol red, bromocresol green, methyl red, diphenylamine, and manganese porphyrin.
[0146] Eggs from the Jinghong No. 1 chicken were selected as test samples. The eggs were wiped and disinfected with 75% ethanol solution and then air-dried. The egg weight ranged from 49.82 to 69.72 g, the long axis from 53.13 to 61.81 mm, the short axis from 40.03 to 51.87 mm, and the egg shape index (long axis / short axis) from 1.10 to 1.45.
[0147] A 3*6 transfer array stamp was prepared using fiber material, with each raised portion of the stamp being a 3*3 mm circle. Eighteen different dye inks were sequentially coated onto each raised circle of the transfer array stamp using a pipette. The ink-soaked stamp was then quickly pressed into the center of a clean eggshell and left to air dry at room temperature for 3 hours, resulting in an eggshell equipped with a tattoo sensor, as shown in Figure 10. Each circular dot formed by the application of different dye inks to the eggshell serves as a sensing unit.
[0148] An industrial camera acquisition system was used to collect image data of the tattooed eggs before the sensor reaction. The camera's focal length, aperture, 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 lighting conditions. The light source was a 20-40W pure white LED with a color temperature of 6000-7000K to ensure that the acquired image information was not affected by ambient light or other factors.
[0149] Each tattooed egg was placed in an independent incubator at a temperature of 37-38℃ and a humidity of 60-70%, with the eggs turned every 90 minutes. This ensured stable contact between the tattoo sensor and the gas produced during the egg's respiration, causing a color change in the sensing unit. After three consecutive days of this process, images of the tattooed eggs were captured again using an industrial camera.
[0150] Python image processing algorithms were used to preprocess and denoise the acquired tattoo sensor array images to reduce computational load, improve efficiency and accuracy, and extract the color R, G, and B features of the images. Specifically, the distorted curvature image of the acquired egg was first corrected with distortion coefficients k1=0.1, k2=0.02, and k3=0.003. Then, mapping calculations were performed to ensure the correct calculation of the center point (cx, cy) and to ensure appropriate distortion correction around the center point in the mapped image. Finally, slicing was used to ensure the output image size was the same as the input image to avoid blank areas at the boundaries. The output is the corrected tattoo egg image shown in Figure 11.
[0151] The corrected image file was resized to a fixed size, with the distance from the left border edge to the center point of the first circular dye ink being the same. The image was then converted to grayscale and subjected to Gaussian filtering. Otsu's thresholding method was used for image binarization to obtain the image contours, which were then sorted according to their areas. The largest contour was approximated to obtain a quadrilateral representing the optical sensor region in the image. The extracted region was cropped into 3*6 smaller regions based on the sensor unit's location. The average R, G, and B colors of a 12-pixel square region within each smaller region were obtained, resulting in an R, G, and B value representing the color of that region.
[0152] Image data before and after the reaction is acquired and processed to calculate the differences in R, G, and B values for each sensing unit. The differences in R, G, and B values for each sensing unit are then amplified (converted from 4-19 to 0-255) and subsequently plotted as a color difference map.
[0153] After the chickens successfully hatch, their true sex is determined by methods such as feather color and venting, and the color difference maps are defined as color difference maps for female and male chickens respectively.
[0154] The image is augmented by randomly adjusting its brightness, contrast, and saturation to between -0.2 and 0.2, and converting it to grayscale with a probability of 0.5.
[0155] An EfficientNet-B0-CBAM model for rapid sex identification of hatching eggs was designed and built. The EfficientNet-B0 baseline network is used as the backbone structure, and a CBAM module is introduced, which sequentially applies the CAM and SAM modules. By assigning different weights to information that needs to be emphasized or suppressed, the information flow within the network is facilitated, extracting deeper feature information during convolution. The feature map output from the CBAM module is then classified through fully connected layers and activation functions in a classification network to output the sex identification result corresponding to the hatching egg sample image. See Example 1 for details.
[0156] The classic model VGGNet16 is built; see Example 1 for details.
[0157] The defined color difference image dataset was divided into a 70% training set and a 30% test set for training and evaluating the model, and a corresponding data loader was created. During training, the number of iterations was set to 100, the learning rate to 0.001, and the batch size to 8.
[0158] The classic model VGGNet16 and the proposed EfficientNet-B0-CBAM model were trained and tested on the egg color difference map dataset, respectively. The results are shown in Figure 12. The proposed fast egg sex identification algorithm, EfficientNet-B0-CBAM, achieved an accuracy of 93.0%, while the classic model VGGNet16 achieved an accuracy of 86.0%. This invention improves the accuracy and efficiency of early egg sex identification, and EfficientNet-B0-CBAM's precision, recall, and accuracy are all higher than those of VGGNet16 in the comparative experiment. EfficientNet-B0-CBAM was selected as the optimal model for lossless prediction of egg sex in the early stages of incubation. Example 3:
[0159] PES film substrates were cut using laser cutting. First, computer-aided design software was used to design the engraving path and parameters. The PES paper substrate was placed on the laser engraving system's worktable, and the laser engraving system was set according to the designed parameters: vector mode, laser power 5.0%, engraving speed 45%, and PPI 750. The resulting rectangular sensor substrate measured 27.6mm x 30.8mm contained nine evenly distributed 3x3 sensing units, each measuring 2.9mm x 3.5mm. Under the same operation, a square sensor substrate measuring 13mm x 13mm was obtained, containing nine evenly distributed circular sensing units with a diameter of 3mm. The sensor substrate design, shown in Figure 13, includes a sensing area, a connection area, and an isolation area.
[0160] Nine fluorescent materials, each weighed 4 mg, were placed into nine centrifuge tubes. After adding 1 mL of ethanol, nine solutions or suspensions were obtained under sonication. The nine fluorescent sensing substances included amine dyes, phthalocyanine dyes, aldehyde dyes, and nitrate dyes, such as erythramine green, diphenylamine, and thymol blue.
[0161] The nine fluorescent sensing solutions were each added in 4 μL dropwise to the sensing area of the aforementioned sensor substrate using a pipette, and then dried and stabilized at 36°C for 48 hours on a heating plate. Under 365 nm ultraviolet excitation light, a fluorescent sensing array as shown in Figure 14 was obtained (the figure shows an example with a circular sensing unit inside).
[0162] Eggs from the Jinghong No. 1 chicken were selected as test samples. The eggs were disinfected by wiping with a 75% ethanol solution and then air-dried. The eggs weighed 49.82–69.72 g, with a major axis of 53.13–61.81 mm, a minor axis of 40.03–51.87 mm, and an egg shape index (major axis / minor axis) of 1.10–1.45. Each egg was placed in an individual incubator at a temperature of 37–38℃ and a humidity of 60–70%, with the eggs turned every 90 minutes.
[0163] An industrial camera acquisition system was used to acquire pre-reaction image data of the aforementioned fluorescence sensor array. The camera's focal length, aperture, 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 equipped with 365 nm ultraviolet excitation light to ensure that the acquired image information was not affected by ambient light or other factors.
[0164] The fluorescence sensor was placed in the chamber of the independently incubated hatching egg on the 5th day of incubation and suspended near the air chamber of the hatching egg, so that the sensor could make stable contact with the gas generated during the respiration of the hatching egg. The color of the sensing unit changed, and the sensor image was acquired again by an industrial camera 24 hours later.
[0165] Python image processing algorithms are used to preprocess and denoise the acquired fluorescence sensor array images to reduce computational load and improve efficiency and accuracy. The mean values of the R, G, and B (red, green, blue) color channels of the image are extracted. Specifically, the image file is converted to grayscale after viewpoint correction and resizing, and then Gaussian filtered. Otsu's thresholding method is used for image binarization to extract contours, which are then sorted according to their area. By approximating the largest contour, a quadrilateral is obtained, representing the optical sensor region in the image. The extracted region is cropped into 3*3 smaller regions based on the sensor unit's location. The average R, G, and B values of a 12*12 pixel area within each smaller region are obtained, thus yielding an R, G, and B value representing the color of that sensor unit region.
[0166] Image data before and after the reaction is acquired and processed to calculate the differences in R, G, and B values for each sensing unit. The differences in R, G, and B values for each sensing unit are then amplified (converted from 4-19 to 0-255) and subsequently plotted as a color difference map.
[0167] After the chickens successfully hatch, their true sex is determined by methods such as feather color and venting, and the color difference maps are defined as color difference maps for female and male chickens respectively.
[0168] The image is augmented by randomly adjusting its brightness, contrast, and saturation to between -0.2 and 0.2, and converting it to grayscale with a probability of 0.5.
[0169] An EfficientNet-B0-CBAM model for rapid sex identification of hatching eggs was designed and built. The EfficientNet-B0 baseline network is used as the backbone structure, and a CBAM module is introduced, which sequentially applies the CAM and SAM modules. By assigning different weights to information that needs to be emphasized or suppressed, the information flow within the network is facilitated, extracting deeper feature information during convolution. The feature map output from the CBAM module is then classified through fully connected layers and activation functions in a classification network to output the sex identification result corresponding to the hatching egg sample image. See Example 1 for details.
[0170] The classic model VGGNet16 is built; see Example 1 for details.
[0171] The defined color difference image dataset was divided into a 70% training set and a 30% test set for training and evaluating the model, and a corresponding data loader was created. During training, the number of iterations was set to 100, the learning rate to 0.001, and the batch size to 8.
[0172] The classic model VGGNet16 and the proposed EfficientNet-B0-CBAM model were trained and tested on the egg color difference map dataset, respectively. The results are shown in Figure 15. The proposed fast egg sex identification algorithm, EfficientNet-B0-CBAM, achieved an accuracy of 96.0%, while the classic model VGGNet16 achieved an accuracy of 90.0%. This invention improves the accuracy and efficiency of early egg sex identification, and EfficientNet-B0-CBAM's precision, recall, and accuracy are all higher than those of VGGNet16 in the comparative experiment. EfficientNet-B0-CBAM was selected as the optimal model for lossless prediction of egg sex in the early stages of incubation.
[0173] 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 with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the present invention. All technical solutions and improvements that do not depart from the spirit and scope of the present invention should be covered within the scope of the claims of the present invention.
Claims
1. An optical sensor for visual olfactory detection of gases, characterized in that: The optical sensor includes a substrate and at least two sensing units mounted within the substrate, wherein the sensing units contain a gas-sensitive material capable of reacting with a gas and inducing changes in the optical signal. The gas-sensitive material is used to adsorb gases or interact with gases, causing changes in the optical properties of the material, including changes in light absorption / reflection characteristics, photoluminescence, and color, thereby detecting the gas composition and concentration.
2. The optical sensor for olfactory visual detection of a gas according to claim 1, characterized in that: The gas-sensitive materials include, but are not limited to, chromophores such as dyes, nanoporous materials, and gold nanoparticles that respond to color changes in gases, or fluorescent / phosphorescent groups such as metal-organic frameworks (MOFs), quantum dots, and carbon dots that respond to luminescence in gases.
3. A method for fabricating an optical sensor according to any one of claims 1-2, characterized in that: The gas-sensitive material is fixed onto a substrate by methods such as dripping, spraying, or printing to obtain a sensing unit. At least two sensing units are distributed on the substrate to form an array-type optical sensor.
4. The method of claim 3, wherein: The substrates include, but are not limited to, eggshells, paper-based substrates, polymer substrates, textile substrates, and water / aerogels.
5. A method for rapid identification of the sex of an egg using the optical sensor of any one of claims 1-2, characterized by: The method uses an optical sensor composed of several sensing units placed in the environment near the hatching egg to react, or uses a sensor to react with the collected hatching egg gas. Then, the changes in optical signals before and after the placement of each sensing unit are collected, processed and analyzed to obtain the sex of the hatching egg.
6. The method for rapid gender identification of fertile eggs using optical sensors according to claim 5, wherein: The optical sensor contains sensing units of at least two different gas-sensitive materials. The method collects the optical changes of the sensing units of different gas-sensitive materials and combines them to form a specific spectrum. The spectrum is then analyzed and processed to determine the type of the egg being tested.
7. The method for rapid gender identification of fertile eggs using optical sensors according to claim 6, wherein: Multiple sensing units with different gas-sensitive materials are arranged on the same substrate. Visual or spectral images are collected before and after the entire substrate is placed near the hatching egg. The difference map or color difference map of the visual or spectral images before and after the substrate is placed near the hatching egg is taken as the spectrum.
8. The method for rapid gender identification of fertile eggs using optical sensors according to claim 7, wherein: When optical properties change into color changes, natural light or artificial light source shines on the gas-sensitive material, and the color change of the reflected light is captured by a camera. By comparing the images captured before and after, a color difference map is formed as a spectrum. When the optical properties change to photoluminescence, a light source with a fixed wavelength is used as the excitation light to irradiate the gas-sensitive material. By affecting the material's luminescence efficiency, luminescence intensity, or emission wavelength, it emits fluorescence or phosphorescence. Subsequently, a spectrometer or camera collects the emission spectrum data or images, compares the differences in the spectral images before and after excitation, and generates a color difference map or difference spectrum map as a spectrum. When the optical properties change into changes in light absorption characteristics, the gas-sensitive material is irradiated with a light source of a fixed wavelength, causing the material to exhibit new absorption peaks, the disappearance of existing absorption peaks, or a shift in peak position. An absorption spectrum image is acquired using a spectrometer, and the differences between the spectral images before and after excitation are compared to generate a difference spectrum as the final spectrum.
9. The method for rapid gender identification of fertile eggs using optical sensors according to claim 7, wherein: The acquired images were processed in the following manner to obtain the atlas: First, a perspective transformation is performed on the image by mapping four specified points in the image—upper left, upper right, lower right, and lower left—to a standard rectangle, thereby achieving perspective correction and obtaining the target image. Next, the image size is adjusted using image preprocessing, the image is converted to grayscale, and then Gaussian filtering is performed to reduce noise; Then, the Otsu thresholding method is used to binarize the image to extract the contours in the image. All contours are sorted according to their area, and the largest contour is obtained and approximated to obtain a quadrilateral, which represents the optical sensor area in the image. Then, after converting the detected contour region into a front view using perspective transformation, rectangular markers are drawn according to the position of the sensing unit, and multiple regions of interest are cropped out. Each region of interest contains only one sensing unit. Finally, the average values of R, G, and B in the region of interest are calculated as the R, G, and B values of the corresponding sensing unit within the region. A color difference map / difference map is then drawn using the R, G, and B values of the sensing unit as a spectrum.
10. The method for rapid gender identification of fertile eggs using optical sensors as claimed in claim 5 wherein: The method specifically includes the following steps: (1) Select hatching eggs, clean and disinfect them, and then put them into the incubator; (2) Place the above-mentioned optical sensor in the environment of the hatching egg and allow it to react fully with the hatching egg gas, or collect the hatching egg gas and allow it to react with the optical sensor; (3) Use an optical information acquisition system to acquire optical signals from the optical sensor before and after step (2); (4) Data processing and model building: The collected optical signals are preprocessed, features are extracted and a hatching egg sex identification model is built. Then, the established hatching egg sex identification model is trained under known conditions. (5) Finally, the trained egg sex recognition model is used to process the optical signals collected from the optical sensors placed in the egg environment under the test scenario to obtain the egg sex judgment result.
11. The method for rapid gender identification of a fertile egg using an optical sensor according to claim 10, wherein: The reaction methods in step (2) include contact between the optical sensor and the hatching egg and non-contact reaction. Contact-type methods include, but are not limited to, spraying gas-sensitive materials onto the eggshell so that the gas-sensitive materials react directly with the gases emitted by the hatching egg, or attaching flexible sensors to the surface of the eggshell and reacting with the gases emitted by the hatching egg. Non-contact methods include, but are not limited to, placing the sensor and the hatching egg in the same chamber, where the gas-sensitive material does not come into contact with the egg but reacts with the gas emitted by the egg, or using a vacuum pump or gas sampling bag to first collect the gas emitted by the egg and then transport the collected gas to the optical sensor for reaction.
12. The method for rapid gender identification of fertile eggs using optical sensors according to claim 10, wherein: The optical information acquisition system in step (3) includes, but is not limited to, industrial camera acquisition systems, smartphones, scanners, ELISA readers, fluorescence spectrophotometers, color recognition devices, ultraviolet spectrophotometers, etc., to acquire optical / visual signal data from sensors.
13. The method for rapid gender identification of fertile eggs using optical sensors according to claim 10, wherein: In step (4), a binary classification model for identifying the sex of hatching eggs is established based on the collected images or optical signals such as spectra. The model for identifying the sex of hatching eggs includes, but is not limited to, principal component analysis, convolutional neural networks, decision trees and random forests, support vector machines, artificial neural networks, etc.
14. The method for rapid gender identification of fertile eggs using optical sensors according to claim 10, wherein: The egg sex identification model consists of nine sequential stages. The first stage is the backbone network, which only uses convolutional modules. The convolutional modules are mainly composed of 3×3 convolutional operations, connected batch normalization layers with a stride of 2, and Swish activation functions connected in sequence. Stages 2-8 employ a CBAM network. Each stage uses a CBAM feature extraction module primarily composed of a channel attention module (CAM) and a spatial attention module (SAM). Stage 2 consists of one 3×3 CBAM feature extraction module, Stage 3 consists of two 3×3 CBAM feature extraction modules, Stage 4 consists of two 5×5 CBAM feature extraction modules, Stage 5 consists of three 3×3 CBAM feature extraction modules, Stage 6 consists of three 5×5 CBAM feature extraction modules, Stage 7 consists of four 5×5 CBAM feature extraction modules, and Stage 8 consists of one 3×3 CBAM feature extraction module. 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 original input feature map F itself are then multiplied together to obtain a channel attention map F'. The channel attention map F' is then 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' itself are then 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 max pooling layer, an average pooling layer, and a multilayer 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 MLP to obtain the first global descriptor vector1 and the second global descriptor vector2. The first global descriptor vector1 and the second global descriptor vector2 are added together, and then processed by the 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, then connected together, and then processed by the convolutional layer to obtain the spatial feature map Ms. The final 9th stage consists of a 1×1 convolution operation, a global average pooling layer, a fully connected layer, and a Softmax activation function connected in sequence.
Citation Information
Patent Citations
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
Black garlic processing stage rapid discrimination method based on olfactory visual sensing technology
CN118150555A
Method for quickly identifying sex of hatching egg by using optical sensor
CN119147514A
System and method for in ovo sexing of avian embryos
US20190174726A1