Method for identifying gender of acipenser sinensis and method for training model for identifying gender of acipenser sinensis
By training a Chinese sturgeon sex identification model using target detection technology and enhancing male and female characteristics through differential preprocessing, the problems of low accuracy and low efficiency in existing technologies have been solved, enabling accurate early sex identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- THREE GORGES HI TECH INFORMATION TECH CO LTD
- Filing Date
- 2025-05-15
- Publication Date
- 2026-06-16
AI Technical Summary
Existing methods for sex determination of Chinese sturgeon suffer from low accuracy, low efficiency, and reliance on human experience, making it difficult to accurately determine sex in the early stages.
A Chinese sturgeon sex identification model was trained using object detection technology. Differential preprocessing was performed on labeled images of female and male fish to enhance individual morphological features. The object detection algorithm was then used for sex identification, and the result with higher confidence was taken as the final identification result.
This improved the accuracy and efficiency of sex identification of Chinese sturgeon, reduced reliance on the experience of the identification personnel, and enabled accurate early sex identification.
Smart Images

Figure CN120635939B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of target detection technology, specifically to a method for sex identification of Chinese sturgeon and a training method for a Chinese sturgeon sex identification model. Background Technology
[0002] Sex determination is both a key and challenging aspect of Chinese sturgeon conservation and aquaculture. Chinese sturgeon lack secondary sexual characteristics, making it impossible to determine their sex from birth to maturity and reproduction based on appearance alone, which greatly inconveniences aquaculture management and conservation efforts. Early sex determination is crucial for controlling the sex ratio within the aquaculture population, managing males and females separately, and selecting suitable broodstock.
[0003] Traditional methods for sexing Chinese sturgeon include ultrasound and surgical examination of the gonads. Ultrasound is relatively late in distinguishing sex, requiring at least stage III, and its accuracy is relatively low. Surgical examination of the gonads requires a wide incision for observation, and suturing is necessary after the examination, making it time-consuming and with a high risk of injury or death.
[0004] CN114287378B discloses a method for rapid sex identification of Chinese sturgeon using an endoscope. This method allows for clear observation of the gonads of stage II or later Chinese sturgeon using a modified endoscope. Combined with the individual morphological characteristics of females and males, accurate sexing can be achieved. Furthermore, the selected incision site causes minimal damage to the Chinese sturgeon and does not affect gonadal development. However, this method relies on manual sex identification, and its accuracy and efficiency depend heavily on the experience of the personnel performing the identification. Summary of the Invention
[0005] This application provides a method for sex identification of Chinese sturgeon and a training method for a Chinese sturgeon sex identification model, which can further improve the accuracy and efficiency of Chinese sturgeon sex identification by means of target detection technology.
[0006] In a first aspect, embodiments of this application provide a method for sex determination of Chinese sturgeon, the method comprising:
[0007] The images to be detected are subjected to a first preprocessing and a second preprocessing respectively to obtain a first input image and a second input image. The first preprocessing is used to enhance the individual morphological features of female fish, and the second preprocessing is used to enhance the individual morphological features of male fish.
[0008] The sex identification model of Chinese sturgeon was used to identify the sex of the first input image and the second input image respectively, and the first identification result and the first confidence score, as well as the second identification result and the second confidence score, were obtained. The Chinese sturgeon sex identification model was trained based on the target detection algorithm. The training set included the first training image and the second training image. The first training image was a female fish labeled image after the first preprocessing, and the second training image was a male fish labeled image after the second preprocessing. The image to be detected, the female fish labeled image and the male fish labeled image were all gonad images of Chinese sturgeon at stage II or above obtained by endoscopy.
[0009] If the first confidence level is greater than the second confidence level, the first identification result shall be taken as the final identification result; if the first confidence level is less than the second confidence level, the second identification result shall be taken as the final identification result.
[0010] Furthermore, in one embodiment, the first preprocessing includes:
[0011] Bilateral filtering is performed on the first original image based on the first spatial kernel and the first color gamut standard deviation. The first original image is any one of the following: the image to be detected, the female fish labeled image, the image to be detected after other processing, and the female fish labeled image after other processing.
[0012] The second preprocessing includes:
[0013] Bilateral filtering is performed on the second original image based on the second spatial kernel and the second color gamut standard deviation. The second original image is any one of the following: the image to be detected, the male fish labeled image, the image to be detected after other processing, and the male fish labeled image after other processing. The scale of the first spatial kernel is larger than the scale of the second spatial kernel, and the standard deviation of the first color gamut is larger than the standard deviation of the second color gamut.
[0014] Furthermore, in one embodiment, the first preprocessing includes:
[0015] Based on the first block size and the first contrast threshold, the first original image is subjected to limited contrast adaptive histogram equalization, wherein the first original image is any one of the following: the image to be detected, the female fish labeled image, the image to be detected after other processing, and the female fish labeled image after other processing.
[0016] The second preprocessing includes:
[0017] The second original image is subjected to limited contrast adaptive histogram equalization based on the second block size and the second contrast threshold. The second original image is any one of the following: the image to be detected, the male fish labeled image, the image to be detected after other processing, and the male fish labeled image after other processing. The first block size is larger than the second block size, and the first contrast threshold is smaller than the second contrast threshold.
[0018] Furthermore, in one embodiment, the first preprocessing includes:
[0019] The first original image is processed by HSV-H channel layering to obtain the first intermediate image. A mask is constructed for the fat part in the first intermediate image to obtain the second intermediate image. The second intermediate image is transformed by a top-hat transform according to a preset convolution kernel. The first original image is any one of the following: the image to be detected, the female fish annotation image, the image to be detected after other processing, and the female fish annotation image after other processing.
[0020] The second preprocessing includes:
[0021] The second original image is subjected to dual-modal fusion of the saturation and luminance channels in the HSV color space to obtain the third intermediate image. The color contrast information and texture luminance information in the third intermediate image are integrated according to the preset weighting coefficient to obtain the fourth intermediate image. The Scharr operator is applied to the fourth intermediate image in the horizontal and vertical directions for collaborative detection. The second original image can be any one of the following: the image to be detected, the male fish annotation image, the image to be detected after other processing, and the male fish annotation image after other processing.
[0022] Furthermore, in one embodiment, the first preprocessing includes:
[0023] The first intermediate image is obtained by performing bilateral filtering on the first original image based on the first spatial kernel and the first color gamut standard deviation, wherein the first original image is the image to be detected or the female fish labeled image;
[0024] The first intermediate image is obtained by performing contrast-adaptive histogram equalization on the first intermediate image based on the first block size and the first contrast threshold;
[0025] The third intermediate image is obtained by performing HSV-H channel layering on the second intermediate image.
[0026] A mask is constructed for the fat portion in the third intermediate image to obtain the fourth intermediate image;
[0027] The first result image is obtained by performing a top-hat transformation on the fourth intermediate image according to a preset convolution kernel, wherein the first result image is the first input image or the first training image;
[0028] The second preprocessing includes:
[0029] The second original image is obtained by bilateral filtering based on the second spatial kernel and the second color gamut standard deviation. The second original image is either the image to be detected or the labeled image of the male fish. The scale of the first spatial kernel is larger than that of the second spatial kernel, and the standard deviation of the first color gamut is larger than that of the second color gamut.
[0030] The fifth intermediate image is subjected to contrast-adaptive histogram equalization based on the second block size and the second contrast threshold to obtain the sixth intermediate image, wherein the first block size is larger than the second block size and the first contrast threshold is smaller than the second contrast threshold.
[0031] The saturation and luminance channels of the sixth intermediate image are fused in a dual-modal manner in the HSV color space to obtain the seventh intermediate image;
[0032] The eighth intermediate image is obtained by integrating the color contrast information and texture brightness information in the seventh intermediate image according to the preset weighting coefficients.
[0033] The Scharr operator is applied to the eighth intermediate image in both the horizontal and vertical directions to perform collaborative detection, resulting in a second result image, which is either the second input image or the second training image.
[0034] Secondly, this application also provides a method for training a Chinese sturgeon sex identification model, the method comprising:
[0035] The first preprocessing of the labeled images of female fish is used to obtain the first training image, and the second preprocessing of the labeled images of male fish is used to obtain the second training image. The first preprocessing is used to enhance the individual morphological features of female fish, and the second preprocessing is used to enhance the individual morphological features of male fish. Both the labeled images of female fish and male fish are gonad images of Chinese sturgeon at stage II or above obtained by endoscopy.
[0036] Based on the object detection algorithm, the Chinese sturgeon sex identification model was trained using the first training image and the second training image as the training set.
[0037] Furthermore, in one embodiment, the first preprocessing includes:
[0038] The first original image is subjected to bilateral filtering based on the first spatial kernel and the first color gamut standard deviation, wherein the first original image is a female fish labeled image or a female fish labeled image after other processing;
[0039] The second preprocessing includes:
[0040] The second original image is subjected to bilateral filtering based on the second spatial kernel and the second color gamut standard deviation. The second original image is a male fish labeled image or a male fish labeled image after other processing. The scale of the first spatial kernel is larger than the scale of the second spatial kernel, and the standard deviation of the first color gamut is larger than the standard deviation of the second color gamut.
[0041] Furthermore, in one embodiment, the first preprocessing includes:
[0042] Based on the first block size and the first contrast threshold, the first original image is subjected to limited contrast adaptive histogram equalization, wherein the first original image is a female fish labeled image or a female fish labeled image after other processing.
[0043] The second preprocessing includes:
[0044] The second original image is subjected to limited contrast adaptive histogram equalization based on the second block size and the second contrast threshold. The second original image is a male fish labeled image or a male fish labeled image after other processing. The first block size is larger than the second block size, and the first contrast threshold is smaller than the second contrast threshold.
[0045] Furthermore, in one embodiment, the first preprocessing includes:
[0046] The first original image is processed by HSV-H channel layering to obtain the first intermediate image. A mask is constructed for the fat part in the first intermediate image to obtain the second intermediate image. The second intermediate image is subjected to top-hat transformation according to the preset convolution kernel. The first original image is the female fish annotation image or the female fish annotation image after other processing.
[0047] The second preprocessing includes:
[0048] The second original image is fused in two modes in the saturation and luminance channels of the HSV color space to obtain the third intermediate image. The color contrast information and texture luminance information in the third intermediate image are integrated according to the preset weighting coefficient to obtain the fourth intermediate image. The Scharr operator is applied to the fourth intermediate image in the horizontal and vertical directions for collaborative detection. The second original image is the male fish labeled image or the male fish labeled image after other processing.
[0049] Furthermore, in one embodiment, the first preprocessing includes:
[0050] The first intermediate image is obtained by performing bilateral filtering on the labeled image of the female fish based on the first spatial kernel and the first color gamut standard deviation.
[0051] The first intermediate image is obtained by performing contrast-adaptive histogram equalization on the first intermediate image based on the first block size and the first contrast threshold;
[0052] The third intermediate image is obtained by performing HSV-H channel layering on the second intermediate image.
[0053] A mask is constructed for the fat portion in the third intermediate image to obtain the fourth intermediate image;
[0054] The first training image is obtained by performing a top-hat transformation on the fourth intermediate image according to the preset convolution kernel;
[0055] The second preprocessing includes:
[0056] The fifth intermediate image is obtained by performing bilateral filtering on the labeled image of the male fish based on the second spatial kernel and the second color gamut standard deviation. The scale of the first spatial kernel is larger than that of the second spatial kernel, and the standard deviation of the first color gamut is larger than that of the second color gamut.
[0057] The fifth intermediate image is subjected to contrast-adaptive histogram equalization based on the second block size and the second contrast threshold to obtain the sixth intermediate image, wherein the first block size is larger than the second block size and the first contrast threshold is smaller than the second contrast threshold.
[0058] The saturation and luminance channels of the sixth intermediate image are fused in a dual-modal manner in the HSV color space to obtain the seventh intermediate image;
[0059] The eighth intermediate image is obtained by integrating the color contrast information and texture brightness information in the seventh intermediate image according to the preset weighting coefficients.
[0060] The second training image is obtained by applying the Scharr operator to the eighth intermediate image in both the horizontal and vertical directions for collaborative detection.
[0061] In this application, a Chinese sturgeon sex identification model is trained based on an object detection algorithm. Annotated images of female and male sturgeon are preprocessed with corresponding sex enhancements before being fed into the training process. This allows the model to better learn the individual morphological characteristics of females and males. When using the trained model for actual inference, the images to be detected are preprocessed with the two sex enhancements before being input into the model. This allows the model to better capture the individual morphological characteristics of females and males, resulting in two identification results and their corresponding confidence levels. The identification result with the higher confidence level is taken as the final identification result. This application utilizes object detection technology to further improve the accuracy and efficiency of Chinese sturgeon sex identification. Attached Figure Description
[0062] Figure 1 This is a flowchart illustrating a method for sex determination of Chinese sturgeon in one embodiment of this application;
[0063] Figure 2 This is a flowchart illustrating the training method for a Chinese sturgeon sex identification model in one embodiment of this application. Detailed Implementation
[0064] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0065] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0066] In the first aspect, embodiments of this application provide a method for sex identification of Chinese sturgeon.
[0067] Figure 1 A flowchart illustrating a method for sex determination of Chinese sturgeon in one embodiment of this application is shown.
[0068] Reference Figure 1 In one embodiment, the method for sex determination of Chinese sturgeon includes the following steps:
[0069] S11. Perform a first preprocessing and a second preprocessing on the image to be detected to obtain a first input image and a second input image, wherein the first preprocessing is used to enhance the individual morphological features of the female fish and the second preprocessing is used to enhance the individual morphological features of the male fish.
[0070] S12. The sex identification of the first input image and the second input image is performed by the Chinese sturgeon sex identification model to obtain the first identification result and the first confidence level, as well as the second identification result and the second confidence level. The Chinese sturgeon sex identification model is trained based on the target detection algorithm. The training set includes the first training image and the second training image. The first training image is a female fish labeled image after the first preprocessing, and the second training image is a male fish labeled image after the second preprocessing. The image to be detected, the female fish labeled image and the male fish labeled image are all gonad images of Chinese sturgeon at stage II or above obtained by endoscopy.
[0071] S13. If the first confidence level is greater than the second confidence level, the first identification result shall be taken as the final identification result; if the first confidence level is less than the second confidence level, the second identification result shall be taken as the final identification result.
[0072] Specifically, the common morphological characteristics of both male and female fish include: gonads that are band-like, with the gonadal frenulum being bluish-gray ribbon-like stripes; the inner surface of the body wall is smooth, with scattered gray spots distributed in a light white color; and the rectum is pure glossy black or glossy black with coarse light-colored patterns.
[0073] The morphological characteristics of male fish include: fat separate from the testes, which is yellowish-white with evenly distributed dotted pigment deposits on the surface; testes are milky white or light pink with clear edges, smooth surface, uniform and delicate texture, and opaque.
[0074] The morphological characteristics of female fish include: fat often mixed with eggs, which is a light yellow or milky white color, and the pigmentation on the surface is generally not obvious; the surface of the ovary is rough, initially slightly transparent, like cotton wool clumps with lobes, and the surface is wrinkled, or round eggs (diameter greater than 0.1 mm) embedded in the fat can be clearly observed, or irregular eggs (diameter less than 0.1 mm) can be vaguely observed.
[0075] In this embodiment, a Chinese sturgeon sex identification model is trained based on an object detection algorithm. The labeled images of female and male sturgeon are preprocessed with corresponding sex enhancements before being fed into the training process. This allows the model to better learn the individual morphological characteristics of females and males. When using the trained model for actual inference, the images to be detected are preprocessed with the two sex enhancements before being input into the model. This helps the model better capture the individual morphological characteristics of females and males, resulting in two identification results and their corresponding confidence levels. The identification result with the higher confidence level is taken as the final identification result. Through this embodiment, the accuracy and efficiency of Chinese sturgeon sex identification can be further improved by leveraging object detection technology.
[0076] Furthermore, in one embodiment, the first preprocessing includes:
[0077] Bilateral filtering is performed on the first original image based on the first spatial kernel and the first color gamut standard deviation. The first original image is any one of the following: the image to be detected, the female fish labeled image, the image to be detected after other processing, and the female fish labeled image after other processing.
[0078] The second preprocessing includes:
[0079] Bilateral filtering is performed on the second original image based on the second spatial kernel and the second color gamut standard deviation. The second original image is any one of the following: the image to be detected, the male fish labeled image, the image to be detected after other processing, and the male fish labeled image after other processing. The scale of the first spatial kernel is larger than the scale of the second spatial kernel, and the standard deviation of the first color gamut is larger than the standard deviation of the second color gamut.
[0080] In this embodiment, the first and second preprocessing processes include differentiated processing at the noise reduction level. For the smooth tissue characteristics of the male fish's testes, a suitable large-scale spatial kernel (e.g., 9×9 pixels) and a wide color gamut standard deviation (e.g., 75) are used for bilateral filtering. The wide color gamut standard deviation allows for larger color fluctuations, suitable for noise fusion in homogeneous areas (smooth testicular surfaces). For the egg mosaic structure of the female fish's ovary, a suitable small-scale spatial kernel (e.g., 5×5 pixels) and a strict color gamut standard deviation (e.g., 25) are used for bilateral filtering to protect the egg edge gradient during noise reduction.
[0081] Furthermore, in one embodiment, the first preprocessing includes:
[0082] Based on the first block size and the first contrast threshold, the first original image is subjected to limited contrast adaptive histogram equalization, wherein the first original image is any one of the following: the image to be detected, the female fish labeled image, the image to be detected after other processing, and the female fish labeled image after other processing.
[0083] The second preprocessing includes:
[0084] The second original image is subjected to limited contrast adaptive histogram equalization based on the second block size and the second contrast threshold. The second original image is any one of the following: the image to be detected, the male fish labeled image, the image to be detected after other processing, and the male fish labeled image after other processing. The first block size is larger than the second block size, and the first contrast threshold is smaller than the second contrast threshold.
[0085] In this embodiment, the first and second preprocessing include differentiated processing at the contrast enhancement level. A Limiting Contrast Adaptive Histogram Equalization (CLAHE) algorithm is employed. For male fish, appropriately large blocks (e.g., 15×15 pixels) are set in combination with a low contrast limit threshold (e.g., 2) to achieve overall equalization of fat distribution. For female fish, appropriately small blocks (e.g., 8×8 pixels) are combined with a high contrast threshold (e.g., 4) to perform local histogram stretching on the egg mosaic structure, thereby more finely enhancing local details.
[0086] Furthermore, in one embodiment, the first preprocessing includes:
[0087] The first original image is processed by HSV-H channel layering to obtain the first intermediate image. A mask is constructed for the fat part in the first intermediate image to obtain the second intermediate image. The second intermediate image is transformed by a top-hat transform according to a preset convolution kernel. The first original image is any one of the following: the image to be detected, the female fish annotation image, the image to be detected after other processing, and the female fish annotation image after other processing.
[0088] The second preprocessing includes:
[0089] The second original image is subjected to dual-modal fusion of the saturation and luminance channels in the HSV color space to obtain the third intermediate image. The color contrast information and texture luminance information in the third intermediate image are integrated according to the preset weighting coefficient to obtain the fourth intermediate image. The Scharr operator is applied to the fourth intermediate image in the horizontal and vertical directions for collaborative detection. The second original image can be any one of the following: the image to be detected, the male fish annotation image, the image to be detected after other processing, and the male fish annotation image after other processing.
[0090] In this embodiment, the first and second preprocessing processes include differentiated processing at the edge enhancement level. Male fish undergo HSV-H channel layer processing to distinguish between beige fat and milky white / light pink testes. A fat mask is constructed to isolate interfering areas, and a top-hat transform is performed with an appropriately sized convolution kernel (e.g., 7×7 pixels) to eliminate minute noise points such as dot-like pigment deposits in the image, thereby improving image quality. Female fish undergo bimodal fusion of the saturation (S) channel and YUV luminance (Y) channel in the HSV color space. By setting appropriate weighting coefficients (e.g., 0.6:0.4), color contrast and texture brightness information are integrated, effectively improving the discernibility of the egg arrangement direction. To further enhance the egg edge features, the Scharr operator is applied for collaborative detection in both the horizontal and vertical directions. The horizontal Scharr operator is mainly used to enhance the linear distribution of eggs, while the vertical Scharr operator is used to suppress interference from tissue folds.
[0091] Furthermore, in one embodiment, the first preprocessing includes:
[0092] The first intermediate image is obtained by performing bilateral filtering on the first original image based on the first spatial kernel and the first color gamut standard deviation, wherein the first original image is the image to be detected or the female fish labeled image;
[0093] The first intermediate image is obtained by performing contrast-adaptive histogram equalization on the first intermediate image based on the first block size and the first contrast threshold;
[0094] The third intermediate image is obtained by performing HSV-H channel layering on the second intermediate image.
[0095] A mask is constructed for the fat portion in the third intermediate image to obtain the fourth intermediate image;
[0096] The first result image is obtained by performing a top-hat transformation on the fourth intermediate image according to a preset convolution kernel, wherein the first result image is the first input image or the first training image;
[0097] The second preprocessing includes:
[0098] The second original image is obtained by bilateral filtering based on the second spatial kernel and the second color gamut standard deviation. The second original image is either the image to be detected or the labeled image of the male fish. The scale of the first spatial kernel is larger than that of the second spatial kernel, and the standard deviation of the first color gamut is larger than that of the second color gamut.
[0099] The fifth intermediate image is subjected to contrast-adaptive histogram equalization based on the second block size and the second contrast threshold to obtain the sixth intermediate image, wherein the first block size is larger than the second block size and the first contrast threshold is smaller than the second contrast threshold.
[0100] The saturation and luminance channels of the sixth intermediate image are fused in a dual-modal manner in the HSV color space to obtain the seventh intermediate image;
[0101] The eighth intermediate image is obtained by integrating the color contrast information and texture brightness information in the seventh intermediate image according to the preset weighting coefficients.
[0102] The Scharr operator is applied to the eighth intermediate image in both the horizontal and vertical directions to perform collaborative detection, resulting in a second result image, which is either the second input image or the second training image.
[0103] In this embodiment, the first preprocessing and the second preprocessing are performed in a differentiated manner at the noise reduction level, the contrast enhancement level, and the edge enhancement level, respectively. Each of the preceding processing steps provides a better intermediate image as a basis for subsequent processing, which helps to improve the overall feature enhancement effect.
[0104] Secondly, based on the same inventive concept, this application also provides a training method for a Chinese sturgeon sex identification model.
[0105] Figure 2 A flowchart illustrating the training method for a Chinese sturgeon sex identification model in one embodiment of this application is shown.
[0106] Reference Figure 2 In one embodiment, the training method for the Chinese sturgeon sex identification model includes:
[0107] S21. The first preprocessing is performed on the labeled image of the female fish to obtain the first training image, and the second preprocessing is performed on the labeled image of the male fish to obtain the second training image. The first preprocessing is used to enhance the individual morphological characteristics of the female fish, and the second preprocessing is used to enhance the individual morphological characteristics of the male fish. Both the labeled image of the female fish and the labeled image of the male fish are gonad images of Chinese sturgeon at stage II or above obtained by endoscopy.
[0108] S22. Based on the target detection algorithm, the Chinese sturgeon sex identification model is trained using the first training image and the second training image as the training set.
[0109] It should be noted that this embodiment only limits the training method of the Chinese sturgeon sex identification model, and does not limit the method of using the Chinese sturgeon sex identification model, and is not limited to using... Figure 1 The parallel preprocessing shown is used to obtain results with higher confidence.
[0110] Furthermore, in one embodiment, the first preprocessing includes:
[0111] The first original image is subjected to bilateral filtering based on the first spatial kernel and the first color gamut standard deviation, wherein the first original image is a female fish labeled image or a female fish labeled image after other processing;
[0112] The second preprocessing includes:
[0113] The second original image is subjected to bilateral filtering based on the second spatial kernel and the second color gamut standard deviation. The second original image is a male fish labeled image or a male fish labeled image after other processing. The scale of the first spatial kernel is larger than the scale of the second spatial kernel, and the standard deviation of the first color gamut is larger than the standard deviation of the second color gamut.
[0114] Furthermore, in one embodiment, the first preprocessing includes:
[0115] Based on the first block size and the first contrast threshold, the first original image is subjected to limited contrast adaptive histogram equalization, wherein the first original image is a female fish labeled image or a female fish labeled image after other processing.
[0116] The second preprocessing includes:
[0117] The second original image is subjected to limited contrast adaptive histogram equalization based on the second block size and the second contrast threshold. The second original image is a male fish labeled image or a male fish labeled image after other processing. The first block size is larger than the second block size, and the first contrast threshold is smaller than the second contrast threshold.
[0118] Furthermore, in one embodiment, the first preprocessing includes:
[0119] The first original image is processed by HSV-H channel layering to obtain the first intermediate image. A mask is constructed for the fat part in the first intermediate image to obtain the second intermediate image. The second intermediate image is subjected to top-hat transformation according to the preset convolution kernel. The first original image is the female fish annotation image or the female fish annotation image after other processing.
[0120] The second preprocessing includes:
[0121] The second original image is fused in two modes in the saturation and luminance channels of the HSV color space to obtain the third intermediate image. The color contrast information and texture luminance information in the third intermediate image are integrated according to the preset weighting coefficient to obtain the fourth intermediate image. The Scharr operator is applied to the fourth intermediate image in the horizontal and vertical directions for collaborative detection. The second original image is the male fish labeled image or the male fish labeled image after other processing.
[0122] Furthermore, in one embodiment, the first preprocessing includes:
[0123] The first intermediate image is obtained by performing bilateral filtering on the labeled image of the female fish based on the first spatial kernel and the first color gamut standard deviation.
[0124] The first intermediate image is obtained by performing contrast-adaptive histogram equalization on the first intermediate image based on the first block size and the first contrast threshold;
[0125] The third intermediate image is obtained by performing HSV-H channel layering on the second intermediate image.
[0126] A mask is constructed for the fat portion in the third intermediate image to obtain the fourth intermediate image;
[0127] The first training image is obtained by performing a top-hat transformation on the fourth intermediate image according to the preset convolution kernel;
[0128] The second preprocessing includes:
[0129] The fifth intermediate image is obtained by performing bilateral filtering on the labeled image of the male fish based on the second spatial kernel and the second color gamut standard deviation. The scale of the first spatial kernel is larger than that of the second spatial kernel, and the standard deviation of the first color gamut is larger than that of the second color gamut.
[0130] The fifth intermediate image is subjected to contrast-adaptive histogram equalization based on the second block size and the second contrast threshold to obtain the sixth intermediate image, wherein the first block size is larger than the second block size and the first contrast threshold is smaller than the second contrast threshold.
[0131] The saturation and luminance channels of the sixth intermediate image are fused in a dual-modal manner in the HSV color space to obtain the seventh intermediate image;
[0132] The eighth intermediate image is obtained by integrating the color contrast information and texture brightness information in the seventh intermediate image according to the preset weighting coefficients.
[0133] The second training image is obtained by applying the Scharr operator to the eighth intermediate image in both the horizontal and vertical directions for collaborative detection.
[0134] The functions of the first and second preprocessing in the above-mentioned Chinese sturgeon sex identification model training method correspond to the steps in the above-mentioned Chinese sturgeon sex identification method embodiment. The only difference is that the original image and the result image do not contain the image to be detected or the image to be detected after other processing. These will not be described in detail here.
[0135] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0136] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.
[0137] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.
[0138] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.
[0139] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.
[0140] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.
[0141] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for sex determination of Chinese sturgeon, characterized in that, The method for sex determination of Chinese sturgeon includes: The images to be detected are subjected to a first preprocessing and a second preprocessing respectively to obtain a first input image and a second input image. The first preprocessing is used to enhance the individual morphological features of female fish, and the second preprocessing is used to enhance the individual morphological features of male fish. The sex identification model of Chinese sturgeon was used to identify the sex of the first input image and the second input image respectively, and the first identification result and the first confidence score, as well as the second identification result and the second confidence score, were obtained. The Chinese sturgeon sex identification model was trained based on the target detection algorithm. The training set included the first training image and the second training image. The first training image was a female fish labeled image after the first preprocessing, and the second training image was a male fish labeled image after the second preprocessing. The image to be detected, the female fish labeled image and the male fish labeled image were all gonad images of Chinese sturgeon at stage II or above obtained by endoscopy. If the first confidence level is greater than the second confidence level, the first identification result shall be taken as the final identification result; if the first confidence level is less than the second confidence level, the second identification result shall be taken as the final identification result. The first preprocessing includes: The first original image is processed by HSV-H channel layering to obtain the first intermediate image. A mask is constructed for the fat part in the first intermediate image to obtain the second intermediate image. The second intermediate image is transformed by a top-hat transform according to a preset convolution kernel. The first original image is any one of the following: the image to be detected, the female fish annotation image, the image to be detected after other processing, and the female fish annotation image after other processing. The second preprocessing includes: The second original image is subjected to dual-modal fusion of the saturation and luminance channels in the HSV color space to obtain the third intermediate image. The color contrast information and texture luminance information in the third intermediate image are integrated according to the preset weighting coefficient to obtain the fourth intermediate image. The Scharr operator is applied to the fourth intermediate image in the horizontal and vertical directions for collaborative detection. The second original image can be any one of the following: the image to be detected, the male fish annotation image, the image to be detected after other processing, and the male fish annotation image after other processing.
2. The method for sex determination of Chinese sturgeon as described in claim 1, characterized in that, The first preprocessing also includes: Bilateral filtering is performed on the first original image based on the first spatial kernel and the first color gamut standard deviation. The first original image is any one of the following: the image to be detected, the female fish labeled image, the image to be detected after other processing, and the female fish labeled image after other processing. The second preprocessing also includes: Bilateral filtering is performed on the second original image based on the second spatial kernel and the second color gamut standard deviation. The second original image is any one of the following: the image to be detected, the male fish labeled image, the image to be detected after other processing, and the male fish labeled image after other processing. The scale of the first spatial kernel is larger than the scale of the second spatial kernel, and the standard deviation of the first color gamut is larger than the standard deviation of the second color gamut.
3. The method for sex determination of Chinese sturgeon as described in claim 1, characterized in that, The first preprocessing also includes: Based on the first block size and the first contrast threshold, the first original image is subjected to limited contrast adaptive histogram equalization, wherein the first original image is any one of the following: the image to be detected, the female fish labeled image, the image to be detected after other processing, and the female fish labeled image after other processing. The second preprocessing also includes: The second original image is subjected to limited contrast adaptive histogram equalization based on the second block size and the second contrast threshold. The second original image is any one of the following: the image to be detected, the male fish labeled image, the image to be detected after other processing, and the male fish labeled image after other processing. The first block size is larger than the second block size, and the first contrast threshold is smaller than the second contrast threshold.
4. The method for sex determination of Chinese sturgeon as described in claim 1, characterized in that, The first preprocessing includes: The first original image is subjected to bilateral filtering based on the first spatial kernel and the first color gamut standard deviation to obtain the fifth intermediate image, wherein the first original image is the image to be detected or the female fish labeled image; The sixth intermediate image is obtained by performing contrast-adaptive histogram equalization on the fifth intermediate image based on the first block size and the first contrast threshold. The first intermediate image is obtained by performing HSV-H channel layering on the sixth intermediate image. A mask is constructed for the fat portion in the first intermediate image to obtain the second intermediate image; The first result image is obtained by performing a top-hat transformation on the second intermediate image according to a preset convolution kernel, wherein the first result image is the first input image or the first training image; The second preprocessing includes: The second original image is obtained by bilateral filtering based on the second spatial kernel and the second color gamut standard deviation. The second original image is either the image to be detected or the labeled image of the male fish. The scale of the first spatial kernel is larger than that of the second spatial kernel, and the standard deviation of the first color gamut is larger than that of the second color gamut. The seventh intermediate image is subjected to contrast-adaptive histogram equalization based on the second block size and the second contrast threshold to obtain the eighth intermediate image, wherein the first block size is larger than the second block size and the first contrast threshold is smaller than the second contrast threshold. The third intermediate image is obtained by performing dual-modal fusion of the saturation and luminance channels of the eighth intermediate image in the HSV color space; The fourth intermediate image is obtained by integrating the color contrast information and texture brightness information in the third intermediate image according to the preset weighting coefficients. The Scharr operator is applied to the fourth intermediate image in both the horizontal and vertical directions to perform collaborative detection, resulting in a second result image, which is either the second input image or the second training image.
5. A method for training a Chinese sturgeon sex identification model, characterized in that, The training method for the Chinese sturgeon sex identification model includes: The first preprocessing of the labeled images of female fish is used to obtain the first training image, and the second preprocessing of the labeled images of male fish is used to obtain the second training image. The first preprocessing is used to enhance the individual morphological features of female fish, and the second preprocessing is used to enhance the individual morphological features of male fish. Both the labeled images of female fish and male fish are gonad images of Chinese sturgeon at stage II or above obtained by endoscopy. Based on the target detection algorithm, the Chinese sturgeon sex identification model was trained using the first training image and the second training image as the training set. The first preprocessing includes: The first original image is processed by HSV-H channel layering to obtain the first intermediate image. A mask is constructed for the fat part in the first intermediate image to obtain the second intermediate image. The second intermediate image is subjected to top-hat transformation according to the preset convolution kernel. The first original image is the female fish annotation image or the female fish annotation image after other processing. The second preprocessing includes: The second original image is fused in two modes in the saturation and luminance channels of the HSV color space to obtain the third intermediate image. The color contrast information and texture luminance information in the third intermediate image are integrated according to the preset weighting coefficient to obtain the fourth intermediate image. The Scharr operator is applied to the fourth intermediate image in the horizontal and vertical directions for collaborative detection. The second original image is the male fish labeled image or the male fish labeled image after other processing.
6. The method for training a Chinese sturgeon sex identification model as described in claim 5, characterized in that, The first preprocessing also includes: The first original image is subjected to bilateral filtering based on the first spatial kernel and the first color gamut standard deviation, wherein the first original image is a female fish labeled image or a female fish labeled image after other processing; The second preprocessing also includes: The second original image is subjected to bilateral filtering based on the second spatial kernel and the second color gamut standard deviation. The second original image is a male fish labeled image or a male fish labeled image after other processing. The scale of the first spatial kernel is larger than the scale of the second spatial kernel, and the standard deviation of the first color gamut is larger than the standard deviation of the second color gamut.
7. The method for training a Chinese sturgeon sex identification model as described in claim 5, characterized in that, The first preprocessing also includes: Based on the first block size and the first contrast threshold, the first original image is subjected to limited contrast adaptive histogram equalization, wherein the first original image is a female fish labeled image or a female fish labeled image after other processing. The second preprocessing also includes: The second original image is subjected to limited contrast adaptive histogram equalization based on the second block size and the second contrast threshold. The second original image is a male fish labeled image or a male fish labeled image after other processing. The first block size is larger than the second block size, and the first contrast threshold is smaller than the second contrast threshold.
8. The training method for the Chinese sturgeon sex identification model as described in claim 5, characterized in that, The first preprocessing includes: The fifth intermediate image is obtained by performing bilateral filtering on the labeled image of the female fish based on the first spatial kernel and the first color gamut standard deviation. The sixth intermediate image is obtained by performing contrast-adaptive histogram equalization on the fifth intermediate image based on the first block size and the first contrast threshold. The first intermediate image is obtained by performing HSV-H channel layering on the sixth intermediate image. A mask is constructed for the fat portion in the first intermediate image to obtain the second intermediate image; The first training image is obtained by performing a top-hat transformation on the second intermediate image according to a preset convolution kernel. The second preprocessing includes: The seventh intermediate image is obtained by performing bilateral filtering on the labeled image of the male fish based on the second spatial kernel and the second color gamut standard deviation. The scale of the first spatial kernel is larger than that of the second spatial kernel, and the standard deviation of the first color gamut is larger than that of the second color gamut. The seventh intermediate image is subjected to contrast-adaptive histogram equalization based on the second block size and the second contrast threshold to obtain the eighth intermediate image, wherein the first block size is larger than the second block size and the first contrast threshold is smaller than the second contrast threshold. The third intermediate image is obtained by performing dual-modal fusion of the saturation and luminance channels of the eighth intermediate image in the HSV color space; The fourth intermediate image is obtained by integrating the color contrast information and texture brightness information in the third intermediate image according to the preset weighting coefficients. The second training image is obtained by applying the Scharr operator to the fourth intermediate image in both the horizontal and vertical directions for collaborative detection.