Boar semen quality analysis method, device, equipment and medium

The video of boar semen in the cloud was recorded and uploaded through a microscope camera, and the sperm trajectory recognition and analysis was used to solve the problems of high artificial dependence and large equipment size in the existing technology, achieving efficient, accurate and low-cost semen quality analysis.

CN119625591APending Publication Date: 2025-03-14MUYUAN FOOD GROUP CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411478746.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The existing boar semen vitality detection methods have problems such as high artificial dependence, cumbersome process, low accuracy, large equipment size, and unsuitable for on-site use.

Method used

The semen video is recorded through a microscope camera and uploaded to the cloud. The video is image-based intercepted and analyzed using AI algorithms, identified and tracked the sperm trajectory, calculated and scored, and finally gave the vitality score of the semen.

Benefits of technology

It realizes automated, efficient, accurate and low-cost boar semen quality analysis, reduces operational complexity and use cost, and improves the objectivity and accuracy of the results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625591A_ABST
    Figure CN119625591A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of breeding equipment, and particularly discloses a boar semen quality analysis method, device, equipment and medium, and the method comprises the following steps: 1) collecting a semen sample video, and uploading the video to a cloud; 2) performing frame extraction on the video to form an image, and performing pre-processing; 3) identifying information in the image; 4) tracking the sperms in the image according to the identification result; 5) analyzing and calculating a tracking trajectory result; and 6) scoring according to a calculation result, and outputting seminal fluid quality evaluation. Through a video monitoring function of a microscope camera, a semen video is recorded and uploaded to a cloud end (computer equipment does not need to be arranged through cloud end design), the video is subjected to picture interception and analysis through an AI algorithm, each sperm in the semen video is identified and tracked, a tracking result is analyzed and scored, and the sperm tracking accuracy is improved. And finally, giving out the activity score of the seminal fluid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of breeding equipment, and in particular relates to a boar semen quality analysis method, device, equipment and medium. Background Art

[0002] With the rapid development of global intelligence, more and more intelligent technologies are being applied to traditional agriculture and animal husbandry industries. Enhancing corporate competitiveness and improving automation and intelligence levels have become important goals of corporate development.

[0003] Boar semen motility testing is an important means of evaluating boar reproductive capacity in the pig industry. Semen motility directly affects the success rate of insemination and reproductive efficiency. Therefore, accurate and rapid evaluation of semen motility is of great significance to the pig industry. Traditional methods for semen motility testing mainly include manual microscope analysis and computer-assisted sperm analysis system (CASA).

[0004] However, manual microscope analysis has the following problems: ① High dependence on manual labor: Manual microscope analysis relies on the experience and skills of the boar station laboratory technicians and is easily affected by human factors, resulting in subjectivity and inconsistency in the results; ② The process is cumbersome and the accuracy is low: After the boar semen is transported out of the boar station, on-site personnel are required to use a manual microscope to shoot a video and transmit it to the boar station laboratory technician for online verification. The process is complicated, and the video shooting effect is affected by human factors, which poses a risk of misjudgment.

[0005] The computer-assisted sperm analysis system (CASA) has the following problems: ① Algorithm limitations: Traditional CASA systems mostly use rule-based image processing algorithms, which have limited processing capabilities for the complexity of sperm morphology and motion trajectory. Especially in the case of dense or overlapping sperm, the detection accuracy is affected, the error range of the test results is large, and the semen quality cannot be correctly evaluated, and it cannot effectively support on-site business needs; ② Volume limitations: The CASA system is a computer software and must be used with a computer device. It is large in size, which is not conducive to transportation and on-site use. Summary of the invention

[0006] In order to overcome the above-mentioned shortcomings of the prior art, the present invention provides a boar semen quality analysis method, device, equipment and medium to solve the above-mentioned problems.

[0007] To achieve the above object, the first aspect of the present invention discloses a method for analyzing boar semen quality, comprising the following steps:

[0008] 1) Collect semen sample video and upload the video to the cloud;

[0009] 2) Extract the video frames into images and perform pre-processing;

[0010] 3) Identify information in the image;

[0011] 4) Tracking the sperm trajectory in the image according to the recognition results;

[0012] 5) Analyze and calculate the tracking trajectory results;

[0013] 6) Score the results based on the calculations and output the semen quality evaluation.

[0014] Compared with the prior art, the present application has the following effects: The purpose of the present invention is to provide an algorithm suitable for boar semen vitality detection, which records semen video and uploads it to the cloud through the video monitoring function of a microscope camera (no computer equipment is required through cloud design), captures and analyzes the video in pictorial form through an AI algorithm, identifies and tracks each sperm in the semen video, analyzes and scores the tracking results, and finally gives a semen vitality score.

[0015] At the same time, the present invention uses the deep learning network YOLOv5 to identify sperm in the video, uses BOT-SORT to track the recognition results, and optimizes the recognition results. The powerful recognition ability of YOLOv5 reduces the hardware requirements for the equipment and the operation requirements for the operator, and supports the use of common slides and glass rods instead of fixed volume slides and pipettes on the device side, which greatly reduces the operation complexity and use cost. At the same time, each sperm in the result is screened, filtered and weighted, which further improves the algorithm's fault tolerance for images, making the results more objective and accurate, and finally achieving a balance of automation, efficiency, accuracy and low cost on the equipment.

[0016] Furthermore, it also includes performing a self-check before step 1) to determine whether the device can form images normally and whether the images are usable.

[0017] Furthermore, the self-check performs the following operations:

[0018] 101) converting the acquired semen sample image from an RGB image into a grayscale image;

[0019] 102) Extract the eigenvalue of the grayscale image. If the eigenvalue is less than the threshold, re-collect the image. If the eigenvalue is greater than the threshold, upload the image to the cloud.

[0020] 103) The cloud calls the sperm recognition module to detect the number of sperm in the image and output the result;

[0021] 104) If the sperm count is greater than or equal to the set value, the test is passed; otherwise, the test is failed, and the user is prompted to adjust the fine focus knob, reacquire the semen sample image, and perform a self-test operation.

[0022] Furthermore, the step 2) performs the following operations:

[0023] 201) Use opencv to read the video, get each frame image, and convert it into RGB mode;

[0024] 202) Use opencv to normalize the image by dividing it by 255.0;

[0025] 203) Use OpenCV to scale the image to the size of the input image required by the model used by the image analysis module.

[0026] Further, the step 3) performs the following operations:

[0027] 301) Define the object category in the microscope image as sperm, collect and annotate the data set;

[0028] 302) Use the YOLOv5 pre-trained model, adjust the category to 1 category, and perform transfer learning;

[0029] 303) The above training model is used to analyze the image after pre-processing in step 3, and the sperm prediction box in the image is output.

[0030] Furthermore, the step 4) performs the following operations:

[0031] 401) obtaining the predicted frame of sperm in each frame of the image outputted in step 3);

[0032] 402) Increase the prediction box by 30 pixels in the top, bottom, left and right directions to increase the tracking range;

[0033] 403) putting the enlarged prediction box of each frame into the BoT-SORT tracker for association tracking;

[0034] 404) obtain the tracking trajectory of each sperm in the video.

[0035] Furthermore, the step 5) performs the following operations:

[0036] 501) obtaining the trajectory coordinate point of each sperm in the video after step 4);

[0037] 502) filtering out sperms with sperms present in frames less than 5;

[0038] 503) Calculate the indicators of each sperm in the video respectively, including total distance, total displacement, total time, total average distance, VCL, VSL, VAP, STR, LIN, WOB, and weight.

[0039] Further, the step 6) performs the following operations:

[0040] 601) obtaining the above-mentioned index of each sperm in step 5);

[0041] 602) According to different threshold setting conditions, the number of sperms that are alive, moving forward, and not fully warmed up are screened out;

[0042] 603) Score the sperm count according to the above, and output the viability, vitality value, and degree of inadequate warming to evaluate the semen quality.

[0043] In a second aspect, the present application discloses a boar semen quality analysis device, comprising:

[0044] Video collection and upload module, used to collect semen sample videos and upload them to the cloud;

[0045] The video processing module extracts the above video frames into images and performs pre-processing;

[0046] A sperm recognition module recognizes the information in the above image;

[0047] Sperm tracking module, which tracks the sperm in the image based on the recognition results;

[0048] Trajectory analysis module, which analyzes and calculates the tracking trajectory results;

[0049] The scoring module scores according to the calculation results and outputs the semen quality evaluation.

[0050] In a third aspect, the present application discloses an electronic device, comprising:

[0051] Memory, used to store computer programs;

[0052] A processor is used to execute the computer program to implement the steps of the aforementioned boar semen quality analysis method.

[0053] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned boar semen quality analysis method are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0055] Figure 1 A flow chart of a boar semen quality analysis method according to an embodiment of the present invention;

[0056] Figure 2Three groups of pictures are collected for the continuous frames of the 21-30 minute semen video of the embodiment of the present invention;

[0057] Figure 3 This is a 21-30 minute semen trajectory picture of an embodiment of the present invention;

[0058] Figure 4 Three groups of pictures are collected for the continuous frames of the semen video with scores of 91-100 in the embodiment of the present invention;

[0059] Figure 5 This is a 91-100 point semen trajectory picture of an embodiment of the present invention. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] Algorithm-related terms used in this application:

[0062] 1. VCL (curvilinear velocity), i.e., curve velocity (μm / s). The average velocity of the sperm head along its actual curve, i.e., the two-dimensional motion trajectory seen under a microscope, reflects the motility of sperm;

[0063] 2. VSL [straight-line (rectilinear) velocity], i.e. linear velocity (μm / s). The average velocity of the sperm head in linear motion between the initial position of the test and the final position;

[0064] 3. VAP (average path velocity), that is, average path velocity (μm / s). The average speed of the sperm head moving along its average path. The average path is calculated by smoothing the actual curve trajectory according to the algorithm of the CASA instrument. The algorithm varies from instrument to instrument, so the values ​​obtained by different CASA systems may not be comparable;

[0065] 4. LIN (linearity), that is, linearity. The linearity of the curved path, VSL / VCL;

[0066] 5. WOB (wobble), which is the swing value of the actual curve path relative to the average path, VAP / VCL;

[0067] 6. STR (straightness), that is, forwardness. The straightness of the average path, VSL / VAP;

[0068] 7. Weight: the number of frames each sperm exists in the video divided by the total number of frames in the video;

[0069] 8. Video analysis technology: Video analysis technology uses computer image visual analysis technology to extract the information of interest from each frame of the collected video and output the analysis results by combining the information of the previous and next frames;

[0070] 9. Opencv: an open source, cross-platform computer vision and machine learning software library;

[0071] 10. Machine Learning: Machine learning is a branch of artificial intelligence that uses algorithms and statistical models to enable computers to perform pattern recognition and decision-making without explicit programming. The process of machine learning usually includes data input, model training, verification, and prediction. By learning from data, machine learning algorithms can automatically improve their performance and are widely used in image recognition, natural language processing, recommendation systems, and other fields;

[0072] 11. Deep learning: Deep learning is a subfield of machine learning. It simulates the working mode of the human brain based on multi-layer neural networks to process and analyze complex data. Deep learning models can automatically extract features and perform high-precision classification and prediction through large amounts of data training. Common deep learning models include convolutional neural networks (CNN), recurrent neural networks (RNN), and generative adversarial networks (GAN). Deep learning has achieved remarkable results in image recognition, speech recognition, natural language processing, and autonomous driving.

[0073] 12. Convolutional Neural Network: It is a deep learning model that is particularly suitable for processing image data. CNN can effectively extract the spatial features of images by introducing convolutional layers and pooling layers. It is widely used in image recognition, target detection, computer vision and other fields. The structure usually includes convolutional layers, pooling layers, activation functions and fully connected layers.

[0074] 13. YOLOv5 (You Only Look Once Version 5): YOLO is a real-time object detection system that uses a convolutional neural network to directly predict bounding boxes and class probabilities in an image. Unlike traditional object detection algorithms, YOLO significantly improves detection speed and efficiency by inputting the entire image into the network at once. The YOLO model divides the image into grids and predicts multiple bounding boxes and corresponding class probabilities in each grid. It can achieve real-time detection while maintaining high accuracy and is widely used in video surveillance, autonomous driving, and robot vision. YOLOv5 is the fifth version of YOLO.

[0075] 14. Kalman filter: Kalman filter is a recursive algorithm used to estimate the state of a dynamic system. It can predict and correct the system state in the presence of noise. It is widely used in navigation, control systems, and signal processing.

[0076] 15. Hungarian algorithm: The Hungarian algorithm is a polynomial time algorithm for solving bipartite graph matching problems, especially suitable for optimal matching problems such as task allocation and resource allocation;

[0077] 16. BoT-SORT: It is an advanced multi-target tracking algorithm. It manages the target status (appearance, disappearance, reappearance) through byte-level tracking, improves the robustness and continuity of tracking, uses the Kalman filter to predict and update the target's motion state, making the tracking process smoother and more accurate, and uses the Hungarian algorithm to solve the association problem between the tracked target and the detection result. By minimizing the association cost function, efficient target matching is achieved. It uses a dual-branch network to extract the target's appearance features and motion features, and then uses these features to track the target.

[0078] like Figure 1 To achieve the above-mentioned purpose, the first aspect of the present invention discloses a method for analyzing boar semen quality, comprising the following steps:

[0079] 1) Collect semen sample video and upload the video to the cloud;

[0080] 2) Extract the video frames into images and perform pre-processing;

[0081] 3) Identify information in the image;

[0082] 4) Tracking the sperm trajectory in the image according to the recognition results;

[0083] 5) Analyze and calculate the tracking trajectory results;

[0084] 6) Score the results based on the calculations and output the semen quality evaluation.

[0085] Compared with the prior art, the present application has the following effects: The purpose of the present invention is to provide an algorithm suitable for boar semen vitality detection, which records semen video and uploads it to the cloud through the video monitoring function of a microscope camera (no computer equipment is required through cloud design), captures and analyzes the video in pictorial form through an AI algorithm, identifies and tracks each sperm in the semen video, analyzes and scores the tracking results, and finally gives a semen vitality score.

[0086] At the same time, the present invention uses the deep learning network YOLOv5 to identify sperm in the video, uses BOT-SORT to track the recognition results, and optimizes the recognition results. The powerful recognition ability of YOLOv5 reduces the hardware requirements for the equipment and the operation requirements for the operator, and supports the use of common slides and glass rods instead of fixed volume slides and pipettes on the device side, which greatly reduces the operation complexity and use cost. At the same time, each sperm in the result is screened, filtered and weighted, which further improves the algorithm's fault tolerance for images, making the results more objective and accurate, and finally achieving a balance of automation, efficiency, accuracy and low cost on the equipment.

[0087] It should be noted that the analyzer in the prior art does not use the deep learning network YOLOv5 to identify sperm in the video, so it is necessary to use a fixed volume slide and a pipette on the device side. Not only is the operation cumbersome, but the fixed volume slide is disposable, so the cost is relatively high. After using this algorithm, the used slides can be reused, which greatly reduces the cost.

[0088] Continuing with the above embodiment, it is more preferred that, in order to ensure the accuracy of the subsequent execution steps and the accuracy of the results, in order to find problems early and solve them early, it also includes performing a self-check before step 1), that is, first obtaining a semen sample image or video. This application takes the image as an example, and performs a self-check on the image to determine whether the device can form an image normally and whether the image is usable (such as whether the image is clear). Step 1 is then performed on the semen that passes the self-check). In other words, if the self-check result shows that the device cannot form an image normally or the image is unclear, an alarm will be sent to remind the operator to adjust the fine focus screw of the microscope to make the image clear, so as to prevent the unclear image from affecting the judgment result of the subsequent steps, thereby affecting the final detection result.

[0089] Continuing with the above embodiment, more specifically, the self-check performs the following operations:

[0090] 101) When the person clicks to start analysis, the acquired semen sample image is converted from an RGB image to a grayscale image;

[0091] 102) Extracting eigenvalues ​​of the grayscale image, if the eigenvalue is less than the threshold, re-collecting, if the eigenvalue is greater than the threshold (500), uploading the image to the cloud, wherein the sum of the squares of the difference in the grayscale values ​​of the interval pixels is taken as the eigenvalue;

[0092] 103) The cloud calls the sperm recognition module to detect the number of sperm in the image and output the result;

[0093] 104) If the sperm count is greater than or equal to the set value (the set value is set according to the different densities of semen), the test is passed; otherwise, the test is failed, and the user is prompted to adjust the fine focus knob, reacquire the semen sample image, and perform a self-test operation.

[0094] Continuing with the above embodiment, more specifically, the step 1) performs the following operations:

[0095] 1. The specific operation of shooting videos is as follows: use a special microscope + industrial camera to ensure the imaging effect. For the business scenario of boar semen detection, use an achromatic inverted optical path; to eliminate edge blur, use a flat field objective; to eliminate the influence of light spots, use an extinction spiral + a lens barrel covered with extinction paper; to make sperm imaging clearer, use an industrial camera with a resolution of 1920*1080, a target surface of 1 / 1.8 inches and a pixel size of 2.0um, and a built-in image polarization processing program and automatic exposure function; use an E-plan-10X objective.

[0096] 2. The specific operation of video uploading is as follows: upload the video to the cloud through the APP module, wherein the APP module can be loaded on electronic devices such as mobile phones and tablets. The APP records a certain length of video (usually 3 seconds, which can be set freely). Since the video will be used for subsequent analysis, there are basic requirements for the quality of the video. The semen under the lens should be focused correctly, without flow, with few impurities and clear sperm; finally, use the mobile phone to upload the video to the cloud through the http protocol.

[0097] Continuing with the above embodiment, more specifically, the step 2) performs the following operations:

[0098] 201) Use opencv to read the video, get each frame image, and convert it into RGB mode;

[0099] 202) Use opencv to normalize the image by dividing it by 255.0;

[0100] 203) Use OpenCV to scale the image to the size of the input image required by the model used by the image analysis module.

[0101] Continuing with the above embodiment, more specifically, the step 3) performs the following operations:

[0102] 301) Define the object category in the microscope image as sperm, collect and annotate the data set;

[0103] 302) Use the YOLOv5 pre-trained model, adjust the category to 1 category, and perform transfer learning;

[0104] 303) The above training model is used to analyze the image after pre-processing in step 3, and the sperm prediction box in the image is output.

[0105] Continuing with the above embodiment, more specifically, the step 4) performs the following operations:

[0106] 401) obtaining the predicted frame of sperm in each frame of the image outputted in step 3);

[0107] 402) Increase the prediction box by 30 pixels in the top, bottom, left and right directions to increase the tracking range;

[0108] 403) putting the enlarged prediction box of each frame into the BoT-SORT tracker for association tracking;

[0109] 404) obtain the tracking trajectory of each sperm in the video.

[0110] Continuing with the above embodiment, more specifically, the step 5) performs the following operations:

[0111] 501) obtaining the trajectory coordinate point of each sperm in the video after step 4);

[0112] 502) filtering out sperms with sperms present in frames less than 5;

[0113] 503) Calculate the indicators of each sperm in the video respectively, including total distance, total displacement, total time, total average distance, VCL, VSL, VAP, STR, LIN, WOB, and weight.

[0114] The indicator calculation formula is as follows:

[0115] ①Total distance: the distance a sperm moves in the video

[0116] ②Total time: the time it takes for a sperm to move in the video

[0117] ③Total displacement: the displacement of a sperm in the video, the distance between the coordinates of the end point and the coordinates of the starting point

[0118] ④Total average distance: Take the average of the trajectory points of a sperm within half a second to form a new average trajectory point, add the first and last two points, that is, the average trajectory. The length of the average trajectory is the total average distance.

[0119] ⑤VCL: total distance / total time

[0120] ⑥VSL: total displacement / total time

[0121] ⑦VAP: Total average distance / total time

[0122] ⑧STR: VSL / VAP

[0123] ⑨LIN: VSL / VCL

[0124] ⑩WOB: VAP / VCL

[0125] Weight: the number of frames in which the sperm exists in the video / the total number of frames in the video

[0126] Continuing with the above embodiment, more specifically, the step 6) performs the following operations:

[0127] 601) obtaining the above-mentioned index of each sperm in step 5);

[0128] 602) The number of sperm that are alive, moving forward, and not fully warmed up is screened out according to different threshold setting conditions, wherein the threshold is determined as follows:

[0129] Setting conditions: If VCL ≥ 10 μm, the sperm is considered alive, and the number of alive sperm / total sperm number is the motility of semen;

[0130] If VCL is ≥ 15 μm and STR is ≥ 20%, the sperm is considered to be viable, and the number of viable sperm / total sperm count is the final viability value;

[0131] If the proportion of LIN < 0.15 is greater than 40%, it is considered that the sperm in the video may not have been fully warmed up and needs to be retested;

[0132] 603) Score the sperm count as above and output the viability, vitality value, and degree of inadequate warming to evaluate the semen quality. If the vitality value is ≥ 70%, the semen is considered qualified and is allowed to be distributed for use.

[0133] like Figure 2 An embodiment shown is a collection of three groups of pictures of continuous frames of semen video from 21 to 30 minutes. It can be seen from the three groups of pictures that only less than 30% of the sperm are in a forward motion state with a slow motion speed, and most of the sperm are in a dead state and have a clumping phenomenon; Figure 3 The example is shown as a 21-30 minute semen trajectory image. From the sperm trajectory image, each sperm has a square frame, with a recognition rate of 99%. The sperm has very few linear motion trajectories and very low forward motion. Figure 4 One embodiment shown is a collection of three groups of pictures of continuous frames of semen video from 91 to 100 minutes. It can be seen from the three groups of pictures that more than 90% of the sperm are in a forward motion state, and the motion speed is very fast; Figure 5 The example shown is a 91-100 point semen trajectory picture. From the sperm trajectory picture, the lines are very dense, and a large straight line trajectory almost covers the square frame, indicating that there are many sperm movement trajectories and almost all sperm are in a forward movement state.

[0134] Therefore, it can be clearly seen from the above four figures that the higher the score, the stronger the vitality of the semen, the denser the activity track of the semen, and the easier it is for the semen to complete mating with the sow. Therefore, the analyzer used by this algorithm can effectively analyze the vitality value of semen, thereby completing the quality analysis of semen.

[0135] It should be noted that, as can be seen from the above, the cloud is the server, the algorithm is implanted on the server for operation, the camera, microscope and other equipment are analyzers, and the APP is installed on mobile devices such as mobile phones. Among them, the working principle is that the analyzer transmits the semen sample video to the APP via wired or wireless transmission, and the APP transmits the video sample to the server via wireless transmission. The server calculates the algorithm for the video sample, and through algorithm analysis, the scoring result is fed back to the APP. The operator can clearly know the quality of the batch of semen by looking at the data displayed on the APP and then according to the semen quality evaluation standard, and draw a conclusion on whether to distribute the plant.

[0136] In a second aspect, the present application discloses a boar semen quality analysis device, comprising:

[0137] Video collection and upload module, used to collect semen sample videos and upload them to the cloud;

[0138] The video processing module extracts the above video frames into images and performs pre-processing;

[0139] A sperm recognition module recognizes the information in the above image;

[0140] Sperm tracking module, which tracks the sperm in the image based on the recognition results;

[0141] Trajectory analysis module, which analyzes and calculates the tracking trajectory results;

[0142] The scoring module scores according to the calculation results and outputs the semen quality evaluation.

[0143] The beneficial effects of the present application are to record semen videos and upload them to the cloud through the video monitoring function of the microscope camera (no computer equipment is required through cloud design), capture and analyze the videos in pictures through AI algorithms, identify and track each sperm in the semen video, analyze and score the tracking results, and finally give a semen vitality score.

[0144] In a third aspect, the present application discloses an electronic device, comprising:

[0145] Memory, used to store computer programs;

[0146] A processor is used to execute the computer program to implement the steps of the aforementioned boar semen quality analysis method.

[0147] In this embodiment, the power supply is used to provide working voltage for each hardware device on the electronic device; the communication interface can create a data transmission channel between the electronic device and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0148] Among them, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0149] In addition, the memory as a carrier for resource storage can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon include operating system, computer programs and data, etc. The storage method can be temporary storage or permanent storage.

[0150] Among them, the operating system is used to manage and control the hardware devices and computer programs on the electronic device to realize the processor's calculation and processing of the massive data in the memory, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the Chinese segmentation method performed by the electronic device disclosed in any of the aforementioned embodiments, the computer program can also further include a computer program that can be used to complete other specific tasks. In addition to data received by the electronic device and transmitted from an external device, the data can also include data collected by its own input and output interfaces.

[0151] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned boar semen quality analysis method are implemented.

[0152] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for analyzing boar semen quality, characterized in that: The following steps are involved: 1) Collect semen sample video and upload the video to the cloud; 2) Extract the video frames into images and perform pre-processing; 3) Identify information in the image; 4) Tracking the sperm trajectory in the image according to the recognition results; 5) Analyze and calculate the tracking trajectory results; 6) Score the results based on the calculations and output the semen quality evaluation.

2. A boar semen quality analysis method according to claim 1, characterized in that: It also includes performing a self-check before step 1) to determine whether the device can image normally and whether the image is usable.

3. A boar semen quality analysis method according to claim 2, characterized in that: The self-test performs the following operations: 101) converting the acquired semen sample image from an RGB image into a grayscale image; 102) Extract the eigenvalue of the grayscale image. If the eigenvalue is less than the threshold, re-collect the image. If the eigenvalue is greater than the threshold, upload the image to the cloud. 103) The cloud calls the sperm recognition module to detect the number of sperm in the image and output the result; 104) If the sperm count is greater than or equal to the set value, the test is passed; otherwise, the test is failed, and the user is prompted to adjust the fine focus knob, reacquire the semen sample image, and perform a self-test operation.

4. A boar semen quality analysis method according to claim 1, characterized in that: The step 2) performs the following operations: 201) Use opencv to read the video, get each frame image, and convert it into RGB mode; 202) Use opencv to normalize the image by dividing it by 255.0; 203) Use OpenCV to scale the image to the size of the input image required by the model used by the image analysis module.

5. A boar semen quality analysis method according to claim 4, characterized in that: The step 3) performs the following operations: 301) Define the object category in the microscope image as sperm, collect and annotate the data set; 302) Use the YOLOv5 pre-trained model, adjust the category to 1 category, and perform transfer learning; 303) The above training model is used to analyze the image after pre-processing in step 3, and the sperm prediction box in the image is output.

6. A boar semen quality analysis method according to claim 5, characterized in that: The step 4) performs the following operations: 401) obtaining the predicted frame of sperm in each frame of the image outputted in step 3); 402) Increase the prediction box by 30 pixels in the top, bottom, left and right directions to increase the tracking range; 403) putting the enlarged prediction box of each frame into the BoT-SORT tracker for association tracking; 404) obtain the tracking trajectory of each sperm in the video.

7. A boar semen quality analysis method according to claim 6, characterized in that: The step 5) performs the following operations: 501) obtaining the trajectory coordinate point of each sperm in the video after step 4); 502) filtering out sperms with sperms present in frames less than 5; 503) Calculate the indicators of each sperm in the video respectively, including total distance, total displacement, total time, total average distance, VCL, VSL, VAP, STR, LIN, WOB, and weight.

8. A boar semen quality analysis method according to claim 7, characterized in that: The step 6) performs the following operations: 601) obtaining the above-mentioned index of each sperm in step 5); 602) According to different threshold setting conditions, the number of sperms that are alive, moving forward, and not fully warmed up are screened out; 603) Score the sperm count according to the above, and output the viability, vitality value, and degree of inadequate warming to evaluate the semen quality.

9. A boar semen quality analysis device, characterized in that: include: Video collection and upload module, used to collect semen sample videos and upload them to the cloud; The video processing module extracts the above video frames into images and performs pre-processing; A sperm recognition module recognizes the information in the above image; Sperm tracking module, which tracks the sperm trajectory in the image based on the recognition results; Trajectory analysis module, which analyzes and calculates the tracking trajectory results; The scoring module scores according to the calculation results and outputs the semen quality evaluation.

10. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the boar semen quality analysis method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the boar semen quality analysis method according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Processing method based on sperm cell detection and storage medium

    CN121121402A