Pig sperm malformation detection method and detection system based on deep learning
Through deep learning algorithms and convolutional neural networks, the problem of subjectivity and low efficiency of traditional manual detection is solved, and the rapid and accurate detection and management support of pig sperm malformation rates is achieved.
Patent Information
- Application Number
- CN202510160239.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-07-22
AI Technical Summary
Traditional artificial microscopes detect the rate of sperm abnormalities in pigs, and it is difficult to achieve rapid screening of large-scale sperm samples.
The object detection algorithm based on deep learning was used to perform morphological detection of sperm, combined with quantitative analysis and result display, and automatic identification and quantitative analysis of malformed sperm was constructed by constructing a convolutional neural network, and rapid evaluation of sperm malformation rate was used using the Darknet-23 backbone network structure.
It realizes automated, rapid and accurate detection of pig sperm abnormality rates, improves detection efficiency and accuracy, reduces manual intervention, provides intuitive results display, and supports rapid detection and management decisions in breeding pig farms.
Smart Images

Figure CN120355644A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and a detection system for detecting pig sperm deformities based on deep learning. Background Art
[0002] The importance of pig sperm quality detection in breeding farms is self-evident, as it directly affects the final quality of the products. During this detection process, a key indicator is the sperm deformity rate. The level of the deformity rate is related to the sustainable development of breeding farms and the interests of farmers. Therefore, accurate detection and control of the pig sperm deformity rate are crucial.
[0003] In traditional methods, the detection of pig sperm deformity rate mainly relies on manual microscopic detection. Although this method can observe the subtle changes in sperm morphology, there are certain subjectivity and differences. This is because the detection results are affected by the personal experience and technical level of the detection personnel, and there may be deviations in the detection results of different personnel. In addition, manual microscopic detection has low efficiency and takes a long time, which is not conducive to the rapid screening of large-scale sperm samples. Summary of the Invention
[0004] Aiming at the deficiencies in the prior art, the purpose of the present invention is to provide a deep learning-based pig sperm deformity detection system that aims to automatically and accurately perform morphological analysis of sperm, and quickly output the deformity rate of the semen and its deformity quality assessment level through statistical means.
[0005] The technical solution adopted by the present invention to solve its technical problems is as follows:
[0006] A method for detecting pig sperm deformities based on deep learning, comprising the following steps:
[0007] Performing morphological detection on sperm through a deep learning object detection algorithm to identify deformed sperm;
[0008] Performing quantitative analysis on the sperm that have completed morphological detection to determine the deformity rate of the sperm;
[0009] Displaying the results of the quantitative analysis, and highlighting when the deformity rate exceeds the threshold.
[0010] Preferably, the method for performing morphological detection on sperm through a deep learning object detection algorithm is as follows:
[0011] Sampling and detecting the submitted semen, injecting the sampled semen onto a detection plate, and then obtaining sperm pictures of multiple fields of view by a scanner;
[0012] Detecting all pig sperm in the scanned fields of view through a deep learning object detection algorithm;
[0013] Each sperm image and sperm field of view scanned by the scanner are detected one by one to complete continuous sampling of the sperm morphology of the sample in multiple fields of view.
[0014] Preferably, the method for constructing the deep learning object detection algorithm is as follows:
[0015] Construct multiple convolutional neural networks to be interconnected, and the output of layer A is used as the input of layer B;
[0016] Manually mark various abnormal sperm targets on the grayscale images collected by the camera with different features to obtain a training set;
[0017] Then input these marked pictures into the neural network for training. The weight values of each parameter in the initial network are all random. The core training idea is to perform gradient descent through the cost function and the backpropagation algorithm, and finally obtain better weights:
[0018] For each sample X in the training set, set the activation value corresponding to the input layer:
[0019] Forward propagation:
[0020] z l = w l a l-1 + b l ;
[0021] a l = σ(z l )
[0022] Calculate the error generated by the output layer:
[0023]
[0024] Backpropagation error:
[0025] δ l = ((w l+1 ) T δ l+1 ) ⊙ σ′(z l )
[0026] Gradient descent:
[0027]
[0028] The weight values of the parameters in each layer of the network can be continuously optimized; at the same time, the map index is used to evaluate the output effect of the current weight. After repeating the calculation / training for multiple rounds, a set of better weight values can be obtained; then the weight data and the network structure are exported as a model, and an AI model for identifying sperm deformity types can be obtained.
[0029] Preferably, the method for quantitatively analyzing the sperm after morphological detection is as follows:
[0030] Perform a secondary screening on the abnormal sperm in all fields of view, and calculate the various abnormal rates by comparing with the total number of sperm.
[0031] According to the historical abnormal data of this pig in the database, perform regression analysis and correction on the current abnormal rate.
[0032] Preferably, the method for displaying the quantitative analysis results is as follows:
[0033] After determining the proportions of various abnormalities of this sperm sample through quantitative analysis, display its data blocks in descending order of the increment ratio, and organize the abnormal data into charts.
[0034] Another technical problem to be solved by the present invention is to provide a pig sperm abnormality detection system based on deep learning, including:
[0035] A data acquisition and preprocessing module, which is used to collect sperm image data and preprocess the images.
[0036] A target detection module, which uses a deep learning target detection algorithm to perform morphological detection on sperm. This module can identify sperm in the image and determine whether they are abnormal sperm.
[0037] A quantitative analysis module, which quantitatively analyzes the sperm after morphological detection, and determines the abnormal rate of sperm by calculating the number of abnormal sperm and the total number of sperm.
[0038] A result display module, which displays the quantitative analysis results for users to view and analyze. When the abnormal rate exceeds a preset threshold, it reminds the user by highlighting.
[0039] Preferably, the backbone network structure used in the deep learning target detection algorithm is Darknet-23.
[0040] Preferably, this target detection module further includes a color marking module, which is used to mark different types of sperm with origin points of different colors.
[0041] Another technical problem to be solved by the present invention is to provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method for detecting pig sperm abnormalities based on deep learning as described in any one of the above.
[0042] Another technical problem to be solved by the present invention is to provide a computer storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for detecting porcine sperm deformity based on deep learning as described in any one of the above are implemented.
[0043] The beneficial effects of the present invention are as follows:
[0044] Through this solution, the automation effect of detecting the porcine sperm deformity rate is realized, and at the same time, different results from the traditional ones are shown, such as the bar chart of the deformity rate and the display of the deformity class set. This system can assist the staff of the breeding farm to quickly detect and analyze the quality of the semen of breeding pigs, greatly saving the time of traditional microscopic examination. Description of the Drawings
[0045] Figure 1 are several porcine sperm field-of-view images obtained by a scanner;
[0046] Figure 2 is the result of morphological deformity detection of porcine sperm;
[0047] Figure 3 is part of the results of quantitative analysis of the porcine sperm deformity detection system;
[0048] Figure 4 is the report page of the porcine sperm deformity detection system. Detailed Embodiments
[0049] The principles and features of the present invention will be described below with reference to the drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention. In the following paragraphs, the present invention will be described more specifically by way of example with reference to the drawings. The advantages and features of the present invention will be clearer according to the following description and the claims. It should be noted that the drawings are all in a very simplified form and use non-precise scales, and are only used to facilitate and clearly assist in explaining the purpose of the embodiments of the present invention.
[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs. The terms used in the description of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0051] Embodiment
[0052] Referring to Figures 1-4 as shown, a method for detecting porcine sperm deformity based on deep learning includes the following steps:
[0053] Detect the morphology of sperm using a deep learning object detection algorithm to identify abnormal sperm;
[0054] Conduct quantitative analysis on the sperm that have completed morphological detection to determine the sperm abnormality rate;
[0055] Display the results of quantitative analysis and highlight them when the abnormality rate exceeds the threshold.
[0056] By using a deep learning object detection algorithm, it is possible to detect the morphology of porcine sperm and accurately identify abnormal sperm. The deep learning algorithm has strong expressive power and feature extraction ability in processing images, and can effectively capture the morphological characteristics of sperm; this method uses a scanner to obtain sperm images of multiple fields of view and detects the porcine sperm in all scanned fields of view through the deep learning algorithm.
[0057] Compared with traditional manual detection methods, it can greatly improve the detection efficiency and speed; this method conducts sampling detection on the submitted semen samples, without any additional treatment or operation on the pigs, avoiding harm and discomfort to the pigs; by detecting each sperm image field of view obtained by the scanner one by one, continuous sampling of the sperm morphology of the sample in multiple fields of view is achieved. This continuous sampling can more comprehensively understand the morphological characteristics of porcine sperm and improve the detection accuracy.
[0058] The method for detecting the morphology of sperm using a deep learning object detection algorithm is as follows:
[0059] Conduct sampling detection on the submitted semen samples, inject the sampled semen onto the detection plate, and then obtain sperm images of multiple fields of view by a scanner;
[0060] Detect the porcine sperm in all scanned fields of view through a deep learning object detection algorithm;
[0061] Detect each sperm image field of view obtained by the scanner one by one to complete continuous sampling of the sperm morphology of the sample in multiple fields of view.
[0062] Since tens of millions of sperm can be contained in a submitted semen sample, it is unrealistic to detect them one by one. Therefore, a sampling detection scheme is adopted here. After extracting a few microliters of semen and injecting it into the detection plate, sperm images of several fields of view are obtained by a scanner. The results are as follows Figure 1 shown.
[0063] The method for constructing a deep learning object detection algorithm is as follows:
[0064] Construct multiple convolutional neural networks connected to each other, and the output of layer A is used as the input of layer B;
[0065] Manually mark various types of abnormal sperm targets on the grayscale images collected by the camera with different features to obtain a training set;
[0066] Then input these marked pictures into the neural network for training. The weight values of the parameters in the initial network are all random. The core training idea is to perform gradient descent through the cost function and the backpropagation algorithm, and finally obtain better weights:
[0067] For each sample X in the training set, set the activation value corresponding to the input layer:
[0068] Forward propagation:
[0069] z l =w l a l-1 +b l ;
[0070] a l =σ(z l );
[0071] Calculate the error generated by the output layer:
[0072]
[0073] Backpropagate the error:
[0074] δ l =((w l+1 ) T δ l+1 )⊙σ′(z l );
[0075] Gradient descent:
[0076]
[0077] The weight values of the parameters in each layer of the network can be continuously optimized; at the same time, the map index is used to evaluate the output effect of the current weights. After repeating the calculation / training for multiple rounds, a set of better weight values can be obtained; then the weight data and the network structure are exported as a model, and an AI model for identifying sperm deformity types can be obtained.
[0078] The backbone network structure used in this solution is an optimized version of Darknet-23, which is a lightweight CNN structure with few parameters and fast speed. Figure 2 The morphological detection results are shown, where sperm of different types are marked with origin points of different colors. Based on the detection results, the number of all abnormal categories in the field of view can be quickly and accurately counted.
[0079] The method for quantitative analysis of sperm that have completed morphological detection is:
[0080] Calculation of malformation rate: The malformed spermatozoa in all fields of view are screened twice, and various malformation rates are calculated by comparing with the total number of spermatozoa. This process can be carried out manually or automatically. Usually, it is necessary to classify and count the malformed spermatozoa in order to accurately calculate various malformation rates;
[0081] Correction of historical data: According to the historical malformation data of this pig in the database, regression analysis is carried out on the current malformation rate. The purpose of this step is to correct the current malformation rate through the information of the pig's historical data to improve its accuracy and reliability. This step usually requires using statistical methods to analyze historical data and establishing a regression model to predict the corrected value of the current malformation rate.
[0082] By calculating the malformation rate and correcting the historical data, the semen quality of the pig can be evaluated more accurately, thus better guiding the decision-making of breeding management; By using historical data for correction, the influence of individual differences and environmental changes of the pig on semen quality can be better considered.
[0083] By using tools such as computer software for automated analysis, the efficiency and accuracy can be improved, and the risk of manual intervention can be reduced.
[0084] After determining the proportion of various malformations of this sperm sample through quantitative analysis, its data blocks are displayed in descending order of the increase ratio, and the malformation data is organized into charts, such as Figure 3 shown and Figure 4 shown.
[0085] Another technical problem to be solved by the present invention is to provide a pig sperm malformation detection system based on deep learning, including:
[0086] A data acquisition and preprocessing module, which is used to collect sperm image data and preprocess the images;
[0087] A target detection module, which uses a deep learning target detection algorithm to perform morphological detection on spermatozoa. This module can identify spermatozoa in the image and determine whether they are malformed spermatozoa;
[0088] A quantitative analysis module, which performs quantitative analysis on the spermatozoa that have completed morphological detection, and determines the malformation rate of spermatozoa by calculating the number of malformed spermatozoa and the total number of spermatozoa;
[0089] A result display module, which displays the quantitative analysis results for users to view and analyze. When the malformation rate exceeds a preset threshold, the user is reminded by highlighting.
[0090] The backbone network structure used in the described deep learning object detection algorithm is Darknet-23. The object detection module further includes a color marking module for marking sperm of different types with origin points of different colors.
[0091] Darknet-23 is a lightweight deep convolutional neural network with high computational efficiency and accuracy. It can effectively process large-scale data sets and quickly and accurately detect objects in images; the color marking module can mark sperm of different types with origin points of different colors, making it more intuitive and convenient to identify and distinguish different types of sperm. Such a marking method can help users better understand and analyze the detection results.
[0092] Through the color marking method, the type and position information of the detected sperm can be visually displayed on the image. This helps to quickly analyze and evaluate semen quality and better guide breeding management decisions; this solution can be customized and extended as needed, such as adding other feature extraction modules or optimizing algorithms to further improve detection performance and accuracy.
[0093] This embodiment also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-described deep learning-based pig sperm malformation detection method are implemented.
[0094] This embodiment also provides a computer storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-described deep learning-based pig sperm malformation detection method are implemented.
[0095] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0096] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.
[0097] The above embodiments of the present invention do not limit the protection scope of the present invention. The implementation manners of the present invention are not limited thereto. All kinds of modifications, substitutions, or changes made to the above structure of the present invention according to the above content of the present invention, in accordance with the common general knowledge and conventional means in the art, without departing from the above basic technical idea of the present invention, shall fall within the protection scope of the present invention.
Claims
1. A method for detecting abnormal pig sperm based on deep learning, characterized in that, It includes the following steps: Perform morphological detection on sperm using a deep learning object detection algorithm to identify abnormal sperm; Conduct quantitative analysis on the sperm that have completed morphological detection to determine the sperm abnormality rate; Display the results of quantitative analysis. When the abnormality rate exceeds the threshold, highlight it.
2. The method for detecting abnormal pig sperm based on deep learning according to claim 1, wherein The method of performing morphological detection on sperm using a deep learning object detection algorithm is as follows: Perform sampling detection on the semen submitted for inspection. Inject the sampled semen onto the detection plate, and then obtain sperm images of multiple fields of view by a scanner; Detect the pig sperm in all scanned fields of view using a deep learning object detection algorithm; Detect each sperm image sperm field of view scanned by the scanner one by one, thereby completing continuous sampling of the sperm morphology of the sample in multiple fields of view.
3. The method for detecting malformed pig sperm based on deep learning according to claim 1, characterized in that, The method of constructing a deep learning object detection algorithm is as follows: Construct multiple convolutional neural networks connected to each other, and the output of layer A is used as the input of layer B; Manually mark various abnormal sperm targets on the grayscale images collected by the camera with different features to obtain a training set; Then input these marked images into the neural network for training. The weight values of the parameters in the initial network are all random. The core training idea is to perform gradient descent through the cost function and the backpropagation algorithm, and finally obtain better weights: For each sample X in the training set, set the activation value corresponding to the input layer: Forward propagation: z l = w l a l-1 + b l ; a l = σ(z l )); Calculate the error generated by the output layer: Backpropagate the error: δ l = ((w l+1 ) T δ l+1 ) ⊙ σ′(z l ); Gradient descent: The weight values of the parameters in each layer of the network can be continuously optimized; at the same time, use the map index to evaluate the output effect of the current weights. After repeating the calculation / training for multiple rounds, a set of better weight values can be obtained; then export the weight data and the network structure as a model, and an AI model for identifying sperm abnormality types can be obtained.
4. The method for detecting malformed pig sperm based on deep learning according to claim 1, characterized in that, The method of performing quantitative analysis on the sperm that have completed morphological detection is as follows: Perform secondary screening on the abnormal sperm in all fields of view, and calculate various abnormality rates by comparing with the total number of sperm; According to the historical abnormality data of this pig in the database, perform regression analysis and correction on the current abnormality rate.
5. The method for detecting abnormal pig sperm based on deep learning according to claim 1, wherein The method of displaying the results of quantitative analysis is as follows: After determining the proportion of various abnormalities of this portion of sperm through quantitative analysis, display its data blocks in descending order of the increment ratio, and organize the abnormality data into a chart.
6. A pig sperm malformation detection system based on deep learning, characterized in that, It includes: A data collection and preprocessing module, which is used to collect sperm image data and preprocess the images; An object detection module, which uses a deep learning object detection algorithm to perform morphological detection on sperm. This module can identify sperm in the image and determine whether they are abnormal sperm; A quantitative analysis module, which conducts quantitative analysis on the sperm that have completed morphological detection. By calculating the number of abnormal sperm and the total number of sperm, it determines the sperm abnormality rate; A result display module, which displays the results of quantitative analysis for users to view and analyze. When the abnormality rate exceeds the preset threshold, it reminds the user by highlighting.
7. The pig sperm malformation detection system based on deep learning according to claim 1, characterized in that, The backbone network structure used by the described deep learning object detection algorithm is Darknet-23.
8. The pig sperm malformation detection system based on deep learning according to claim 1, characterized in that, This object detection module also includes a color marking module, which is used to mark different types of sperm with origin points of different colors.
9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the deep learning-based pig sperm malformation detection method according to any one of claims 1-5.
10. A computer storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps of the deep learning-based pig sperm malformation detection method according to any one of claims 1-5.