Sperm morphology data identification method, system and storage medium
Through multi-modal feature extraction and feature fusion methods, the time-consuming and accuracy problems of manual inspection in traditional sperm morphology analysis are solved, and efficient and accurate sperm morphology recognition is achieved, adapting to different image features and resolutions.
Patent Information
- Application Number
- CN202411060072.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-08-05
AI Technical Summary
Traditional sperm morphology analysis relies on manual microscopy, which is time-consuming and labor-intensive and susceptible to human factors, making it difficult to guarantee the accuracy and consistency of the results. Existing computer-aided image processing methods are difficult to fully describe the morphological and structural characteristics of sperm and adapt to Difficulty with images of different resolutions and qualities.
Using multi-modal feature extraction and feature fusion methods, by acquiring and preprocessing sperm morphology data, image segmentation and edge detection are performed, morphological, texture and color features are extracted, and image information of different resolutions is combined to form a comprehensive feature vector. Identification of sperm morphology.
It improves the accuracy and robustness of sperm morphology analysis, enhances the comprehensiveness and efficiency of identification, can effectively handle diverse sample data, adapts to different image qualities and resolutions, and reduces human errors.
Smart Images

Figure CN118587211B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image analysis, and in particular to a sperm morphology data recognition method, system and storage medium. Background Art
[0002] In the field of biomedical image processing, sperm morphology analysis is an important task, which is widely used in fertility diagnosis, assisted reproductive technology and related scientific research. Traditional sperm morphology analysis mainly relies on manual microscopy, which is not only time-consuming and labor-intensive, but also easily affected by human factors, making it difficult to ensure the accuracy and consistency of the results. In order to improve the efficiency and accuracy of sperm morphology analysis, computer-assisted image processing technology has gradually become a research hotspot.
[0003] Computer vision is an important branch of artificial intelligence and computer science. Its main goal is to enable computers to have the ability to "see" and understand and interpret visual information. Specifically, computer vision studies how to use computers to acquire, process, analyze and understand image or video data obtained from the real world in order to extract meaningful information or make decisions.
[0004] Conventional sperm morphology image-assisted processing methods often use a single feature structure extraction, which is difficult to fully describe the morphological and structural characteristics of sperm, and has poor adaptability to images of different resolutions and qualities, and is difficult to process diverse sample data. Summary of the invention
[0005] In order to solve the above technical problems, the present invention proposes a sperm morphology data recognition method, system and storage medium to solve at least one of the above technical problems.
[0006] The present application provides a method for identifying sperm morphology data, comprising the following steps:
[0007] Step S1: acquiring sperm morphology data, and preprocessing the sperm morphology data to obtain sperm morphology preprocessing data;
[0008] Step S2: performing image segmentation according to the sperm morphology preprocessing data to obtain sperm segmentation data;
[0009] Step S3: extracting multimodal features based on the sperm segmentation data to obtain multimodal feature data;
[0010] Step S4: Perform feature fusion based on the multimodal feature data to obtain sperm multimodal fusion data for sperm morphology data recognition.
[0011] The present invention obtains the original sperm morphology image data. Preprocessing is performed, including denoising, contrast enhancement, standardization and other operations, to remove interference factors in the image and improve the quality and consistency of the image. Through the preprocessing steps, the noise and other interference factors in the image are removed to ensure the accuracy and reliability of subsequent processing. Through operations such as contrast enhancement and standardization, the image features are made more obvious, which is helpful for subsequent image segmentation and feature extraction. Through image segmentation, the morphological area of sperm is accurately extracted to avoid background interference and improve the accuracy of morphological recognition. Complex image data is simplified into segmentation data of sperm morphology to reduce the complexity of data processing. Multimodal features are extracted from the segmented sperm image, including morphological features (such as shape, size, contour), texture features (such as grayscale, contrast), color features, etc. By extracting multiple features, the morphological features of sperm are comprehensively analyzed to improve the comprehensiveness and accuracy of recognition. Multimodal feature extraction makes the feature representation of each sperm morphology richer, which is convenient for subsequent feature fusion and classification. Feature fusion integrates information from different modalities and improves the accuracy and robustness of sperm morphology recognition. By integrating the comprehensive feature data, sperm morphology classification can be performed more effectively, improving recognition efficiency and effect.
[0012] Preferably, the sperm morphology data includes first sperm morphology data and second sperm morphology data, and the sperm morphology preprocessing data includes first sperm morphology preprocessing data and second sperm morphology preprocessing data, and step S1 is specifically:
[0013] Controlling a first resolution camera to collect sperm images through a microscope and preset first resolution parameter data to obtain first sperm morphology data;
[0014] Controlling the second resolution camera to collect sperm images through a microscope and preset second resolution parameter data to obtain second sperm morphology data, wherein pixel data corresponding to the first resolution camera is greater than pixel data corresponding to the second resolution camera, and the first resolution parameter data and the second resolution parameter data are different resolution parameter data;
[0015] Gaussian filtering is performed on the first sperm morphology data to obtain first sperm morphology preprocessing data, and mean filtering is performed on the second sperm morphology data to obtain second sperm morphology preprocessing data.
[0016] In the present invention, cameras with different resolutions are used to collect sperm morphology data, so that the system can process high-resolution and low-resolution data at the same time. High-resolution images can capture more subtle sperm morphology details, while low-resolution images can improve processing speed and efficiency. By using high-resolution and low-resolution data, richer image information can be provided, the diversity of data is enhanced, and the generalization ability of the recognition algorithm can be improved. Gaussian filtering of high-resolution images helps to remove high-frequency noise, while retaining the detailed features of sperm morphology, improving the signal-to-noise ratio of the image, and providing better data for subsequent processing. Mean filtering of low-resolution images can smooth the image, reduce the impact of noise, and is suitable for processing situations with fewer image details and improving image quality. By preprocessing images of different resolutions, morphological, texture and color features are extracted respectively, and information of different scales and detail levels can be captured, thereby improving the comprehensiveness and accuracy of feature extraction. By adaptively adjusting the preprocessing methods and parameters of images of different resolutions, the edges of different regions can be processed more finely, the accuracy of image segmentation can be improved, and the effectiveness of subsequent feature extraction can be ensured. After Gaussian filtering, high-resolution images can be more finely edge detected and segmented. After mean filtering, low-resolution images can be more quickly edge detected and segmented, improving overall processing efficiency. Using data sources with different resolutions can increase the system's adaptability to different types of data, and improve robustness and generalization capabilities. By fusing the multimodal features of high-resolution and low-resolution images to form a comprehensive feature vector, the morphology of sperm can be more comprehensively described, and the accuracy and reliability of recognition can be improved. Using different preprocessing methods (Gaussian filtering and mean filtering), the most suitable method can be selected according to the resolution characteristics of the image to improve the efficiency and effect of preprocessing. Images with higher resolution provide details, and images with lower resolution provide overall outlines. Hierarchical processing can improve processing speed and optimize resource utilization while ensuring recognition accuracy.
[0017] Preferably, the sperm segmentation data includes first sperm segmentation data and second sperm segmentation data, and step S2 is specifically:
[0018] Performing canny edge detection on the first sperm morphology preprocessing data to obtain the first sperm morphology edge data;
[0019] Performing refined morphological processing according to the first sperm morphological edge data to obtain the first sperm segmentation data;
[0020] Perform Sobel edge detection on the second sperm morphology preprocessing data to obtain the primary edge data of sperm morphology;
[0021] Perform prewitt edge detection on the primary edge data of sperm morphology to obtain the secondary edge data of sperm morphology;
[0022] The sperm morphology secondary edge data is processed by multimodal fusion morphology to obtain the second sperm segmentation data.
[0023] In the present invention, Canny edge detection is used for high-resolution images, and the edges of sperm morphology can be more finely identified and more detailed information can be captured. Based on high-resolution edge data, refined morphological processing is performed to more accurately segment the morphology of sperm and reduce the influence of artifacts and noise. For low-resolution images, Sobel edge detection is first used to obtain primary edge data, and then Prewitt edge detection is used to refine the edges. This multi-level detection method can gradually enhance edge information and ensure the accuracy of edge detection. Combining multiple edge detection results, through multi-modal fusion morphological processing, edge information can be more comprehensively extracted, and the accuracy and robustness of segmentation can be improved. For images of different resolutions, different edge detection and morphological processing methods are used to better adapt to the characteristics of the image and improve the adaptability of the system. By fusing multiple edge detection results, the error caused by a single method can be effectively reduced, the robustness of the system can be improved, and the variability of different image qualities and samples can be adapted. Through hierarchical edge detection and morphological processing, the processing speed can be improved while ensuring accuracy, and the utilization of computing resources can be optimized.
[0024] Preferably, step S3 specifically includes:
[0025] Calculate the regional attributes, sperm circumference and shape factor according to the sperm segmentation data to obtain sperm regional data line data, sperm circumference data and sperm shape factor data, wherein the sperm shape factor data includes sperm roundness shape factor data and sperm aspect ratio shape factor data;
[0026] Performing characteristic vectorization processing on sperm area data line data, sperm perimeter data and sperm shape factor data to obtain sperm morphological characteristic data;
[0027] Gray-level co-occurrence matrix is calculated based on sperm segmentation data to obtain sperm gray-level co-occurrence matrix data;
[0028] Perform local binary calculation on the sperm gray-level co-occurrence matrix data to obtain sperm texture feature data;
[0029] Performing color histogram calculation according to sperm segmentation data to obtain sperm color histogram data;
[0030] Performing color space conversion on sperm color histogram data to obtain sperm color feature data;
[0031] According to the sperm morphological feature data, sperm texture feature data, sperm color feature data and sperm segmentation data, spatial labeling and feature vectorization are performed to obtain multimodal feature data.
[0032] The present invention comprehensively describes the geometric morphology of sperm by calculating the shape factors such as the area, perimeter, roundness and aspect ratio of the sperm region, provides detailed morphological features, and helps to accurately identify different types of sperm morphology. By calculating the grayscale co-occurrence matrix and the local binary pattern (LBP), the texture features of the sperm image are extracted, and the microscopic texture information in the image can be captured, which enhances the ability to distinguish features. By combining morphological features, texture features and color features, the information of different modalities is integrated to form a multi-dimensional feature vector, which can capture more comprehensive information and improve the accuracy of recognition. By spatially marking and vectorizing multimodal features, the consistency of different features in space and the uniformity of data formats are ensured, which facilitates subsequent feature fusion and analysis. Through fine morphological feature calculation, the morphological structure of sperm can be accurately described and the accuracy of recognition can be improved. By extracting the texture features and color features of the sperm image, more image details can be captured, the ability to distinguish features can be enhanced, and the robustness of recognition can be improved.
[0033] Preferably, step S4 is specifically:
[0034] Performing feature selection according to the multimodal feature data to obtain multimodal feature selection data;
[0035] Performing feature fusion on sperm morphology feature selection data in the multimodal feature selection data and sperm texture feature selection data in the multimodal feature selection data to obtain primary sperm multimodal fusion data;
[0036] Feature fusion is performed based on the primary sperm multimodal fusion data and the sperm color feature selection data in the multimodal feature selection data to obtain sperm multimodal fusion data for sperm morphology data recognition operations.
[0037] In the present invention, feature selection is performed on multimodal feature data to screen out the most distinguishing feature data, reduce redundant information, reduce computational complexity, and improve the effectiveness and recognition accuracy of features. Morphological features, texture features and color features are combined to ensure that the selected features have good representativeness and distinguishing ability in all aspects. First, the morphological features and texture features are fused, and the morphological structure information and texture detail information can be effectively combined to form primary fusion data. On the basis of the primary fusion data, the color features are combined for advanced fusion, so that the final multimodal fusion data contains information on morphology, texture and color, ensuring the comprehensiveness and richness of the features. Through the hierarchical feature fusion method, the morphological, texture and color features are fully utilized, the comprehensiveness and description ability of the feature data are improved, and thus the accuracy of recognition is improved. The morphological features provide macroscopic structure information, the texture features provide microscopic detail information, and the color features provide color distribution information. The combination of the three can effectively enhance the complementarity of the features and improve the robustness and adaptability of the system. Through feature selection, the most representative features are screened out to reduce the feature dimension; and then through hierarchical feature fusion, the features of different modes are gradually integrated, the computing resources are optimized, and the processing efficiency is improved. The hierarchical feature fusion method can gradually integrate features, avoid the computational complexity brought by one-time fusion, and improve the overall processing efficiency.
[0038] Preferably, the refined morphological processing is specifically:
[0039] Performing local segmentation on the first sperm morphology preprocessing data according to the first sperm morphology edge data to obtain sperm local segmentation data;
[0040] Perform edge strength calculation and texture complexity calculation on sperm local segmentation data to obtain sperm edge strength data and sperm local texture complexity data;
[0041] Generating sperm local corrosion coefficient and sperm local expansion coefficient according to sperm edge strength data, sperm local texture complexity data and sperm local segmentation data, and obtaining sperm local corrosion coefficient data and sperm local expansion coefficient data;
[0042] Performing an opening operation according to sperm local corrosion coefficient data and first sperm morphology preprocessing data to obtain sperm morphology edge opening operation data;
[0043] A closing operation is performed based on the sperm local expansion coefficient data and the sperm morphology edge opening operation data to obtain the first sperm segmentation data.
[0044] In the present invention, the sperm morphology preprocessing data is locally segmented according to the first sperm morphology edge data, so that the morphological area of the sperm can be more accurately identified, the error can be reduced, and the segmentation accuracy can be improved. By performing local segmentation processing on the image, the calculation amount of the overall processing is reduced and the processing efficiency is improved. By calculating the sperm edge strength and local texture complexity, and generating adaptive corrosion and expansion coefficients according to these data, the intensity of the morphological processing can be dynamically adjusted to ensure the best processing effect in different areas. By performing edge strength calculation on the sperm local segmentation data, the strong edge area in the image can be identified, and these areas are finely processed, which helps to maintain the integrity of the sperm morphology. By calculating the local texture complexity, the area with complex texture can be identified, and specific processing can be performed on these areas to reduce the noise impact and improve the segmentation effect. By generating local corrosion and expansion coefficients, and performing adaptive opening and closing operations, the processing parameters can be dynamically adjusted according to the characteristics of different areas, ensuring that good segmentation effects can be obtained under different image quality and sample variation conditions. Opening and closing operations are performed first, and then closing operations are performed, which can effectively remove noise and smooth edges, while maintaining the integrity of sperm morphology and enhancing the robustness of the system.
[0045] Preferably, the multimodal fusion morphological processing is specifically:
[0046] Perform edge fusion according to the primary edge data of sperm morphology and the secondary edge data of sperm morphology to obtain sperm morphology edge fusion data;
[0047] Performing an open operation on the sperm morphology edge fusion data to obtain sperm morphology fusion open operation data;
[0048] The sperm morphology fusion open operation data is closed to obtain the second sperm segmentation data.
[0049] In the present invention, by combining the primary edge data and secondary edge data of sperm morphology, the advantages of different edge detection methods can be combined to improve the accuracy and comprehensiveness of edge detection. The edge fusion step can more comprehensively and accurately identify the edges of sperm by integrating edge information from different sources, reducing missed detection and false detection. Opening the fused edge data can effectively remove small noise and isolated points while maintaining the smoothness of the edge. After the opening operation, closing the operation can fill small holes and gaps in the edge, enhance the continuity and integrity of the edge, and ensure that the segmentation result is more accurate. By fusing the results of different edge detection methods, it is possible to cope with different image qualities and sample variations, and improve the robustness and adaptability of the system. Through the morphological processing method of multimodal fusion, the advantages of different features can be combined to adapt to various complex backgrounds and noise conditions, and the stability and consistency of segmentation can be improved.
[0050] Preferably, the sperm morphology edge fusion data includes sperm morphology edge commonality fusion data and sperm morphology edge multi-scale fusion data, and the edge fusion is specifically:
[0051] According to the primary edge data of sperm morphology and the secondary edge data of sperm morphology, maximum values are extracted and fused to obtain edge maximum value fusion data;
[0052] Minimum value extraction and fusion are performed based on the primary edge data of sperm morphology and the secondary edge data of sperm morphology to obtain edge minimum value fusion data;
[0053] Perform logical AND processing based on the edge maximum value fusion data and the edge minimum value fusion data to obtain the sperm morphology edge commonality fusion data;
[0054] Perform multi-scale Gaussian blurring on the primary edge data of sperm morphology and the secondary edge data of sperm morphology to obtain primary edge multi-scale Gaussian blurring data and secondary edge multi-scale Gaussian blurring data respectively;
[0055] The primary edge multi-scale Gaussian blur data and the secondary edge multi-scale Gaussian blur data are weightedly fused to obtain the sperm morphology edge multi-scale fusion data.
[0056] In the present invention, by extracting the maximum and minimum data of the edge and performing logical AND processing, the common edge of sperm can be accurately identified, and the accuracy and stability of edge detection can be improved. The maximum value extraction, minimum value extraction and logical AND processing methods are simple to calculate, and the edge data can be quickly fused to improve the processing efficiency. The maximum value fusion data and the minimum value fusion data are logically AND processed, and the common edge information can be retained, noise and false detection can be reduced, and the accuracy of edge detection can be further improved. By performing multi-scale Gaussian blur processing on the primary and secondary edge data, the edges can be smoothed at different scales, the influence of noise can be reduced, and the continuity and integrity of the edges can be improved. The primary edge and secondary edge data after multi-scale Gaussian blur processing are weighted fused, and information of different scales is integrated to improve the accuracy and robustness of edge detection. By combining the results of different edge detection methods and integrating information of different modalities, the edges of sperm can be more comprehensively and accurately identified, and the robustness and adaptability of the system can be improved. The multi-scale Gaussian blur and weighted fusion method can adapt to image features of different scales and improve the adaptability of the system under various complex backgrounds and noise conditions.
[0057] Preferably, the present application also provides a sperm morphology data recognition system for executing the sperm morphology data recognition method as described above, the sperm morphology data recognition system comprising:
[0058] A sperm morphology preprocessing module is used to obtain sperm morphology data and preprocess the sperm morphology data to obtain sperm morphology preprocessing data;
[0059] A sperm morphology preprocessing data segmentation module is used to perform image segmentation according to the sperm morphology preprocessing data to obtain sperm segmentation data;
[0060] A sperm multimodal feature extraction module is used to extract multimodal features based on sperm segmentation data to obtain multimodal feature data;
[0061] The sperm multimodal feature fusion module is used to perform feature fusion based on the multimodal feature data to obtain sperm multimodal fusion data for sperm morphology data recognition.
[0062] Preferably, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method as described in any one of the above items when running.
[0063] The beneficial effect of the present invention is that by controlling the first resolution camera and the second resolution camera to collect high-resolution and low-resolution sperm image data respectively, the processing efficiency can be guaranteed while obtaining images with rich details. The high-resolution image provides fine morphological details, and the low-resolution image improves the processing speed and the robustness of the overall morphological recognition. The high-resolution data is Gaussian filtered to remove high-frequency noise while retaining fine edges; the low-resolution data is mean filtered to effectively smooth the image and improve the image quality. The adaptive preprocessing selects the optimal filtering method according to the image resolution characteristics to improve the preprocessing effect. Canny edge detection and refined morphological processing (such as local corrosion and expansion) are used for high-resolution data to achieve high-precision edge detection and segmentation to ensure complete details. For low-resolution data, Sobel edge detection is first performed, and then Prewitt edge detection is performed to gradually refine the edge to reduce false detection and missed detection. Combined with primary and secondary edge data, maximum and minimum value fusion is performed, and common edges are retained through logical and processing to further improve the accuracy of edge detection. Through multi-scale Gaussian blur processing and weighted fusion, edge information is enhanced, image features of different scales are adapted, and the accuracy and robustness of segmentation are improved. The regional attributes, perimeter, and shape factor (including roundness and aspect ratio) of sperm are calculated to fully describe the geometric morphology of sperm. The texture features of sperm are extracted through gray-level co-occurrence matrix and local binary pattern (LBP) calculation to capture the microscopic details in the image. The color distribution characteristics of sperm are obtained through color histogram calculation and color space conversion to provide additional distinguishing information. First, the morphological features and texture features are fused to improve the comprehensiveness of the features by combining the geometric morphology and texture details. On the basis of the primary fusion data, the color features are combined for advanced fusion to form a comprehensive feature vector containing morphological, texture and color information. Through adaptive preprocessing and morphological processing methods, the processing parameters can be dynamically adjusted according to the image characteristics to ensure the good performance of the system under different image quality and sample variation conditions. Combining different edge detection results and multimodal features, the adaptability and robustness of the system are enhanced, and the accuracy and stability of recognition are improved. The most representative features are screened out through feature selection methods to reduce feature dimensions; the hierarchical feature fusion method gradually integrates the features of different modalities, optimizes computing resources, and improves processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting implementations made with reference to the following drawings:
[0065] Figure 1 A flowchart showing the steps of a sperm morphology data identification method according to an embodiment is shown;
[0066] Figure 2A flowchart showing the steps of a sperm morphology pretreatment method according to an embodiment is shown;
[0067] Figure 3 A flowchart showing the steps of a sperm morphology preprocessing data segmentation method according to an embodiment is shown;
[0068] Figure 4 A flowchart of the steps of a sperm multimodal feature extraction method according to an embodiment is shown;
[0069] Figure 5 A flowchart of the steps of a sperm multimodal feature fusion method according to an embodiment is shown. DETAILED DESCRIPTION
[0070] The following is a clear and complete description of the technical method of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are 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 technicians in this field without creative work are within the scope of protection of the present invention.
[0071] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor methods and / or microcontroller methods.
[0072] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.
[0073] See also Figures 1 to 5 The present application provides a method for identifying sperm morphology data, comprising the following steps:
[0074] Step S1: acquiring sperm morphology data, and preprocessing the sperm morphology data to obtain sperm morphology preprocessing data;
[0075] Step S2: performing image segmentation according to the sperm morphology preprocessing data to obtain sperm segmentation data;
[0076] Step S3: extracting multimodal features based on the sperm segmentation data to obtain multimodal feature data;
[0077] Step S4: Perform feature fusion based on the multimodal feature data to obtain sperm multimodal fusion data for sperm morphology data recognition.
[0078] In one embodiment of the present invention, a first resolution camera (high resolution) is used to capture sperm images through a microscope to obtain detailed morphological data, and a second resolution camera (low resolution) is used to capture sperm images through a microscope to obtain overall morphological data.
[0079] The specific preprocessing of high-resolution images is: use Gaussian filtering to remove noise. # Perform Gaussian filtering on high-resolution images high_res_preprocessed = cv2.GaussianBlur(high_res_image, (5, 5), 1.5). The specific preprocessing of low-resolution images is: use mean filtering to smooth. # Perform mean filtering on low-resolution images low_res_preprocessed = cv2.blur(low_res_image, (3, 3)).
[0080] Perform Canny edge detection on high-resolution preprocessed data. Perform local erosion and dilation processing according to edge strength and local texture complexity. # Generate local erosion and dilation coefficients kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (3, 3)); high_res_eroded = cv2.erode(high_res_edges, kernel, iterations=1); high_res_dilated = cv2.dilate(high_res_eroded, kernel, iterations=1); high_res_segmented = high_res_dilated, and obtain the corresponding high-resolution sperm segmentation data (first sperm segmentation data).
[0081] Perform Sobel edge detection on the low-resolution preprocessed data. Perform Prewitt edge detection on the edge data after Sobel detection. Fusion of multiple edge detection results, open and close operations, to obtain the corresponding low-resolution sperm segmentation data (second sperm segmentation data).
[0082] According to the sperm segmentation data, multimodal feature extraction is performed to obtain multimodal feature data, which includes sperm morphological feature data, sperm texture feature data and sperm color feature data; the specific steps of generating sperm morphological feature data are: according to the sperm segmentation data, the regional attributes (area, perimeter, etc.) of sperm morphology and shape factors such as roundness and aspect ratio are calculated to obtain sperm morphological feature data; the specific steps of generating sperm texture feature data are: grayscale conversion of the mirror segmentation image is performed, and the grayscale co-occurrence matrix of the converted grayscale image is calculated. The calculated grayscale co-occurrence matrix is subjected to local binary pattern feature extraction to obtain sperm texture feature data. The specific steps of generating sperm color feature data are: according to the sperm segmentation data, the color histogram is calculated to obtain sperm color histogram data, and the mirror color histogram data is converted into color space to obtain sperm color feature data.
[0083] According to the multimodal feature data, feature fusion is performed to obtain sperm multimodal fusion data for sperm morphological data recognition. Specifically, the most discriminative multimodal features are selected from the multimodal feature data to obtain multimodal feature selection data; morphological and texture feature fusion is performed on the multimodal feature selection data, and the primary multimodal fusion data is obtained by combining morphological features and texture features. Based on the primary fusion data, the color features are combined to form the final multimodal fusion feature vector.
[0084] The specific operation of sperm morphology data recognition is as follows: Use fusion features to train the recognition model (such as support vector machine SVM). from sklearn.svm import SVC# Train SVM classifier classifier = SVC(kernel='linear'); classifier.fit(final_fusion, labels). Use the trained model to recognize sperm morphology data.
[0085] The present invention obtains the original sperm morphology image data. Preprocessing is performed, including denoising, contrast enhancement, standardization and other operations, to remove interference factors in the image and improve the quality and consistency of the image. Through the preprocessing steps, the noise and other interference factors in the image are removed to ensure the accuracy and reliability of subsequent processing. Through operations such as contrast enhancement and standardization, the image features are made more obvious, which is helpful for subsequent image segmentation and feature extraction. Through image segmentation, the morphological area of sperm is accurately extracted to avoid background interference and improve the accuracy of morphological recognition. Complex image data is simplified into segmentation data of sperm morphology to reduce the complexity of data processing. Multimodal features are extracted from the segmented sperm image, including morphological features (such as shape, size, contour), texture features (such as grayscale, contrast), color features, etc. By extracting multiple features, the morphological features of sperm are comprehensively analyzed to improve the comprehensiveness and accuracy of recognition. Multimodal feature extraction makes the feature representation of each sperm morphology richer, which is convenient for subsequent feature fusion and classification. Feature fusion integrates information from different modalities and improves the accuracy and robustness of sperm morphology recognition. By integrating the comprehensive feature data, sperm morphology classification can be performed more effectively, improving recognition efficiency and effect.
[0086] Preferably, the sperm morphology data includes first sperm morphology data and second sperm morphology data, and the sperm morphology preprocessing data includes first sperm morphology preprocessing data and second sperm morphology preprocessing data, and step S1 is specifically:
[0087] Step S11: controlling a first resolution camera to collect sperm images through a microscope and preset first resolution parameter data to obtain first sperm morphology data;
[0088] Step S12: controlling the second resolution camera to collect sperm images through a microscope and preset second resolution parameter data to obtain second sperm morphology data, wherein the pixel data corresponding to the first resolution camera is greater than the pixel data corresponding to the second resolution camera, and the first resolution parameter data and the second resolution parameter data are different resolution parameter data;
[0089] Step S13: performing Gaussian filtering on the first sperm morphology data to obtain first sperm morphology preprocessing data, and performing mean filtering on the second sperm morphology data to obtain second sperm morphology preprocessing data.
[0090] In one embodiment of the present invention, a high-resolution camera (first resolution camera) is used to collect sperm images through a microscope and preset first resolution parameters to obtain fine morphological data. A low-resolution camera (second resolution camera) is used to collect sperm images through a microscope and preset second resolution parameters to obtain overall morphological data.
[0091] Gaussian filtering is used to remove noise from high-resolution images to preserve fine edges. Mean filtering is used to smooth low-resolution images to improve image quality.
[0092] The first resolution camera is a camera used to capture high-resolution sperm images, such as pixel count: 20MP (20 million pixels), resolution: 5472 x 3648 pixels, and optical system: 40x microscope lens.
[0093] The second resolution camera is a camera used to collect low-resolution sperm images. Low-resolution cameras have advantages in overall morphological recognition and processing speed, and are suitable for rapid detection in a larger range. Number of pixels: 5MP (5 million pixels), resolution: 2592 x 1944 pixels, optical system: 10x microscope lens.
[0094] The first resolution parameter data is used to control the shooting parameters of the first resolution camera to ensure the quality and details of the high-resolution image. These parameters include exposure time, gain, contrast, brightness, etc. For example, exposure time: 20ms, gain: 1.0, contrast: 70, brightness: 50.
[0095] The second resolution parameter data is used to control the shooting parameters of the second resolution camera to ensure the quality and overall field of view of the low resolution image. These parameters include exposure time, gain, contrast, brightness, etc. Exposure time: 10ms, gain: 2.0, contrast: 60, brightness: 40.
[0096] In the present invention, cameras with different resolutions are used to collect sperm morphology data, so that the system can process high-resolution and low-resolution data at the same time. High-resolution images can capture more subtle sperm morphology details, while low-resolution images can improve processing speed and efficiency. By using high-resolution and low-resolution data, richer image information can be provided, the diversity of data is enhanced, and the generalization ability of the recognition algorithm can be improved. Gaussian filtering of high-resolution images helps to remove high-frequency noise, while retaining the detailed features of sperm morphology, improving the signal-to-noise ratio of the image, and providing better data for subsequent processing. Mean filtering of low-resolution images can smooth the image, reduce the impact of noise, and is suitable for processing situations with fewer image details and improving image quality. By preprocessing images of different resolutions, morphological, texture and color features are extracted respectively, and information of different scales and detail levels can be captured, thereby improving the comprehensiveness and accuracy of feature extraction. By adaptively adjusting the preprocessing methods and parameters of images of different resolutions, the edges of different regions can be processed more finely, the accuracy of image segmentation can be improved, and the effectiveness of subsequent feature extraction can be ensured. After Gaussian filtering, high-resolution images can be more finely edge detected and segmented. After mean filtering, low-resolution images can be more quickly edge detected and segmented, improving overall processing efficiency. Using data sources with different resolutions can increase the system's adaptability to different types of data, and improve robustness and generalization capabilities. By fusing the multimodal features of high-resolution and low-resolution images to form a comprehensive feature vector, the morphology of sperm can be more comprehensively described, and the accuracy and reliability of recognition can be improved. Using different preprocessing methods (Gaussian filtering and mean filtering), the most suitable method can be selected according to the resolution characteristics of the image to improve the efficiency and effect of preprocessing. Images with higher resolution provide details, and images with lower resolution provide overall outlines. Hierarchical processing can improve processing speed and optimize resource utilization while ensuring recognition accuracy.
[0097] Preferably, the sperm segmentation data includes first sperm segmentation data and second sperm segmentation data, and step S2 is specifically:
[0098] Step S21: performing canny edge detection on the first sperm morphology preprocessing data to obtain first sperm morphology edge data;
[0099] Step S22: performing refined morphological processing according to the first sperm morphological edge data to obtain first sperm segmentation data;
[0100] More importantly, the present invention also provides an embodiment, clustering calculation is performed according to the first sperm morphology edge data to obtain sperm morphology edge clustering data; a self-attention encoder is constructed, and the sperm morphology edge clustering data is encoded by the self-attention encoder to obtain edge clustering encoded data; a feature map is constructed according to the edge clustering encoded data to obtain edge clustering encoded map data; a self-attention decoder is constructed, and the edge clustering encoded map data is decoded by the self-attention decoder to obtain edge clustering decoded data; feature segmentation and morphological processing are performed according to the edge clustering decoded data and the first sperm morphology edge data to obtain first sperm segmentation data;
[0101] Cluster the edge data of sperm morphology, simplify the data structure, and extract the main edge features. Use the K-means clustering algorithm to cluster the edge data. Extract the coordinates of the edge points and perform clustering calculations. Construct a self-attention encoder model. Encode the clustered edge data. Convert the encoded edge cluster data into an image for subsequent processing. Use a self-attention decoder to decode the encoded graph data and restore the edge structure. Construct a self-attention decoder model. Decode the encoded graph data. Combine the decoded data with the original edge data, perform feature segmentation, and perform morphological processing (such as dilation and erosion) to obtain the first sperm segmentation data.
[0102] The self-attention mechanism generates a new representation for each element in the input sequence by calculating the relevance (attention weight) of each element to other elements. The self-attention mechanism mainly includes three steps: Calculate the attention weight: Calculate the attention weight through the query, key, and value matrix. Weighted summation: Use the attention weight to perform weighted summation on the value matrix to generate a new representation. Output transformation: Perform a linear transformation on the result of the weighted summation to obtain the final output.
[0103] Construct a self-attention encoder model, including a multi-head self-attention mechanism and a linear transformation. The self-attention encoder contains a multi-head self-attention layer and a feed-forward neural network (FFN). Each layer of the encoder contains a multi-head self-attention mechanism and a feed-forward neural network. The self-attention encoder model encodes the input data through a multi-head self-attention mechanism and a feed-forward neural network, which can capture global information and long-distance dependencies and improve the quality of feature extraction.
[0104] The Self-Attention Decoder is a deep learning model based on the self-attention mechanism, which is used to decode the target information from the high-level features generated by the encoder. The main components of the Self-Attention Decoder include three parts: Multi-Head Self-Attention Mechanism: The self-attention mechanism inside the decoder can focus on the relationship between different positions in the decoding process. Encoder-Decoder Attention Mechanism: The decoder also needs to pay attention to the high-level features generated by the encoder. FeedForward Neural Network (FFN): Used for nonlinear transformation and feature extraction.
[0105] Step S23: performing Sobel edge detection on the second sperm morphology preprocessing data to obtain primary edge data of sperm morphology;
[0106] Step S24: performing prewitt edge detection on the primary edge data of sperm morphology to obtain secondary edge data of sperm morphology;
[0107] Step S25: Perform multimodal fusion morphological processing on the sperm morphology secondary edge data to obtain second sperm segmentation data.
[0108] The present invention provides an embodiment in which Canny edge detection is performed on the first sperm morphology preprocessing data to obtain the first sperm morphology edge data; input: the first sperm morphology preprocessing data (high-resolution image). Steps: Use a Gaussian filter to smooth the image to reduce noise. Calculate the image gradient to obtain the gradient amplitude and direction. Apply non-maximum suppression to eliminate non-edge points. Use a double threshold method to connect the edges to obtain the final edge image. Output: the first sperm morphology edge data.
[0109] According to the first sperm morphology edge data, the refined morphological processing is performed to obtain the first sperm segmentation data. Input: the first sperm morphology edge data. Steps: Locally segment the image according to the edge data. Calculate the edge strength and local texture complexity. Generate the local corrosion coefficient and expansion coefficient according to the edge strength and texture complexity. Perform opening and closing operations on the image to obtain the segmentation result. Output: the first sperm segmentation data.
[0110] Perform Sobel edge detection on the second sperm morphology preprocessing data to obtain the primary edge data of sperm morphology Input: Second sperm morphology preprocessing data (low-resolution image). Steps: Use the Sobel operator to calculate the gradient of the image. Combine the horizontal and vertical gradients to obtain the primary edge data. Output: Primary edge data of sperm morphology.
[0111] Perform Prewitt edge detection on the primary edge data of sperm morphology to obtain the secondary edge data of sperm morphology Input: primary edge data of sperm morphology. Steps: Use the Prewitt operator to calculate the gradient of the image. Combine the horizontal and vertical gradients, calculate the gradient amplitude, and obtain the secondary edge data. Output: secondary edge data of sperm morphology.
[0112] Perform multimodal fusion morphological processing on the secondary edge data of sperm morphology to obtain the second sperm segmentation data. Input: sperm morphology secondary edge data. Steps: Perform maximum value extraction and fusion to obtain edge maximum fusion data. Perform minimum value extraction and fusion to obtain edge minimum fusion data. Perform logical AND processing on the maximum and minimum fusion data to obtain edge commonality fusion data. Perform multiscale Gaussian blur processing on the primary edge and secondary edge data. Perform weighted fusion on the multiscale Gaussian blur results to obtain multiscale fusion data. Perform opening and closing operations on the multiscale fusion data to obtain the final segmentation result. Output: the second sperm segmentation data.
[0113] The primary edge data and the secondary edge data are subjected to maximum value extraction and fusion to obtain edge maximum value fusion data. The primary edge data and the secondary edge data are subjected to minimum value extraction and fusion to obtain edge minimum value fusion data. The maximum value fusion data and the minimum value fusion data are subjected to logical AND processing to obtain edge commonality fusion data. The primary edge data and the secondary edge data are subjected to multi-scale Gaussian blur processing to obtain primary edge multi-scale Gaussian blur data and secondary edge multi-scale Gaussian blur data, respectively. The multi-scale Gaussian blur data of the primary edge and the secondary edge are subjected to weighted fusion to obtain multi-scale fusion data. The multi-scale fusion data is subjected to opening and closing operations to remove noise and isolated points, smooth the edges, and obtain the second sperm segmentation data.
[0114] In the present invention, Canny edge detection is used for high-resolution images, and the edges of sperm morphology can be more finely identified and more detailed information can be captured. Based on high-resolution edge data, refined morphological processing is performed to more accurately segment the morphology of sperm and reduce the influence of artifacts and noise. For low-resolution images, Sobel edge detection is first used to obtain primary edge data, and then Prewitt edge detection is used to refine the edges. This multi-level detection method can gradually enhance edge information and ensure the accuracy of edge detection. Combining multiple edge detection results, through multi-modal fusion morphological processing, edge information can be more comprehensively extracted, and the accuracy and robustness of segmentation can be improved. For images of different resolutions, different edge detection and morphological processing methods are used to better adapt to the characteristics of the image and improve the adaptability of the system. By fusing multiple edge detection results, the error caused by a single method can be effectively reduced, the robustness of the system can be improved, and the variability of different image qualities and samples can be adapted. Through hierarchical edge detection and morphological processing, the processing speed can be improved while ensuring accuracy, and the utilization of computing resources can be optimized.
[0115] Preferably, step S3 specifically includes:
[0116] Step S31: performing regional attribute calculation, sperm perimeter calculation and shape factor calculation according to the sperm segmentation data, and obtaining sperm regional data line data, sperm perimeter data and sperm shape factor data, wherein the sperm shape factor data includes sperm roundness shape factor data and sperm aspect ratio shape factor data;
[0117] Step S32: performing characteristic vector quantization processing on the sperm area data line data, sperm circumference data and sperm shape factor data to obtain sperm morphological characteristic data;
[0118] Step S33: performing gray-level co-occurrence matrix calculation according to the sperm segmentation data to obtain sperm gray-level co-occurrence matrix data;
[0119] Step S34: performing local binary calculation on the sperm gray-level co-occurrence matrix data to obtain sperm texture feature data;
[0120] Step S35: performing color histogram calculation according to the sperm segmentation data to obtain sperm color histogram data;
[0121] Step S36: performing color space conversion on the sperm color histogram data to obtain sperm color feature data;
[0122] Step S37: spatially label and feature vectorize the sperm morphological feature data, sperm texture feature data, sperm color feature data and sperm segmentation data to obtain multimodal feature data.
[0123] In one embodiment provided by the present invention, input: sperm segmentation data, steps: calculating region attributes (area, centroid, etc.), calculating perimeter, calculating shape factor (roundness, aspect ratio), output: sperm region data line data, sperm perimeter data, sperm shape factor data.
[0124] Perform contour detection on the segmented sperm region and calculate the area of the region. Use the contour perimeter calculation method to obtain the sperm perimeter data. Calculate the roundness shape factor: . Calculate the aspect ratio: Get the major axis and minor axis by fitting the ellipse, aspect ratio = major axis / minor axis.
[0125] The sperm area data line data, sperm circumference data and sperm shape factor data are processed by feature vectorization to obtain sperm morphological feature data Input: sperm area data line data, sperm circumference data, sperm shape factor data. Steps: The above data are processed by feature vectorization. Output: sperm morphological feature data.
[0126] The calculated area, perimeter, roundness, aspect ratio and other data are combined into a feature vector for subsequent feature fusion.
[0127] Calculate the gray-level co-occurrence matrix based on the sperm segmentation data to obtain the sperm gray-level co-occurrence matrix data. Input: sperm segmentation data, step: calculate the gray-level co-occurrence matrix. Output: sperm gray-level co-occurrence matrix data.
[0128] For the segmented sperm region, the gray level co-occurrence matrix is calculated to obtain the co-occurrence matrix of texture features. The greycomatrix function is used to calculate the gray level co-occurrence matrix and extract texture features such as contrast and homogeneity.
[0129] Perform local binary calculation on the sperm gray-level co-occurrence matrix data to obtain sperm texture feature data. Input: sperm gray-level co-occurrence matrix data, step: calculate local binary pattern (LBP) features. Output: sperm texture feature data. Use the LBP algorithm to perform local binary calculation on the gray-level co-occurrence matrix data and extract texture feature data.
[0130] Calculate the color histogram based on the sperm segmentation data to obtain the sperm color histogram data. Input: sperm segmentation data. Steps: Calculate the color histogram. Output: sperm color histogram data. Calculate the color histogram of the segmented sperm area to obtain color feature data. Color histogram calculation: Use the calcHist function to calculate the RGB or HSV color histogram. Color space conversion: Use the cvtColor function to convert the image from RGB space to HSV space and extract color features.
[0131] Perform color space conversion on sperm color histogram data to obtain sperm color feature data. Input: sperm color histogram data, step: perform color space conversion (such as RGB to HSV). Output: sperm color feature data. Convert the color histogram data from RGB space to HSV space to extract more color features.
[0132] According to the sperm morphological feature data, sperm texture feature data, sperm color feature data and sperm segmentation data, spatial labeling and feature vectorization are performed to obtain multimodal feature data. Input: sperm morphological feature data, sperm texture feature data, sperm color feature data, sperm segmentation data, step: perform spatial labeling and vectorization on the above-mentioned features. Output: multimodal feature data. The morphological feature, texture feature and color feature data are standardized and combined into a comprehensive feature vector to form multimodal feature data.
[0133] The present invention comprehensively describes the geometric morphology of sperm by calculating the shape factors such as the area, perimeter, roundness and aspect ratio of the sperm region, provides detailed morphological features, and helps to accurately identify different types of sperm morphology. By calculating the grayscale co-occurrence matrix and the local binary pattern (LBP), the texture features of the sperm image are extracted, and the microscopic texture information in the image can be captured, which enhances the ability to distinguish features. By combining morphological features, texture features and color features, the information of different modalities is integrated to form a multi-dimensional feature vector, which can capture more comprehensive information and improve the accuracy of recognition. By spatially marking and vectorizing multimodal features, the consistency of different features in space and the uniformity of data formats are ensured, which facilitates subsequent feature fusion and analysis. Through fine morphological feature calculation, the morphological structure of sperm can be accurately described and the accuracy of recognition can be improved. By extracting the texture features and color features of the sperm image, more image details can be captured, the ability to distinguish features can be enhanced, and the robustness of recognition can be improved.
[0134] Preferably, step S4 is specifically:
[0135] Step S41: performing feature selection according to the multimodal feature data to obtain multimodal feature selection data;
[0136] Step S42: performing feature fusion on the sperm morphology feature selection data in the multimodal feature selection data and the sperm texture feature selection data in the multimodal feature selection data to obtain primary sperm multimodal fusion data;
[0137] Step S43: Perform feature fusion based on the primary sperm multimodal fusion data and the sperm color feature selection data in the multimodal feature selection data to obtain sperm multimodal fusion data for sperm morphology data recognition.
[0138] The present invention provides an embodiment in which feature selection is performed according to multimodal feature data to obtain multimodal feature selection data, input: multimodal feature data, step: feature selection is performed using a feature selection algorithm (such as SelectKBest, based on variance threshold, etc.). Output: multimodal feature selection data. Using the SelectKBest method, the first several features with the highest scores are selected according to the F test to obtain selected data of sperm morphological features, texture features and color features.
[0139] The sperm morphology feature selection data in the multimodal feature selection data and the sperm texture feature selection data in the multimodal feature selection data are feature fused to obtain primary sperm multimodal fusion data. Input: sperm morphology feature selection data and sperm texture feature selection data in the multimodal feature selection data. Steps: concatenate or weightedly fuse the morphological features and texture features to form a primary fusion feature vector. Output: Primary sperm multimodal fusion data combines the selected morphological features (such as area, perimeter, roundness, aspect ratio) and texture features (such as contrast, homogeneity, LBP features of gray-level co-occurrence matrix, etc.) into a feature vector.
[0140] According to the primary sperm multimodal fusion data and the sperm color feature selection data in the multimodal feature selection data, feature fusion is performed to obtain sperm multimodal fusion data for sperm morphology data recognition. Input: primary sperm multimodal fusion data, sperm color feature selection data. Steps: concatenate or weightedly fuse the primary fusion features with the color features to form the final multimodal fusion feature vector. Output: sperm multimodal fusion data combines the primary fusion feature data (morphological features and texture features) with the color feature data (such as HSV color histogram features) to form the final multimodal fusion feature vector for sperm morphology data recognition.
[0141] In the present invention, feature selection is performed on multimodal feature data to screen out the most distinguishing feature data, reduce redundant information, reduce computational complexity, and improve the effectiveness and recognition accuracy of features. Morphological features, texture features and color features are combined to ensure that the selected features have good representativeness and distinguishing ability in all aspects. First, the morphological features and texture features are fused, and the morphological structure information and texture detail information can be effectively combined to form primary fusion data. On the basis of the primary fusion data, the color features are combined for advanced fusion, so that the final multimodal fusion data contains information on morphology, texture and color, ensuring the comprehensiveness and richness of the features. Through the hierarchical feature fusion method, the morphological, texture and color features are fully utilized, the comprehensiveness and description ability of the feature data are improved, and thus the accuracy of recognition is improved. The morphological features provide macroscopic structure information, the texture features provide microscopic detail information, and the color features provide color distribution information. The combination of the three can effectively enhance the complementarity of the features and improve the robustness and adaptability of the system. Through feature selection, the most representative features are screened out to reduce the feature dimension; and then through hierarchical feature fusion, the features of different modes are gradually integrated, the computing resources are optimized, and the processing efficiency is improved. The hierarchical feature fusion method can gradually integrate features, avoid the computational complexity brought by one-time fusion, and improve the overall processing efficiency.
[0142] Preferably, the refined morphological processing is specifically:
[0143] Performing local segmentation on the first sperm morphology preprocessing data according to the first sperm morphology edge data to obtain sperm local segmentation data;
[0144] Perform edge strength calculation and texture complexity calculation on sperm local segmentation data to obtain sperm edge strength data and sperm local texture complexity data;
[0145] Generating sperm local corrosion coefficient and sperm local expansion coefficient according to sperm edge strength data, sperm local texture complexity data and sperm local segmentation data, and obtaining sperm local corrosion coefficient data and sperm local expansion coefficient data;
[0146] Performing an opening operation according to sperm local corrosion coefficient data and first sperm morphology preprocessing data to obtain sperm morphology edge opening operation data;
[0147] A closing operation is performed based on the sperm local expansion coefficient data and the sperm morphology edge opening operation data to obtain the first sperm segmentation data.
[0148] The present invention provides an embodiment in which first sperm morphology preprocessing data is locally segmented according to first sperm morphology edge data to obtain sperm local segmentation data. Input: first sperm morphology edge data, first sperm morphology preprocessing data, step: using edge data as a mask to locally segment the preprocessing data. Output: sperm local segmentation data uses edge data as a mask and is applied to preprocessing data to obtain sperm local segmentation data.
[0149] Perform edge strength calculation and texture complexity calculation on sperm local segmentation data to obtain sperm edge strength data and sperm local texture complexity data. Input: sperm local segmentation data, steps: Calculate edge strength: perform edge detection on local segmentation data and calculate edge strength. Calculate texture complexity: Use texture analysis method (such as LBP) to calculate local texture complexity. Output: sperm edge strength data, sperm local texture complexity data. Use edge detection algorithm (such as Sobel) to calculate edge strength. Use local binary pattern (LBP) to calculate local texture complexity.
[0150] According to the sperm edge strength data, sperm local texture complexity data and sperm local segmentation data, the sperm local corrosion coefficient and sperm local expansion coefficient are generated to obtain sperm local corrosion coefficient data and sperm local expansion coefficient data. Input: sperm edge strength data, sperm local texture complexity data, sperm local segmentation data, step: generate adaptive local corrosion coefficient and expansion coefficient. Output: sperm local corrosion coefficient data, sperm local expansion coefficient data.
[0151] The steps of generating adaptive local corrosion coefficient and expansion coefficient are as follows: normalizing sperm edge strength data and sperm local texture complexity data to obtain normalized edge strength data and normalized texture complexity data; obtaining the threshold range of edge strength and texture complexity, # setting the threshold range, low normalized edge strength data edge_strength_threshold_low = 0.3, high normalized edge strength data edge_strength_threshold_high = 0.7, low normalized texture complexity data texture_complexity_threshold_low = 0.3, high normalized texture complexity data texture_complexity_threshold_high = 0.7. Based on the normalized edge strength and texture complexity data, the local corrosion coefficient and expansion coefficient are generated using the linear interpolation method.
[0152] Generate local erosion coefficients and expansion coefficients through linear interpolation: def generate_adaptive_coefficients(edge_strength, texture_complexity, low_threshold, high_threshold): # Linear interpolation generates erosion coefficients erosion_coeff = np.interp(edge_strength, [0,1], [1, 3]) # Generate erosion coefficients according to edge strength erosion_coeff = np.where(edge_strength<low_threshold, 1, erosion_coeff);erosion_coeff = np.where(edge_strength> high_threshold, 3, erosion_coeff) # Linear interpolation generates expansion coefficient dilation_coeff = np.interp(texture_complexity, [0, 1], [1, 3]) # Generate expansion coefficient according to texture complexity dilation_coeff = np.where(texture_complexity<low_threshold, 1, dilation_coeff);dilation_coeff = np.where(texture_complexity> high_threshold, 3, dilation_coeff); return erosion_coeff, dilation_coeff # Generate adaptive erosion and dilation coefficients erosion_coeff, dilation_coeff = generate_adaptive_coefficients(edge_strength_normalized, texture_complexity_normalized, edge_strength_threshold_low, edge_strength_threshold_high). Generate local erosion and dilation coefficients based on normalized edge strength and texture complexity data through linear interpolation. Linear interpolation maps the erosion and dilation coefficients to the range of [1, 3] within the value range of edge strength and texture complexity [0, 1]. For each pixel, linear interpolation is performed according to its edge strength (normalized edge strength data) to generate the erosion coefficient.If the edge strength (normalized edge strength data) is lower than the low threshold (low normalized edge strength data), the erosion coefficient is set to 1; if the edge strength (normalized edge strength data) is higher than the high threshold (high normalized edge strength data), the erosion coefficient is set to 3. For each pixel, a dilation coefficient is generated by linear interpolation according to its texture complexity (normalized texture complexity data). If the texture complexity (normalized texture complexity data) is lower than the low threshold (low normalized texture complexity data), the dilation coefficient is set to 1; if the texture complexity (normalized texture complexity data) is higher than the high threshold (high normalized texture complexity data), the dilation coefficient is set to 3.
[0153] According to the sperm local corrosion coefficient data and the first sperm morphology preprocessing data, an opening operation is performed to obtain sperm morphology edge opening operation data. Input: sperm local corrosion coefficient data, first sperm morphology preprocessing data, step: use the corrosion coefficient to perform an opening operation on the preprocessing data. Output: sperm morphology edge opening operation data Use the local corrosion coefficient to perform corrosion and expansion operations (opening operation) on the preprocessing data to obtain the opening operation data.
[0154] According to the sperm local expansion coefficient data and the sperm morphology edge opening operation data, a closing operation is performed to obtain the first sperm segmentation data. Input: sperm local expansion coefficient data, sperm morphology edge opening operation data, step: use the expansion coefficient to close the opening operation data. Output: the first sperm segmentation data. Use the local expansion coefficient to perform expansion and corrosion operations (closing operations) on the opening operation data to obtain the final segmentation data. Use the first sperm morphology edge data as a mask to perform local segmentation on the first sperm morphology preprocessing data.
[0155] In the present invention, the sperm morphology preprocessing data is locally segmented according to the first sperm morphology edge data, so that the morphological area of the sperm can be more accurately identified, the error can be reduced, and the segmentation accuracy can be improved. By performing local segmentation processing on the image, the calculation amount of the overall processing is reduced and the processing efficiency is improved. By calculating the sperm edge strength and local texture complexity, and generating adaptive corrosion and expansion coefficients according to these data, the intensity of the morphological processing can be dynamically adjusted to ensure the best processing effect in different areas. By performing edge strength calculation on the sperm local segmentation data, the strong edge area in the image can be identified, and these areas are finely processed, which helps to maintain the integrity of the sperm morphology. By calculating the local texture complexity, the area with complex texture can be identified, and specific processing can be performed on these areas to reduce the noise impact and improve the segmentation effect. By generating local corrosion and expansion coefficients, and performing adaptive opening and closing operations, the processing parameters can be dynamically adjusted according to the characteristics of different areas, ensuring that good segmentation effects can be obtained under different image quality and sample variation conditions. Opening and closing operations are performed first, and then closing operations are performed, which can effectively remove noise and smooth edges, while maintaining the integrity of sperm morphology and enhancing the robustness of the system.
[0156] Preferably, the multimodal fusion morphological processing is specifically:
[0157] Perform edge fusion according to the primary edge data of sperm morphology and the secondary edge data of sperm morphology to obtain sperm morphology edge fusion data;
[0158] Performing an open operation on the sperm morphology edge fusion data to obtain sperm morphology fusion open operation data;
[0159] The sperm morphology fusion open operation data is closed to obtain the second sperm segmentation data.
[0160] The present invention provides an embodiment in which edge fusion is performed according to the primary edge data of sperm morphology and the secondary edge data of sperm morphology to obtain sperm morphology edge fusion data. Input: sperm morphology primary edge data, sperm morphology secondary edge data, step: using the maximum fusion method to fuse the primary edge data and the secondary edge data. Output: sperm morphology edge fusion data. Using the maximum fusion method, the primary edge data and the secondary edge data are fused to retain all edge information.
[0161] Perform a closing operation on the sperm morphology fusion open operation data to obtain the second sperm segmentation data. Input: sperm morphology fusion open operation data, step: use the closing operation to fill the small holes in the edge and enhance the continuity and integrity of the edge. Output: the second sperm segmentation data. Use the morphological closing operation (dilation operation followed by erosion operation) to process the edge data after the open operation, fill the small holes in the edge, and enhance the continuity and integrity of the edge.
[0162] In the present invention, by combining the primary edge data and secondary edge data of sperm morphology, the advantages of different edge detection methods can be combined to improve the accuracy and comprehensiveness of edge detection. The edge fusion step can more comprehensively and accurately identify the edges of sperm by integrating edge information from different sources, reducing missed detection and false detection. Opening the fused edge data can effectively remove small noise and isolated points while maintaining the smoothness of the edge. After the opening operation, closing the operation can fill small holes and gaps in the edge, enhance the continuity and integrity of the edge, and ensure that the segmentation result is more accurate. By fusing the results of different edge detection methods, it is possible to cope with different image qualities and sample variations, and improve the robustness and adaptability of the system. Through the morphological processing method of multimodal fusion, the advantages of different features can be combined to adapt to various complex backgrounds and noise conditions, and the stability and consistency of segmentation can be improved.
[0163] Preferably, the sperm morphology edge fusion data includes sperm morphology edge commonality fusion data and sperm morphology edge multi-scale fusion data, and the edge fusion is specifically:
[0164] According to the primary edge data of sperm morphology and the secondary edge data of sperm morphology, maximum values are extracted and fused to obtain edge maximum value fusion data;
[0165] Minimum value extraction and fusion are performed based on the primary edge data of sperm morphology and the secondary edge data of sperm morphology to obtain edge minimum value fusion data;
[0166] Perform logical AND processing based on the edge maximum value fusion data and the edge minimum value fusion data to obtain the sperm morphology edge commonality fusion data;
[0167] Perform multi-scale Gaussian blurring on the primary edge data of sperm morphology and the secondary edge data of sperm morphology to obtain primary edge multi-scale Gaussian blurring data and secondary edge multi-scale Gaussian blurring data respectively;
[0168] The primary edge multi-scale Gaussian blur data and the secondary edge multi-scale Gaussian blur data are weightedly fused to obtain the sperm morphology edge multi-scale fusion data.
[0169] The present invention provides an embodiment in which maximum value extraction and fusion are performed based on the primary edge data of sperm morphology and the secondary edge data of sperm morphology to obtain edge maximum fusion data. Input: primary edge data of sperm morphology, secondary edge data of sperm morphology. Steps: compare the primary edge data and the secondary edge data pixel by pixel, take the maximum value, and form maximum fusion data. Output: edge maximum fusion data Using the maximum fusion method, compare the primary edge data and the secondary edge data pixel by pixel to take the maximum value.
[0170] According to the sperm morphology primary edge data and sperm morphology secondary edge data, the minimum value is extracted and fused to obtain the edge minimum value fusion data. Input: sperm morphology primary edge data, sperm morphology secondary edge data. Steps: Compare the primary edge data and the secondary edge data pixel by pixel, take the minimum value, and form the minimum value fusion data. Output: edge minimum value fusion data. Using the minimum value fusion method, compare the primary edge data and the secondary edge data pixel by pixel and take the minimum value.
[0171] According to the edge maximum fusion data and the edge minimum fusion data, logical AND processing is performed to obtain the sperm morphology edge commonality fusion data. Input: edge maximum fusion data, edge minimum fusion data. Steps: Perform pixel-by-pixel logical AND operation on the maximum fusion data and the minimum fusion data to obtain the commonality fusion data. Output: Sperm morphology edge commonality fusion data Using the logical AND method, the maximum fusion data and the minimum fusion data are logically ANDed pixel by pixel.
[0172] According to the primary edge data of sperm morphology and the secondary edge data of sperm morphology, multi-scale Gaussian blur is performed to obtain primary edge multi-scale Gaussian blur data and secondary edge multi-scale Gaussian blur data respectively. Input: primary edge data of sperm morphology, secondary edge data of sperm morphology. Steps: Perform Gaussian blur processing of different scales on the primary edge data and the secondary edge data respectively. Output: primary edge multi-scale Gaussian blur data, secondary edge multi-scale Gaussian blur data. Use Gaussian blur methods of different scales to smooth the primary edge data and the secondary edge data.
[0173] Gaussian Blur: , is the image data after Gaussian blur, is the constant term of pi, is the image standard deviation, is the image horizontal coordinate data, is the image ordinate data. In order to enhance the multi-scale features of the image, Gaussian blur processing can be applied at different scales. Gaussian blur of different scales is achieved by using different value to achieve. Choose different value, select a different set of values according to actual needs values to generate Gaussian blur effects of different scales. Select some discrete Values, such as 1, 2, 3, etc. Apply different The Gaussian blur processing of different values is performed to generate blurred images of different scales. The blurred images of different scales are weighted fused to enhance the edge and detail information, and the primary edge multi-scale Gaussian blur data and the secondary edge multi-scale Gaussian blur data are obtained.
[0174] Select different σ values according to the image features and processing requirements to generate multi-scale Gaussian blurred images. Generate Gaussian blurred images of different scales: Apply Gaussian blur processing with different σ values to the input image to obtain blurred images of different scales. Gaussian blur is achieved through convolution operation, which convolves the Gaussian kernel with the image. Weighted fusion of Gaussian blurred images of different scales is performed to enhance the multi-scale features of the image. Weighted fusion can be achieved by multiplying the blurred images of each scale by the corresponding weight and then adding all the weighted images.
[0175] According to the primary edge multi-scale Gaussian blur data and the secondary edge multi-scale Gaussian blur data, weighted fusion is performed to obtain sperm morphology edge multi-scale fusion data. Input: primary edge multi-scale Gaussian blur data, secondary edge multi-scale Gaussian blur data. Steps: Weighted fusion of Gaussian blur data of different scales is performed to obtain multi-scale fusion data. Output: sperm morphology edge multi-scale fusion data. Weighted fusion of Gaussian blur results of different scales is performed to enhance edge information.
[0176] In the present invention, by extracting the maximum and minimum data of the edge and performing logical AND processing, the common edge of sperm can be accurately identified, and the accuracy and stability of edge detection can be improved. The maximum value extraction, minimum value extraction and logical AND processing methods are simple to calculate, and the edge data can be quickly fused to improve the processing efficiency. The maximum value fusion data and the minimum value fusion data are logically AND processed, and the common edge information can be retained, noise and false detection can be reduced, and the accuracy of edge detection can be further improved. By performing multi-scale Gaussian blur processing on the primary and secondary edge data, the edges can be smoothed at different scales, the influence of noise can be reduced, and the continuity and integrity of the edges can be improved. The primary edge and secondary edge data after multi-scale Gaussian blur processing are weighted fused, and information of different scales is integrated to improve the accuracy and robustness of edge detection. By combining the results of different edge detection methods and integrating information of different modalities, the edges of sperm can be more comprehensively and accurately identified, and the robustness and adaptability of the system can be improved. The multi-scale Gaussian blur and weighted fusion method can adapt to image features of different scales and improve the adaptability of the system under various complex backgrounds and noise conditions.
[0177] Preferably, the present application also provides a sperm morphology data recognition system for executing the sperm morphology data recognition method as described above, the sperm morphology data recognition system comprising:
[0178] A sperm morphology preprocessing module is used to obtain sperm morphology data and preprocess the sperm morphology data to obtain sperm morphology preprocessing data;
[0179] A sperm morphology preprocessing data segmentation module is used to perform image segmentation according to the sperm morphology preprocessing data to obtain sperm segmentation data;
[0180] A sperm multimodal feature extraction module is used to extract multimodal features based on sperm segmentation data to obtain multimodal feature data;
[0181] The sperm multimodal feature fusion module is used to perform feature fusion based on the multimodal feature data to obtain sperm multimodal fusion data for sperm morphology data recognition.
[0182] Preferably, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method as described in any one of the above items when running.
[0183] The beneficial effect of the present invention is that by controlling the first resolution camera and the second resolution camera to collect high-resolution and low-resolution sperm image data respectively, the processing efficiency can be guaranteed while obtaining images with rich details. The high-resolution image provides fine morphological details, and the low-resolution image improves the processing speed and the robustness of the overall morphological recognition. The high-resolution data is Gaussian filtered to remove high-frequency noise while retaining fine edges; the low-resolution data is mean filtered to effectively smooth the image and improve the image quality. The adaptive preprocessing selects the optimal filtering method according to the image resolution characteristics to improve the preprocessing effect. Canny edge detection and refined morphological processing (such as local corrosion and expansion) are used for high-resolution data to achieve high-precision edge detection and segmentation to ensure complete details. For low-resolution data, Sobel edge detection is first performed, and then Prewitt edge detection is performed to gradually refine the edge to reduce false detection and missed detection. Combined with primary and secondary edge data, maximum and minimum value fusion is performed, and common edges are retained through logical and processing to further improve the accuracy of edge detection. Through multi-scale Gaussian blur processing and weighted fusion, edge information is enhanced, image features of different scales are adapted, and the accuracy and robustness of segmentation are improved. The regional attributes, perimeter, and shape factor (including roundness and aspect ratio) of sperm are calculated to fully describe the geometric morphology of sperm. The texture features of sperm are extracted through gray-level co-occurrence matrix and local binary pattern (LBP) calculation to capture the microscopic details in the image. The color distribution characteristics of sperm are obtained through color histogram calculation and color space conversion to provide additional distinguishing information. First, the morphological features and texture features are fused to improve the comprehensiveness of the features by combining the geometric morphology and texture details. On the basis of the primary fusion data, the color features are combined for advanced fusion to form a comprehensive feature vector containing morphological, texture and color information. Through adaptive preprocessing and morphological processing methods, the processing parameters can be dynamically adjusted according to the image characteristics to ensure the good performance of the system under different image quality and sample variation conditions. Combining different edge detection results and multimodal features, the adaptability and robustness of the system are enhanced, and the accuracy and stability of recognition are improved. The most representative features are screened out through feature selection methods to reduce feature dimensions; the hierarchical feature fusion method gradually integrates the features of different modalities, optimizes computing resources, and improves processing efficiency.
[0184] Therefore, from any point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the attached application documents rather than the above description, and it is intended that all changes within the meaning and scope of equivalent elements of the application documents are included in the present invention.
[0185] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those 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 should conform to the widest scope consistent with the principles and novel features invented herein.
Claims
1. A method for identifying sperm morphology data, characterized in that: The following steps are involved: Step S1 includes: Controlling a first resolution camera to collect sperm images through a microscope and preset first resolution parameter data to obtain first sperm morphology data; Controlling the second resolution camera to collect sperm images through a microscope and preset second resolution parameter data to obtain second sperm morphology data, wherein pixel data corresponding to the first resolution camera is greater than pixel data corresponding to the second resolution camera, and the first resolution parameter data and the second resolution parameter data are different resolution parameter data; Performing Gaussian filtering on the first sperm morphology data to obtain first sperm morphology preprocessing data, and performing mean filtering on the second sperm morphology data to obtain second sperm morphology preprocessing data; Step S2 comprises: Performing canny edge detection on the first sperm morphology preprocessing data to obtain the first sperm morphology edge data; Performing refined morphological processing according to the first sperm morphological edge data to obtain the first sperm segmentation data; Perform Sobel edge detection on the second sperm morphology preprocessing data to obtain the primary edge data of sperm morphology; Perform prewitt edge detection on the primary edge data of sperm morphology to obtain the secondary edge data of sperm morphology; Perform multimodal fusion morphological processing on the secondary edge data of sperm morphology to obtain the second sperm segmentation data; Step S3: performing multimodal feature extraction according to the sperm segmentation data to obtain multimodal feature data, wherein the sperm segmentation data includes first sperm segmentation data and second sperm segmentation data; Step S4: performing feature fusion according to the multimodal feature data to obtain sperm multimodal fusion data for performing sperm morphology data recognition operation; The detailed morphological processing is as follows: Performing local segmentation on the first sperm morphology preprocessing data according to the first sperm morphology edge data to obtain sperm local segmentation data; Perform edge strength calculation and texture complexity calculation on sperm local segmentation data to obtain sperm edge strength data and sperm local texture complexity data; Generating sperm local corrosion coefficient and sperm local expansion coefficient according to sperm edge strength data, sperm local texture complexity data and sperm local segmentation data, and obtaining sperm local corrosion coefficient data and sperm local expansion coefficient data; Performing an opening operation according to sperm local corrosion coefficient data and first sperm morphology preprocessing data to obtain sperm morphology edge opening operation data; A closing operation is performed based on the sperm local expansion coefficient data and the sperm morphology edge opening operation data to obtain the first sperm segmentation data.
2. The method according to claim 1, characterized in that Step S3 is specifically as follows: Calculate the regional attributes, sperm circumference and shape factor according to the sperm segmentation data to obtain sperm regional data line data, sperm circumference data and sperm shape factor data, wherein the sperm shape factor data includes sperm roundness shape factor data and sperm aspect ratio shape factor data; Performing characteristic vectorization processing on sperm area data line data, sperm perimeter data and sperm shape factor data to obtain sperm morphological characteristic data; Gray-level co-occurrence matrix is calculated based on sperm segmentation data to obtain sperm gray-level co-occurrence matrix data; Perform local binary calculation on the sperm gray-level co-occurrence matrix data to obtain sperm texture feature data; Performing color histogram calculation according to sperm segmentation data to obtain sperm color histogram data; Performing color space conversion on sperm color histogram data to obtain sperm color feature data; According to the sperm morphological feature data, sperm texture feature data, sperm color feature data and sperm segmentation data, spatial labeling and feature vectorization are performed to obtain multimodal feature data.
3. The method according to claim 1, characterized in that: Step S4 is specifically as follows: Performing feature selection according to the multimodal feature data to obtain multimodal feature selection data; Performing feature fusion on sperm morphology feature selection data in the multimodal feature selection data and sperm texture feature selection data in the multimodal feature selection data to obtain primary sperm multimodal fusion data; Feature fusion is performed based on the primary sperm multimodal fusion data and the sperm color feature selection data in the multimodal feature selection data to obtain sperm multimodal fusion data for sperm morphology data recognition operations.
4. The method according to claim 1, characterized in that: The multimodal fusion morphological processing is specifically as follows: Perform edge fusion according to the primary edge data of sperm morphology and the secondary edge data of sperm morphology to obtain sperm morphology edge fusion data; Performing an open operation on the sperm morphology edge fusion data to obtain sperm morphology fusion open operation data; The sperm morphology fusion open operation data is closed to obtain the second sperm segmentation data.
5. The method according to claim 4, characterized in that The sperm morphology edge fusion data includes sperm morphology edge commonality fusion data and sperm morphology edge multi-scale fusion data. The edge fusion is specifically as follows: According to the primary edge data of sperm morphology and the secondary edge data of sperm morphology, maximum values are extracted and fused to obtain edge maximum value fusion data; Minimum value extraction and fusion are performed based on the primary edge data of sperm morphology and the secondary edge data of sperm morphology to obtain edge minimum value fusion data; Perform logical AND processing based on the edge maximum value fusion data and the edge minimum value fusion data to obtain the sperm morphology edge commonality fusion data; Perform multi-scale Gaussian blurring on the primary edge data of sperm morphology and the secondary edge data of sperm morphology to obtain primary edge multi-scale Gaussian blurring data and secondary edge multi-scale Gaussian blurring data respectively; The primary edge multi-scale Gaussian blur data and the secondary edge multi-scale Gaussian blur data are weightedly fused to obtain the sperm morphology edge multi-scale fusion data.
6. A sperm morphology data recognition system, characterized in that: Used to perform the sperm morphology data identification method according to claim 1, the sperm morphology data identification system comprises: A sperm morphology preprocessing module is used to obtain sperm morphology data and preprocess the sperm morphology data to obtain sperm morphology preprocessing data; A sperm morphology preprocessing data segmentation module is used to perform image segmentation according to the sperm morphology preprocessing data to obtain sperm segmentation data; A sperm multimodal feature extraction module is used to extract multimodal features based on sperm segmentation data to obtain multimodal feature data; The sperm multimodal feature fusion module is used to perform feature fusion based on the multimodal feature data to obtain sperm multimodal fusion data for sperm morphology data recognition.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 5 when executed.
Citation Information
Patent Citations
Sperm morphology anomaly detection method
CN104268515A
Automatic sperm morphology analysis method based on multi-scale feature fusion
CN113313678A
