A method, device, equipment and storage medium for detecting sperm activity

By performing multi-level preprocessing on sperm video data, the problem of high-cost sperm motility detection has been solved, achieving low-cost, efficient, and accurate sperm motility detection.

CN115700758BActive Publication Date: 2026-07-24SUZHOU BASECARE MEDICAL DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU BASECARE MEDICAL DEVICE CO LTD
Filing Date
2022-11-09
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing methods for detecting sperm motility require laboratories and specialized instruments, are costly, have limited accessibility, and cannot balance algorithm processing speed and accuracy.

Method used

By acquiring sperm video data, at least two levels of preprocessing algorithms are used to process the video frame images, including operations such as dilation and erosion, filtering, binarization, gradient, and edge point removal, to determine the target trajectory data corresponding to the sperm video data, and then calculate sperm motility.

Benefits of technology

It reduces the cost of sperm motility testing, increases the accessibility of the testing method, and improves the testing speed and accuracy through optical imaging and processing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115700758B_ABST
    Figure CN115700758B_ABST
Patent Text Reader

Abstract

The application discloses a sperm activity detection method, device, equipment and storage medium. The method comprises the following steps: acquiring sperm video data collected by a video collection device; wherein the sperm video data comprises at least two video frame images; for each video frame image, at least two levels of preprocessing algorithms are adopted to sequentially perform preprocessing operations on the video frame image, and reference preprocessing image sets and target preprocessing images are obtained respectively; based on the reference preprocessing image sets and the target preprocessing images, target trajectory data corresponding to the sperm video data is determined; and based on the target trajectory data, sperm activity corresponding to the sperm video data is determined. The embodiment of the application takes into account the algorithm processing speed and the algorithm accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, apparatus, device, and storage medium for detecting sperm motility. Background Technology

[0002] In the process of sexual reproduction, sperm motility directly affects the mother's chances of conception; therefore, sperm motility testing is of paramount importance.

[0003] Current methods for detecting sperm motility require laboratory facilities and specialized instruments, such as high-speed photomicrography, laser light scattering measurement, and automated sperm function image analyzers. Therefore, current methods for detecting sperm motility are costly, have limited accessibility, and cannot simultaneously balance processing speed and accuracy. Summary of the Invention

[0004] This invention provides a method, apparatus, device, and storage medium for detecting sperm motility, which addresses the problem of high cost of detection equipment used in existing sperm motility detection methods, improves the accessibility of sperm motility detection methods, and balances algorithm processing speed and algorithm accuracy.

[0005] According to one embodiment of the present invention, a method for detecting sperm motility is provided, the method comprising:

[0006] Acquire sperm video data captured by a video acquisition device; wherein the sperm video data contains at least two video frame images;

[0007] For each video frame image, at least two levels of preprocessing algorithms are used to perform preprocessing operations on the video frame images sequentially, so as to obtain a reference preprocessed image set and a target preprocessed image respectively;

[0008] Based on each of the aforementioned reference preprocessed image sets and each of the aforementioned target preprocessed images, the target trajectory data corresponding to the sperm video data is determined;

[0009] Based on the target trajectory data, the sperm activity corresponding to the sperm video data is determined.

[0010] According to another embodiment of the present invention, a sperm motility detection device is provided, the device comprising:

[0011] A sperm video data acquisition module is used to acquire sperm video data collected by a video acquisition device; wherein the sperm video data contains at least two video frame images;

[0012] The target preprocessed image determination module is used to perform preprocessing operations on each video frame image sequentially using at least two levels of preprocessing algorithms to obtain a reference preprocessed image set and a target preprocessed image, respectively.

[0013] The target trajectory data determination module is used to determine the target trajectory data corresponding to the sperm video data based on each of the reference preprocessed image sets and each of the target preprocessed images;

[0014] The sperm activity determination module is used to determine the sperm activity corresponding to the sperm video data based on the target trajectory data.

[0015] According to another embodiment of the present invention, an electronic device is provided, the electronic device comprising:

[0016] Video capture equipment used to collect sperm video data;

[0017] At least one processor; and

[0018] A memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the sperm motility detection method according to any embodiment of the present invention.

[0020] According to another embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the sperm motility detection method according to any embodiment of the present invention.

[0021] The technical solution of this invention employs at least two levels of preprocessing algorithms to sequentially preprocess each video frame image in the sperm video data acquired by a video acquisition device, thereby obtaining a reference preprocessed image set and a target preprocessed image. The reference preprocessed image set contains at least one reference preprocessed image. Based on each reference preprocessed image set and each target preprocessed image, target trajectory data corresponding to the sperm video data is determined. Based on the target trajectory data, sperm activity corresponding to the sperm video data is determined. This solves the problem of high equipment costs in existing sperm activity detection methods, improves the accessibility of sperm activity detection methods, and enhances the processing speed of the sperm activity detection algorithm by using optical imaging and processing methods. Furthermore, determining the target trajectory data based on at least two preprocessed images improves the accuracy of the sperm activity detection algorithm.

[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A flowchart illustrating a method for detecting sperm motility according to an embodiment of the present invention;

[0025] Figure 2 This is a schematic diagram of a binarized image provided in one embodiment of the present invention;

[0026] Figure 3 A flowchart illustrating a method for determining target trajectory data according to an embodiment of the present invention;

[0027] Figure 4 This is a schematic diagram of target trajectory data provided in one embodiment of the present invention;

[0028] Figure 5 A flowchart illustrating another method for detecting sperm motility provided in one embodiment of the present invention;

[0029] Figure 6 This is a schematic diagram of an intermediate sperm image in a second intermediate reference image provided in an embodiment of the present invention;

[0030] Figure 7 This is a schematic diagram of an intermediate sperm image in a target reference image provided in an embodiment of the present invention;

[0031] Figure 8 This is a schematic diagram of the structure of a sperm motility detection device provided in one embodiment of the present invention;

[0032] Figure 9 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation

[0033] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0035] Figure 1 This is a flowchart illustrating a method for detecting sperm motility according to an embodiment of the present invention. This embodiment is applicable to situations where the motility of sperm samples is detected. The method can be executed by a sperm motility detection device, which can be implemented in hardware and / or software and can be configured in a terminal device. Figure 1 As shown, the method includes:

[0036] S110. Acquire sperm video data collected by the video acquisition device.

[0037] Specifically, the sperm video data is used to characterize the video data of the sperm sample placed in the container. For example, the recording duration of the video acquisition device can be 10 seconds or 5 seconds, etc., and the recording duration of the video acquisition device is not limited here. In this embodiment, the sperm video data includes at least two video frame images.

[0038] S120. For each video frame image, at least two levels of preprocessing algorithms are used to perform preprocessing operations on the video frame images in sequence, so as to obtain a reference preprocessed image set and a target preprocessed image respectively.

[0039] Specifically, the sperm video data is segmented into frames to obtain each video frame image. In this embodiment, the reference preprocessed image set includes at least one reference preprocessed image. Specifically, the reference preprocessed image can be used to represent the preprocessed image corresponding to the intermediate-level preprocessing algorithm, and the target preprocessed image can be used to represent the preprocessed image corresponding to the final-level preprocessing algorithm.

[0040] In one optional embodiment, at least two levels of preprocessing algorithms are used to sequentially perform preprocessing operations on video frame images to obtain a reference preprocessed image set and a target preprocessed image, including: using a first-level preprocessing algorithm to perform a first preprocessing operation on the video frame images to obtain a first intermediate reference image; wherein the first preprocessing algorithm includes a dilation and erosion algorithm; adding the first intermediate reference image as a reference preprocessed image to the reference preprocessed image set; and using a second-level preprocessing algorithm to determine the target preprocessed image based on the first intermediate reference image; wherein the second-level preprocessing algorithm includes a binarization algorithm, a gradient algorithm, and an edge point removal algorithm.

[0041] Specifically, in the first-level preprocessing stage, the dilation algorithm in the dilation-erosion algorithm is used to perform a dilation operation on the video frame image to obtain a dilated image. Then, the erosion algorithm in the dilation-erosion algorithm is used to perform an erosion operation on the dilated image to obtain a first intermediate reference image. The dilation-erosion algorithm is also known as the opening operation algorithm, which has the functions of eliminating small areas with high brightness, separating objects at fine points, and smoothing the boundaries of larger objects without significantly changing their area.

[0042] Based on the above embodiments, optionally, the first preprocessing algorithm further includes a filtering algorithm. Accordingly, the first-level preprocessing algorithm is used to perform a first preprocessing operation on the video frame image to obtain a first intermediate reference image, including: using a filtering algorithm to perform a filtering operation on the video frame image to obtain a filtered image, and using a dilation and erosion algorithm to perform a dilation and erosion operation on the filtered image to obtain a first intermediate reference image.

[0043] For example, the filtering algorithms include, but are not limited to, Gaussian filtering, mean filtering, median filtering, average filtering, and Kalman filtering, etc. The specific filtering algorithm used is not limited here.

[0044] The advantage of this setup is that it can eliminate interference factors in video frame images, further improve the image quality of preprocessed images, and thus improve the accuracy of sperm motility detection methods.

[0045] Specifically, in the second-level preprocessing process, a binarization algorithm is used to perform a binarization operation on the first intermediate reference image to obtain a binarized image. A gradient algorithm is used to perform gradient processing on the binarized image to obtain a gradient image. An edge removal algorithm is used to determine the target preprocessed image based on the gradient image.

[0046] Figure 2 This is a schematic diagram of a binarized image provided in one embodiment of the present invention. Specifically, Figure 2 Each white pixel in the image represents a sperm image.

[0047] In another optional embodiment, at least two levels of preprocessing algorithms are used to sequentially perform preprocessing operations on video frame images to obtain a reference preprocessed image set and a target preprocessed image, including: using a first-level preprocessing algorithm to perform a first preprocessing operation on the video frame images to obtain a second intermediate reference image; wherein the first preprocessing algorithm includes a dilation and erosion algorithm, a binarization algorithm, and a gradient algorithm; adding the second intermediate reference image as a reference preprocessed image to the reference preprocessed image set; and using a second-level preprocessing algorithm to determine the target preprocessed image based on the second intermediate reference image; wherein the second-level preprocessing algorithm includes an edge removal algorithm.

[0048] Specifically, in the first-level preprocessing process, the dilation algorithm in the dilation and erosion algorithm is used to perform a dilation operation on the video frame image to obtain a dilated image, and the erosion algorithm in the dilation and erosion algorithm is used to perform an erosion operation on the dilated image to obtain an eroded image. The binarization algorithm is used to perform a binarization operation on the eroded image to obtain a binarized image, and the gradient algorithm is used to perform gradient processing on the binarized image to obtain a second intermediate reference image.

[0049] Specifically, in the second-level preprocessing process, an edge removal algorithm is used to determine the target preprocessed image based on the first intermediate reference image.

[0050] In another optional embodiment, at least two levels of preprocessing algorithms are used to sequentially perform preprocessing operations on video frame images to obtain a reference preprocessed image set and a target preprocessed image, including: using a first-level preprocessing algorithm to perform a first preprocessing operation on the video frame images to obtain a first intermediate reference image; wherein the first preprocessing algorithm includes a dilation and erosion algorithm; using a second-level preprocessing algorithm to perform a second preprocessing operation on the first intermediate reference image to obtain a second intermediate reference image; wherein the second-level preprocessing algorithm includes a binarization algorithm and a gradient algorithm; determining a reference preprocessed image set based on the first intermediate reference image and / or the second intermediate reference image; and using a third-level preprocessing algorithm to determine the target preprocessed image based on the second intermediate reference image; wherein the third-level preprocessing algorithm includes an edge removal algorithm.

[0051] In one optional embodiment, determining a reference preprocessed image set based on a first intermediate reference image and / or a second intermediate reference image includes: adding the first intermediate reference image as a reference preprocessed image to the reference preprocessed image set; and / or adding the second intermediate reference image as a reference preprocessed image to the reference preprocessed image set. Specifically, the reference preprocessed image set includes the first intermediate reference image and / or the second intermediate reference image.

[0052] Specifically, in the first-level preprocessing stage, the dilation algorithm (part of the dilation and erosion algorithm) is used to dilate the video frame image to obtain a dilated image, and the erosion algorithm (part of the dilation and erosion algorithm) is used to erode the dilated image to obtain a first intermediate reference image. In the second-level preprocessing stage, a binarization algorithm is used to binarize the first intermediate reference image to obtain a binary image, and a gradient algorithm is used to perform gradient processing on the binary image to obtain a second intermediate reference image. In the third-level preprocessing stage, an edge removal algorithm is used to determine the target preprocessed image based on the second intermediate reference image.

[0053] S130. Based on each reference preprocessed image set and each target preprocessed image, determine the target trajectory data corresponding to the sperm video data.

[0054] Specifically, the target trajectory data is used to characterize the target trajectory of each sperm in the sperm sample during the recording time.

[0055] In one optional embodiment, the target trajectory data corresponding to the sperm video data is determined based on each reference preprocessed image set and each target preprocessed image, including: for each target sperm image in each target preprocessed image, determining at least one reference centroid coordinate corresponding to the target sperm image based on the target centroid coordinates corresponding to the target sperm image and the reference preprocessed image set; determining the average centroid coordinate based on the target centroid coordinate and each reference centroid coordinate; and determining the target trajectory data based on each average centroid coordinate corresponding to each target preprocessed image.

[0056] Specifically, for each target preprocessed image, image recognition is performed on the target preprocessed image to obtain at least one target sperm image corresponding to the target preprocessed image. In an optional embodiment, the method further includes: determining the target centroid coordinates corresponding to the target sperm image based on the minimum bounding matrix corresponding to the target sperm image.

[0057] For example, the target centroid coordinates M satisfy the formula:

[0058]

[0059] Where, m pqLet B denote the moment of the minimum bounding matrix, and let I(x,y) denote the minimum bounding matrix. Let I(x,y) denote the pixel value of the target preprocessed image at pixel position (x,y).

[0060] Specifically, for each reference preprocessed image, image recognition is performed on the reference preprocessed image to obtain at least one reference sperm image corresponding to the reference preprocessed image. In an optional embodiment, the method further includes: determining the coordinates of the centroid of the reference sperm image based on the minimum bounding matrix corresponding to the reference sperm image.

[0061] Specifically, for each reference preprocessed image, at least one distance error is determined based on the target centroid coordinates and at least one intermediate centroid coordinate corresponding to the reference preprocessed image, and the intermediate centroid coordinates that satisfy the preset error range of the distance error are used as the reference centroid coordinates corresponding to the target centroid coordinates.

[0062] Specifically, the average centroid coordinates are obtained by averaging the target centroid coordinates and at least one reference centroid coordinates.

[0063] Specifically, the average centroid coordinates of each target sperm image in the first frame of the preprocessed target image are obtained, and the target trajectory in the first frame is created based on each average centroid coordinate. The average trajectory G of the previous frame corresponding to the i-th sperm in the previous preprocessed target image is obtained. i And obtain the current average centroid coordinates of each current target sperm image in the current target preprocessed image, and compare each current average centroid coordinate with the average trajectory G of the previous frame. i Perform correlation matching. If a match is successful, then adjust the average trajectory G of the previous frame based on the current average centroid coordinates of the successfully matched frame. i Update the data to obtain the average trajectory G of the current frame corresponding to the i-th sperm. i If a match fails, a new target trajectory is created based on at least one of the current average centroid coordinates of the unmatched target. If the current target preprocessed image is the last frame of the target preprocessed image, the current frame's average trajectory G is... i The new target trajectory and the target trajectory are respectively used as the target trajectory in the target trajectory data.

[0064] In another optional embodiment, determining the average centroid coordinates based on the target centroid coordinates and each reference centroid coordinate includes: using the target centroid coordinates as the current target centroid coordinates, and determining the current target trajectory direction between the current target centroid coordinates and the previous average centroid coordinates corresponding to the current target centroid coordinates; for each reference centroid coordinate, using the reference centroid coordinates as the current reference centroid coordinates, and determining the current reference trajectory direction between the current reference centroid coordinates and the previous average centroid coordinates; determining the direction errors corresponding to the current target trajectory direction and at least one current reference trajectory direction, and determining the average centroid coordinates based on the current target centroid coordinates and the current reference centroid coordinates corresponding to the current reference trajectory direction whose direction errors satisfy a preset error range.

[0065] Specifically, the previous average centroid coordinate is used to represent the last average centroid coordinate in the average trajectory of the previous frame that is associated with and matched with the current target centroid coordinate.

[0066] Based on the above embodiments, optionally, if there is no previous average centroid coordinate corresponding to the current target centroid coordinate, it means that there is no previous frame average trajectory associated with and matched with the current target centroid coordinate. In this case, the current target centroid coordinate is used as the average centroid coordinate, or the average coordinate value corresponding to the current target centroid coordinate and each reference centroid coordinate is used as the average centroid coordinate.

[0067] Based on the above embodiments, optionally, if the direction errors corresponding to each current reference centroid coordinate do not meet the preset error range, then the current target centroid coordinate is used as the average centroid coordinate.

[0068] Figure 3 This is a flowchart illustrating a method for determining target trajectory data according to an embodiment of the present invention. Specifically, the target preprocessed image corresponding to the sperm video data is traversed. If the traversal is complete, the target trajectory data is determined based on the average centroid coordinates. If the traversal is not complete, the target preprocessed image P is then... i Preprocess the target image P i The target sperm image in the video is traversed. If the traversal is complete, the step of traversing the target preprocessed image corresponding to the sperm video data is repeated. If the traversal is not complete, the traversed target preprocessed image P is obtained. i Image of target sperm Q j The corresponding target centroid coordinates M j Determine whether there exists a centroid coordinate M that is related to the target. j The average trajectory G of the previous frame of the associated matching i-1 If not, then based on the target centroid coordinates M j and the coordinates M of the target centroid jAt least one corresponding reference centroid coordinate is used to determine the relationship with the target sperm image Q. j The corresponding average centroid coordinates. If so, then determine the target centroid coordinates M. j The trajectory direction relative to the previous average centroid coordinates, and the determination of the target centroid coordinates M. j Given at least one corresponding reference centroid coordinate and the trajectory direction corresponding to the previous average centroid coordinate, determine whether there are reference centroid coordinates whose direction error satisfies a preset error range. If so, based on the target centroid coordinate M... j And determine the reference centroid coordinates where the direction error meets the preset error range, and the average centroid coordinates; otherwise, set the target centroid coordinates M. j As the average centroid coordinates.

[0069] Figure 4 This is a schematic diagram of target trajectory data provided in one embodiment of the present invention. Specifically, Figure 4 The target trajectory of each sperm in the sperm video data is shown.

[0070] The advantage of this setting is that the trajectory direction of the target sperm image in the target preprocessed image can be corrected by referring to the trajectory direction of the reference sperm image in the preprocessed image, thereby further improving the accuracy of the target trajectory data and thus improving the accuracy of the sperm activity detection algorithm.

[0071] S140. Based on the target trajectory data, determine the sperm activity corresponding to the sperm video data.

[0072] In one optional embodiment, determining the sperm activity corresponding to the sperm video data based on the target trajectory data includes: determining the number of motile sperm corresponding to the target trajectory data based on the trajectory type of each target trajectory in the target trajectory data; and determining the sperm activity corresponding to the sperm video data based on the number of motile sperm and the total number of sperm corresponding to the target trajectory data.

[0073] Specifically, the trajectory type is obtained by fitting each target trajectory in the target trajectory data. Sperm with a non-linear trajectory type are identified as motile sperm, while sperm with a linear trajectory type are identified as inactive sperm.

[0074] Specifically, sperm motility = number of motile sperm / total number of sperm.

[0075] The advantage of this setup is that motile sperm in a sperm sample typically move forward with irregular twisting motion, while inactive sperm in the sample exhibit linear motility due to the flow of semen. Therefore, this embodiment of the invention effectively filters out inactive sperm from the sperm sample by selecting target trajectories from the target trajectory data based on trajectory type.

[0076] The technical solution of this embodiment employs at least two levels of preprocessing algorithms to sequentially preprocess each video frame image in the sperm video data acquired by the video acquisition device, obtaining a reference preprocessed image set and a target preprocessed image. The reference preprocessed image set contains at least one reference preprocessed image. Based on each reference preprocessed image set and each target preprocessed image, target trajectory data corresponding to the sperm video data is determined. Based on the target trajectory data, sperm activity corresponding to the sperm video data is determined. This solves the problem of high equipment cost in existing sperm activity detection methods, improves the accessibility of sperm activity detection methods, and improves the processing speed of the sperm activity detection algorithm by using optical imaging and processing methods. Furthermore, determining the target trajectory data based on at least two preprocessed images improves the accuracy of the sperm activity detection algorithm.

[0077] Figure 5 This is a flowchart of another sperm motility detection method provided in one embodiment of the present invention. This embodiment further refines the technical feature of "using a third-level preprocessing algorithm to determine the target preprocessing image based on a second intermediate reference image" in the above embodiment. For example... Figure 5 As shown, the method includes:

[0078] S210. Acquire sperm video data collected by the video acquisition device.

[0079] S220. For each video frame image, the first-level preprocessing algorithm is used to perform the first preprocessing operation on the video frame image to obtain the first intermediate reference image.

[0080] S230. Using a second-level preprocessing algorithm, perform a second preprocessing operation on the first intermediate reference image to obtain a second intermediate reference image.

[0081] S240. Determine a reference preprocessed image set based on the first intermediate reference image and / or the second intermediate reference image.

[0082] S250. For each intermediate sperm image in the second intermediate reference image, obtain the block images corresponding to the multiple image blocks covering the intermediate sperm image.

[0083] Specifically, image recognition is performed on the second intermediate reference image to obtain at least one intermediate sperm image. A preset number of image blocks are used to cover the intermediate sperm image, and block images corresponding to each image block in the second intermediate reference image are obtained. For example, the preset number of blocks may be 16*16 or 20*20, etc., and the preset number of blocks is not limited here.

[0084] Figure 6 This is a schematic diagram of an intermediate sperm image in a second intermediate reference image provided according to an embodiment of the present invention. Specifically, Figure 6 The area formed by the white pixels in the image represents a specific intermediate sperm image in the second intermediate reference image. Figure 6 The image within the box represents a block image. Specifically, a block image may contain part of an intermediate sperm image and part of a background region image, or it may not contain a background region image.

[0085] S260. For each block image, if the pixel values ​​of each pixel in the block image are different, the block image is treated as an edge point image.

[0086] Specifically, if the pixel values ​​of each pixel in the block image are different, it means that the block image contains part of the intermediate sperm image and part of the background area image, and the block image is used as the edge point image. If the pixel values ​​of each pixel in the block image are the same, it means that the block image does not contain the background area image.

[0087] S270. Replace the pixel values ​​of each edge point in the second intermediate reference image with the background pixel values ​​to obtain the target reference image.

[0088] Figure 7 This is a schematic diagram of an intermediate sperm image in a target reference image provided in an embodiment of the present invention. Specifically, it is shown below. Figure 6 For example, Figure 7 To Figure 6 The intermediate sperm image obtained after performing edge removal operation on the intermediate sperm image.

[0089] S280. Based on the target reference image, determine the target preprocessed image.

[0090] In one optional embodiment, the target reference image is used as the target preprocessed image. The advantage of this approach is that pixels located at edge points in the sperm image are easily affected by brightness noise. Edge removal can effectively reduce the impact of brightness noise, thereby further improving the image quality of the preprocessed image and consequently increasing the accuracy of the sperm motility detection algorithm.

[0091] In another optional embodiment, the third-level preprocessing algorithm further includes a boundary point filtering algorithm. Accordingly, based on the target reference image, the target preprocessing image is determined, including: performing gradient processing on the target reference image to obtain a gradient image; using the boundary point filtering algorithm to determine the target pixels in the target reference image based on the gradient values ​​of each pixel in the gradient image; and replacing the pixel values ​​corresponding to each target pixel in the target reference image with background pixels to obtain the target preprocessing image.

[0092] In one optional embodiment, a boundary point filtering algorithm is used to determine target pixels in the target reference image based on the gradient values ​​of each pixel in the gradient image. This includes: for each pixel in the gradient image, if the gradient value of the pixel is greater than a first gradient threshold, the pixel is designated as a boundary pixel; if the gradient value of the pixel is less than a second gradient threshold, the pixel is designated as a target pixel; if the gradient value of the pixel is greater than the second gradient threshold and less than the first gradient threshold, and if the set of adjacent pixels corresponding to the pixel does not contain a boundary pixel, then the pixel is designated as a target pixel; wherein the first gradient threshold is greater than the second gradient threshold.

[0093] Specifically, the set of adjacent pixels includes eight pixels adjacent to the current pixel: above, below, left, right, upper left, lower left, upper right, and lower right. If none of the pixels in the set of adjacent pixels are boundary pixels, the pixel is considered the target pixel. If the set of adjacent pixels contains at least one boundary pixel, the pixel is considered a boundary pixel.

[0094] The advantage of this setting is that it can further eliminate the influence of interference factors, improve the accuracy of target trajectory data, and thus improve the accuracy of sperm motility detection algorithms.

[0095] S290. Based on each reference preprocessed image set and each target preprocessed image, determine the target trajectory data corresponding to the sperm video data.

[0096] S291. Based on the target trajectory data, determine the sperm activity corresponding to the sperm video data.

[0097] The technical solution of this embodiment obtains block images corresponding to multiple image blocks covering the intermediate sperm images for each intermediate sperm image in the second intermediate reference image. For each block image, if the pixel values ​​of each pixel in the block image are different, the block image is used as an edge point image. The pixel values ​​of each pixel in the edge point image of the second intermediate reference image are replaced with background pixel values ​​to obtain the target reference image. Based on the target reference image, the target preprocessed image is determined. This solves the problem that the target preprocessed image is affected by brightness factors, eliminates the problem that the target preprocessed image is blurred due to changes in light intensity, improves the image quality of the target preprocessed image, and further improves the accuracy of the sperm activity detection algorithm.

[0098] Figure 8 This is a schematic diagram of a sperm motility detection device provided in one embodiment of the present invention. Figure 8 As shown, the device includes: a sperm video data acquisition module 310, a target preprocessing image determination module 320, a target trajectory data determination module 330, and a sperm activity determination module 340.

[0099] The sperm video data acquisition module 310 is used to acquire sperm video data collected by the video acquisition device; wherein the sperm video data contains at least two video frame images;

[0100] The target preprocessed image determination module 320 is used to perform preprocessing operations on each video frame image sequentially using at least two levels of preprocessing algorithms to obtain a reference preprocessed image set and a target preprocessed image respectively.

[0101] The target trajectory data determination module 330 is used to determine the target trajectory data corresponding to the sperm video data based on each reference preprocessed image set and each target preprocessed image.

[0102] The sperm motility determination module 340 is used to determine the sperm motility corresponding to the sperm video data based on the target trajectory data.

[0103] The technical solution of this embodiment employs at least two levels of preprocessing algorithms to sequentially preprocess each video frame image in the sperm video data acquired by the video acquisition device, obtaining a reference preprocessed image set and a target preprocessed image. The reference preprocessed image set contains at least one reference preprocessed image. Based on each reference preprocessed image set and each target preprocessed image, target trajectory data corresponding to the sperm video data is determined. Based on the target trajectory data, sperm activity corresponding to the sperm video data is determined. This solves the problem of high equipment cost in existing sperm activity detection methods, improves the accessibility of sperm activity detection methods, and improves the processing speed of the sperm activity detection algorithm by using optical imaging and processing methods. Furthermore, determining the target trajectory data based on at least two preprocessed images improves the accuracy of the sperm activity detection algorithm.

[0104] Based on the above embodiments, optionally, the target preprocessing image determination module 320 includes:

[0105] The first intermediate reference image determination unit is used to perform a first preprocessing operation on the video frame image using a first-level preprocessing algorithm to obtain a first intermediate reference image; wherein, the first preprocessing algorithm includes a dilation and erosion algorithm;

[0106] The second intermediate reference image determination unit is used to perform a second preprocessing operation on the first intermediate reference image using a second-level preprocessing algorithm to obtain a second intermediate reference image; wherein the second-level preprocessing algorithm includes a binarization algorithm and a gradient algorithm;

[0107] A reference preprocessed image set determination unit is used to determine a reference preprocessed image set based on a first intermediate reference image and / or a second intermediate reference image;

[0108] The target preprocessing image determination unit is used to determine the target preprocessing image based on the second intermediate reference image using a third-level preprocessing algorithm; wherein the third-level preprocessing algorithm includes an edge point removal algorithm.

[0109] Based on the above embodiments, optionally, the target preprocessing image determination unit includes:

[0110] The block image acquisition subunit is used to acquire block images corresponding to multiple image blocks covering the intermediate sperm image for each intermediate sperm image in the second intermediate reference image;

[0111] The edge point image determination subunit is used to treat each block image as an edge point image when the pixel values ​​of each pixel in the block image are different.

[0112] The target preprocessing image determination subunit is used to replace the pixel values ​​of each edge point in the second intermediate reference image with the background pixel values ​​to obtain the target reference image, and determine the target preprocessing image based on the target reference image.

[0113] Based on the above embodiments, optionally, the third-level preprocessing algorithm also includes a boundary point filtering algorithm. Correspondingly, the target preprocessing image determination subunit is specifically used for:

[0114] Gradient processing is performed on the target reference image to obtain the gradient image;

[0115] A boundary point filtering algorithm is used to determine the target pixel in the target reference image based on the gradient value of each pixel in the gradient image.

[0116] The pixel values ​​corresponding to each target pixel in the target reference image are replaced with background pixels to obtain the target preprocessed image.

[0117] Based on the above embodiments, optionally, the target preprocessing image determination subunit is specifically used for:

[0118] For each pixel in the gradient image, if the gradient value of the pixel is greater than the first gradient threshold, the pixel is regarded as a boundary pixel.

[0119] If the gradient value of a pixel is less than the second gradient threshold, the pixel is taken as the target pixel.

[0120] If the gradient value of a pixel is greater than the second gradient threshold but less than the first gradient threshold, and the set of adjacent pixels corresponding to the pixel does not contain boundary pixels, then the pixel is taken as the target pixel; wherein, the first gradient threshold is greater than the second gradient threshold.

[0121] Based on the above embodiments, optionally, the target trajectory data determination module 330 includes:

[0122] The reference centroid coordinate determination unit is used to determine at least one reference centroid coordinate corresponding to the target sperm image for each target sperm image in each target preprocessed image, based on the target centroid coordinates corresponding to the target sperm image and the reference preprocessed image set.

[0123] The target trajectory data determination unit is used to determine the average centroid coordinates based on the target centroid coordinates and the coordinates of each reference centroid, and to determine the target trajectory data based on the average centroid coordinates corresponding to each target preprocessed image.

[0124] Based on the above embodiments, optionally, the target trajectory data determination unit is specifically used for:

[0125] Use the target centroid coordinates as the current target centroid coordinates, and determine the current target trajectory direction between the current target centroid coordinates and the previous average centroid coordinates corresponding to the current target centroid coordinates;

[0126] For each reference centroid coordinate, the reference centroid coordinate is used as the current reference centroid coordinate, and the current reference trajectory direction between the current reference centroid coordinate and the previous average centroid coordinate is determined.

[0127] Determine the directional errors corresponding to the current target trajectory direction and at least one current reference trajectory direction, and determine the average centroid coordinates based on the current target centroid coordinates and the current reference centroid coordinates corresponding to the current reference trajectory direction whose directional errors satisfy a preset error range.

[0128] Based on the above embodiments, optionally, the sperm motility determination module 340 is specifically used for:

[0129] Based on the trajectory type of each target trajectory in the target trajectory data, determine the number of motile sperm corresponding to the target trajectory data;

[0130] Based on the number of motile sperm and the total number of sperm corresponding to the target trajectory data, the sperm activity corresponding to the sperm video data is determined.

[0131] The sperm motility detection device provided in this embodiment of the invention can execute the sperm motility detection method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method.

[0132] Figure 9 This is a schematic diagram of an electronic device provided according to one embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 10 may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown in this embodiment, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0133] like Figure 9As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor 11. The processor 11 can perform various appropriate actions and processes based on the computer programs stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0134] Multiple components in electronic device 10 are connected to I / O interface 15, including: input units, such as keyboard, mouse, etc.; in this embodiment, the input units include video acquisition device 16 for acquiring sperm video data; output units 17, such as various types of displays, speakers, etc.; storage units 18, such as disks, optical disks, etc.; and communication units 19, such as network cards, modems, wireless transceivers, etc. The communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0135] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as methods for detecting sperm motility.

[0136] In some embodiments, the sperm motility detection method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the sperm motility detection method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the sperm motility detection method by any other suitable means (e.g., by means of firmware).

[0137] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0138] Embodiment 5 of the present invention also provides a computer-readable storage medium storing computer instructions for causing a processor to execute a method for detecting sperm motility, the method comprising:

[0139] Acquire sperm video data captured by a video acquisition device; wherein the sperm video data contains at least two video frame images;

[0140] For each video frame image, at least two levels of preprocessing algorithms are used to perform preprocessing operations on the video frame images sequentially, resulting in a reference preprocessed image set and a target preprocessed image;

[0141] Based on each reference preprocessed image set and each target preprocessed image, the target trajectory data corresponding to the sperm video data is determined.

[0142] Based on the target trajectory data, the sperm activity corresponding to the sperm video data is determined.

[0143] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0144] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0145] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0146] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0147] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0148] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for detecting sperm motility, characterized in that, include: Acquire sperm video data captured by a video acquisition device; wherein the sperm video data contains at least two video frame images; For each video frame image, at least two levels of preprocessing algorithms are used to sequentially perform preprocessing operations on the video frame image to obtain a reference preprocessed image set and a target preprocessed image, respectively; wherein, the reference preprocessed image set contains at least one reference preprocessed image, the reference preprocessed image is the preprocessed image corresponding to the first level or intermediate level preprocessing algorithm, and the target preprocessed image is the preprocessed image corresponding to the last level preprocessing algorithm. Based on each of the aforementioned reference preprocessed image sets and each of the aforementioned target preprocessed images, the target trajectory data corresponding to the sperm video data is determined; Based on the target trajectory data, determine the sperm activity corresponding to the sperm video data; The step of determining the target trajectory data corresponding to the sperm video data based on each of the reference preprocessed image sets and each of the target preprocessed images includes: For each target sperm image in each target preprocessed image, based on the target centroid coordinates corresponding to the target sperm image and the reference preprocessed image set, at least one reference centroid coordinate corresponding to the target sperm image is determined; Based on the target centroid coordinates and the reference centroid coordinates, the average centroid coordinates are determined, and based on the average centroid coordinates corresponding to each of the target preprocessed images, the target trajectory data is determined.

2. The method according to claim 1, characterized in that, The process employs at least two levels of preprocessing algorithms to sequentially preprocess the video frame images, obtaining a reference preprocessed image set and a target preprocessed image, including: A first-level preprocessing algorithm is used to perform a first preprocessing operation on the video frame image to obtain a first intermediate reference image; wherein, the first-level preprocessing algorithm includes a dilation and erosion algorithm; A second-level preprocessing algorithm is used to perform a second preprocessing operation on the first intermediate reference image to obtain a second intermediate reference image; wherein, the second-level preprocessing algorithm includes a binarization algorithm and a gradient algorithm; Based on the first intermediate reference image and / or the second intermediate reference image, a reference preprocessed image set is determined; A third-level preprocessing algorithm is used to determine the target preprocessed image based on the second intermediate reference image; wherein, the third-level preprocessing algorithm includes an edge point removal algorithm.

3. The method according to claim 2, characterized in that, The third-level preprocessing algorithm, based on the second intermediate reference image, determines the target preprocessed image, including: For each intermediate sperm image in the second intermediate reference image, obtain block images corresponding to multiple image blocks covering the intermediate sperm image; For each block image, if the pixel values ​​of each pixel in the block image are different, the block image is treated as an edge point image; The pixel values ​​of each edge point in the second intermediate reference image are replaced with background pixel values ​​to obtain the target reference image, and the target preprocessed image is determined based on the target reference image.

4. The method according to claim 3, characterized in that, The third-level preprocessing algorithm also includes a boundary point filtering algorithm. Correspondingly, determining the target preprocessed image based on the target reference image includes: Gradient processing is performed on the target reference image to obtain a gradient image; A boundary point filtering algorithm is used to determine the target pixel in the target reference image based on the gradient value of each pixel in the gradient image. The pixel values ​​corresponding to each target pixel in the target reference image are replaced with background pixels to obtain the target preprocessed image.

5. The method according to claim 4, characterized in that, The boundary point filtering algorithm, based on the gradient values ​​of each pixel in the gradient image, determines the target pixel in the target reference image, including: For each pixel in the gradient image, if the gradient value of the pixel is greater than a first gradient threshold, the pixel is regarded as a boundary pixel. If the gradient value of the pixel is less than the second gradient threshold, the pixel is taken as the target pixel. If the gradient value of a pixel is greater than a second gradient threshold and less than a first gradient threshold, and if the set of adjacent pixels corresponding to the pixel does not contain the boundary pixel, then the pixel is taken as the target pixel; wherein the first gradient threshold is greater than the second gradient threshold.

6. The method according to claim 1, characterized in that, The step of determining the average centroid coordinates based on the target centroid coordinates and each of the reference centroid coordinates includes: The target centroid coordinates are used as the current target centroid coordinates, and the current target trajectory direction between the current target centroid coordinates and the previous average centroid coordinates corresponding to the current target centroid coordinates is determined; For each reference centroid coordinate, the reference centroid coordinate is used as the current reference centroid coordinate, and the current reference trajectory direction between the current reference centroid coordinate and the previous average centroid coordinate is determined; Determine the directional errors corresponding to the current target trajectory direction and at least one current reference trajectory direction, and determine the average centroid coordinates based on the current target centroid coordinates and the current reference centroid coordinates corresponding to the current reference trajectory direction whose directional errors satisfy a preset error range.

7. The method according to any one of claims 1-6, characterized in that, The step of determining sperm motility corresponding to the sperm video data based on the target trajectory data includes: Based on the trajectory type of each target trajectory in the target trajectory data, the number of motile sperm corresponding to the target trajectory data is determined; Based on the number of motile sperm and the total number of sperm corresponding to the target trajectory data, the sperm activity corresponding to the sperm video data is determined.

8. A device for detecting sperm motility, characterized in that, include: A sperm video data acquisition module is used to acquire sperm video data collected by a video acquisition device; wherein the sperm video data contains at least two video frame images; The target preprocessed image determination module is used to perform preprocessing operations on each video frame image sequentially using at least two levels of preprocessing algorithms to obtain a reference preprocessed image set and a target preprocessed image, respectively; wherein, the reference preprocessed image set contains at least one reference preprocessed image, which is a preprocessed image corresponding to the first or intermediate level preprocessing algorithm, and the target preprocessed image is a preprocessed image corresponding to the last level preprocessing algorithm; The target trajectory data determination module is used to determine the target trajectory data corresponding to the sperm video data based on each of the reference preprocessed image sets and each of the target preprocessed images; A sperm motility determination module is used to determine the sperm motility corresponding to the sperm video data based on the target trajectory data. The target trajectory data determination module includes: The reference centroid coordinate determination unit is used to determine at least one reference centroid coordinate corresponding to the target sperm image for each target sperm image in each target preprocessed image, based on the target centroid coordinates corresponding to the target sperm image and the reference preprocessed image set. The target trajectory data determination unit is used to determine the average centroid coordinates based on the target centroid coordinates and each of the reference centroid coordinates, and to determine the target trajectory data based on the average centroid coordinates corresponding to each of the target preprocessed images.

9. An electronic device, characterized in that, The electronic device includes: Video capture equipment used to collect sperm video data; At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, which enables the at least one processor to perform the sperm motility detection method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the method for detecting sperm activity according to any one of claims 1-7.