Device and method for determining multiple qualities of hatching eggs
By designing a multi-quality measurement device for breeding eggs that integrates industrial control machine, microcontroller, weighing unit, light source and camera, the problems of complex and low efficiency of breeding egg detection process in the prior art are solved, and efficient and accurate multi-index detection is achieved.
Patent Information
- Application Number
- CN202411787338.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-12-06
AI Technical Summary
In the prior art, the process of measuring the quality of eggs with multiple plants is complicated, dependent on multiple equipment, the process is cumbersome, the efficiency is low, and the evaluation standards are not uniform.
A multi-quality measurement device for eggs is designed, including an industrial control machine, a microcontroller, a weighing unit, a front light source, a back light source and a camera. Through multi-angle light image acquisition and image processing, the detection of multi-index parameters of eggs is achieved.
Multi-angle data acquisition and multi-index parameter detection of breeding eggs are realized, the detection process is simplified, the detection efficiency and accuracy are improved, and the detection reliability is ensured.
Smart Images

Figure CN119245745B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent detection equipment, and in particular to a device and method for determining multiple qualities of breeding eggs. Background Art
[0002] Breeding plays an important role in improving the production efficiency, quality, adaptability and disease resistance of the poultry farming industry. The egg quality evaluation indicators used for breeding mainly include external quality and internal quality. External quality mainly includes egg weight, egg shape index, eggshell color, eggshell gloss, whether there is shape deformity, whether there are defects on the outside of the eggshell (such as dirt, cracks), etc. These are closely related to breeding to reduce pathogen contamination and ensure the collision resistance of poultry eggs during transportation. These external quality indicators are very important for ensuring the hatching rate of eggs and the health of chicks after hatching. Internal quality mainly includes the height of the air chamber, whether there are foreign objects inside the eggshell (such as blood spots and meat spots), and incubation status such as embryonic vitality. These internal qualities help to evaluate the hatching potential of eggs and the health of future chicks.
[0003] At present, egg weight is generally measured by electronic or mechanical balances; egg shape index is obtained by measuring the long axis and the wide axis with a vernier caliper and calculating the proportion; eggshell color is generally tested by a colorimeter to check the consistency and standardization of eggshell color; the glossiness and integrity of the eggshell (whether it is smooth or cracked) are mainly checked manually. The size of the air chamber, the presence of foreign matter inside, and embryonic vitality are mainly tested and evaluated through manual light transmission.
[0004] It can be seen that the process of inspecting and evaluating the internal and external quality of breeding eggs is rather complicated, requiring a lot of manual operation and a variety of auxiliary instruments or tools. It is not only inefficient, but also has inconsistent evaluation standards. Summary of the invention
[0005] The invention provides a device and method for determining multiple qualities of breeding eggs, which are used to solve the problem that in the prior art, when determining multiple qualities of breeding eggs, multiple equipment such as egg weight scales, light detectors, egg shape detectors, crack detectors, etc. are relied on, and the process is complicated and the operation is cumbersome.
[0006] The present invention provides a device for determining multiple qualities of breeding eggs, comprising an industrial computer, a microcontroller, a weighing unit, a front light source, a back light source and a camera;
[0007] The weighing unit comprises a weighing platform composed of a plurality of movable rollers for carrying the tested eggs; the front light source is installed above the weighing platform, and the back light source is installed below the weighing platform, and the light generated by the back light source can pass through the weighing platform and irradiate the tested eggs;
[0008] The industrial computer controls the control motor of the roller, the front light source, the back light source and / or the camera through the microcontroller;
[0009] The camera is installed above the weighing platform, and is used to collect the front illumination image of the tested egg after the front light source is turned on, or collect the back illumination image of the tested egg after the back light source is turned on;
[0010] The industrial computer realizes multi-index parameter detection of the tested breeding eggs according to the measurement data fed back by the weighing unit and the front illumination image and the back illumination image collected by the camera.
[0011] According to a breeding egg multi-quality determination device provided by the present invention, the multi-index parameter detection includes at least: egg weight detection, eggshell color detection, eggshell gloss detection, egg shape index detection, shape deformity detection, air chamber height detection, eggshell external defect detection, eggshell internal foreign matter detection and incubation status detection.
[0012] According to a breeding egg multi-quality determination device provided by the present invention, the industrial computer performs the eggshell color detection, specifically including:
[0013] Acquire a frontal illumination image of the tested breeding egg;
[0014] Converting the frontal illumination image from the RGB color space to the HSV color space to separate the eggshell image from the frontal illumination image according to a predetermined HSV color threshold;
[0015] Inputting the eggshell image into an eggshell color detection model to obtain an eggshell color detection result output by the eggshell color detection model;
[0016] The eggshell color detection model is obtained after training based on an eggshell image sample set, and each eggshell image sample in the eggshell image sample set is pre-labeled with an eggshell color label.
[0017] According to a breeding egg multi-quality determination device provided by the present invention, the industrial computer performs the eggshell gloss detection, specifically including:
[0018] Collecting the front illumination image of the tested breeding egg and determining the illumination intensity of the front light source when collecting the front illumination image;
[0019] Separating the reflective patch area from the frontal illumination image according to the image features of the reflective patch on the eggshell;
[0020] Marking the edge of the reflective patch area based on an edge detection algorithm to obtain a first edge marked image;
[0021] Calculate a first ratio between the pixel area of the reflective patch of the tested egg and the total pixel area of the egg according to the first edge annotation image;
[0022] The first ratio is input into a target relationship model to obtain a glossiness detection result output by the target relationship model; the target relationship model is a relationship model between the proportion of the reflective patch area matched to the light intensity and the glossiness value.
[0023] According to a breeding egg multi-quality determination device provided by the present invention, the industrial computer performs the egg shape index detection, specifically including:
[0024] The microcontroller controls the operation of the control motor of the roller so that the tested eggs rotate on the weighing platform;
[0025] Controlling the backside light source and the camera to be turned on by the microcontroller to obtain a plurality of backside illumination images;
[0026] Binarizing the back-illuminated image to obtain a binary image of the eggs;
[0027] The average value of the ratio of the major axis length to the broad axis length of the elliptical area corresponding to the tested egg determined from all the binary images of the eggs is used as the egg shape index detection result of the tested egg.
[0028] According to a breeding egg multi-quality determination device provided by the present invention, the industrial computer performs the shape deformity detection, specifically including:
[0029] After acquiring the binary image of the breeding eggs, separating the elliptical area corresponding to the breeding eggs to be tested from the binary image of the breeding eggs;
[0030] The elliptical region is rotated multiple times with the long axis and the wide axis as the rotation axes respectively, to obtain a long axis rotation image set and a wide axis rotation image set;
[0031] After superimposing all the long-axis rotation images in the long-axis rotation image set, determining a second ratio between the area of the non-overlapping portion and the total area of the pixels of the breeding egg;
[0032] After superimposing all the wide-axis rotation images in the wide-axis rotation image set, determining a third ratio between the area of the non-overlapping portion and the total area of the pixels of the breeding egg;
[0033] A shape deformity detection result is determined according to the second ratio and the third ratio.
[0034] According to a breeding egg multi-quality determination device provided by the present invention, the industrial computer performs the air chamber height detection, specifically including:
[0035] Acquire a back-illuminated image of the tested egg;
[0036] After converting the back-illuminated image into a grayscale image, the blunt end region of the egg is determined therefrom;
[0037] Marking the edge of the area where the gas chamber is located in the blunt end area of the egg to obtain a second edge marked image;
[0038] When it is determined that the similarity matching result between the second edge-annotated image and the standard air cell template image is qualified, determining the number of pixels corresponding to the air cell height from the second edge-annotated image;
[0039] The air chamber height detection result is determined according to the number of pixels.
[0040] According to a breeding egg multi-quality determination device provided by the present invention, the industrial computer performs the eggshell external defect detection, eggshell internal foreign matter detection and incubation status detection, specifically including:
[0041] Acquire a back-illuminated image of the tested egg;
[0042] Inputting the back-illuminated image into a multi-label image classification model to obtain an eggshell external defect detection result, an eggshell internal foreign matter detection result, and an incubation status detection result output by the multi-label image classification model;
[0043] The multi-label image classification model is obtained by training a hybrid network model combining the characteristics of a convolutional neural network and a Swin Transformer architecture using a back-illuminated image sample set;
[0044] The backside illumination image sample set includes a plurality of backside illumination image samples, and each of the backside illumination image samples is pre-labeled with an eggshell external defect label, an eggshell internal foreign matter label, and an incubation status label.
[0045] A breeding egg multi-quality determination device according to the present invention further comprises: a human-computer interaction unit communicatively connected to the industrial control computer;
[0046] The human-computer interaction unit is used to respond to different input information from the user and send different driving instructions to the industrial computer;
[0047] And, receiving the multi-index parameter detection results of the tested breeding eggs uploaded by the industrial computer, and displaying the multi-index parameter detection results on the human-computer interaction screen.
[0048] A device for determining multiple qualities of breeding eggs according to the present invention further comprises: a housing;
[0049] The industrial computer, the microcontroller, the weighing unit, the front light source, the back light source, the camera and the human-computer interaction unit are all integrated and installed in the housing.
[0050] The present invention also provides a method for determining multiple qualities of breeding eggs, which is applied to an industrial computer of any of the above-mentioned devices for determining multiple qualities of breeding eggs, comprising:
[0051] Turning on the camera and obtaining the weighing result of the weighing platform;
[0052] When it is determined that the weighing result is greater than a preset weight, a front light source is turned on;
[0053] receiving a frontal illumination image captured by the camera;
[0054] Turn off the front light source and obtain the egg weight test result;
[0055] Turning on the back light source and controlling the motor of the control roller to receive the all-round back illumination image of the tested egg collected by the camera;
[0056] Based on the front illumination image and the back illumination image, multi-index parameter detection of the tested breeding eggs is achieved.
[0057] The multi-quality determination device and method for breeding eggs provided by the present invention can collect data from multiple angles, detect, evaluate and record multiple internal and external index parameters of breeding eggs, can be used for poultry eggs of different varieties and sizes, has strong adaptability, ensures the accuracy and reliability of detection, and thus helps to perform more refined quality control. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0059] Figure 1 It is a structural schematic diagram of a breeding egg multi-quality determination device provided by the present invention.
[0060] Figure 2 The present invention discloses an electrical wiring diagram of a device for determining multiple qualities of breeding eggs.
[0061] Figure 3 The present invention is a schematic diagram of the control connection of the device for determining the multiple qualities of breeding eggs.
[0062] Figure 4 It is a schematic diagram of the architecture of the multi-label image classification model provided by the present invention.
[0063] Figure 5 The present invention is a schematic diagram of the process of the method for determining multiple qualities of breeding eggs.
[0064] Among them, 1-industrial computer; 2-microcontroller; 3-weighing unit; 4-front light source; 5-back light source; 6-camera; 7-breeding eggs to be tested; 8-weighing platform; 9-power module; 10-transformer module; 11-human-computer interaction screen. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0066] It should be noted that in the description of the present invention, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, device, article or equipment including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or equipment. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, device, article or equipment including the elements. The orientation or position relationship indicated by the terms "upper", "lower" and the like is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0067] The terms "first", "second", etc. in the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged when appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" means at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0068] Combine the following Figure 1-Figure 5 Description The multi-quality determination device for breeding eggs provided by the present invention is a miniaturized multi-index non-destructive determination device, which can effectively evaluate the quality and hatching potential of breeding eggs, and is of great significance to scientific research and small hatcheries in breeding egg selection, cost saving and efficiency improvement. It can effectively solve the following defects existing in the current breeding egg detection:
[0069] (1) Single testing index. There is a lack of multi-index testing equipment for hatching eggs. Existing equipment mainly relies on appearance testing and cannot accurately judge the internal quality of hatching eggs. Some equipment can only test a few indicators of hatching eggs and cannot comprehensively evaluate the quality of hatching eggs.
[0070] (2) Low detection efficiency and complicated operation process. The existing manual detection method is inefficient and uses multiple devices to evaluate indicators separately, resulting in low detection efficiency and complicated operation.
[0071] Figure 1 Schematic diagram of the structure of the device for determining the multi-quality of breeding eggs provided by the present invention. Figure 1 As shown, it mainly includes an industrial computer 1, a microcontroller 2, a weighing unit 3, a front light source 4, a back light source 5 and a camera 6.
[0072] The weighing unit 3 mainly comprises a weighing platform 8 composed of a plurality of movable rollers for carrying the eggs 7 to be tested.
[0073] The front light source 4 is installed above the weighing platform 8, and the back light source 5 is installed below the weighing platform 8. The light generated by the back light source can pass through the weighing platform 8 and irradiate the tested breeding eggs 7.
[0074] The industrial computer 1 controls the control motor of the roller, the front light source 4 , the back light source 5 and / or the camera 6 through the microcontroller 2 .
[0075] The camera 6 is installed above the weighing platform 8, and is used to collect the front illumination image of the tested egg after the front light source 4 is turned on, or to collect the back illumination image of the tested egg after the back light source 5 is turned on.
[0076] The industrial computer 1 implements multi-index parameter detection of the tested breeding eggs 7 according to the measurement data fed back by the weighing unit 3 and the front illumination image and the back illumination image collected by the camera 6 .
[0077] Among them, considering the portability of the breeding egg multi-quality determination device, the industrial computer 1 can select a small industrial computer, which as the core control unit is mainly responsible for receiving, processing and storing data from other components, and analyzing and judging the breeding egg quality according to the preset detection algorithm.
[0078] The microcontroller 2 serves as an auxiliary control unit of the industrial computer 1 and is responsible for controlling the control motor (hereinafter referred to as the motor) of the roller in the weighing platform 8, the front light source 4, the back light source 5 and the opening and closing of the camera 6. The selection of the microcontroller 2 mainly considers the characteristics of low power consumption, high reliability and easy programming.
[0079] The weighing unit 3 includes a weighing platform 8 composed of a plurality of movable rollers (for example, 2), which is used to carry the tested eggs 7. A weighing sensor is connected below the weighing platform 8, which is used to collect the weight including the weighing bracket, the control motor, the rollers and the back light source 5, and then obtains the weight data of the tested eggs 7 through calibration and transmits it to the industrial computer 1. The weighing bracket is used to fix the rollers, the control motor and the back light source 5, mainly to provide support.
[0080] The front light source 4 is installed above the weighing platform 8 to provide lighting when the camera 6 collects the front light image. The front light image refers to the image of the egg captured by the camera when the front light source 4 is located on the front of the egg to be tested 7 and illuminates it, which is usually used to show the surface characteristics of the egg to be tested, such as color, texture and shape.
[0081] The back light source 5 is installed below the weighing platform 8, and the light generated can be irradiated on the egg to be tested through the weighing platform 8, and is used to provide lighting when the camera 6 collects the back light image. The back light image (also called a perspective image) refers to the image captured by the camera 6 when the back light source 5 is located on the back of the egg to be tested 7 (i.e., the side opposite to the front) and irradiates through the transparent or partially transparent area of the weighing platform 8. It is usually used to implement the internal structure or internal characteristics of the egg, such as the size of the air chamber, the position of the yolk, the thickness of the eggshell and other multi-index parameter detection.
[0082] As an optional embodiment, the weighing platform 8 may be made of a transparent or translucent material, so that the light from the back light source 5 can pass through the weighing platform 8 and irradiate the eggs 7 to be tested.
[0083] Two or more rollers may be provided on the weighing platform 8, and anti-slip materials (such as rubber or silicone) may be coated on the rollers. Thus, when the rollers rotate, the tested eggs 7 placed thereon may be driven to rotate, thereby adjusting the posture of the tested eggs 7, so that the camera 6 can collect front illumination images and / or back illumination images of the tested eggs 7 at multiple angles.
[0084] Figure 2 The electrical wiring diagram of the device for determining the multi-quality of hatching eggs provided by the present invention is as follows: Figure 2 As shown, the input voltage of the power module 9 of the breeding egg multi-quality determination device provided by the present invention can adopt 220V three-phase electricity. By matching the transformation module 10 such as the boat switch and the switching power supply, the input voltage is transformed into a low-voltage DC voltage such as 12V and 5V, and combined with the relevant splitter to provide the required working power for the industrial computer 1, the microcontroller 2, the weighing unit 3, the front light source 4, the back light source 5 and the camera 6, the cooling fan and other components. Among them, the boat switch is used to control the power on and off of the entire detection device. When the boat switch is in the on state, the 220V three-phase electricity will enter the subsequent circuit through the switch. The switching power supply converts the 220V three-phase electricity into low-voltage DC power such as 12V and 5V, and provides the required power for each electronic component in the detection device. The output end of the switching power supply is connected to each component through a splitter.
[0085] Specifically, the cooling fan is connected to an output port of the splitter through a cable, and is used to dissipate heat for internal components of the entire detection device, ensuring that the detection device will not be damaged due to overheating when working for a long time.
[0086] The hatching egg multi-quality determination device is also provided with status indicator lights, including a power light and an operation status indicator light, which are used to display the power status and operation status of the detection device respectively. These indicator lights are also connected to the specific output port of the splitter.
[0087] The present invention also configures a DC motor speed regulator for the control motor of the roller, which is used to modulate the speed of the control motor according to actual needs. The DC motor speed regulator is connected to the output port of the splitter and is connected to the microcontroller through a control signal line.
[0088] The microcontroller is the control center of the entire detection device. It is responsible for receiving signals from various sensors and processing and judging them according to preset algorithms and programs. The microcontroller is connected to other components through control signal lines to control the entire detection device. A reset switch is also configured for the microcontroller to restore the microcontroller to its initial state when it fails or needs to be restarted.
[0089] The weighing sensor is connected to the microcontroller 2 through the DY500 module. The DY500 module is a high-precision weighing sensor signal processor that can amplify, convert analog-to-digital, perform nonlinear correction and temperature compensation on the detection signal of the weighing sensor within a large range, and convert the processed weight signal into a digital signal and output it to the microcontroller 2.
[0090] Figure 2 The front lamp beads and back lamp beads shown in the figure refer to the light-emitting parts of the front light source and the back light source respectively, which are used to provide light sources so that the camera 6 can capture the relevant front lighting images and back lighting images, and are connected to the relay through the lamp bead driving board.
[0091] Figure 3 Schematic diagram of the control connection of the device for determining the multi-quality of hatching eggs provided by the present invention. Figure 3 As shown, the control connection of the breeding egg multi-quality determination device provided by the present invention can be described in detail as follows:
[0092] The camera 6 is connected to the industrial computer 1 via a USB interface to transmit the collected image data to the industrial computer 1 for processing in real time.
[0093] The industrial computer 1, as the core processing unit of the detection device, is responsible for receiving, processing and analyzing the image data from the camera 6. At the same time, it is also responsible for controlling the operation of other components, such as controlling the motor, the front light source 4, the back light source 5, etc. The industrial computer 1 is also connected to the human-computer interaction screen 11 through the HDMI interface (High-Definition Multimedia Interface) to display the quality detection results on the human-computer interaction interface and perform human-computer interaction.
[0094] The human-machine interaction screen 11 provides an intuitive human-machine interaction interface for the user, which is used to display the quality test results of the tested eggs, test operation prompts, etc. The user can perform operations through the human-machine interaction screen 11, such as selecting a test mode, viewing historical records, etc.
[0095] As the core component of the weighing unit 3, the weighing sensor is mainly used to detect the weight of the tested eggs. It is connected to the microcontroller 2 via a 485 line and transmits the egg weight detection data to the microcontroller 2 for processing.
[0096] The microcontroller 2 is responsible for receiving the weight data from the weighing sensor, and the microcontroller is also responsible for controlling the operation of the motor. Under the control of the microcontroller, the control motor is responsible for driving the rotation of the roller on the weighing unit 3 to adjust the posture of the eggs to be tested.
[0097] The front light source 4 and the back light source 5 are mainly used to provide sufficient illumination for the camera 6 to ensure that the collected image is clear and accurate. Both can also be connected to the microcontroller through the 485 line, and the microcontroller 2 can adjust the brightness and color of the light source as needed.
[0098] Below, a specific implementation method of detecting the tested eggs based on the egg multi-quality determination device provided by the present invention is provided, which mainly includes but is not limited to the following steps:
[0099] Step 1: Place the tested eggs 7 on the weighing platform 8, and the industrial computer 1 controls the control motor of the roller through the microcontroller 2 to keep the weighing platform stable.
[0100] Step 2: The industrial computer 1 turns on the front light source 4 through the microcontroller 2, and the camera 6 collects the front light image of the tested eggs and transmits it to the industrial computer 1 for processing.
[0101] Step 3, the industrial computer 1 analyzes the eggshell color, eggshell glossiness and other index parameters of the breeding eggs according to the front illumination image.
[0102] Step 4: The industrial computer 1 turns off the front light source 4 and turns on the back light source 5 through the microcontroller 2. The camera 6 collects the back light image of the tested egg again and transmits it to the industrial computer 1 for processing.
[0103] Step 5, the industrial computer 1 analyzes the egg shape index, air chamber height, eggshell defects and other index parameters of the breeding eggs according to the back illumination image.
[0104] Step 6: The industrial computer 1 receives the egg weight detection data fed back by the weighing unit 3, and makes a comprehensive judgment on the quality of the breeding eggs in combination with the analysis results of steps 3 and 5.
[0105] Step 7, the industrial computer 1 outputs the multi-index parameter detection results of the tested breeding eggs, including egg weight, eggshell color, eggshell gloss, egg shape index, air chamber height and eggshell defects and other multi-index parameters.
[0106] The multi-quality determination device for breeding eggs provided by the present invention can collect data from multiple angles, detect, evaluate and record internal and external multi-index parameters of breeding eggs, can be used for poultry eggs of different varieties and sizes, has strong adaptability, ensures the accuracy and reliability of detection, and thus helps to perform more refined quality control.
[0107] As an optional embodiment, the multi-quality determination device for breeding eggs provided by the present invention can comprehensively realize the detection of multiple index parameters, mainly including but not limited to the following detection items: egg weight detection, eggshell color detection, eggshell gloss detection, egg shape index detection, shape deformity detection, air chamber height detection, eggshell external defect detection, eggshell internal foreign matter detection and incubation status detection.
[0108] It should be noted that the breeding egg multi-quality determination device provided in the present invention can be applied to the detection of breeding eggs of common laying birds, such as chicken eggs, duck eggs, goose eggs, quail eggs, etc.
[0109] Among them, egg weight refers to the weight of a single breeding egg. Egg weight is an important indicator to measure the quality of breeding eggs. Different types of laying birds have different standard weight ranges for breeding eggs. The size of egg weight is usually related to the breed of laying hens, feeding management, nutritional status and genetic factors.
[0110] Eggshell color refers to the color of the outer shell of the breeding egg, such as white, brown, blue, etc. Although eggshell color is mainly affected by the breed of laying hens, it can indirectly reflect whether the breeding environment and feed ingredients of laying poultry are normal. At the same time, abnormal eggshell color can also be used as an intuitive detection indicator of breeding egg quality.
[0111] Eggshell gloss refers to the smoothness and reflective ability of the eggshell surface. Eggshells with good gloss usually indicate that the eggshell structure is complete and the texture is tight, which helps to protect the egg from external pollution. Therefore, eggshell gloss can also be used as a detection indicator for the quality of breeding eggs.
[0112] The egg shape index is a quantitative indicator that describes the shape of the egg. It is usually calculated by measuring the long axis and the wide axis of the egg. The egg shape index is used to evaluate whether the shape of the egg is close to an oval. For eggs with abnormal egg shape index, it is generally considered that the quality of the egg is low.
[0113] Shape deformity refers to abnormalities in the shape of the eggs, such as flat, elongated, curved, etc. These deformities may affect the hatchability of the eggs and the quality of the chicks.
[0114] The air cell is located at the blunt end of the egg. It is a cavity between the shell membrane and the eggshell. The size of the air cell increases as the egg is stored. Air cell height detection helps to assess the freshness of the eggs and the state of embryo development. Too high an air cell may indicate that the eggs are old or the embryo is developing abnormally.
[0115] External eggshell defects refer to cracks, spots, stains and other defects on the outer shell of the breeding eggs. These defects may affect the preservation ability of the breeding eggs, the hatching rate and the health status of the chicks.
[0116] Foreign matter in eggs refers to abnormal substances present inside the breeding eggs, such as blood spots and meat spots. These foreign matter indicates that the eggs are poorly fertilized or that the hen has health problems, which will affect the hatching rate of the breeding eggs and the quality of the chicks.
[0117] The incubation status refers to the development of the eggs during the incubation process, including the growth and development stage of the embryo, whether the embryo is alive, etc. The incubation status detection helps to determine the hatching potential and hatching effect of the eggs.
[0118] The above-mentioned index parameters together constitute an important component of the multi-quality determination of breeding eggs. The breeding egg multi-quality determination device provided by the present invention can comprehensively evaluate the quality and hatching potential of breeding eggs through comprehensive detection of these index parameters, effectively improve the control accuracy of breeding egg quality, and avoid the occurrence of misjudgment and missed judgment.
[0119] Hereinafter, it will be described in detail how to use the breeding egg multi-quality determination device provided by the present invention to achieve rapid and accurate detection of the above-mentioned index parameters.
[0120] (1) Regarding egg weight testing:
[0121] The present invention obtains the egg weight of the egg to be tested by placing the egg to be tested on a weighing platform 8 and collecting the data of the weighing sensor by the industrial computer 1. In the actual process of reading the egg weight, the final egg weight can be determined by removing obvious abnormal data points and using moving average filtering to smooth the data and reduce the influence of noise, and by averaging the collected multiple egg weight data.
[0122] The industrial computer 1 compares the actual detected egg weight with the predetermined standard egg weight of the same type of breeding eggs. If it is determined that the actual detected egg weight is close to the standard egg weight, it is considered to be qualified in this test. Otherwise, it is directly determined that the breeding eggs to be tested are abnormal breeding eggs.
[0123] (2) About eggshell color detection:
[0124] The overall logic of the industrial computer 1 of the present invention when performing eggshell color detection is: performing preprocessing such as image denoising and adjusting brightness and contrast on the collected front illumination image of the tested breeding egg; converting the preprocessed image from the RGB color space to the HSV color space; using threshold segmentation to separate the eggshell image from the background; extracting image features such as color histogram, color moment, texture features, etc. from the segmented eggshell image; and using the eggshell color detection model to classify and distinguish the extracted image features.
[0125] As an optional embodiment, the multi-quality determination device for breeding eggs provided by the present invention, when the industrial computer 1 performs eggshell color detection according to the collected data, specifically performs but is not limited to the following steps:
[0126] Acquire a frontal illumination image of the tested breeding egg;
[0127] Converting the frontal illumination image from the RGB color space to the HSV color space to separate the eggshell image from the frontal illumination image according to a predetermined HSV color threshold;
[0128] Inputting the eggshell image into an eggshell color detection model to obtain an eggshell color detection result output by the eggshell color detection model;
[0129] The eggshell color detection model is obtained after training based on an eggshell image sample set, and each eggshell image sample in the eggshell image sample set is pre-labeled with an eggshell color label.
[0130] Any front-illuminated image of the eggs to be tested can be subjected to pre-processing such as image denoising to remove noise and interference in the image. If necessary, the brightness and contrast of the front-illuminated image can then be adjusted to ensure that the information in the image is clear and discernible.
[0131] The preprocessed frontal illumination image is converted from RGB color space to HSV color space. In HSV color space, the color information of the image is divided into three components: hue, saturation, and value.
[0132] First, the preprocessed frontal illumination image is converted from RGB color space to HSV color space to better utilize color information for segmentation.
[0133] In the HSV color space, the appropriate hue threshold, saturation threshold, and brightness threshold are set in advance by observing and analyzing the color difference between the eggshell and the background. The selection of these HSV thresholds needs to ensure that the eggshell part can be accurately separated from the image while avoiding mistaking the background or other interference parts for the eggshell.
[0134] After setting the threshold, the threshold segmentation algorithm can be applied to process the frontal illumination image in the HSV color space. According to the set threshold, the pixels in the frontal illumination image are divided into two categories: one is the pixels that meet the threshold condition (i.e. the eggshell image part), and the other is the pixels that do not meet the threshold condition (i.e. the background part). Through threshold segmentation, the eggshell image can be accurately separated from the frontal illumination image, providing accurate input for subsequent feature extraction and eggshell color detection model classification.
[0135] Specifically, the threshold segmentation algorithm processes the frontal illumination image in the HSV color space, mainly including the following steps:
[0136] First, appropriate HSV thresholds are set in advance, including hue threshold, saturation threshold and brightness threshold.
[0137] Among them, hue indicates the type of color. For eggshell color detection, the hue threshold can be set according to the color range of the actual eggshell. For example, if the eggshell of the tested breeding egg is mainly brown, a hue range corresponding to brown is set as the hue threshold. This range is usually determined through experiments or after observing a large number of samples. Saturation indicates the purity of the color. For eggshells, a higher saturation threshold can be selected to exclude lighter or blurred parts of the image. This helps to separate the eggshell image more accurately. Brightness indicates the brightness of the color. For eggshell color detection, the setting of the brightness threshold can take into account the brightness difference between the eggshell and the background. Usually, the brightness of the eggshell will be higher or lower than the background, so a suitable brightness range can be set to distinguish the eggshell from the background.
[0138] After setting the HSV threshold, the image is processed using the threshold segmentation algorithm.
[0139] The threshold segmentation algorithm traverses each pixel in the frontal illumination image and checks whether its HSV value falls within the set threshold range. If the HSV value of the pixel meets the threshold condition, it is classified as eggshell; if it does not meet the condition, it is classified as background. Through this process, the pixels in the frontal illumination image are divided into two categories: eggshell and background, thereby achieving the separation of the eggshell image from the background.
[0140] After completing the threshold segmentation, some subsequent processing can be performed, such as removing noise, filling holes, etc., to further optimize the segmentation effect of the eggshell image.
[0141] Finally, color features, such as color histogram, color moment, etc., can be extracted from the segmented eggshell image for subsequent classification and discrimination of the eggshell color detection model.
[0142] Among them, the eggshell color detection model can adopt a convolutional neural network model (such as LeNet, ResNet, DenseNet, etc.) and a network model based on an attention mechanism (such as SENet, Transformer model, etc.).
[0143] The multi-quality determination device for breeding eggs provided by the present invention realizes multi-index parameter detection of breeding eggs by integrating high-precision image acquisition, deep learning algorithm and intelligent control system, especially efficient and accurate detection of eggshell color, which not only improves the detection accuracy of breeding egg quality, but also reduces the labor cost of detection, and enhances quality control and traceability.
[0144] (3) About eggshell gloss detection:
[0145] Based on the contents of the above embodiments, as an optional embodiment, the overall logic of the multi-quality determination device for breeding eggs provided by the present invention for the industrial computer to perform the eggshell gloss detection is: by adjusting the light intensity of the front light source 4 to detect the size of the reflective patch, thereby evaluating the eggshell gloss.
[0146] Prior to this, while keeping the camera position unchanged, the light intensity of the front light source 4 was gradually increased to capture images of reflective patches under different lighting conditions. An image processing algorithm was used to extract the reflective patches on the eggshell surface, an edge detection algorithm was used to identify and extract the edges of the reflective patches, and the ratio of the pixel area of the reflective patches to the total pixel area of the eggs was calculated. A relationship model between the ratio and the eggshell gloss under different light intensities was established for subsequent evaluation of the eggshell gloss.
[0147] As an optional embodiment, the present invention provides a specific implementation method for calculating the eggshell glossiness, including but not limited to the following steps:
[0148] Collecting the front illumination image of the tested breeding egg and determining the illumination intensity of the front light source when collecting the front illumination image;
[0149] Separating the reflective patch area from the frontal illumination image according to the image features of the reflective patch on the eggshell;
[0150] Marking the edge of the reflective patch area based on an edge detection algorithm to obtain a first edge marked image;
[0151] Calculate a first ratio between the pixel area of the reflective patch of the tested egg and the total pixel area of the egg according to the first edge annotation image;
[0152] The first ratio is input into a target relationship model to obtain a glossiness detection result output by the target relationship model; the target relationship model is a relationship model between the proportion of the reflective patch area matched to the light intensity and the glossiness value.
[0153] Before the actual test, a relationship model between the reflective patch area ratio and the gloss value under different light intensities can be pre-built. The reflective patch area ratio specifically refers to the ratio between the reflective patch pixel area and the total pixel area of the egg, including:
[0154] A large number of reflective patch image samples of eggshells are photographed under different light intensities, and all these reflective patch image samples are grouped according to the light intensity to ensure that the light intensity of each group of reflective patch image samples is relatively consistent.
[0155] For each set of reflective patch image samples, the reflective patch area is extracted using an image processing algorithm, and the ratio of its pixel area to the total pixel area of the egg is calculated. At the same time, the eggshell glossiness label of each reflective patch image sample is marked.
[0156] For the reflective patch image samples under each light intensity, a statistical method (such as regression analysis, machine learning algorithm, etc.) is used to establish a relationship model between the reflective patch area ratio and the gloss value of the reflective patch image samples. In this way, the relationship model corresponding to each light intensity can be determined.
[0157] In the actual detection process, you can first use a light intensity meter or directly record the working parameters of the light source on the industrial computer to obtain the light intensity under the current front light source 4, so as to match the corresponding target relationship model from multiple pre-established relationship models according to the detected light intensity.
[0158] While ensuring that the shooting distance, angle and other parameters between the camera 6 and the tested eggs 7 are consistent with the warehouse management parameters when the associated model is built, a front illumination image of the tested eggs 7 is captured. The obtained front illumination image can be pre-processed with the same denoising, brightness contrast adjustment and the like as in the modeling.
[0159] According to the image features of the reflective patches on the eggshell (such as brightness, color, etc.), image processing techniques (such as threshold segmentation, morphological processing, etc.) are used to separate the reflective patch area on the eggshell surface from the front illumination image.
[0160] Then, based on the edge detection algorithm (such as Canny edge detection, Sobel operator, etc.), the separated reflective patch area is edge-marked to obtain the first edge-marked image. The purpose of this step is to accurately calculate the pixel area of the reflective patch. Then, the pixel area of the reflective patch can be obtained by counting the number of pixels in the reflective patch area in the first edge-marked image. Similarly, by counting the number of pixels in the egg area in the entire frontal illumination image, the total pixel area of the eggs to be tested can be obtained. Dividing the pixel area of the reflective patch by the total pixel area of the eggs can obtain the reflective patch area ratio (referred to as the first ratio).
[0161] Finally, the first ratio is input into the rated target relationship model matched according to the current light intensity, and the glossiness detection result of the target relationship model according to the input can be obtained.
[0162] The separated reflective patch area is edge-labeled based on an edge detection algorithm (such as Canny edge detection, Sobel operator, etc.) to obtain a first edge-labeled image, which specifically includes but is not limited to the following steps:
[0163] The reflective patch area is converted into a grayscale image for subsequent edge detection. If there is noise in the grayscale image, a Gaussian filter or other method can be used to denoise it to improve the accuracy of edge detection.
[0164] You can choose a suitable edge detection algorithm based on the actual detection requirements. If you need high-precision edge detection, you can choose Canny edge detection; if you are more concerned about detection speed and sensitivity to fine textures, you can choose Sobel operator for edge detection.
[0165] For example, for Canny edge detection, appropriate threshold parameters (such as high threshold and low threshold) can be set to balance sensitivity and accuracy when detecting edges. For Sobel operator edge detection, the built-in convolution kernel can be used directly for gradient calculation, and the size and shape of the convolution kernel can be adjusted as needed to determine the boundary between the reflective patch and the normal area of the eggshell.
[0166] After applying the edge detection algorithm, a binary image (or grayscale image, but the edge part will be highlighted) containing edge information is obtained, and this binary image (or the edge part in the grayscale image) can be used as the first edge annotation image.
[0167] The multi-quality determination device for breeding eggs provided by the present invention can provide rapid detection of eggshell gloss, can indirectly evaluate physical properties such as hardness and thickness of eggshells and evaluate the freshness of breeding eggs, thereby judging the overall quality of breeding eggs. By automatically removing breeding eggs whose gloss does not meet the requirements, the accuracy of breeding egg quality assessment is improved, the breeding egg screening process is optimized, and the practicality of the multi-quality determination device for breeding eggs is enhanced.
[0168] (4) Regarding the egg shape index test:
[0169] As an optional embodiment, the multi-quality determination device for breeding eggs provided by the present invention can, on the basis of performing the above-mentioned detection of external index parameters of breeding eggs (such as eggshell color detection, eggshell gloss detection, etc.), also automatically perform accurate detection of some important internal index parameters, such as egg shape index detection.
[0170] The overall detection logic of the egg shape index detection in the multi-quality determination device provided by the present invention is: by binarizing the back-illuminated image, the size of the area corresponding to the tested egg is counted. Different from the method of selecting the outline of the egg using the minimum circumscribed rectangular frame adopted by the traditional statistical method, and taking the length and width of the rectangular frame as the long axis length and wide axis length of the egg, the present invention takes into account that the shape of the egg is not a standard ellipse, and the outline of the image is often accompanied by sawtooth phenomenon, and the length and width of the minimum circumscribed selection frame have a certain deviation from the actual length and width axis of the egg. The size of the elliptical area corresponding to the tested egg in multiple (for example, 3) back-illuminated images is determined by average calculation, thereby reducing the detection error.
[0171] As an optional embodiment, the present invention provides a method for performing egg shape index detection, including but not limited to the following steps:
[0172] The microcontroller controls the operation of the control motor of the roller so that the tested eggs rotate on the weighing platform;
[0173] Controlling the backside light source and the camera to be turned on by the microcontroller to obtain a plurality of backside illumination images;
[0174] Binarizing the back-illuminated image to obtain a binary image of the eggs;
[0175] The average value of the ratio of the major axis length to the broad axis length of the elliptical area corresponding to the tested egg determined from all the binary images of the eggs is used as the egg shape index detection result of the tested egg.
[0176] The eggs to be tested are placed on the weighing platform 8 to ensure that the eggs to be tested can rotate stably and freely under the action of the rollers. The industrial computer 1 sends instructions through the microcontroller 2 to start the control motor of the control roller. The operation of the control motor will drive the eggs to be tested on the weighing platform 8 to rotate at a certain speed. The purpose of this step is to capture images of the eggs to be tested from multiple angles, so as to more accurately evaluate their shapes.
[0177] When the eggs start to rotate, the microcontroller 2 controls the back light source 5 and the camera 6 to start synchronously. The back light source 5 provides enough light so that the camera 6 can clearly capture the outline of the eggs to be tested. The camera 6 is responsible for taking multiple back-illuminated images of the eggs to be tested at different angles.
[0178] All back-lighting images captured by the camera are transmitted to the industrial computer 1 for processing.
[0179] First, these back-lit images are binarized, which means that the pixels in the back-lit images are divided into two categories: foreground (the elliptical area corresponding to the egg to be tested, usually the outline of the egg to be tested) and background. This step helps to more clearly identify the boundaries of the egg to be tested.
[0180] Furthermore, in the binary image, the elliptical region where the tested egg is located is determined in the binary image of the egg in the back-illuminated image by image processing algorithms (such as edge detection, contour recognition, etc.). Since multiple back-illuminated images are taken of the tested egg during the rotation process, the elliptical region can be extracted from all the binary images of the eggs, and the lengths of the major axis and the width axis of each elliptical region can be calculated.
[0181] Finally, the ratio of all the extracted long axis and wide axis lengths is calculated, and the average value of the ratio is used as the egg shape index of the tested eggs, and whether the egg shape index meets the standard is judged. For example, the ratio between the average long axis length and the average wide axis length can be used to determine whether the egg shape index meets the standard. The judgment result and the calculated egg shape index can be used together as the egg shape index test result of the tested eggs.
[0182] The multi-quality determination device for breeding eggs provided by the present invention can capture the shape characteristics of breeding eggs more comprehensively by controlling a motor to rotate the breeding eggs and taking photos from multiple angles, thereby improving the accuracy of egg shape index measurement, and showing significant technical advantages in improving detection accuracy, automation, adaptability and scalability.
[0183] (5) Regarding shape deformity detection:
[0184] As an optional embodiment, the multi-quality determination device for breeding eggs provided by the present invention can also perform shape deformity detection on the breeding eggs to be tested through an industrial computer, and its overall detection logic is: using the high asymmetry of deformed breeding eggs, the breeding egg binary image obtained in the above embodiment is superimposed with all the images obtained after flipping it upside down (i.e., rotating it with the wide axis of the elliptical area as the rotation axis) and flipping it left to right (i.e., rotating it with the long axis of the elliptical area as the rotation axis), and the overlapping part and the non-overlapping part after the superposition are calculated, and the area ratio of the non-overlapping part is used to evaluate the symmetry of the left and right halves and the similarity of the big and small heads of the breeding eggs to be tested.
[0185] As an optional embodiment, the following specifically introduces the specific implementation steps of the industrial computer 1 in performing shape deformity detection, including but not limited to:
[0186] After acquiring the binary image of the breeding eggs, separating the elliptical area corresponding to the breeding eggs to be tested from the binary image of the breeding eggs;
[0187] The elliptical region is rotated multiple times with the long axis and the wide axis as the rotation axes respectively, to obtain a long axis rotation image set and a wide axis rotation image set;
[0188] After superimposing all the long-axis rotation images in the long-axis rotation image set, determining a second ratio between the area of the non-overlapping portion and the total area of the pixels of the breeding egg;
[0189] After superimposing all the wide-axis rotation images in the wide-axis rotation image set, determining a third ratio between the area of the non-overlapping portion and the total area of the pixels of the breeding egg;
[0190] A shape deformity detection result is determined according to the second ratio and the third ratio.
[0191] According to the image processing method provided in the above embodiment, after obtaining the binary image of the breeding egg and separating the elliptical region, the separated elliptical region is rotated multiple times (e.g., at certain angles) with its long axis as the rotation axis, and the rotated image is saved after each rotation to form a long-axis rotation image set. Similarly, the elliptical region is rotated multiple times with its wide axis as the rotation axis, and the image after each rotation is saved to form a wide-axis rotation image set.
[0192] All images in the long-axis rotation image set are superimposed, and the non-overlapping parts (i.e., areas that do not overlap at different rotation angles) are recorded during the superposition process. The areas of these non-overlapping parts are calculated and compared with the total pixel area of the egg to obtain the second ratio. Similarly, the wide-axis rotation image set is processed similarly to calculate the third ratio of the non-overlapping area to the total pixel area of the egg.
[0193] According to the size of the second ratio and the third ratio, it is possible to directly determine whether the shape of the tested egg is deformed. Generally speaking, if the two ratios are large, it means that the shape of the egg is very different at different rotation angles, that is, the shape may be more deformed; on the contrary, if the ratio is small, the shape is more regular.
[0194] A certain threshold may be set, and when the second ratio and / or the third ratio exceeds the corresponding threshold, it is determined that the shape is deformed; otherwise, it is determined that the shape is normal.
[0195] Optionally, the function expression for calculating the ratio D (which may be referred to as the overlap degree) of the area of the non-overlapping portion to the total area of the pixels of the egg may be:
[0196] ;
[0197] Among them, E is the total pixel area of the breeding egg; h is the pixel value of the long axis of the breeding egg image; w is the pixel value of the wide axis of the breeding egg image; i and j are both position variables in the binary image; are the pixels in the overlapping area.
[0198] The larger the overlap D, the lower the symmetry of the tested eggs; the smaller the overlap D, the higher the symmetry. Studies have shown that when D1 ≥ 2.6%, the left-right asymmetry of the tested eggs is very obvious and can be easily distinguished by the naked eye; when D2 ≥ 3.2%, the size of the tested eggs is very obvious and can be easily distinguished by the naked eye. Among them, D1 is the second ratio calculated, and D2 is the third ratio calculated.
[0199] The multi-quality determination device for breeding eggs provided by the present invention can accurately capture the shape characteristics of breeding eggs and improve the accuracy of shape detection by separating the elliptical area where the breeding eggs are located and processing the rotation image set. The entire detection process can be automatically completed by a computer program without manual intervention, thereby improving detection efficiency and accuracy.
[0200] (6) Regarding the air chamber height detection:
[0201] Based on the contents of the above embodiments, as an optional embodiment, the multi-quality determination device for breeding eggs provided by the present invention can also realize automatic detection of air chamber height, and its overall implementation logic is: after detecting the blunt end of the breeding egg, use an edge detection algorithm (such as the Canny algorithm) to detect the edge contour of the air chamber in the back-illuminated image (i.e., the breeding egg transmission image); analyze the extracted contour, use a shape matching algorithm to compare the extracted contour with a preset template, obtain the number of pixels of the air chamber height, and calculate and convert it into millimeter units.
[0202] As an optional embodiment, the present invention provides a specific implementation of the air chamber height detection performed in an industrial computer, which mainly includes but is not limited to the following steps:
[0203] Acquire a back-illuminated image of the tested egg;
[0204] After converting the back-illuminated image into a grayscale image, the blunt end region of the egg is determined therefrom;
[0205] Marking the edge of the area where the gas chamber is located in the blunt end area of the egg to obtain a second edge marked image;
[0206] When it is determined that the similarity matching result between the second edge-annotated image and the standard air cell template image is qualified, determining the number of pixels corresponding to the air cell height from the second edge-annotated image;
[0207] The air chamber height detection result is determined according to the number of pixels.
[0208] After receiving any back-illuminated image uploaded by the camera 6, it is converted into a grayscale image. This is because the processing speed of grayscale images is usually faster than that of color images, and the grayscale information is sufficient for tasks such as edge detection and shape recognition.
[0209] After conversion to grayscale images, image processing algorithms (such as threshold segmentation, morphological processing, etc.) are used to identify and determine the blunt end area of the egg. The blunt end area is where the air cell is usually located, so this step is the prerequisite for the subsequent marking of the edge of the air cell.
[0210] After the blunt end of the egg is determined, the edge of the air cell can be marked using an edge detection algorithm (such as the Canny algorithm). The edge detection algorithm can identify the location of the image where the brightness changes dramatically, thereby outlining the edge of the air cell.
[0211] After the annotation is completed, the obtained edge image is called the second edge annotation image, which can clearly show the edge and shape of the air chamber.
[0212] In order to verify whether the annotated air chamber edge is accurate, the second edge annotated image is matched with the standard air chamber template image for similarity. The standard air chamber template image is prepared in advance, which represents the ideal air chamber shape and edge features. The image matching algorithm (such as template matching, feature point matching, etc.) can be used to calculate the similarity between the second edge annotated image and the standard template. If the similarity reaches the preset threshold, the matching result is considered qualified, otherwise it is necessary to re-annotate the edge or re-detect the new back-illuminated image.
[0213] After confirming that the matching result is qualified, the height of the air cell can be determined from the second edge annotation image. This can be achieved by measuring the vertical distance of the air cell edge in the grayscale image. Specifically, the highest point and the lowest point of the air cell edge can be selected, and then the number of pixels between them can be calculated.
[0214] The last step is to calculate the actual air chamber height of the egg to be tested based on the number of pixels corresponding to the air chamber height. This can be determined by the camera resolution and the actual size of each pixel in the grayscale image. Combining the above two parameters with the calculated number of pixels between the highest and lowest points of the air chamber edge, the actual height of the air chamber can be obtained as the final result output of the air chamber height detection.
[0215] The multi-quality determination device for breeding eggs provided by the present invention has an entire detection process when performing multi-index parameter detection, which is completely realized based on image processing algorithms and computer technology, does not require manual intervention, and greatly improves detection efficiency and accuracy.
[0216] (7) Regarding detection of external defects in eggshells, detection of foreign matter inside eggshells and detection of hatching status:
[0217] Based on the content of the above embodiment, as an optional embodiment, the multi-quality determination device for breeding eggs provided by the present invention can also simultaneously realize the functions of eggshell external defect detection, eggshell internal foreign body detection and incubation status detection, and its overall detection logic is: pre-collect a back-illuminated image sample set containing different eggshell defects, blood line development, double yolk, hatched, and internal foreign bodies, and classify and mark the area where the breeding eggs are located and the location of the foreign bodies; use the Transformer vision multi-label image classification algorithm, and use the classified back-illuminated image sample set to train the multi-label image classification model. During the training process, the back-illuminated image samples are used as input, and the classified defect information, blood line development, double yolk, internal foreign body and other labels are used as output for model training. The model can learn a variety of characteristics of breeding eggs, and improve the accuracy and robustness of the model through appropriate training strategies, such as data enhancement, transfer learning, etc.; use the test set to evaluate the trained multi-label image classification model, use the average precision mean, accuracy, recall and other indicators to evaluate the recognition performance of the model, and adjust the structure and hyperparameters of the model to obtain better results.
[0218] As an optional embodiment, the present invention provides a specific method for implementing eggshell external defect detection, eggshell internal foreign matter detection and incubation status detection, including but not limited to the following steps:
[0219] The acquired back-illuminated image is used as input and passed to a pre-trained multi-label image classification model. The multi-label image classification model is a hybrid network model that combines the characteristics of a convolutional neural network (CNN) and a Transformer architecture, and can simultaneously process multiple feature information in the image.
[0220] The multi-label image classification model processes the input back-illuminated image and outputs three key detection results: eggshell external defect detection result, eggshell internal foreign body detection result and incubation status detection result. These results are usually given in the form of probability values or classification labels, indicating the possibility of a certain defect, foreign body or incubation status of the tested eggs.
[0221] The multi-label image classification model is obtained by training on a large number of back-illuminated image sample sets. The back-illuminated image sample set contains multiple back-illuminated image samples, and each sample is pre-labeled with the label of eggshell external defects, eggshell internal foreign matter, and hatching status. Through this labeled information, the model can learn the correspondence between image features and labels, so that it can accurately classify and detect when a new image is input.
[0222] The multi-quality determination device for hatching eggs provided by the present invention can detect multiple quality indicators at the same time by using a multi-label image classification model, thereby greatly improving the detection efficiency. Since the model is a hybrid network model combining a convolutional neural network and a SwinTransformer architecture, it can make full use of the local and global feature information in the back-illuminated image to improve the accuracy of detection.
[0223] Figure 4 It is a schematic diagram of the architecture of the multi-label image classification model provided by the present invention, such as Figure 4 As shown, it mainly includes multiple functional blocks connected in sequence, and these functional blocks work together to achieve the multi-label classification task of the input image.
[0224] according to Figure 4 The overall architecture diagram of the multi-label image classification model shown in Figure 1 adds a stem network based on the Swin Transformer to capture low-level features such as edges and textures from the original input using convolution operations for subsequent deep network layers. Dense Block consists of densely connected convolution blocks, in which feature maps are connected along the channel dimension. Patch Merging is a feature aggregation module for image patches, which divides the feature map into 2×2 windows and connects the features at the same position in each window, which can be used to distinguish the importance of features in different channels. The fully connected layer is used as a classification layer. The vector from the fully connected layer is used as the input of the output layer. The score of each node is obtained using the Sigmoid activation function, ranging from 0 to 1, with a threshold of 0.5 to determine the predicted label for each category.
[0225] Figure 4 The structure of the stem is specifically shown in the figure, where Conv 3×3, / 2 means the convolution kernel size is 3 and the stride is 2; BN means batch normalization operation; ReLU means nonlinear activation layer; MaxPool means maximum pooling operation.
[0226] at the same time, Figure 4 The structure of the ECA attention mechanism module is also specifically shown in the paper. By adaptively calculating the kernel size of the one-dimensional convolution, the one-dimensional convolution is used in the ECA attention mechanism module to replace the fully connected layer to calculate the channel attention, which can flexibly capture the inter-channel dependency, thereby enhancing the feature representation capability while reducing the number of parameters. The lightweight and efficient characteristics make the ECA attention mechanism module easy to integrate into various CNN architectures, providing a simple and effective method to improve network performance.
[0227] in addition, Figure 4The specific structure of two consecutive Swin-Transformer blocks is also shown in the figure. The SwinTransformer Block consists of two parts: a region-based window multi-head self-attention module (RW-MSA) and a shifted window-based multi-head self-attention module (SW-MSA). Assuming the window size is set to 7, the size of the input feature map is H / 4×W / 4×C. W-MSA divides the feature map into non-overlapping regions, totaling H / 4S×H / 4S, and the feature map of each region is represented as L∈R(S×S×C). MLP refers to multi-layer perceptron; LN (Layer norm) means layer normalization.
[0228] at last, Figure 4 The architecture of the Multi-head self-attention module (MSA) is also specifically shown in the paper. Usually, MSA consists of multiple heads, each of which uses three linear mapping functions to generate a query vector q, a key vector k, and a value vector v. The output of each head is defined as follows:
[0229] ;
[0230] Among them, d represents the dimension of q, i.e., the outputs of all heads are concatenated to form the final MSA output. Specifically, RW-MSA and SW-MSA restrict the MSA computation to a local window.
[0231] In summary, the overall model architecture of the multi-label image classification model provided by the present invention starts with the input layer, followed by the initial feature extraction module Stem, multiple feature extraction units, and the final classification output layer. Each feature extraction unit consists of a Swin Transformer module and an image patch feature aggregation module Patch Merging.
[0232] Among them, the input layer is responsible for receiving the back-illuminated image of the eggs to be classified as input and performing preprocessing such as normalization of the input image.
[0233] The initial feature extraction module Stem is used to extract preliminary feature representation from the input image, mainly including multiple 3 3 convolutional layers (Conv), each with a kernel size of 3x3. The first convolutional layer has a stride of 2, which is used to reduce the resolution of the feature map while increasing the number of channels. The stride of the next two convolutional layers defaults to 1, which further extracts features while keeping the resolution of the feature map unchanged (or changing it according to actual needs).
[0234] Each convolutional layer is followed by a batch normalization unit BN, which is used to speed up the training process and improve the generalization ability of the model. It is followed by a ReLU activation function unit, which is used to introduce nonlinear characteristics and enhance the expressiveness of the model.
[0235] Each feature extraction unit is the core part of the multi-label image classification model, which uses the self-attention mechanism to capture long-distance dependencies in the image. Inside each Swin Transformer module, it mainly contains multiple self-attention heads and feedforward neural networks FFN, as well as layer normalization LN and residual connections.
[0236] The image block feature aggregation module Patch Merging is mainly used to reduce the resolution of the feature map between each feature extraction unit and increase the number of channels to extract higher-level feature representations.
[0237] The classification output layer is mainly used to convert the extracted features into the final classification results.
[0238] It usually contains one or more fully connected linear layers and a softmax function or a sigmoid function to output the predicted probability of each category.
[0239] In addition, due to the high similarity between classes and small differences within classes, a back-illuminated image may belong to multiple classes, that is, a back-illuminated image belongs to a multi-label class. In order to solve the data imbalance problem, the present invention uses a binary cross entropy loss function for loss optimization in this multi-label classification task, as shown in the following formula.
[0240] ;
[0241] in, M is the total number of samples, N is the number of categories. represents the true label of the i-th back-lit image sample, represents the predicted value of the i-th back-lit image sample.
[0242] In summary, the model architecture of the multi-label image classification model provided by the present invention realizes the multi-label classification task of the input image through the sequentially connected input layer, initial feature extraction module (Stem), multiple feature extraction units (including components such as Swin Transformer module) and classification output layer. Each functional block plays a specific role and together constitutes an efficient and powerful model architecture.
[0243] As an optional embodiment, refer to Figure 1 As shown, the breeding egg multi-quality determination device provided by the present invention further includes: a human-computer interaction unit communicatively connected to the industrial control computer;
[0244] The human-computer interaction unit is used to respond to different input information from the user and send different driving instructions to the industrial computer;
[0245] And, receiving the multi-index parameter detection result of the tested breeding eggs uploaded by the industrial computer, and displaying the multi-index parameter detection result on the human-computer interaction screen 11.
[0246] In the egg multi-quality determination device provided by the present invention, the human-machine interaction unit is a key component, which establishes a communication connection with the industrial computer 1, such as using an interface connection such as USB, Ethernet, serial port, etc. The human-machine interaction unit can be integrated on the housing of the detection device, or connected as an external device.
[0247] The human-computer interaction unit has the function of receiving user input information, which can be instructions or data input by the user through a touch screen, keyboard, mouse or other input devices.
[0248] According to different input information from the user, the human-computer interaction unit can identify and parse the input information, and then convert it into drive instructions recognizable by the industrial computer, that is, it will send the corresponding drive instructions to the industrial computer 1. These drive instructions may include starting the detection process, adjusting the detection parameters, selecting a specific detection mode, etc.
[0249] In addition, after the industrial computer 1 completes the multi-index parameter detection of the tested eggs, the human-computer interaction unit is responsible for receiving the test results uploaded by the industrial computer. These test results may include egg weight detection, eggshell color detection, eggshell gloss detection, egg shape index detection, shape deformity detection, air chamber height detection, eggshell external defect detection, eggshell internal foreign matter detection and incubation status detection, etc., or the detected related index parameters. The human-computer interaction unit displays these test results on the human-computer interaction screen 11 in an intuitive manner (such as charts, numbers, graphics, etc.) for users to view and analyze.
[0250] The multi-quality determination device for breeding eggs provided by the present invention allows users to conveniently input instructions and view test results through a human-computer interaction unit without directly operating a complex industrial computer or professional software. This greatly improves the user experience and operational convenience. At the same time, the human-computer interaction unit can quickly respond to user input and display the test results in real time, thereby shortening the test cycle and improving the test efficiency. In addition, through the intuitive display method provided by the human-computer interaction unit, users can more clearly understand the various index parameters of the breeding eggs to be tested, thereby more accurately evaluating the quality and performance of the breeding eggs.
[0251] In addition, the egg multi-quality determination device provided by the present invention also includes a housing for integrating all the above components and centrally realizing the detection function. The industrial computer 1, the microcontroller 2, the weighing unit 3, the front light source 4, the back light source 5, the camera 6 and the human-computer interaction unit are all integrated and installed in the housing.
[0252] Figure 5 Schematic diagram of the process of the method for determining multiple qualities of hatching eggs provided by the present invention, such as Figure 5 As shown, the present invention can perform the following method for determining the multiple quality of breeding eggs through the breeding egg multiple quality determination device provided by any of the above embodiments, including but not limited to:
[0253] Turning on the camera and obtaining the weighing result of the weighing platform;
[0254] When it is determined that the weighing result is greater than a preset weight, a front light source is turned on;
[0255] receiving a frontal illumination image captured by the camera;
[0256] Turn off the front light source and obtain the egg weight test result;
[0257] Turning on the back light source and controlling the motor of the control roller to receive the all-round back illumination image of the tested egg collected by the camera;
[0258] Based on the front illumination image and the back illumination image, multi-index parameter detection of the tested breeding eggs is achieved.
[0259] When performing a specific detection task, first start the egg multi-quality determination device provided in any of the above embodiments, turn on the camera to prepare to shoot the eggs to be tested. At the same time, the weighing unit starts working, and obtains the weight data of the eggs to be tested through the weighing sensor. For example, when a breeding egg is placed on the weighing table, the weighing sensor will immediately detect its weight and send the data to the industrial computer.
[0260] The industrial computer will check the egg weight data sent by the weighing unit to determine whether it is greater than the preset weight threshold (such as 5 grams). If the weight is greater than the preset value, it means that an object has been placed on the weighing table. At this time, the industrial computer will turn on the front light source to provide sufficient light for the subsequent front light image acquisition.
[0261] After the front light source is turned on, the camera starts to collect the front light images of the tested eggs. These front light images will be used for subsequent color, glossiness and other indicators.
[0262] After completing the acquisition of the front light image, the industrial computer will turn off the front light source and save the acquired image data. At the same time, it will read the data of the weighing unit again to obtain the accurate egg weight test result and save the result in the database.
[0263] Next, the industrial computer will turn on the backlight source and control the roller motor to make the eggs to be tested roll on the roller, thereby collecting all-round backlight images. These backlight images will be used to detect the internal quality and structural characteristics of the eggs. For example, through the combination of the transmitted light source and the camera, the distribution of the yolk and egg white inside the eggs and whether there are cracks or abnormal structures can be observed.
[0264] Finally, the industrial control machine uses image processing technology and machine learning algorithms to analyze and process the collected front and back illumination images, thereby realizing multi-index parameter detection of the tested eggs. These parameters may include color, gloss, weight, internal quality, etc. For example, by comparing the image features of different eggs, their quality differences and their superiority and inferiority can be evaluated.
[0265] The method for determining the multi-quality of breeding eggs provided by the present invention can collect data from multiple angles, detect, evaluate and record multiple internal and external index parameters of breeding eggs, can be used for poultry eggs of different varieties and sizes, has strong adaptability, ensures the accuracy and reliability of detection, and thus helps to perform more refined quality control.
[0266] After introducing the device and method for determining the multi-quality of hatching eggs provided by the present invention in detail, a brief summary is given of some important improvements of the present invention in the actual detection process in the field:
[0267] (1) The multi-quality determination device for breeding eggs provided by the present invention integrates the functions of breeding egg weight, egg shape index, deformity, cracks, dark spots, air chamber size, double yolk eggs, internal foreign matter, and hatching status detection into a small device, thereby reducing the number of test equipment required and simplifying the operation steps.
[0268] (2) The multi-quality determination device for breeding eggs provided by the present invention collects, analyzes and processes front-side illumination images and back-side illumination images, and adopts a multi-label image classification algorithm to identify information such as breeding egg deformities, cracks, dark spots, air chamber size, double yolk eggs, internal foreign matter and hatching status.
[0269] (3) The hybrid network model with the proposed convolutional neural network and Transformer architecture characteristics was used to perform multi-label image classification of breeding eggs, and simultaneously identify deformed eggs, cracked eggs, dark-spotted eggs, double-yolk eggs, foreign eggs, and hatching eggs.
[0270] Based on the above improvements, the multi-quality determination device for breeding eggs provided by the present invention can collect multi-angle data, detect, evaluate and record internal and external multi-index parameters of a breeding egg, and can be used for poultry eggs of different varieties and sizes. It has strong adaptability and ensures the accuracy and reliability of detection.
[0271] Compared with the current large-scale automated equipment, this equipment is small in size, low in cost, compact in structure, easy to operate, and has the advantages of intelligence, miniaturization, and lightweight. It can meet the needs of small-scale, high-precision testing and is suitable for scientific research, small batches, and high-quality breeding egg production and testing.
[0272] Multi-label image classification of hatching eggs can be achieved, and multi-label classification can not only identify single features, but also perform comprehensive analysis. For example, it can identify hatching eggs that are both dirty and cracked, thereby helping to perform more detailed quality control.
[0273] All the device embodiments described above are merely illustrative, wherein the elements described as separate elements may or may not be physically separated, and the elements displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.
[0274] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the device described in each embodiment or some parts of the embodiment.
[0275] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A device for measuring multiple qualities of breeding eggs, characterized in that: Including industrial computer, microcontroller, weighing unit, front light source, back light source and camera; The weighing unit comprises a weighing platform composed of a plurality of movable rollers for carrying the tested eggs; the front light source is installed above the weighing platform, and the back light source is installed below the weighing platform, and the light generated by the back light source can pass through the weighing platform and irradiate the tested eggs; The industrial computer controls the control motor of the roller, the front light source, the back light source and / or the camera through the microcontroller; The camera is installed above the weighing platform, and is used to collect the front illumination image of the tested egg after the front light source is turned on, or collect the back illumination image of the tested egg after the back light source is turned on; The industrial computer realizes multi-index parameter detection of the tested breeding eggs according to the measurement data fed back by the weighing unit and the front illumination image and the back illumination image collected by the camera; The multi-index parameter detection includes eggshell external defect detection, eggshell internal foreign matter detection and hatching status detection; The industrial computer performs the eggshell external defect detection, eggshell internal foreign matter detection and hatching status detection, specifically including: Acquire a back-illuminated image of the tested egg; Inputting the back-illuminated image into a multi-label image classification model to obtain an eggshell external defect detection result, an eggshell internal foreign matter detection result, and an incubation status detection result output by the multi-label image classification model; The multi-label image classification model is obtained by training a hybrid network model combining the characteristics of a convolutional neural network and a SwinTransformer architecture using a back-illuminated image sample set; The backside illumination image sample set includes a plurality of backside illumination image samples, and each of the backside illumination image samples is pre-labeled with an eggshell external defect label, an eggshell internal foreign matter label, and an incubation status label.
2. The device for measuring the multi-quality of hatching eggs according to claim 1, characterized in that: The multi-index parameter detection also includes: at least one of egg weight detection, eggshell color detection, eggshell gloss detection, egg shape index detection, shape deformity detection and air chamber height detection.
3. The device for determining the multi-quality of hatching eggs according to claim 2, characterized in that: The industrial computer performs the eggshell color detection, specifically including: Acquire a frontal illumination image of the tested breeding egg; Converting the frontal illumination image from the RGB color space to the HSV color space to separate the eggshell image from the frontal illumination image according to a predetermined HSV color threshold; Inputting the eggshell image into an eggshell color detection model to obtain an eggshell color detection result output by the eggshell color detection model; The eggshell color detection model is obtained after training based on an eggshell image sample set, and each eggshell image sample in the eggshell image sample set is pre-labeled with an eggshell color label.
4. The device for determining the multi-quality of hatching eggs according to claim 2, characterized in that: The industrial computer performs the eggshell gloss detection, specifically including: Collecting the front illumination image of the tested breeding egg and determining the illumination intensity of the front light source when collecting the front illumination image; Separating the reflective patch area from the frontal illumination image according to the image features of the reflective patch on the eggshell; Marking the edge of the reflective patch area based on an edge detection algorithm to obtain a first edge marked image; Calculate a first ratio between the pixel area of the reflective patch of the tested egg and the total pixel area of the egg according to the first edge annotation image; The first ratio is input into a target relationship model to obtain a glossiness detection result output by the target relationship model; the target relationship model is a relationship model between the proportion of the reflective patch area matched to the light intensity and the glossiness value.
5. The device for measuring multiple qualities of hatching eggs according to claim 2, characterized in that: The industrial computer performs the egg-shaped index detection, specifically including: The microcontroller controls the operation of the control motor of the roller so that the tested eggs rotate on the weighing platform; Controlling the backside light source and the camera to be turned on by the microcontroller to obtain a plurality of backside illumination images; Binarizing the back-illuminated image to obtain a binary image of the eggs; The average value of the ratio of the major axis length to the broad axis length of the elliptical area corresponding to the tested egg determined from all the binary images of the eggs is used as the egg shape index detection result of the tested egg.
6. The device for measuring multiple qualities of hatching eggs according to claim 5, characterized in that: The industrial computer performs the shape deformity detection, specifically including: After acquiring the binary image of the breeding eggs, separating the elliptical area corresponding to the breeding eggs to be tested from the binary image of the breeding eggs; The elliptical region is rotated multiple times with the long axis and the wide axis as the rotation axes respectively, to obtain a long axis rotation image set and a wide axis rotation image set; After superimposing all the long-axis rotation images in the long-axis rotation image set, determining a second ratio between the area of the non-overlapping portion and the total area of the pixels of the breeding egg; After superimposing all the wide-axis rotation images in the wide-axis rotation image set, determining a third ratio between the area of the non-overlapping portion and the total area of the pixels of the breeding egg; A shape deformity detection result is determined according to the second ratio and the third ratio.
7. The device for measuring multiple qualities of hatching eggs according to claim 2, characterized in that: The industrial computer performs the air chamber height detection, specifically including: Acquire a back-illuminated image of the tested egg; After converting the back-illuminated image into a grayscale image, the blunt end region of the egg is determined therefrom; Marking the edge of the area where the gas chamber is located in the blunt end area of the egg to obtain a second edge marked image; When it is determined that the similarity matching result between the second edge-annotated image and the standard air cell template image is qualified, determining the number of pixels corresponding to the height of the air cell from the second edge-annotated image; The air chamber height detection result is determined according to the number of pixels.
8. The device for measuring multiple qualities of hatching eggs according to claim 1, characterized in that: Also includes: A human-computer interaction unit communicatively connected to the industrial computer; The human-computer interaction unit is used to respond to different input information from the user and send different driving instructions to the industrial computer; And, receiving the multi-index parameter detection results of the tested breeding eggs uploaded by the industrial computer, and displaying the multi-index parameter detection results on the human-computer interaction screen.
9. The device for measuring multiple qualities of hatching eggs according to claim 8, characterized in that: Also includes: case; The industrial computer, the microcontroller, the weighing unit, the front light source, the back light source, the camera and the human-computer interaction unit are all integrated and installed in the housing.
10. A method for determining multiple qualities of hatching eggs using the hatching egg multiple qualities determination device according to any one of claims 1 to 9, characterized in that: include: Turning on the camera and obtaining the weighing result of the weighing platform; When it is determined that the weighing result is greater than a preset weight, a front light source is turned on; receiving a frontal illumination image captured by the camera; Turn off the front light source and obtain the egg weight test result; Turning on the back light source and controlling the motor of the control roller to receive the all-round back illumination image of the tested egg collected by the camera; Based on the front illumination image and the back illumination image, multi-index parameter detection of the tested breeding eggs is achieved.
Citation Information
Patent Citations
Method and equipment for intelligently measuring egg laying performance and egg quality of poultry
CN116636481A