A method for training a gynecological micro-ecological image recognition model

By using dual-channel fluorescence image input, Retinex decomposition, and CLIPN diffusion generation network, combined with lightweight training, a gynecological microecological image recognition model was constructed. This solved the problems of high-quality data scarcity and uneven illumination, and achieved high-precision, real-time gynecological microecological image recognition.

CN122157252APending Publication Date: 2026-06-05SUZHOU CENTENNIAL VOCATIONAL COLLEGE

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUZHOU CENTENNIAL VOCATIONAL COLLEGE
Filing Date
2026-03-04
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In existing technologies, gynecological microecological image recognition models struggle to achieve high-precision recognition and real-time deployment due to the scarcity of high-quality data, uneven lighting, and high computational costs.

Method used

A gynecological microecological image recognition model was constructed by employing dual-channel fluorescence image input, a Retinex decomposition illumination diversity enhancement mechanism, a CLIPN-inspired negative semantic guided diffusion generation network, and a lightweight training strategy. Through multi-task learning and interference structure suppression, a high-quality training set was generated and the model complexity was reduced.

Benefits of technology

It significantly improves the model's adaptability to changes in lighting and its recognition accuracy, alleviates the problem of imbalanced datasets, and enables efficient real-time recognition in resource-constrained environments. It is suitable for immediate examination of gynecological microecological images and primary healthcare applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122157252A_ABST
    Figure CN122157252A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of gynecological image recognition, and particularly relates to a method for training a gynecological micro-ecological image recognition model, comprising the following steps: obtaining a set of gynecological microorganism fluorescence microscopic images processed by first and second channel staining, and performing screening, cleaning and labeling; constructing an illumination diversity enhancement mechanism based on Retinex decomposition, generating virtual images with illumination changes to enhance the training set; constructing a diffusion generation network based on negative semantic guidance, generating high-quality false positive samples to expand the data; constructing an image recognition model containing a double-channel processing branch and a fusion attention module, and training using a multi-task loss function; and finally obtaining a lightweight final model through knowledge distillation. The present application effectively improves the robustness of the model to illumination changes and interferents, alleviates the problem of positive sample scarcity, and is suitable for automatic and high-precision auxiliary diagnosis of gynecological micro-ecology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of gynecological image recognition technology, and more specifically to a method for training a gynecological microecological image recognition model. Background Technology

[0002] Gynecological microecological testing is a key means of assessing the health of women's reproductive tract and diagnosing infectious diseases. Traditional testing methods mainly rely on manual microscopic examination of vaginal secretion smears by laboratory personnel, judging by observing morphological targets such as white blood cells, clue cells, trichomonas, and spores. This method is not only time-consuming and labor-intensive, but its results also heavily depend on the experience and subjective judgment of the laboratory personnel, which can easily lead to missed diagnoses, misdiagnoses, and inconsistent diagnostic standards, making it difficult to meet the clinical needs of large-scale screening and rapid and accurate diagnosis.

[0003] In recent years, with the development of computer vision technology, artificial intelligence-based automatic image recognition methods have been introduced into this field to assist or replace manual interpretation. However, several problems are encountered in practical applications: First, high-quality, large-scale, and accurately labeled gynecological microscopic image datasets are scarce, especially rare category samples, which leads to limited model generalization ability. Second, problems such as uneven illumination, staining differences, air bubbles, and impurities during the acquisition of microscopic images can significantly reduce the recognition accuracy and stability of the model. Third, high-performance models often have a large number of parameters and high computational costs, making it difficult to achieve real-time deployment in commonly used embedded or edge devices in clinical settings.

[0004] Therefore, how to construct an automatic image recognition model for gynecological microecology that can fully utilize multi-channel fluorescence information, effectively resist the influence of light and interference, and operate efficiently in resource-constrained environments has become a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] In view of the above-mentioned shortcomings of the existing technology, the present invention provides a method for training a gynecological microecological image recognition model, which can effectively solve the problems mentioned in the existing technology.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] This invention provides a method for training a gynecological microecological image recognition model, comprising the following steps:

[0008] S100. Obtain a fluorescent microscopic image set of gynecological microorganisms. The image set includes images acquired by microscope after double fluorescent staining of vaginal secretion samples. The images are acquired in two independent channels, with the first channel marking fungal structures and the second channel marking cellular components.

[0009] S200: The image set is filtered and cleaned to remove blurry images, duplicate images, and images containing non-target interference structures, to obtain a pre-cleaned image set;

[0010] S300. The image set after preliminary cleaning is labeled. The labeled objects include white blood cells, clue cells, trichomonas, spores and bubbles. The labeling information includes the target bounding box coordinates, category labels and interference structure masks, forming a training image set with labeled information.

[0011] S400. Construct a lighting diversity enhancement mechanism based on Retinex decomposition to generate virtual images of lighting changes. And associate with the original image Features are used to form an enhanced training set with improved illumination diversity.

[0012] S500: Construct a CLIPN-inspired negative semantic guided diffusion generation network to generate false positive samples and compare them with the original image. Feature alignment is performed and added to the training set to form an enhanced training set containing false positive samples;

[0013] S600. Construct an image recognition model to be trained. The image recognition model includes a dual-channel image processing branch, which processes two channel images respectively to obtain dual-channel features. The model architecture also includes a fusion attention module for integrating dual-channel features.

[0014] S700. Calculate the loss value between the image recognition model output and the real label using a preset loss function. The preset loss function includes classification cross-entropy loss, bounding box regression loss and interference structure suppression loss.

[0015] S800. Set a preset threshold. When the loss value is less than the preset threshold, a trained image recognition model is obtained and denoted as the first model.

[0016] S900: Perform lightweight processing on the first model to obtain the final image recognition model, and then process the original image... The data is input into the final image recognition model to obtain the target bounding box coordinates, category label probabilities, and interference structure annotations of the original image.

[0017] Furthermore, the dual-channel staining process in step S100 specifically includes:

[0018] The gynecological microecological samples were stained using a first fluorescent staining agent and a second fluorescent staining agent. The first fluorescent staining agent was used to label fungal structures, and the second fluorescent staining agent was used to label cellular components.

[0019] The stained sample was scanned using a high-power microscope to obtain a fluorescence image with a resolution of 4096×4096 pixels, and the image depth of each channel was 16 bits of gray.

[0020] The first and second channel images are superimposed to generate a dual-channel composite image, which is used as the input sample for the initial image set.

[0021] Furthermore, the screening and cleaning process in step S200 specifically includes:

[0022] Blurred images are removed based on an image quality assessment algorithm, which includes frequency domain energy analysis and spatial gradient intensity statistics.

[0023] Duplicate images are detected and deleted using a hash algorithm, which employs a perceptual hashing method with a hash length of 64 bits.

[0024] Non-target interference structures, including bubbles, fragments, and unstained regions, are identified and labeled using a morphological segmentation algorithm. The labeled images are then processed by masking to retain the effective target regions, resulting in a pre-cleaned image set.

[0025] Furthermore, the specific implementation steps of step S400 include:

[0026] The image after initial cleaning is decomposed using Retinex to separate the original image. Decomposed into illuminance components With reflection component It satisfies the following formula:

[0027] ;

[0028] Construct an illuminance diffusion branch and apply a Gaussian diffusion model to the illuminance components. Perturbation is performed to generate multiple sets of illuminance change sequences. ,in The preset number of illumination variation groups;

[0029] Construct a reflection diffusion branch for the reflection component. Perform fixed noise injection to ensure that tissue texture and semantic tags remain unchanged;

[0030] The perturbed illuminance component With fixed reflection component Re-synthesize to generate virtual images with varying brightness. And retain the original image The annotation information;

[0031] By adjusting the lighting coefficient For the virtual image Perform continuous illumination changes, where Indicates a completely dark tone. Indicates standard brightness. Indicates overexposure;

[0032] The generated virtual image and corresponding annotation information and original image The labeled information is associated to form a training set with enhanced illumination diversity.

[0033] Furthermore, the implementation steps of the illuminance diffusion branch include:

[0034] For the illuminance component Perform discrete wavelet transform to extract multi-scale illumination features;

[0035] The diffusion process is constructed by generating a sequence of illumination changes through iterative Gaussian noise injection, where the number of diffusion steps N=100 and the noise intensity at each step is... ;

[0036] Introducing an illumination adjustment factor during the reverse denoising process Using the linear interpolation formula:

[0037] ;

[0038] in, This represents the global average illuminance.

[0039] Furthermore, the specific implementation steps of step S500 include:

[0040] Define input condition triples ,in The coordinates of the target bounding box. This is a positive text suggestion. This is a negative text prompt;

[0041] The CLIP text encoder is used to perform multimodal semantic embedding on the positive and negative text prompts to generate positive semantic vectors. With negative semantic vector ;

[0042] Construct a semantic modulation module, and and As a conditional input, the cross-attention mechanism simultaneously guides target generation and interference suppression during the diffusion denoising process;

[0043] Introducing non-target region mask The interfering structural region is expanded into a mask region through morphological dilation, and then combined with the contrastive loss function. Constrain the generated image so that no specific interfering structures appear in non-target regions;

[0044] Construct a discriminative scoring module to perform the following triple filtering on the generated images:

[0045] Image quality assessment: Calculate the image quality assessment index FID score, requiring FID≤30;

[0046] Text-target alignment evaluation: The similarity score between the text description and the generated target is calculated using the CLIP model, requiring a similarity score ≥ 0.85;

[0047] Box alignment evaluation: A lightweight CNN is used to classify the target regions in the generated image, requiring a classification confidence score of ≥0.90;

[0048] The generated image and the original image were filtered by the discriminative scoring module. After the annotation information is aligned, it is added to the training set to form an enhanced training set containing false positive samples.

[0049] Furthermore, the specific structure of the semantic modulation module includes a feature fusion layer, a cross-attention layer, and a gating control layer;

[0050] The feature fusion layer will convert the positive semantic vector With negative semantic vector Concatenate into a joint semantic vector The cross-attention layer employs a multi-head attention mechanism to combine the joint semantic vectors. Characteristics of the latent space during the diffusion process Interact to generate semantic guidance features ;

[0051] Gating control layer: through learnable parameters The weights of positive and negative semantics are dynamically adjusted using the following formula:

[0052] ;

[0053] in, For the final semantic guidance features, This is a positive semantic guidance feature. It is a negative semantic guidance feature.

[0054] Furthermore, the loss function The mathematical expression is:

[0055] ;

[0056] in, Embedding for target features, To generate image feature embeddings, Embed the j-th interfering structural feature. For temperature coefficient, This represents the total number of interference structure types.

[0057] The technical solution provided by this invention has the following advantages compared with the known prior art:

[0058] This invention fully utilizes the specific spectral information of different stained targets by employing a dual-channel fluorescence image input and fusion attention mechanism. Simultaneously, the constructed Retinex decomposition-based illumination diversity enhancement mechanism effectively simulates and covers common lighting conditions in clinical microscopy, such as uneven illumination, underexposure, or overexposure, thus greatly enhancing the model's adaptability to changes in imaging conditions. Combined with a multi-task learning framework that includes interference structure suppression loss, the model can accurately identify targets while effectively suppressing interference from non-target structures such as bubbles and debris. The final trained model achieves high-precision multi-target detection and classification on gynecological microecological images, effectively overcoming the false positives and false negatives caused by the light sensitivity and limited feature set of traditional methods.

[0059] This invention creatively introduces a diffusion-generative network based on negative semantic guidance, which, under precise guidance from text prompts and bounding box conditions, can generate "false positive" samples that conform to medical morphological characteristics and have clean backgrounds. This method not only expands the training set size, but more importantly, it can selectively synthesize rare category samples with low clinical positive rates that are difficult to obtain in large quantities. This effectively alleviates the class imbalance problem in the dataset and significantly improves the model's sensitivity and generalization ability for recognizing various targets, especially rare pathogens.

[0060] This invention employs a two-stage strategy of training followed by distillation. First, a high-performance but parameter-heavy primary model is trained. Then, knowledge distillation is used to transfer its knowledge to a student model with approximately 40% fewer parameters. This strategy significantly reduces model complexity and computational overhead while preserving the model's recognition performance to the maximum extent. This enables the final model to perform rapid, real-time inference and analysis on clinical terminal devices with limited computing power, providing a feasible technical foundation for the immediate testing of gynecological microecology and its widespread application in primary healthcare institutions. Attached Figure Description

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

[0062] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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 creative effort are within the scope of protection of the present invention.

[0064] The present invention will be further described below with reference to embodiments.

[0065] Example:

[0066] Reference Figure 1 A method for training a gynecological microecological image recognition model includes the following steps:

[0067] S100. Obtain a fluorescent microscopic image set of gynecological microorganisms. The image set includes images acquired by microscope after double fluorescent staining of vaginal secretion samples. The images are acquired in two independent channels, with the first channel marking fungal structures and the second channel marking cellular components.

[0068] S200: The image set is filtered and cleaned to remove blurry images, duplicate images, and images containing non-target interference structures, resulting in a pre-cleaned image set.

[0069] S300. The image set after initial cleaning is labeled. The labeled objects include white blood cells, clue cells, trichomonas, spores and bubbles. The labeling information includes the target bounding box coordinates, category labels and interference structure masks, forming a training image set with labeled information.

[0070] In one specific embodiment, multiple gynecological laboratory experts were engaged to independently annotate the images on a dedicated annotation platform. An annotation consistency check algorithm was employed, retaining only regions where at least two experts' annotations were consistent. The annotation information was saved in COCO dataset format. This step constructed a high-quality, authoritatively annotated dataset, providing reliable ground truth labels for supervised learning.

[0071] S400. Construct a lighting diversity enhancement mechanism based on Retinex decomposition to generate virtual images of lighting changes. And associate with the original image Features are used to form an enhanced training set with improved illumination diversity.

[0072] In one specific embodiment, the single-scale Retinex algorithm is used for decomposition of the reflection components. Gaussian smoothing and fixation were performed; control degree components were also applied. By applying random Gamma correction and multiplicative noise from a log-normal distribution, K=10 sets of images under different lighting conditions are generated. The illumination coefficient is then... Uniform sampling within the range of [0.3, 1.5] simulates common lighting conditions under clinical microscopy, such as uneven illumination, underexposure, or overexposure. This mechanism increases the training sample size by an order of magnitude and significantly enhances the model's robustness to changes in illumination.

[0073] S500: Construct a CLIPN-inspired negative semantic guided diffusion generation network to generate false positive samples and compare them with the original image. Feature alignment is performed and added to the training set to form an enhanced training set containing false positive samples;

[0074] In one specific embodiment, a pre-trained model is used as the basis for positive prompts. Set to "Clear white blood cell morphology", negative prompt. The criteria were defined as "bubbles, impurities, and blurred regions." During the denoising process, a semantic modulation module dynamically weighted positive and negative semantic vectors to guide the generation of images with clear target structures and suppressed interference. After screening, approximately 5000 high-quality false positive samples were added to the training set, effectively alleviating the problem of insufficient rare category samples.

[0075] S600. Construct an image recognition model to be trained. The image recognition model includes a dual-channel image processing branch, which processes the two channel images respectively to obtain dual-channel features. The model architecture also includes a fusion attention module for integrating dual-channel features.

[0076] Specifically, both dual-channel branches use ResNet-34 as the backbone network for feature extraction. The fusion attention module combines channel attention and spatial attention. First, the feature maps of the two channels are weighted by channel, and then the spatial attention map is used to highlight the salient regions of consensus between the two channels. This design enables the model to adaptively fuse complementary information from different colored channels, thereby improving feature expressiveness.

[0077] S700: The image recognition model output result and the real label are calculated using a preset loss function. The preset loss function includes classification cross-entropy loss, bounding box regression loss and interference structure suppression loss.

[0078] S800. Set a preset threshold. When the loss value is less than the preset threshold, the trained image recognition model is obtained and is recorded as the first model.

[0079] In one specific embodiment, the preset threshold is set to 0.01, and the Adam optimizer is used to train for 300 epochs. When the average loss on the validation set is lower than the threshold for 10 consecutive epochs, the training is stopped early. The resulting first model achieves an average accuracy of 92.7% on the internal test set.

[0080] S900: The first model is lightweighted to obtain the final image recognition model, and the original image is... The data is input into the final image recognition model to obtain the target bounding box coordinates, category label probabilities, and interference structure annotations of the original image.

[0081] In a specific embodiment, the lightweighting process for the first model includes the following steps:

[0082] The first model underwent structured pruning, with its importance evaluated based on the L1 norm of the convolutional channels. A global pruning ratio of 40% was set, retaining only the top 60% of channels by importance in each layer. Short-term fine-tuning was then performed after pruning to restore performance. The resulting intermediate model had approximately 60% of the parameters of the first model, and its inference speed was improved by about 1.8 times.

[0083] Using the pruned intermediate model as the teacher model, a MobileNetV3-Small student model with approximately 35% of the parameters of the first model was constructed. The model was trained using a distillation loss function that combines cross-entropy loss and KL divergence loss. The soft label weights of the teacher model accounted for 70%. The AdamW optimizer was used to train the model for 100 epochs with an initial learning rate of 1e-4, and a learning rate decay strategy was employed.

[0084] The final student model's average accuracy on the test set decreased by no more than 1.5% compared to the first model. The number of model parameters was compressed from approximately 21.3M to approximately 7.5M, and the model file size was reduced from 85MB to 30MB. In actual testing on a Jetson Nano embedded device, the inference speed reached 18 frames per second, meeting the real-time requirements. The model was finally exported in ONNX format and integrated into the diagnostic system.

[0085] Furthermore, the dual-channel staining process in step S100 specifically includes:

[0086] The gynecological microecological samples were stained using a dual-channel method with a first fluorescent staining agent and a second fluorescent staining agent. The first fluorescent staining agent was used to label fungal structures, and the second fluorescent staining agent was used to label cellular components.

[0087] The stained sample was scanned using a high-power microscope to obtain a fluorescence image with a resolution of 4096×4096 pixels, and the image depth of each channel was 16 bits of gray.

[0088] The first and second channel images are superimposed to generate a dual-channel composite image, which is used as the input sample for the initial image set.

[0089] Specifically, in practice, calcium fluorescent white was used as the first fluorescent staining agent to label the fungal cell wall, and acridine orange was used as the second fluorescent staining agent to distinguish between the cell nucleus and cytoplasm. Vaginal secretion smears were scanned using a fully automated fluorescence microscope to acquire dual-channel images. Each channel image had a resolution of 4096×4096 pixels and a bit depth of 16 bits, ensuring rich image detail and a wide dynamic range. This step achieved structured imaging of gynecological microecological samples, providing a high-quality, multi-channel visual data foundation for subsequent model training.

[0090] Furthermore, the screening and cleaning process in step S200 specifically includes:

[0091] Blurry images are removed based on image quality assessment algorithms, which include frequency domain energy analysis and spatial gradient intensity statistics.

[0092] Duplicate images are detected and removed using a hash algorithm. The hash algorithm employs a perceptual hashing method with a hash length of 64 bits.

[0093] Morphological segmentation algorithms are used to identify and label non-target interference structures, including bubbles, fragments, and unstained regions. The labeled images are then masked to retain the effective target regions, resulting in a pre-cleaned image set.

[0094] Specifically, in practice, the Laplacian gradient variance method is used to evaluate image sharpness, with a threshold of 200, and blurry images with a gradient variance below this value are removed. A perceptual hashing algorithm is used to calculate the image hash value; images with a Hamming distance less than 5 are considered duplicates and removed. A method combining morphological opening operations and edge detection is used to identify and mask interfering structures such as bubbles and fiber fragments. This step significantly improves the dataset quality and reduces noise interference during model training.

[0095] Furthermore, the specific implementation steps of step S400 include:

[0096] Retinex decomposition is performed on the pre-cleaned image to separate the original image. Decomposed into illuminance components With reflection component It satisfies the following formula:

[0097] ;

[0098] Construct an illuminance diffusion branch and apply the Gaussian diffusion model to the illuminance components. Perturbation is performed to generate multiple sets of illuminance change sequences. ,in The preset number of illumination variation groups;

[0099] Construct a reflection diffusion branch for the reflection component. Perform fixed noise injection to ensure that tissue texture and semantic tags remain unchanged;

[0100] The perturbed illuminance component With fixed reflection component Re-synthesize to generate virtual images with varying brightness. And retain the original image The annotation information;

[0101] By adjusting the lighting coefficient For virtual images Perform continuous illumination changes, where Indicates a completely dark tone. Indicates standard brightness. Indicates overexposure;

[0102] The generated virtual image and corresponding annotation information and original image The labeled information is associated to form a training set with enhanced illumination diversity.

[0103] Furthermore, the implementation steps of the illuminance diffusion branch include:

[0104] Contrast component Perform discrete wavelet transform to extract multi-scale illumination features;

[0105] The diffusion process is constructed by generating a sequence of illumination changes through iterative Gaussian noise injection, where the number of diffusion steps N=100 and the noise intensity at each step is... ;

[0106] Introducing an illumination adjustment factor during the reverse denoising process Using the linear interpolation formula:

[0107] ;

[0108] in, This represents the global average illuminance.

[0109] Furthermore, the specific implementation steps of step S500 include:

[0110] Define input condition triples ,in The coordinates of the target bounding box, This is a positive text suggestion. This is a negative text prompt;

[0111] The CLIP text encoder is used to perform multimodal semantic embedding on positive and negative text prompts to generate positive semantic vectors. With negative semantic vector ;

[0112] Construct a semantic modulation module, and and As a conditional input, the cross-attention mechanism simultaneously guides target generation and interference suppression during the diffusion denoising process;

[0113] Introducing non-target region mask The interfering structural region is expanded into a mask region through morphological dilation, and then combined with the contrastive loss function. Constrain the generated image so that no specific interfering structures appear in non-target regions;

[0114] Construct a discriminative scoring module to perform the following triple filtering on the generated images:

[0115] Image quality assessment: Calculate the image quality assessment index FID score, requiring FID≤30;

[0116] Text-target alignment evaluation: The similarity score between the text description and the generated target is calculated using the CLIP model, requiring a similarity score ≥ 0.85;

[0117] Box alignment evaluation: A lightweight CNN is used to classify the target regions in the generated image, requiring a classification confidence score of ≥0.90;

[0118] The generated image and the original image were filtered by the discriminative scoring module. After the annotation information is aligned, it is added to the training set to form an enhanced training set containing false positive samples.

[0119] Furthermore, the specific structure of the semantic modulation module includes a feature fusion layer, a cross-attention layer, and a gating control layer;

[0120] The feature fusion layer will combine the positive semantic vector With negative semantic vector Concatenate into a joint semantic vector The cross-attention layer employs a multi-head attention mechanism to combine the joint semantic vectors. Latent space characteristics in the diffusion process Interact to generate semantic guidance features ;

[0121] Gating control layer: through learnable parameters The weights of positive and negative semantics are dynamically adjusted using the following formula:

[0122] ;

[0123] in, For the final semantic guidance features, As a positive semantic guidance feature, It is a negative semantic guidance feature.

[0124] Furthermore, the loss function The mathematical expression is:

[0125] ;

[0126] in, Embedding for target features, To generate image feature embeddings, Embed the j-th interfering structural feature. For temperature coefficient, This represents the total number of interference structure types.

[0127] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions will not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for training a gynecological microecological image recognition model, characterized in that, Includes the following steps: S100. Obtain a fluorescent microscopic image set of gynecological microorganisms. The image set includes images acquired by microscope after double fluorescent staining of vaginal secretion samples. The images are acquired in two independent channels, with the first channel marking fungal structures and the second channel marking cellular components. S200: The image set is filtered and cleaned to remove blurry images, duplicate images, and images containing non-target interference structures, to obtain a pre-cleaned image set; S300. The image set after preliminary cleaning is labeled. The labeled objects include white blood cells, clue cells, trichomonas, spores and bubbles. The labeling information includes the target bounding box coordinates, category labels and interference structure masks, forming a training image set with labeled information. S400. Construct a lighting diversity enhancement mechanism based on Retinex decomposition to generate virtual images of lighting changes. And associate with the original image Features are used to form an enhanced training set with improved illumination diversity. S500: Construct a CLIPN-inspired negative semantic guided diffusion generation network to generate false positive samples and compare them with the original image. Feature alignment is performed and added to the training set to form an enhanced training set containing false positive samples; S600. Construct an image recognition model to be trained. The image recognition model includes a dual-channel image processing branch, which processes two channel images respectively to obtain dual-channel features. The model architecture also includes a fusion attention module for integrating dual-channel features. S700. Calculate the loss value between the image recognition model output and the real label using a preset loss function. The preset loss function includes classification cross-entropy loss, bounding box regression loss and interference structure suppression loss. S800. Set a preset threshold. When the loss value is less than the preset threshold, a trained image recognition model is obtained and denoted as the first model. S900: Perform lightweight processing on the first model to obtain the final image recognition model, and then process the original image... The data is input into the final image recognition model to obtain the target bounding box coordinates, category label probabilities, and interference structure annotations of the original image.

2. The method for training a gynecological microecological image recognition model according to claim 1, characterized in that, The dual-channel staining process in step S100 specifically includes: The gynecological microecological samples were stained using a first fluorescent staining agent and a second fluorescent staining agent. The first fluorescent staining agent was used to label fungal structures, and the second fluorescent staining agent was used to label cellular components. The stained sample was scanned using a high-power microscope to obtain a fluorescence image with a resolution of 4096×4096 pixels, and the image depth of each channel was 16 bits of gray. The first and second channel images are superimposed to generate a dual-channel composite image, which is used as the input sample for the initial image set.

3. The method for training a gynecological microecological image recognition model according to claim 1, characterized in that, The screening and cleaning process in step S200 specifically includes: Blurred images are removed based on an image quality assessment algorithm, which includes frequency domain energy analysis and spatial gradient intensity statistics. Duplicate images are detected and deleted using a hash algorithm, which employs a perceptual hashing method with a hash length of 64 bits. Non-target interference structures, including bubbles, fragments, and unstained regions, are identified and labeled using a morphological segmentation algorithm. The labeled images are then processed by masking to retain the effective target regions, resulting in a pre-cleaned image set.

4. The method for training a gynecological microecological image recognition model according to claim 1, characterized in that, The specific implementation steps of step S400 include: The image after initial cleaning is decomposed using Retinex to separate the original image. Decomposed into illuminance components With reflection component It satisfies the following formula: ; Construct an illuminance diffusion branch and apply a Gaussian diffusion model to the illuminance components. Perturbation is performed to generate multiple sets of illuminance change sequences. ,in The preset number of illumination variation groups; Construct a reflection diffusion branch for the reflection component. Perform fixed noise injection to ensure that tissue texture and semantic tags remain unchanged; The perturbed illuminance component With fixed reflection component Re-synthesize to generate virtual images with varying brightness. And retain the original image The annotation information; By adjusting the lighting coefficient For the virtual image Perform continuous illumination changes, where Indicates a completely dark tone. Indicates standard brightness. Indicates overexposure; The generated virtual image and corresponding annotation information and original image The labeled information is associated to form a training set with enhanced illumination diversity.

5. The method for training a gynecological microecological image recognition model according to claim 4, characterized in that, The implementation steps of the illuminance diffusion branch include: For the illuminance component Perform discrete wavelet transform to extract multi-scale illumination features; The diffusion process is constructed by generating a sequence of illumination changes through iterative Gaussian noise injection, where the number of diffusion steps N=100 and the noise intensity at each step is... ; Introducing an illumination adjustment factor during the reverse denoising process Using the linear interpolation formula: ; in, This represents the global average illuminance.

6. The method for training a gynecological microecological image recognition model according to claim 1, characterized in that, The specific implementation steps of step S500 include: Define input condition triples ,in The coordinates of the target bounding box, This is a positive text suggestion. This is a negative text prompt; The CLIP text encoder is used to perform multimodal semantic embedding on the positive and negative text prompts to generate positive semantic vectors. With negative semantic vector ; Construct a semantic modulation module, and and As a conditional input, the cross-attention mechanism simultaneously guides target generation and interference suppression during the diffusion denoising process; Introducing non-target region mask The interference structure region is expanded into a mask region through morphological dilation, and then combined with the contrastive loss function. Constrain the generated image so that no specific interfering structures appear in non-target regions; Construct a discriminative scoring module to perform the following triple filtering on the generated images: Image quality assessment: Calculate the image quality assessment index FID score, requiring FID≤30; Text-target alignment evaluation: The similarity score between the text description and the generated target is calculated using the CLIP model, requiring a similarity score ≥ 0.85; Box alignment evaluation: A lightweight CNN is used to classify the target regions in the generated image, requiring a classification confidence score of ≥0.90; The generated image and the original image were filtered by the discriminative scoring module. After the annotation information is aligned, it is added to the training set to form an enhanced training set containing false positive samples.

7. The method for training a gynecological microecological image recognition model according to claim 6, characterized in that, The specific structure of the semantic modulation module includes a feature fusion layer, a cross-attention layer, and a gating control layer; The feature fusion layer will convert the positive semantic vector With negative semantic vector Concatenate into a joint semantic vector The cross-attention layer employs a multi-head attention mechanism to combine the joint semantic vectors. Characteristics of the latent space during the diffusion process Interact to generate semantic guidance features ; Gating control layer: through learnable parameters The weights of positive and negative semantics are dynamically adjusted using the following formula: ; in, For the final semantic guidance features, This is a positive semantic guidance feature. It is a negative semantic guidance feature.

8. A method for training a gynecological microecological image recognition model according to claim 6, characterized in that, The loss function The mathematical expression is: ; in, Embedding for target features, To generate image feature embeddings, Embed the j-th interfering structural feature. For temperature coefficient, This represents the total number of interference structure types.