Method, device and equipment for classifying fallopian tube images and storage medium
By standardizing the processing of fallopian tube images, processing noise using a diffusion model, and employing Transformer classification, the problem of misjudgment caused by different imaging conditions was solved, thus improving the accuracy of fallopian tube obstruction diagnosis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN XINGLIN HOSPITAL (XIAMEN INFECTIOUS DISEASE HOSPITAL)
- Filing Date
- 2026-02-05
- Publication Date
- 2026-05-19
AI Technical Summary
Due to differences in imaging conditions, existing technologies can lead to misjudgments of fallopian tube blockage, increasing the risk of misdiagnosis and missed diagnosis.
By standardizing the fallopian tube images, adding and removing random noise using a diffusion model, capturing long-distance dependencies using the Transformer's self-attention mechanism, and classifying the target region by assigning attention weights.
It reduces misdiagnosis caused by different imaging conditions, improves the diagnostic accuracy of fallopian tube obstruction, and reduces the risk of misdiagnosis and missed diagnosis.
Smart Images

Figure CN121639702B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image classification, and in particular to a method, apparatus, device, and storage medium for classifying fallopian tube images. Background Technology
[0002] Fallopian tube obstruction is a common cause of female infertility, accounting for approximately 25% to 35% of infertility cases. Typical pathological forms include hydrosalpinx and tubal adhesions. When the fallopian tubes are blocked, it interferes with the normal process of fertilization between the egg and sperm within the fallopian tube, or prevents the fertilized egg from being transported smoothly to the uterus, thus leading to infertility. The causes of fallopian tube obstruction are quite complex, mainly closely related to many factors such as pelvic inflammatory disease (including cases caused by sexually transmitted infections), adhesions after pelvic surgery, endometriosis, and multiple miscarriages.
[0003] Currently, the medical field has developed various methods to aid in the diagnosis of fallopian tube obstruction, encompassing imaging examinations (such as hysterosalpingography (HSG) and hysterosalpingography ultrasound (HyCoSy)), hysteroscopy, and laparoscopy. While these methods play a vital role in clinical practice, they also have some significant limitations. Specifically, diagnostic conclusions rely heavily on the subjective judgment of radiologists or obstetricians and gynecologists. Especially when assessing the nature, extent, and specific location of fallopian tube lesions, significant differences in judgment between doctors can exist. This not only increases the risk of misdiagnosis but may also lead to missed diagnoses, thus affecting the patient's chances of receiving timely and accurate diagnosis and treatment.
[0004] In view of the above, this application is hereby submitted. Summary of the Invention
[0005] This invention discloses a method, apparatus, device, and storage medium for classifying fallopian tube images, aiming to solve the problem in the prior art that the fallopian tube obstruction may be misjudged due to different imaging conditions.
[0006] The first embodiment of the present invention provides a method for classifying fallopian tube images, comprising:
[0007] Obtain fallopian tube image information to be classified, and perform standardization processing on the fallopian tube images;
[0008] The diffusion model is used to add random noise to the standardized fallopian tube image, and the noise is removed in reverse. The addition and removal of noise are dynamically adjusted based on the standardized fallopian tube image.
[0009] The results generated at each time step of the inverse noise removal process are input into the Transformer, which captures long-range dependencies from the gradually clearing fallopian tube images through a self-attention mechanism, highlights the target region by allocating attention weights, and classifies the fallopian tube image information based on the target region.
[0010] Preferably, the standardized expression is:
[0011] ;
[0012] in, These are the standardized pixel values. The average pixel value of the image. Let x be the standard deviation of the image pixels, and x be the pixel value before standardization.
[0013] Preferably, the addition and removal of noise are based on dynamic adjustment of standardized fallopian tube images, specifically:
[0014] The quality of the hysterosalpingography (HSG) images was assessed, and the images were preprocessed based on the assessment results. Information on potential obstruction areas was also detected and generated.
[0015] Based on the location and type of the potential obstruction area information, the noise parameters of the potential obstruction area are determined, wherein the location includes proximal, mid-segment and distal, and different weighting coefficients are assigned to different locations; the type includes cystic obstruction and solid obstruction, and the noise distribution type is selected according to the obstruction type.
[0016] Based on the quality assessment results and noise parameters, adaptive noise parameters are generated, and adaptive denoising processing is performed on the fallopian tube images after adding noise based on the adaptive noise parameters.
[0017] Preferably, the results generated at each time step of the inverse noise removal process are input into a Transformer. A self-attention mechanism is used to capture long-range dependencies from the gradually clearer fallopian tube images. Attention weights are assigned to highlight target regions, and the fallopian tube image information is classified based on these target regions. Specifically:
[0018] The results of each time step of the reverse noise removal process are encoded to generate the input embedding sequence;
[0019] The input embedding sequence is processed by a self-attention mechanism, and the feature evolution at different time steps is analyzed based on the temporal correlation of the processing results to determine the key regions of the fallopian tube.
[0020] The key regions are enhanced with features, and the enhanced key regions are classified by a classifier to generate classification results.
[0021] A second embodiment of the present invention provides a device for classifying fallopian tube images, comprising:
[0022] A standardization processing unit is used to acquire fallopian tube image information to be classified and to perform standardization processing on the fallopian tube images;
[0023] The noise processing unit is used to call the diffusion model to add random noise to the standardized fallopian tube image and remove the noise in reverse, wherein the addition and removal of noise are dynamically adjusted based on the standardized fallopian tube image.
[0024] The classification unit is used to input the results generated at each time step of the inverse noise removal process into the Transformer, capture long-distance dependencies from the gradually clearing fallopian tube images through a self-attention mechanism, highlight the target region through the allocation of attention weights, and classify the fallopian tube image information based on the target region.
[0025] Preferably, the standardized expression is:
[0026] ;
[0027] in, These are the standardized pixel values. The average pixel value of the image. Let x be the standard deviation of the image pixels, and x be the pixel value before standardization.
[0028] Preferably, the addition and removal of noise are based on dynamic adjustment of standardized fallopian tube images, specifically:
[0029] The quality of the hysterosalpingography (HSG) images was assessed, and the images were preprocessed based on the assessment results. Information on potential obstruction areas was also detected and generated.
[0030] Based on the location and type of the potential obstruction area information, the noise parameters of the potential obstruction area are determined, wherein the location includes proximal, mid-segment and distal, and different weighting coefficients are assigned to different locations; the type includes cystic obstruction and solid obstruction, and the noise distribution type is selected according to the obstruction type.
[0031] Based on the quality assessment results and noise parameters, adaptive noise parameters are generated, and adaptive denoising processing is performed on the fallopian tube images after adding noise based on the adaptive noise parameters.
[0032] Preferably, the results generated at each time step of the inverse noise removal process are input into a Transformer. A self-attention mechanism is used to capture long-range dependencies from the gradually clearer fallopian tube images. Attention weights are assigned to highlight target regions, and the fallopian tube image information is classified based on these target regions. Specifically:
[0033] The results of each time step of the reverse noise removal process are encoded to generate the input embedding sequence;
[0034] The input embedding sequence is processed by a self-attention mechanism, and the feature evolution at different time steps is analyzed based on the temporal correlation of the processing results to determine the key regions of the fallopian tube.
[0035] The key regions are enhanced with features, and the enhanced key regions are classified by a classifier to generate classification results.
[0036] The third embodiment of the present invention provides a device for classifying fallopian tube images, including a memory and a processor. The memory stores a computer program, which can be executed by the processor to implement a method for classifying fallopian tube images as described in any of the above embodiments.
[0037] The fourth embodiment of the present invention provides a computer-readable storage medium storing a computer program that can be executed by a processor of the device in which the computer-readable storage medium is located, so as to implement a method for classifying fallopian tube images as described in any of the above claims.
[0038] Based on the present invention, a method, apparatus, device, and storage medium for classifying fallopian tube images are provided. First, fallopian tube image information to be classified is acquired and standardized. Then, a diffusion model is used to add random noise to the standardized fallopian tube images, followed by inverse noise removal. Finally, the results generated at each time step of the inverse noise removal are input into a Transformer. A self-attention mechanism is used to capture long-distance dependencies from the gradually clearing fallopian tube images, and attention weights are allocated to highlight target regions. The fallopian tube image information is then classified based on these target regions. This solves the problem in existing technologies where different imaging conditions may lead to misjudgments of fallopian tube obstruction. Attached Figure Description
[0039] Figure 1 This is a flowchart illustrating a method for classifying fallopian tube images provided in the first embodiment of the present invention;
[0040] Figure 2This is a schematic diagram of a module for classifying fallopian tube images provided in the second embodiment of the present invention. Detailed Implementation
[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] To better understand the technical solution of the present invention, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0043] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0044] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0045] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0046] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0047] The terms "first" and "second" used in the embodiments are merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" can be interchanged in a specific order or sequence where permissible. It should be understood that the objects distinguished by "first" and "second" can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein.
[0048] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0049] This invention discloses a method, apparatus, device, and storage medium for classifying fallopian tube images, aiming to solve the problem in the prior art that the fallopian tube obstruction may be misjudged due to different imaging conditions.
[0050] Please see Figure 1 The first embodiment of the present invention provides a method for classifying fallopian tube images, which can be executed by a fallopian tube image classification device (hereinafter referred to as the classification device), and in particular, by one or more processors within the classification device, to at least implement the following steps:
[0051] S101, Obtain the fallopian tube image information to be classified, and perform standardization processing on the fallopian tube image;
[0052] In this embodiment, the classification device can be a desktop computer, laptop computer, server, workstation, or other terminal with data processing capabilities. It can communicate with the fallopian tube imaging device via wired or wireless means to receive fallopian tube image information. The classification device can be equipped with a corresponding operating system and application software, and the functions required in this embodiment can be realized through the combination of the operating system and application software.
[0053] In this embodiment, the fallopian tube image information to be classified is first acquired. The images can originate from various imaging devices, such as X-ray angiography machines, CT scanners, or other devices suitable for medical image acquisition, to ensure that the acquired images have high resolution and completeness. To eliminate image differences that may be caused by different devices and acquisition conditions, the fallopian tube images need to be standardized. In the standardization process, the pixel values of the images are standardized using the following expression: ,in, These are the standardized pixel values. The average pixel value of the image. This represents the standard deviation of the image pixels. This expression effectively adjusts the distribution of pixel values in the image, centering it around zero and limiting it to a certain range, thereby reducing the interference of external factors such as illumination and contrast on the image analysis results. In specific implementation, firstly, the set of all pixel values is extracted from the fallopian tube image, and its overall mean and standard deviation are calculated. Then, each pixel value is transformed according to the above expression to generate a standardized image. Through normalization, the image data is mapped to a uniform distribution range, which helps the model extract features more efficiently, especially when dealing with complex areas such as fallopian tube lesions, significantly reducing the interference of background noise.
[0054] S102, The diffusion model is called to add random noise to the standardized fallopian tube image and remove the noise in reverse, wherein the addition and removal of noise are dynamically adjusted based on the standardized fallopian tube image;
[0055] It should be noted that in this embodiment, the diffusion model can be trained by gradually increasing random noise, and then the noise can be removed through the reverse process to generate high-quality image data. The formulas for increasing noise (2) and removing noise (3) are as follows:
[0056] (2)
[0057] (3)
[0058] in, This represents image data containing noise at time t. It is the raw image data (noise-free). This represents random noise increasing over time (t). During this process, the model can effectively learn and identify minute changes in fallopian tube images, thereby helping to determine whether an obstruction exists, its nature, and its severity.
[0059] Specifically, in this embodiment, a hysterosalpingography (HSG) image is acquired, and the Laplacian operator is used to assess the image quality and calculate a blur score. The blur score is determined by the reciprocal of the variance of the Laplacian operator. Simultaneously, the overall image contrast is extracted, calculated based on the standard deviation of the image pixel values.
[0060] Next, the images are standardized to eliminate data bias, and further preprocessing steps are performed to detect potential obstruction areas. Specifically, the sum of the image mean and standard deviation is used as the threshold for binarization to convert the grayscale image into a binary image. It should be noted that in existing technologies, different imaging conditions may lead to misjudgments of fallopian tube obstruction. Using the sum of the mean and standard deviation as the threshold for binarization is to eliminate the influence of different imaging conditions and make the detection of obstruction areas more stable and reliable. Furthermore, obstruction areas (contrast agent retention) are usually brighter than normal areas, with pixel values higher than the average. Using the sum of the mean and standard deviation as the threshold can filter out brighter areas than the normal distribution, i.e., potential obstruction areas. Potential obstruction areas are obtained through connected component analysis. Features of each region are extracted, including the region's average pixel intensity, standard deviation, and area, to support obstruction area classification and noise adjustment. For example, areas with high pixel intensity standard deviations often show complex tissue characteristics, while larger areas may represent more severe lesions.
[0061] Subsequently, region-specific noise parameters are determined based on the location and type of the obstruction area. The fallopian tube length is divided into three equal parts by calculating the region's centroid location to distinguish between proximal, mid-segment, and distal obstruction locations. Furthermore, the obstruction type is determined based on the region's pixel intensity standard deviation: if the standard deviation is higher than 20% of the average pixel intensity, it is classified as cystic obstruction; otherwise, it is classified as solid obstruction. Weighting coefficients are assigned to obstructions at different locations; for example, proximal obstruction has a weight of 1.2, mid-segment obstruction 1.0, and distal obstruction 0.8, to highlight the importance of different locations.
[0062] Based on image quality assessment results and specific parameters of the occlusion region, adaptive noise parameters are dynamically calculated. The initial noise level is obtained by multiplying the base noise by the complement of the blur score, and further adjusted by combining position weight coefficients. The noise distribution type is selected according to the occlusion type: Gaussian distribution is used to generate noise for cystic occlusions, while uniform distribution is used for solid occlusions. Furthermore, scaling factors are applied to the noise parameters for different occlusion types, for example, magnifying cystic occlusions by a factor of 1.2 and reducing solid occlusions by a factor of 0.8, to simulate the true texture characteristics of the lesion region.
[0063] After calculating the noise parameters, the image is processed using the corresponding noise matrix. The generated noise matrix is then subjected to Gaussian filtering (kernel size of 1) to ensure the smoothness and naturalness of the noise. Subsequently, the filtered noise matrix is superimposed on the original image to generate a noisy image.
[0064] Finally, adaptive denoising is performed on the image after noise addition. A denoising intensity parameter is calculated using the original noise parameters; this parameter is 10 times the noise scale to effectively remove the added noise. The denoising algorithm employs a non-local mean denoising method with a template window size of 7 and a search window size of 21 to ensure fine-grained denoising. After denoising, the pixel value range of the image is limited to ensure that the output image data is within the valid range.
[0065] S103, the results generated at each time step of the inverse noise removal are input into the Transformer, long-distance dependencies are captured from the gradually clearing fallopian tube images through a self-attention mechanism, and the target region is highlighted by the allocation of attention weights, and the fallopian tube image information is classified based on the target region.
[0066] In this embodiment, the image results at each time step t are obtained from the inverse denoising process of the diffusion model. These images, ranging from random noise to gradually clearer fallopian tube images, demonstrate the dynamic evolution of the denoising process. To input the Transformer model, the images at each time step are preprocessed into a sequence of fixed-size image patches. These image patches are positionally encoded to generate position embedding vectors, preserving spatial structure information. The image patches and their position embedding vectors are fused to form an input embedding sequence containing both spatial and semantic information.
[0067] In the Transformer, a multi-head self-attention mechanism is used to process the input embedding sequence. Through a linear transformation, the input sequence is mapped to a query matrix Q, a key matrix K, and a value matrix V. The dot product of the query matrix and the key matrix reflects the correlation between different image patches. The result is scaled to the square root of the key vector dimension and then normalized using Softmax to generate attention weights. These weights are used to weight the value matrix, resulting in a weighted feature representation that highlights key features. The core of the self-attention mechanism lies in its ability to dynamically allocate weights, focusing more attention on salient regions of the image.
[0068] To further analyze the feature evolution between time steps, a temporal correlation analysis is established. By calculating the feature similarity matrix between adjacent time steps, the trend of feature change is extracted, and the similarity information is used to update the attention weights, thereby strengthening the representation of temporally correlated regional features. This temporal correlation analysis can not only capture the gradual emergence of image details during denoising, but also improve the classification accuracy in dynamic image scenes.
[0069] The localization of the target region relies on the generated attention weights, and a heatmap is constructed to visually represent high-response areas in the image. Thresholding segmentation of the heatmap can extract potential target regions, which, when combined with prior anatomical knowledge, accurately determine the boundaries of key areas of the fallopian tube.
[0070] After identifying the target region, its features are further enhanced. By calculating the local self-attention score within the target region, the model can refine the representation of important features within the region. Simultaneously, local and global features are fused to ensure that the target region features retain good expressiveness within the overall context, thereby enhancing the discriminative ability of the classification model.
[0071] The classifier inputs the enhanced features into a fully connected layer and uses the Softmax function to calculate the probability distribution for each category. Based on a preset confidence threshold, it finally outputs the classification result of the image.
[0072] To optimize model performance, a feedback optimization mechanism was established. The cross-entropy loss between the classifier's output and the true labels was used to guide model updates. By adjusting the parameters of the attention module and the weight coefficients of the feature enhancement module through backpropagation, the model was continuously optimized, further improving classification performance.
[0073] In one possible implementation of this embodiment, an interactive health consultation system extended by a large language model can also be used to achieve standardized medical processes. These models integrate the results of diffusion models and Transformers to provide real-time, accurate medical advice based on input images, assisting hospital radiologists and obstetricians in decision-making. The model's advantage lies in reducing misjudgments caused by differences in physician experience, which is particularly important for doctors with relatively limited experience at the grassroots level. Combining such a system, especially in resource-scarce areas, can improve the service capacity for infertile patients in primary healthcare institutions. The model's output is standardized and quantified using a General Linear Model (GLM), as shown in the formula below:
[0074]
[0075] in, It is the output of the model. The intercept term represents the sum of all independent variables ( to When ) is zero, The expected value. It is a constant that provides the baseline value for the model. Independent variables ( to (This indicates information such as the patient's age, weight, and past medical history.) It is the independent variable ( to The coefficient of ) is used to provide interactive and accurate medical decision-making through online AR updates and database queries in various health consultation application scenarios.
[0076] Please see Figure 2 The second embodiment of the present invention provides a device for classifying fallopian tube images, comprising:
[0077] Standardization processing sheet 201 is used to acquire fallopian tube image information to be classified and to perform standardization processing on the fallopian tube images;
[0078] The noise processing unit 202 is used to call the diffusion model to add random noise to the standardized fallopian tube image and remove the noise in reverse, wherein the addition and removal of noise are dynamically adjusted based on the standardized fallopian tube image.
[0079] The classification unit 203 is used to input the results generated at each time step of the inverse noise removal process into the Transformer, capture long-distance dependencies from the gradually clearing fallopian tube images through a self-attention mechanism, highlight the target region through the allocation of attention weights, and classify the fallopian tube image information based on the target region.
[0080] Preferably, the standardized expression is:
[0081] ;
[0082] in, These are the standardized pixel values. The average pixel value of the image. represents the standard deviation of the image pixels.
[0083] Preferably, the addition and removal of noise are based on dynamic adjustment of standardized fallopian tube images, specifically:
[0084] The quality of the hysterosalpingography (HSG) images was assessed, and the images were preprocessed based on the assessment results. Information on potential obstruction areas was also detected and generated.
[0085] Based on the location and type of potential congestion area information, determine region-specific noise parameters;
[0086] Based on the quality assessment results and noise parameters, adaptive noise parameters are generated, and adaptive denoising processing is performed on the fallopian tube images after adding noise based on the adaptive noise parameters.
[0087] Preferably, the results generated at each time step of the inverse noise removal process are input into a Transformer. A self-attention mechanism is used to capture long-range dependencies from the gradually clearer fallopian tube images. Attention weights are assigned to highlight target regions, and the fallopian tube image information is classified based on these target regions. Specifically:
[0088] The results of each time step of the reverse noise removal process are encoded to generate the input embedding sequence;
[0089] The input embedding sequence is processed by a self-attention mechanism, and the feature evolution at different time steps is analyzed based on the temporal correlation of the processing results to determine the key regions of the fallopian tube.
[0090] The key regions are enhanced with features, and the enhanced key regions are classified by a classifier to generate classification results.
[0091] The third embodiment of the present invention provides a device for classifying fallopian tube images, including a memory and a processor. The memory stores a computer program, which can be executed by the processor to implement a method for classifying fallopian tube images as described in any of the above embodiments.
[0092] The fourth embodiment of the present invention provides a computer-readable storage medium storing a computer program that can be executed by a processor of the device in which the computer-readable storage medium is located, so as to implement a method for classifying fallopian tube images as described in any of the above claims.
[0093] Based on the present invention, a method, apparatus, device, and storage medium for classifying fallopian tube images are provided. First, fallopian tube image information to be classified is acquired and standardized. Then, a diffusion model is used to add random noise to the standardized fallopian tube images, followed by inverse noise removal. Finally, the results generated at each time step of the inverse noise removal are input into a Transformer. A self-attention mechanism is used to capture long-distance dependencies from the gradually clearing fallopian tube images, and attention weights are allocated to highlight target regions. The fallopian tube image information is then classified based on these target regions. This solves the problem in existing technologies where different imaging conditions may lead to misjudgments of fallopian tube obstruction.
[0094] Exemplary examples show that the computer program described in the third and fourth embodiments of the present invention can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in implementing a device for classifying fallopian tube images. For example, the apparatus described in the second embodiment of the present invention.
[0095] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. This processor is the control center of the method for classifying fallopian tube images, connecting various parts of the method through various interfaces and lines.
[0096] The memory can be used to store the computer program and / or modules. The processor, by running or executing the computer program and / or modules stored in the memory and calling the data stored in the memory, implements various functions of a method for classifying fallopian tube images. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, text conversion function, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, text message data, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0097] If the implemented module is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0098] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0099] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for classifying images of the fallopian tubes, characterized in that, include: Obtain fallopian tube image information to be classified, and perform standardization processing on the fallopian tube images; A diffusion model is used to add random noise to the standardized fallopian tube images, and then the noise is removed in reverse. The addition and removal of noise are dynamically adjusted based on the standardized fallopian tube images. Specifically: The quality of the hysterosalpingography (HSG) images is assessed. Based on the quality assessment results, the images are preprocessed, and potential obstruction area information is detected and generated. The noise parameters of the potential obstruction areas are determined based on their location and type. The obstruction type is determined by the standard deviation of the region's pixel intensity. When the standard deviation is higher than a preset proportion of the average pixel intensity, it is determined to be cystic obstruction; otherwise, it is determined to be solid obstruction. Based on the quality assessment results and noise parameters, adaptive noise parameters are generated, and adaptive denoising processing is performed on the noise-added fallopian tube images based on the adaptive noise parameters. Specifically, the quality assessment involves: using the Laplacian operator to assess the image quality, calculating the blur score, which is determined by the reciprocal of the variance of the Laplacian operator, and simultaneously calculating the overall image contrast based on the standard deviation of the image pixel values. The detection and generation of potential blocking region information specifically involves: using the sum of the image mean and standard deviation as the threshold for binarization processing, converting the grayscale image into a binary image, and obtaining potential blocking regions through connected component analysis; The step of determining the noise parameters of the potential obstruction area based on the location and type of the potential obstruction area information further includes: dividing the fallopian tube length into three equal parts by calculating the centroid position of the area, distinguishing the proximal, middle and distal obstruction locations, and assigning different weight coefficients to different locations; selecting the noise distribution type according to the obstruction type, wherein cystic obstruction uses a Gaussian distribution to generate noise, and solid obstruction uses a uniform distribution to generate noise; and applying scaling factors to the noise parameters of different types of obstruction respectively. The results generated at each time step of the inverse noise removal process are input into the Transformer. The long-distance dependencies are captured from the gradually clearing fallopian tube images through a self-attention mechanism. The target region is highlighted by the allocation of attention weights, and the fallopian tube image information is classified based on the target region. Specifically, the process involves: preprocessing the results of each time step of the inverse noise removal process into a fixed-size sequence of image patches; encoding the image patches to generate location embedding vectors; fusing the image patches and location embedding vectors to form the input embedding sequence; mapping the input sequence to a query matrix Q, a key matrix K, and a value matrix V using a multi-head self-attention mechanism; extracting the trend of feature changes by calculating the feature similarity matrix of adjacent time steps, and using the similarity information to update the attention weights to strengthen the representation of temporally relevant regional features; constructing a heatmap to present high-response areas in the image, performing threshold segmentation on the heatmap to extract target regions, and combining the target regions with anatomical prior knowledge to determine the boundaries of key areas of the fallopian tube; calculating the local self-attention score within the target region to refine the feature expression within the region, fusing the local features with the global features and inputting them into a classifier, and outputting the classification result based on the Softmax function.
2. The method for classifying fallopian tube images according to claim 1, characterized in that, The standardized expression is: ; in, These are the standardized pixel values. The average pixel value of the image. Let x be the standard deviation of the image pixels, and x be the pixel value before standardization.
3. A device for classifying images of the fallopian tubes, characterized in that, include: A standardization processing unit is used to acquire fallopian tube image information to be classified and to perform standardization processing on the fallopian tube images; The noise processing unit is used to add random noise to the standardized fallopian tube images by calling a diffusion model, and then remove the noise in reverse. The addition and removal of noise are dynamically adjusted based on the standardized fallopian tube images. Specifically: The quality of the hysterosalpingography (HSG) images is assessed. Based on the quality assessment results, the images are preprocessed, and potential obstruction area information is detected and generated. The noise parameters of the potential obstruction areas are determined based on their location and type. The obstruction type is determined by the standard deviation of the region's pixel intensity. When the standard deviation is higher than a preset proportion of the average pixel intensity, it is determined to be cystic obstruction; otherwise, it is determined to be solid obstruction. Based on the quality assessment results and noise parameters, adaptive noise parameters are generated, and adaptive denoising processing is performed on the noise-added fallopian tube images based on the adaptive noise parameters. Specifically, the quality assessment involves: using the Laplacian operator to assess the image quality, calculating the blur score, which is determined by the reciprocal of the variance of the Laplacian operator, and simultaneously calculating the overall image contrast based on the standard deviation of the image pixel values. The detection and generation of potential blocking region information specifically involves: using the sum of the image mean and standard deviation as the threshold for binarization processing, converting the grayscale image into a binary image, and obtaining potential blocking regions through connected component analysis; The step of determining the noise parameters of the potential obstruction area based on the location and type of the potential obstruction area information further includes: dividing the fallopian tube length into three equal parts by calculating the centroid position of the area, distinguishing the proximal, middle and distal obstruction locations, and assigning different weight coefficients to different locations; selecting the noise distribution type according to the obstruction type, wherein cystic obstruction uses a Gaussian distribution to generate noise, and solid obstruction uses a uniform distribution to generate noise; and applying scaling factors to the noise parameters of different types of obstruction respectively. The classification unit is used to input the results generated at each time step of the inverse noise removal process into the Transformer, capture long-distance dependencies from the gradually clearing fallopian tube images through a self-attention mechanism, highlight the target region through the allocation of attention weights, and classify the fallopian tube image information based on the target region. Specifically, the process involves: preprocessing the results of each time step of the inverse noise removal process into a fixed-size sequence of image patches; encoding the image patches to generate location embedding vectors; fusing the image patches and location embedding vectors to form the input embedding sequence; mapping the input sequence to a query matrix Q, a key matrix K, and a value matrix V using a multi-head self-attention mechanism; extracting the trend of feature changes by calculating the feature similarity matrix of adjacent time steps, and using the similarity information to update the attention weights to strengthen the representation of temporally relevant regional features; constructing a heatmap to present high-response areas in the image, performing threshold segmentation on the heatmap to extract target regions, and combining the target regions with anatomical prior knowledge to determine the boundaries of key areas of the fallopian tube; calculating the local self-attention score within the target region to refine the feature expression within the region, fusing the local features with the global features and inputting them into a classifier, and outputting the classification result based on the Softmax function.
4. A classification device for fallopian tube images, characterized in that, The device includes a memory and a processor, wherein the memory stores a computer program that can be executed by the processor to implement a method for classifying fallopian tube images as described in any one of claims 1 to 2.
5. A computer-readable storage medium, characterized in that, The device contains a computer program that can be executed by a processor of the device in which the computer-readable storage medium is located, to implement a method for classifying fallopian tube images as described in any one of claims 1 to 2.