Improved method for determining the sex of a chick
By training a classification model and automatically identifying the region of interest in chick wing images, and extracting feather line parameters, the problem of automation and accuracy in chick sex determination in existing technologies has been solved, achieving fast and reliable automated sex determination.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- EGG CHICK AUTOMATED TECHNOLOGIES
- Filing Date
- 2022-07-04
- Publication Date
- 2026-07-03
AI Technical Summary
In the existing technology, the methods for determining the sex of chicks require a lot of manual operation and have a low degree of automation. Existing image processing methods cannot achieve fully automatic, fast and reliable sex determination.
By training a classification model, the system automatically identifies regions of interest in chick wing images, extracts feather line parameters, and applies algorithms such as decision trees for sex classification. Combined with a conveyor and camera, it acquires high-quality images and achieves automated processing.
It enables rapid and reliable automatic sex determination of chicks, reducing the time to within 400 milliseconds, thus improving the level of automation and accuracy.
Smart Images

Figure CN117677288B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for determining the sex of chicks by observing the arrangement of feathers at the wingtips, and an apparatus for carrying out the method. Background Technology
[0002] It is well known that the sex of chicks is determined by the arrangement of the feathers at the tips of their wings. In fact, as... Figure 1a and Figure 1b As shown, the wingtip comprises two rows of feathers: the primary flight feathers and the coverts. The tips of the primary flight feathers and coverts are highlighted in the image. Figure 1a In male chicks, these two rows of feathers terminate at the same level, while... Figure 1b In female chicks, the tips of the primary flight feathers terminate further than the tips of the coverts, thus an alternation of relatively short and relatively long feathers can be observed.
[0003] Determining the sex of chicks by their feathers was initially done manually by operators, which took a lot of time.
[0004] A solution to automate this determination was also proposed.
[0005] Therefore, document EP 1-092-347 discloses a method for determining the sex of chicks, which uses a conveyor to separate the chicks and bring them near a camera. At this point, for example, vibrations of the conveyor cause the chicks to become unbalanced, prompting them to actively spread their wings, and one or more images of the chicks' wings are acquired.
[0006] Image processing methods have also been proposed to automatically determine the sex of chicks based on the acquired images. For example, in US 6,396,938, the first method involves extracting shape parameters (length, mid-section position, and tip position) from each feather, as well as calculating parameters that quantify the length variation between two adjacent feathers.
[0007] Another method described in this document involves locating the coordinates of the feather tips and determining a polynomial function connecting the feather tips. The sex of the chick is then determined based on the parameters of the polynomial function.
[0008] For chicks with uncertain results, manual research or new automated determinations can be conducted.
[0009] However, in US 6,396,938, these methods are implemented on previously annotated images of chick wings to at least identify the tips of the feathers. Therefore, the described methods do not enable fully automated processing to determine the sex of chicks based on image acquisition. Summary of the Invention
[0010] In view of the above, the object of the present invention is to provide an improved, fully automated solution for determining the sex of chicks based on images of their wings.
[0011] Specifically, the purpose of this invention is to provide a fast and reliable image processing method for determining the sex of chicks.
[0012] Another object of the present invention is to provide a fully automated process for determining the sex of chicks.
[0013] In this respect, the present invention relates to a method for determining the sex of chicks, the method being implemented by a computer based on an image of the chicks, the method comprising:
[0014] - Identify the region of interest in the image where the wing feathers are visible.
[0015] - A classification model trained on a training dataset including images of male chick wings and images of female chick wings is run on the region of interest to determine the male or female sex of the chick.
[0016] In some implementations, the method is applied to each of multiple images acquired from the same chick, and further includes a step of determining the sex of the chick based on the results obtained from all images by a classification model.
[0017] In some implementations, determining the region of interest in an image includes:
[0018] - Scan the image using a window of a defined size to define multiple regions of the image.
[0019] - For each region, calculate the Haar characteristics for that region.
[0020] - Apply the trained classifier to each Haar feature to determine whether the region represents a feather, and
[0021] - Define the region of interest in the image as the area representing feathers.
[0022] In some implementations, the method further includes: processing the region of interest to determine a set of lines corresponding to the feathers of a chick in the image, determining a set of parameters based on the extracted lines, and applying a classification model to the set of parameters.
[0023] In some implementations, processing the region of interest to determine a set of lines corresponding to feathers on the image includes:
[0024] - Run edge detection processing on the region of interest, and
[0025] - Apply the Hough transform to the edges generated by the process to determine a set of lines corresponding to the feathers visible on the region of interest.
[0026] In some implementations, edge detection processing includes:
[0027] - Run a Gaussian filter and threshold the region of interest to obtain a binary representation of the region of interest.
[0028] - Calculate a distance map on the binary representation of the region of interest to determine the distance between each point and the edge closest to that point, and normalize the map to obtain a grayscale representation of the region of interest.
[0029] - Run the erosion operation on the obtained grayscale representation.
[0030] In some implementations, thresholding the region of interest includes determining a threshold for each current pixel in the region of interest based on the intensity values of pixels included in the local neighborhood of the current pixel.
[0031] In some implementations, identifying all the lines representing feathers further includes:
[0032] - Rotate the region of interest by an angle determined by the angle of the longest line relative to the horizontal line, so that the line is substantially horizontal.
[0033] - Eliminate lines that extend in a direction that forms an angle greater than a predetermined threshold relative to the X-axis after rotating the region of interest.
[0034] In some implementations, determining parameters based on the extracted lines includes:
[0035] - Identify the set of lines corresponding to the long feathers, and
[0036] - Identify a set of lines corresponding to short feathers.
[0037] In some implementations, the method includes rotating the region of interest such that the lines representing feathers extend substantially horizontally, sorting each line in order of length, and identifying a set of lines corresponding to long feathers, including:
[0038] - Initialize a set of lines corresponding to the long feather, the set including the longest line.
[0039] - For each line included in the group, perform the following steps:
[0040] Identify all adjacent lines of the line under consideration along the vertical axis.
[0041] For each adjacent line, calculate the length difference and distance between the center of the adjacent line and the center of the line under discussion.
[0042] If the relative difference and distance are less than their respective thresholds, the adjacent lines are identified as lines corresponding to long feathers and added to the set of lines corresponding to long feathers.
[0043] In some implementations, identifying a set of lines corresponding to short feathers includes: for each line corresponding to a long feather in that set, starting from the line located at the maximum vertical position in that set, performing the following steps:
[0044] - Identify adjacent lines of the line under consideration among lines that do not belong to the group of lines corresponding to long feathers.
[0045] - For each adjacent line, calculate the length difference, the distance between the considered line and the adjacent line along the vertical axis, and the distances between the distal and proximal ends of the considered line and the proximal and distal ends of the adjacent lines along the horizontal axis.
[0046] - If the calculated difference and distance are less than their respective thresholds, then adjacent lines are identified as lines corresponding to short feathers.
[0047] In some implementations, the parameters determined based on the line include at least:
[0048] - Corresponding to the number of threads in long feathers,
[0049] - Corresponding to the number of lines in short feathers,
[0050] - The average angle between the line and the horizontal line, and
[0051] - The average deviation between two adjacent lines measured vertically.
[0052] In some implementations, the parameters determined based on the line further include at least one of the following:
[0053] - The minimum, maximum, and / or horizontal and / or vertical positions of the center of the line.
[0054] - The minimum, average, and / or maximum horizontal and / or vertical distance between the centers of two consecutive lines.
[0055] - The minimum, average, and / or maximum length of the lines corresponding to long feathers.
[0056] - The minimum, average, and / or maximum length of the lines corresponding to short feathers.
[0057] - The average intensity of the pixels corresponding to the lines of short feathers.
[0058] - The average intensity of the pixels corresponding to the lines of long feathers.
[0059] - The difference in average intensity of pixels between lines corresponding to long feathers and lines corresponding to short feathers.
[0060] - The position of each line relative to the horizontal axis, and the minimum, average, and / or maximum angles between two lines.
[0061] - The minimum, average, and / or maximum distance between the proximal ends of the two lines corresponding to the long feathers and the line corresponding to the short feathers located between them.
[0062] - The minimum, average, and / or maximum distance between the distal ends of the two lines corresponding to the long feathers and the line corresponding to the short feathers located between them.
[0063] In some implementations, the classification model trained to determine the sex of chicks is a decision tree.
[0064] In some implementations, a classification model is trained on a database of annotated training images, wherein each training image is obtained by applying the following steps: identifying a region of interest and processing the region of interest to extract a set of lines representing feathers, and the annotation includes an indication of the chick's sex and an associated level of determination based on the number of lines corresponding to long feathers and the number of lines corresponding to short feathers.
[0065] In some implementations, the method is carried out on a set of images of the same chick and includes determining the sex of the chick based on the results most frequently provided by the classification model.
[0066] According to another subject, a computer program product is described, which includes code instructions for implementing the methods described above when executed by a computing unit.
[0067] The present invention also relates to an apparatus for determining the sex of chicks, the apparatus comprising at least:
[0068] - A camera adapted to acquire at least one image of a chick, and
[0069] - A computing unit configured to perform the method described above on an image acquired by a camera.
[0070] In some embodiments, the camera is adapted to acquire images in a wavelength range between 340 nm and 500 nm, preferably between 400 nm and 450 nm.
[0071] In some embodiments, the device further includes a conveyor adapted to bring the chicks into the field of view of the camera, wherein the conveyor is adapted to make the chicks unbalanced such that the chicks spread their wings when they are in front of the camera.
[0072] In some implementations, the camera is configured to acquire a series of at least 20 images of each chick.
[0073] In some embodiments, the apparatus includes: a conveyor; a first station for detecting chicks of a first sex (male or female), the first station including the camera; and an actuator adapted to pick up or deport chicks detected as belonging to the first sex from the conveyor, wherein a computing unit is configured to implement a first classification model optimized for detecting the first sex on images acquired by the camera, and the computing unit is further configured to implement a second classification model optimized for detecting the second sex on images acquired from chicks whose first sex has not yet been determined.
[0074] The proposed method enables the automatic, rapid, and reliable determination of the sex of chicks based on one or more images of chicks. Specifically, the method includes: identifying a region of interest in the image where the chick's wing feathers are visible; processing the image to automatically extract a set of lines corresponding to the feathers; and finally classifying the sex of the chick based on parameters of these lines.
[0075] Therefore, determining the sex of chicks can be done in 400 milliseconds, which is much faster than existing methods. Attached Figure Description
[0076] Other features, details, and advantages will become apparent from the following detailed description and analysis of the accompanying drawings, in which:
[0077] Figure 1a
[0078] [ Figure 1a As already described, an example of a male chick's wing is shown.
[0079] Figure 1b
[0080] [ Figure 1b As already described, an example of a female chick's wing is shown.
[0081] Figure 2a
[0082] [ Figure 2a An example of a device for determining the sex of chicks according to one embodiment is shown schematically.
[0083] Figure 2b
[0084] [ Figure 2b This illustration schematically shows another example of a device for determining the sex of chicks according to one embodiment.
[0085] Figure 3
[0086] [ Figure 3 The illustration schematically shows the main steps of a method for determining the sex of chicks according to one embodiment.
[0087] Figure 4a 、 Figure 4b
[0088] [ Figure 4a ]、[ Figure 4b An example of an image used to train a classifier for determining regions of interest in an image is shown.
[0089] Figure 5
[0090] [ Figure 5 This illustrates an example of Haar features that can be computed on an image to determine a region of interest.
[0091] Figure 6a
[0092] [ Figure 6a The diagram illustrates steps for an example of a process performed on a region of interest in an image to extract a set of lines corresponding to a feather.
[0093] Figure 6b
[0094] [ Figure 6b The diagram illustrates steps for an example of a process performed on a region of interest in an image to extract a set of lines corresponding to a feather.
[0095] Figure 6c
[0096] [ Figure 6c The diagram illustrates steps for an example of a process performed on a region of interest in an image to extract a set of lines corresponding to a feather.
[0097] Figure 6d
[0098] [ Figure 6d The diagram illustrates steps for an example of a process performed on a region of interest in an image to extract a set of lines corresponding to a feather.
[0099] Figure 6e
[0100] [ Figure 6e The diagram illustrates steps for an example of a process performed on a region of interest in an image to extract a set of lines corresponding to a feather.
[0101] Figure 6f
[0102] [ Figure 6f The diagram illustrates steps for an example of a process performed on a region of interest in an image to extract a set of lines corresponding to a feather.
[0103] Figure 7
[0104] [ Figure 7 The diagram shows a set of lines corresponding to the long and short feathers of a chick. Detailed Implementation
[0105] refer to Figure 3 A method for determining the sex of chicks will now be described. This method is implemented by a computer 10, which includes one or more computing units 11 (e.g., processors, microprocessors, controllers, microcontrollers, FPGAs, etc.) and a memory 12 storing code instructions executed by the computing units. As will be seen in more detail below, the memory 12 may also store pre-trained classification models used during processing.
[0106] The method for determining the sex of chicks is implemented by processing one or more images representing the wings of chicks received by computer 10.
[0107] exist Figure 2a In one embodiment illustrated schematically, an apparatus 1 for determining the sex of a chick includes: a camera 20 adapted to acquire images of the chick; and a computing unit to which the camera 20 sends the acquired images.
[0108] Camera 20 can be adapted to acquire images at wavelengths, for example, between 340 nm and 500 nm, which is the wavelength range for obtaining optimal contrast when observing wing feathers. The camera can also be adapted to acquire images in a wavelength range between 400 nm and 450 nm. The camera can be monochrome and centered on wavelengths within this range (e.g., 405 nm).
[0109] In some embodiments, the device 1 includes a conveyor 30 adapted to individually and continuously bring chicks into the field of view of the camera 20. The conveyor 30 may be adapted to cause the chicks to become unbalanced, such that the chicks spread their wings as they pass in front of the camera. As a non-limiting example, the conveyor 30 may include a portion located upstream of the camera 20 that is capable of vibrating in a manner that causes the chicks to become unbalanced.
[0110] In addition, the camera can take a series of images of each chick, such as at least 20 consecutively acquired images, or 40 images of each chick. The camera 20 transmits these images to the computer 10 to implement a method for determining the sex of the chicks. The set of images taken by the camera has the same size and the same resolution.
[0111] exist Figure 2a In one embodiment shown, device 1 may include a single station that enables the classification of chicks, the single station including a camera 20 that captures images of the chicks, and computer 10 directly determines whether a chick corresponds to a male or a female by applying a process that specifically includes running a classification algorithm trained to determine whether a chick is male or female.
[0112] In a variant, for example in Figure 2b In the illustrated case, device 1 may include a first station comprising a camera 20 that captures images of chicks (as described above, with their wings spread) and transmits these images to computer 10, thereby enabling the determination of whether the chicks correspond only to the primary sex, male or female. If necessary, computer 10 implements a classification model optimized for detecting the primary sex. Figure 2b In the example shown, the first station makes it possible to identify only the female chicks.
[0113] The first station further includes an adapter adapted to pick or deport chicks identified as corresponding to the first sex from the conveyor.
[0114] For the remaining chicks, in one embodiment, computer 10 can apply a second classification model optimized for detecting the second sex to the corresponding image. In a variant, the apparatus includes a second station that also includes a camera for acquiring images of the remaining chicks. Computer 10 (which may be different from or the same as the computer at the first station) runs the processing described below on the acquired images and applies the optimized model to detect the second sex. Apparatus 1 may include a second actuator adapted to gather or deport chicks identified as corresponding to the second sex from the conveyor.
[0115] The remaining chicks can be gathered together and delivered to the conveyor starting point or analyzed by the operator.
[0116] According to another variation, the conveyor includes: two image capturing stations, each with at least one camera, which doubles the chance of correctly presenting chicks with their wings spread; and a classification model between male and female sexes, or two classification models, each optimized to detect each sex, receiving images from the two cameras as input.
[0117] Return to reference Figure 3 The method includes step 100: determining a region of interest in an image based on an image of a chick, where wing feathers are visible. This step allows, on the one hand, the image to be discarded where wing feathers are not visible, and on the other hand, it allows the remaining portion of the processing to be run on a region that can have a smaller size than the original image, thus reducing computation time.
[0118] Based on the region of interest obtained from the image, the method further includes, and is described in more detail below, implementing a classification model 400 trained on a training database to determine the male or female sex of the chick, the training database including images of the wings of male and female chicks. As described above, the method may include: successively implementing a first optimized model to determine that the chick belongs to a first sex (male or female), and a second optimized model to determine that the chick belongs to the other sex (female or male).
[0119] In some implementations, the determination of 100 regions of interest can be carried out by applying a trained model (e.g., a deep learning model).
[0120] In a particular implementation, determining the region of interest in an image includes scanning the image with a window of a defined size to define multiple regions of the image.
[0121] For each obtained region, 110 Haar features are calculated, thus enabling the generation of a vector associated with each region. (Reference) Figure 5 Haar features are obtained from a pattern M of pixels whose size is smaller than that of region R. The pixel pattern comprises two subsets of pixels corresponding to defined locations within the pattern. Haar features are computed by subtracting the cumulative intensity of the pixels in the first subset from the cumulative intensity of the pixels in the second subset. Thus, Haar features are obtained for each possible location of the pixel pattern within the region, and the resulting vectors collect all Haar features computed over the entire region under consideration.
[0122] The obtained vectors are then fed into the trained classifier 120 to determine whether the regions from which vectors have been obtained represent feathers. (Reference) Figure 4a and Figure 4b The classifier is advantageously trained on an image database consisting of images showing feathers by an ensemble classifier (AdaBoost) type algorithm. Figure 4a ) and other images that do not show feathers ( Figure 4b The Haar feature vectors are calculated on this image database based on the preceding paragraphs. Therefore, the trained classifier can be, for example, a decision tree.
[0123] The region of interest in the image is the area detected by the classifier as displaying feathers.
[0124] Multiple regions of interest (ROIs) can be detected in the same image. In some implementations, the steps of the method can be performed on all ROIs detected in the image. Alternatively, the steps of the method are performed on a first ROI, and the method is repeated on a second ROI only if the sex of the chick cannot be determined based on the first ROI, and so on, until the sex of the chick has been determined based on the image.
[0125] In some implementations, once a region of interest has been identified for an image, the method may include directly applying a classification model trained on said region of interest, such as a neural network-type classification model.
[0126] In a variant, and as Figure 3 As shown, the method includes: step 200 of processing the region of interest before implementing the classification model to determine the lines corresponding to the feathers of a chick, and step 300 of determining a set of relevant parameters provided at the input of the model.
[0127] refer to Figures 6a to 6f We will describe an implementation scheme that processes 200 regions of interest (or each region of interest) to extract lines corresponding to the feathers of a chick in an image.
[0128] The process includes: performing edge detection 210 on the region of interest, and determining a set of lines 220 corresponding to the feathers based on the detected edges.
[0129] Figure 6a An example of the region of interest (ROI) of the image obtained at the end of step 100 above is shown. In some embodiments, the edge detection process includes: applying a Gaussian filter and thresholding the ROI to obtain the region (e.g., ...). Figure 6b As shown, this is the binary representation of an area where all pixels are either black or white.
[0130] Thresholding is advantageously adaptive in order to compensate for any changes in the image's lighting conditions. For each current pixel in the region of interest, a local threshold can be determined based on the intensity values of the pixels included in the current pixel's local neighborhood (e.g., a square window centered on the current pixel). This threshold could, for example, be the average intensity of the pixels within the window.
[0131] The edge detection process can then include the following steps: calculating a distance map on the obtained binary representation to determine the distance between each point in the binary region and the edge closest to that point. The metric used to calculate the distance can be, for example, Chebyshev distance or chessboard distance. The obtained distance map is then normalized to obtain a grayscale representation of the region of interest, such as... Figure 6c The example shown.
[0132] The process then involves eroding the obtained region of interest, which enables the reduction of noise in the image, specifically noise between feathers.
[0133] Then, the determination of lines corresponding to feathers can be performed on the region of interest obtained by applying the Hough transform 220. Figures 6a to 6f In the example shown, the obtained line is in Figure 6d The lines are visible. As can be understood from the above specific implementation, the lines are groups of pixels arranged in a basically linear form, but the lines are not necessarily perfectly straight or have a constant width.
[0134] Once the lines are obtained, the method can also include rotating the region of interest by 230 degrees so that the lines are substantially horizontal. In this regard, the rotation angle can be determined by identifying the longest feathers in the region of interest (e.g., the two or three longest feathers), calculating the angle of each line relative to the x-axis, and calculating the average angle across the feathers considered.
[0135] In some implementations, once the rotation has been performed, the angle of each line corresponding to the feather relative to the X-axis can be recalculated, and lines forming angles greater than a determined threshold relative to that axis can be removed, as these lines then correspond to noise rather than real feathers. The angle threshold can be between 20° and 30°, for example, equal to 25°. Examples of the results are shown in... Figure 6e As shown in the image.
[0136] Return to reference Figure 3 The determination of parameter 300 based on the lines representing feathers first includes: identifying line 310 corresponding to long feathers and identifying line 320 corresponding to short feathers. Figure 6f The line LL, corresponding to long feathers, and the line LC, corresponding to short feathers, are shown.
[0137] The identification 310 of lines corresponding to long feathers is performed by initializing a set of lines corresponding to long feathers, said set including the longest line among all those lines appearing in the region obtained in step 200.
[0138] This group can then be completed using other lines as defined below:
[0139] - For each line included in a set of lines corresponding to long feathers, identify all adjacent lines of the line under consideration along the vertical axis or the Y-axis. In this respect, Figure 7 An example is shown where the Y-axis is displayed and the lines are indexed from top to bottom, with the index shown to the right of each line. The number to the right of each line indicates the line's order of length. Therefore, in Figure 7In the example, the longest line is the line at index 2, and its adjacent lines along the Y-axis are index lines 1, 3, and 4.
[0140] Then, for each adjacent line, a set of parameters is calculated, which includes:
[0141] The length difference between the line considered in this group and its adjacent lines.
[0142] ο is the distance between the center of the line under consideration and the center of the adjacent line along the horizontal axis X and the vertical axis Y.
[0143] - Compare these parameters with predetermined thresholds. The distance threshold is preferably less than 25%, for example, between 10% and 25%, or equal to 15%. The distance threshold between the centers of each line along the Y-axis is preferably less than 50% of the length of the line under consideration (corresponding to the long feather), for example, equal to 30% of the length of the line. The distance threshold between the centers of each line along the X-axis is preferably less than 50% of the length of the line under consideration, preferably less than 30%, for example, equal to 25%. If these three parameters are less than their respective thresholds, adjacent lines are identified as corresponding to long feathers and added to the group.
[0144] Repeat this process until no adjacent lines are added to the set of lines corresponding to the long feather.
[0145] In one implementation, other lines are automatically considered to correspond to short feathers. However, for greater accuracy, the method includes identifying 320 lines corresponding to short feathers. For each line corresponding to a long feather in a previously formed group, this identification is performed following a position index along the Y-axis (i.e., starting from the line located at the highest vertical position in that group), and this identification includes:
[0146] - Identify adjacent lines of the line under consideration that do not belong to the group of lines corresponding to long feathers. Figure 7 In the example, for a line with index 1, no adjacent lines will be identified, but for a line with index 2, adjacent lines with index 3 will be identified.
[0147] Then, for each line adjacent to the line in question, the length difference between the line under consideration and the adjacent line, the distance between the two lines along the vertical axis, and the distance along the horizontal axis between the proximal or distal end of the line under consideration and the distal end of the adjacent line, respectively, are calculated based on the relative position of the longest line with respect to the shortest line on the axis X.
[0148] The term "distal end" refers to the end furthest from the origin along the X-axis, and "proximal end" refers to the nearest end. For example, in... Figure 7In the example, if the shortest line in the region obtained after processing 200 is near the far end of the longest line, the distance between the far end of the line in question and the near end of the adjacent line is calculated. Conversely, if the shortest line is close to the near end of the longest line, the distance between the near end of the line in question and the far end of the adjacent line is calculated.
[0149] - Compare these parameters with predetermined thresholds. The threshold for the length difference is preferably between 50% and 80% of the length of the line under consideration, for example, equal to 60%. The distance threshold along the Y-axis is preferably less than 50% of the length of the line under consideration, for example, equal to 30%. The distances between the proximal and distal ends of the line under consideration and the distal and proximal ends of adjacent lines, respectively, are less than 50% of the length of the line under consideration, for example, equal to 50%. If these three parameters are less than their respective thresholds, the adjacent lines are identified as corresponding to short feathers.
[0150] Once the lines corresponding to long feathers and the lines corresponding to short feathers are identified, the method may include: calculating a set of 330 parameters based on regions of interest from processing 200, which are then fed to a classification model trained to determine the male or female sex of the chick.
[0151] In some implementations, these parameters include at least the number of rows corresponding to long feathers and the number of rows corresponding to short feathers.
[0152] In addition, these parameters may further include the average angle between these lines and the horizontal line, as well as the deviation or average distance measured perpendicularly (along the Y-axis) between two adjacent lines.
[0153] In some implementations, the parameters used for the model may further include one or more of the following parameters, or any combination thereof:
[0154] - The minimum, maximum, and / or horizontal and / or vertical positions of the center of the line.
[0155] - The minimum, average, and / or maximum horizontal and / or vertical distance between the centers of two consecutive lines.
[0156] - The minimum, average, and / or maximum length of the lines corresponding to long feathers.
[0157] - The minimum, average, and / or maximum length of the lines corresponding to short feathers.
[0158] - The average intensity of the pixels corresponding to the lines of short feathers.
[0159] - The average intensity of the pixels corresponding to the lines of long feathers.
[0160] - The difference in average intensity of pixels between lines corresponding to long feathers and lines corresponding to short feathers.
[0161] - Position relative to the horizontal axis of each line
[0162] - The minimum, average, and / or maximum angle between the two lines.
[0163] - The minimum, average, and / or maximum distance between the proximal ends of the two lines corresponding to the long feathers and the line corresponding to the short feathers located between them.
[0164] - The minimum, average, and / or maximum distance between the distal ends of the two lines corresponding to the long feathers and the line corresponding to the short feathers located between them.
[0165] The parameters calculated at the end of step 300 are provided to a model trained to determine the sex of a chick. The model is trained to have two output categories, male / female, or alternatively, the two categories include a first sex and an indeterminate category.
[0166] The model used is, for example, but not limited to, a decision tree.
[0167] As described above, the model is trained on a database of annotated images of chick wings. Preferably, the annotated images are images that have undergone the line extraction process of step 200, and for these images, steps 300 are also performed to determine the lines corresponding to long feathers and the lines corresponding to short feathers, so that these parameters can be provided to the model for its training.
[0168] Annotation is performed by an experienced operator based on the number of long and short feathers in the region of interest under consideration; that is, the male or female attributes of the chicks are assigned to the region of interest under consideration.
[0169] The annotation can also include a degree of certainty associated with the determined sex, which can also be indicated by the operator. For example, on an image containing 5 long feathers and 0 short feathers, the annotation could be "Male; 100%". According to another example, on an image containing 4 long feathers and 2 short feathers, the annotation could be "Female; 100%". The degree of certainty is preferably between 60% and 100%, and in cases of greater uncertainty, the annotation indicates an uncertain sex. According to a third example, on an image containing 3 long feathers and 1 short feather, the annotation could be "Indeterminate". Images of this type are then not saved for training the model.
[0170] In one embodiment where several images (e.g., at least 20 images) are acquired for the same chick, the above processing can be performed on each image. Thus, for each image, a result regarding the chick's sex is obtained, and the chick's sex is then determined by majority vote, i.e., the result obtained most frequently among all images of the same chick.
[0171] In one variant, parameters extracted from each image can be fed to a trained model, and the sex of chicks can be determined by majority voting.
[0172] The experimental results regarding the application of the above method are reproduced below, including the implementation of steps 200 and 300 and the application of a trained decision tree model to a group of 10,000 chicks of the same sex. The parameters extracted from the images and used in this experiment are:
[0173] - The number of long and short feathers
[0174] - The average angle between the line and the horizontal line, and
[0175] - The average distance along the Y-axis between two adjacent lines, and
[0176] -A set of additional parameters listed above in paragraph 92.
[0177] [Table 1]
[0178]
[0179]
Claims
1. A method for determining the sex of a chick, the method being implemented by a computer based on an image of the chick, the method comprising: - Determine the region of interest in the image, where the feathers of the wing are visible. - Process the region of interest (200) to determine a set of lines corresponding to the feathers of the chick in the image, - Determine a set of parameters based on the extracted lines. - A classification model (400) trained on a training dataset including images of male chick wings and images of female chick wings, running on the set of parameters, to determine the male or female sex of the chicks. The method further includes: rotating the region of interest such that the line representing the feather extends substantially horizontally, and the parameters determined based on the line include at least: - Corresponding to the number of threads in long feathers, - Corresponding to the number of lines in short feathers, -The average angle between the line and the horizontal line, and - The average deviation between two adjacent lines measured vertically.
2. The method of claim 1, wherein the method is implemented for each of a plurality of images acquired on the same chick, and further comprises the step of determining the sex of the chick based on the results obtained by the classification model for all the images.
3. The method according to claim 1 or 2, wherein determining the region of interest of the image comprises: - Scan the image using a window of a defined size to define multiple regions of the image. - For each region, calculate the Haar feature (110) of that region. - The trained classifier is applied to each Haar feature to determine whether the region represents a feather, and - The region of interest in the image is determined as the region representing feathers.
4. The method of claim 1, wherein processing the region of interest (200) to determine a set of lines corresponding to the feather on the image comprises: - Run edge detection processing (210) on the region of interest, and - Apply the Hough transform to the edges generated by the edge detection process to determine a set of lines (220) corresponding to the feathers visible on the region of interest.
5. The method of claim 1, wherein determining the parameters based on the extracted line comprises: - Identify a set of lines (310) corresponding to the long feathers, and - Identify a set of lines (320) corresponding to short feathers.
6. The method of claim 1, comprising: Rotating the region of interest such that the lines representing the feathers extend substantially horizontally, sorting each line in order of length, and identifying the group of lines (310) corresponding to long feathers includes: - Initialize the group of lines corresponding to the long feather, the group including the longest line. - For each line included in the group, perform the following steps: ○ Identify all adjacent lines of the line under consideration along the vertical axis. For each adjacent line, calculate the length difference and distance between the center of the adjacent line and the center of the line under consideration. If the length difference and the distance are less than their respective thresholds, the adjacent lines are identified as lines corresponding to long feathers and added to the group of lines corresponding to long feathers.
7. A method for identifying a set of lines corresponding to a short feather, comprising: For each line of a long feather corresponding to a group, starting from the line located at the maximum vertical position of the group, perform the following steps: - Identify adjacent lines of the lines under consideration that do not belong to the group of lines corresponding to long feathers. - For each adjacent line, calculate the length difference, the distance between the considered line and the adjacent line along the vertical axis, and the distances between the distal and proximal ends of the considered line and the proximal and distal ends of the adjacent lines along the horizontal axis, respectively. - If the calculated difference and distance are less than their respective thresholds, the adjacent lines are identified as lines corresponding to short feathers.
8. The method of claim 7, wherein a classification model is trained on a database of annotated training images, wherein each training image is obtained by applying the following steps: determining a region of interest and processing the region of interest to determine a set of lines representing the feathers, and extracting parameters based on the lines, and the annotation includes an indication of the chick's sex and an associated level of certainty, the level of certainty being determined based on the number of lines corresponding to long feathers and the number of lines corresponding to short feathers.
9. The method of claim 8, wherein the method is implemented on a set of images of the same chick, and includes determining the sex of the chick based on the most frequently provided result of the classification model.
10. A computer program product comprising code instructions for implementing the method according to any one of the preceding claims when executed by a computing unit.
11. An apparatus (1) for determining the sex of a chick, the apparatus comprising at least: - Camera (20), said camera being adapted to acquire at least one image of a chick, and - A computing unit (10) configured to perform the method according to any one of claims 1 to 10 on the image acquired by the camera.
12. The apparatus (1) according to claim 11, the apparatus further comprising a conveyor (30) adapted to bring the chick into the field of view of the camera (20), wherein the conveyor is adapted to make the chick unbalanced such that the chick spreads its wings when it is in front of the camera.
13. The apparatus (1) according to claim 12, the apparatus comprising: Conveyor (30); The first station for detecting chicks of the first sex, male or female, includes the camera (20). And an actuator adapted to pick up or expel chicks detected as belonging to the first sex from the conveyor, wherein the computing unit (10) is configured to implement a first classification model optimized for detecting the first sex on the image acquired by the camera, and the computing unit (10) is further configured to implement a second classification model optimized for detecting the second sex on the image acquired from chicks whose first sex has not yet been determined.