Medical data set construction method based on AIGC image generation

By using multimodal semantic association and diffusion models to generate data in the construction of medical data sets, the problems of data bias and privacy regulations in the construction of medical data sets are solved, and high-quality and diverse medical data sets are achieved, which improves the diagnostic accuracy and generalization capabilities of the model.

CN119889596AActive Publication Date: 2025-04-25XIAMEN UNIV

Patent Information

Application Number
CN202510381402.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-04-25
Estimated Expiration
2045-03-28

AI Technical Summary

Technical Problem

The collection of medical data is subject to strict privacy regulations and ethical restrictions, and there are data bias in medical data sets, which affects the generalization ability of the model.

Method used

By establishing multimodal semantic associations between medical imaging features, pathological report text and anatomical markers, a structured propt template library is generated, and data is generated using diffusion models to verify anatomical structure rationality and mix dynamic weights, extracting the base layer of shared features, monitoring the model training process, and generating evaluation data sets in real time.

Benefits of technology

The problems of data bias and privacy regulations are solved, and the generated data sets have high medical rationality and accuracy, improving the model's diagnostic accuracy and generalization ability of various diseases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119889596A_ABST
    Figure CN119889596A_ABST
Patent Text Reader

Abstract

The invention discloses a medical data set construction method based on AIGC image generation, and belongs to the technical field of image generation models, and the method specifically comprises the steps: constructing a medical field semantic constraint matrix, generating a structured prompt template library, inputting a real medical image and the structured prompt into a diffusion model through LORA fine tuning, and building a mapping relation to generate data. Verifying the reasonability of an anatomical structure for generated data; enabling organ morphological parameters to accord with medical priori knowledge through cyclic correction; generating variants of different scales according to target focus features; forming a three-dimensional continuous parameter space; and extracting a shared feature base layer for pre-training, improving the weight of real data in the later stage of training, monitoring a feature response mode in the training process, and generating a same-type evaluation data set test in real time when an index does not accord with a standard until the standard is reached.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image generation models, and in particular to a method for constructing a medical data set based on AIGC image generation. Background Art

[0002] In the medical field, data is a key factor in promoting medical research, disease diagnosis, and treatment plan formulation. High-quality, large-scale, and diverse medical datasets are essential for developing accurate and reliable medical artificial intelligence models. However, the current construction of medical datasets faces many challenges, which limits the further development of medical artificial intelligence technology.

[0003] The collection of medical data is often subject to strict privacy regulations and ethical restrictions. Patients' personal information and medical records are highly sensitive data and require strict authorization and security measures before they can be used. This makes large-scale, multi-center data collection difficult, and the acquisition of data is costly and time-consuming. Existing medical data sets often have data bias problems, such as a large number of samples for certain diseases and very few samples for other rare diseases. This imbalance in data distribution will cause the model to have a strong ability to recognize common diseases during training, but a low diagnostic accuracy for rare diseases. In addition, factors such as different races, genders, and ages will also lead to differences in medical data. If the data set cannot fully cover these factors, the generalization ability of the model will be limited and cannot be accurately applied to different patient groups.

[0004] In recent years, image generation technology based on artificial intelligence generated content (AIGC) has made significant progress. Aiming at the dataset construction problem existing in the medical field, this paper proposes a medical dataset construction method based on AIGC image generation. Summary of the invention

[0005] The purpose of the present invention is to provide a method for constructing a medical data set based on AIGC image generation to solve the following technical problems: The collection of medical data is often subject to strict privacy regulations and ethical restrictions, and medical data sets often have problems with data bias.

[0006] The purpose of the present invention can be achieved through the following technical solutions: A method for constructing a medical data set based on AIGC image generation, comprising the following steps: S1. Establish multimodal semantic associations between medical image features, pathology report texts and anatomical markers, construct a semantic constraint matrix in the medical field, and generate a structured prompt template library based on the semantic constraint matrix; S2, a controllable fine-tuning module based on LORA, inputs the real medical image and the structured prompt into the diffusion model, establishes a mapping relationship between medical features and latent space, and the diffusion model generates data; S3. Verify the rationality of the anatomical structure of the generated data to determine whether the anatomical features are consistent with the biological features. If not, make the organ morphological parameters consistent with medical prior knowledge through a cyclic correction mechanism; S4, generating variants of different scales according to the characteristics of the target lesion, wherein the scales include anatomical position offset, tissue density gradient, and lesion stage evolution, and forming a three-dimensional continuous parameter space according to the scale changes; S5, mixing the real data and the generated data according to the dynamic weights, and optimizing the representation space of the diffusion model by a hierarchical feature alignment algorithm; S6, extracting a shared feature base layer of the real data and the generated data, and applying the shared feature base layer to the pre-training stage of the diffusion model; in the later stage of the diffusion model training, gradually increasing the training weight of the real data to a preset ratio, and freezing the feature channel corresponding to the generated data; S7. Monitor the characteristic response patterns of the diffusion model training process. When it is identified that the set indicators of the model do not meet the preset standards, generate an evaluation data set of the same type as the current training sample in real time and test the model until the set indicators of the model meet the preset standards.

[0007] As a further solution of the present invention: in step S1, the construction of the structured prompt template library includes: Extract anatomical marking information from medical data in DICOM format, and establish a basic anatomical structure framework based on the anatomical marking information; based on the anatomical structure framework, extract key description sentences in the pathology report, and build a pathology feature dictionary based on the key description sentences; combine the pathology feature dictionary to analyze different medical imaging features and establish a multimodal feature mapping relationship; based on the multimodal feature mapping relationship, build a feature fusion attention weight matrix; based on the attention weight matrix, generate a prompt grammatical structure with constraints; finally, verify and optimize the prompt grammatical structure through the semantic verification module of the medical knowledge graph.

[0008] As a further solution of the present invention: in step S2, the controllable fine-tuning module includes: Construct a medical feature embedding space, map the structured prompt into the latent space, set an anatomical structure attention guidance mechanism in the embedding space, and strengthen the set key area features; based on the attention guidance mechanism, generate a pathological feature diffusion path constraint algorithm to control the generation path of lesion features, optimize the tissue texture of the generated data, set a multi-scale feature consistency loss function, calculate the difference of key area features at different resolutions, and adjust the model parameters until the loss function converges; verify whether the generated data is consistent with the structured prompt through a semantic alignment verifier, otherwise repeat the above process.

[0009] As a further solution of the present invention: in step S4, the implementation of the data dynamic enhancement system includes: Perform basic geometric transformations on the generated data through the anatomical space transformation engine, including translation, rotation and scaling; during the geometric transformation process, adjust the tissue density in the generated data; A lesion timeline is set according to medical knowledge, and the lesion process is divided into several stages. At each stage, the lesion features in the image are adjusted according to the feature changes of the current stage, including the size, shape and density of the lesion features, wherein the size change and shape change of the lesion features are simulated by geometrically transforming the generated data, and the density of the lesion features is simulated by adjusting the tissue density in the generated image; The image parameters of known time points in the lesion timeline are obtained, and interpolation calculations are performed between the parameters of adjacent time points to obtain the parameter values ​​of the intermediate time points, thereby generating a smooth lesion evolution sequence with a preset time point density, and adding artifact features that conform to the laws of physiological movement to the evolution sequence.

[0010] As a further solution of the present invention: in step S5, the dynamic weight mixing includes: Calculate the feature distribution distance between the generated data and the real data in real time, and evaluate the data domain difference between the generated data and the real data according to the feature distribution distance; use KL divergence to adaptively adjust the mixing ratio of the generated data and the real data according to the feature distribution distance; design a hierarchical feature space alignment loss function according to the mixing ratio to optimize the feature representation of the data; evaluate the confidence of the generated data, and remove the generated data with a confidence lower than a threshold; The similarity between medical image features and pathology report features is calculated through the loss function. By minimizing the loss function, the model parameters are adjusted to align the features of the two modal data in a common feature space.

[0011] As a further solution of the present invention: in step S6, extracting the shared feature base layer of the real data and the generated data includes: A shared feature encoder is constructed to extract the shared features of generated data and real data. Based on the shared features, the unique features of the generated data and the real data are distinguished. A cross-domain feature alignment loss function is introduced to align the spatial distribution of the same features between the two types of images. According to the aligned feature distribution, the features are shuffled to integrate feature information at different levels and scales.

[0012] As a further solution of the present invention: in step S6, gradually increasing the training weight of the real data to a preset ratio includes: Evaluate the importance of each feature channel in the model, identify key feature channels, freeze the parameters of key feature channels during model training, adaptively adjust the learning rate of model training according to the changes in the training stage and model performance parameters, and gradually increase the proportion of real data in each training batch during model training, and reconstruct and classify the features of real data.

[0013] As a further solution of the present invention: in step S7, generating an evaluation data set of the same type as the current training sample in real time, and testing the model until the set index of the model reaches the preset standard includes: Perform transformation operations on the current training sample, including rotation, flipping, scaling, and adding noise, and sample from the original training data set to form a new evaluation data set with the changed training sample. Input the generated evaluation data set into the currently trained diffusion model, record the prediction results of the diffusion model, and calculate the performance of the diffusion model on the evaluation data set according to the set indicators. According to the test results, adjust the hyperparameters of the model, and modify the number of neurons and layers of the model. After adjusting the model, generate an evaluation data set of the same type as the current training sample again to test the model. Repeat the above process until the set indicators of the model reach the preset standards.

[0014] Beneficial effects of the present invention: (1) The present invention simultaneously establishes multimodal semantic associations between medical images, pathology report texts and anatomical markers, solving the integration and sharing barriers caused by inconsistent data formats and standards in different medical institutions. The generated data comes with semantic information and feature annotations, reducing the need for manual annotation by a large number of professional medical personnel, reducing the workload and cost of annotation, and performing semantic verification based on structured prompt templates and medical knowledge graphs to improve annotation consistency and quality. The data dynamic enhancement system simulates changes at different scales, generates diversified data that conforms to medical prior knowledge, covers rare diseases and special situations, solves the problem that traditional data enhancement methods cannot simulate real physiological and pathological changes, and improves the diagnostic accuracy and generalization ability of the model for various diseases.

[0015] (2) The present invention verifies the anatomical rationality and cyclically corrects the generated data to ensure that it has high medical rationality and accuracy, and optimizes image features and textures through multiple mechanisms in the controllable fine-tuning module. The progressive fine-tuning mechanism allows the model to adjust adaptively according to the training situation, improving training efficiency and stability. The model training process is monitored in real time, and an evaluation data set test is generated when the indicators do not meet the preset standards. The parameters and structure are adjusted to ensure that the model meets the standards. The dynamic test set generation engine identifies the vulnerable features of the model, constructs challenging samples, and expands the test coverage, so as to achieve continuous evolution of the test set and improve the reliability and stability of the model in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The present invention will be further described below in conjunction with the accompanying drawings.

[0017] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION

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

[0019] See also Figure 1 As shown, the present invention is a method for constructing a medical data set based on AIGC image generation, comprising the following steps: S1. Establish multimodal semantic associations between medical image features, pathology report texts and anatomical markers, construct a semantic constraint matrix in the medical field, and generate a structured prompt template library based on the semantic constraint matrix; S2, a controllable fine-tuning module based on LORA, inputs the real medical image and the structured prompt into the diffusion model, establishes a mapping relationship between medical features and latent space, and the diffusion model generates data; S3. Verify the rationality of the anatomical structure of the generated data to determine whether the anatomical features are consistent with the biological features. If not, make the organ morphological parameters consistent with medical prior knowledge through a cyclic correction mechanism; S4, generating variants of different scales according to the characteristics of the target lesion, wherein the scales include anatomical position offset, tissue density gradient, and lesion stage evolution, and forming a three-dimensional continuous parameter space according to the scale changes; S5, mixing the real data and the generated data according to the dynamic weights, and optimizing the representation space of the diffusion model by a hierarchical feature alignment algorithm; S6, extracting a shared feature base layer of the real data and the generated data, and applying the shared feature base layer to the pre-training stage of the diffusion model; in the later stage of the diffusion model training, gradually increasing the training weight of the real data to a preset ratio, and freezing the feature channel corresponding to the generated data; S7. Monitor the characteristic response patterns of the diffusion model training process. When it is identified that the set indicators of the model do not meet the preset standards, generate an evaluation data set of the same type as the current training sample in real time and test the model until the set indicators of the model meet the preset standards.

[0020] In another preferred embodiment of the present invention, the construction of the structured prompt template library in step S1 is a rigorous and complex process, which is an important basis for the subsequent generation of high-quality medical images based on AIGC. The following are the detailed steps: First, the present invention focuses on medical data in DICOM (Digital Imaging and Communications in Medicine) format. As a standard data format widely used in the medical field, DICOM contains a large amount of accurate information about the human anatomical structure. The present invention uses advanced data analysis technology to accurately extract anatomical marking information from these DICOM format medical data. These marking information covers key contents such as the position, size, shape of various organs of the human body and their relative relationship.

[0021] Based on the extracted anatomical marker information, the present invention begins to establish a basic anatomical structure framework. This is like building a solid skeleton for subsequent work, which presents the anatomical structure of the human body in a systematic and orderly manner. Through this framework, the present invention can clearly understand the hierarchical relationship and spatial layout of each anatomical part, providing an accurate reference for the subsequent integration of other medical information.

[0022] With the basic anatomical structure framework, the present invention shifts its focus to the pathology report. The pathology report is a text description obtained by the doctor after a detailed examination of the diseased tissue, which contains a lot of key information about the characteristics of the disease. The present invention uses natural language processing technology to conduct an in-depth analysis of the pathology report and extract key descriptive sentences. These sentences may describe important information such as the type, degree, and distribution of the lesion.

[0023] According to the extracted key description sentences, the present invention constructs a pathological feature dictionary. This dictionary is like a knowledge base, which classifies and organizes various pathological features, and provides rich vocabulary resources for the subsequent establishment of multimodal feature mapping relationships. Through the pathological feature dictionary, the present invention can more accurately describe and express the characteristics of different diseases, providing strong support for generating prompts that conform to medical practice.

[0024] Combined with the constructed pathological feature dictionary, the present invention conducts a detailed analysis of different medical image features. Medical image features can be obtained through various imaging technologies (such as X-ray, CT, MRI, etc.), which reflect the visual information of the internal structure and lesions of the human body. The present invention uses machine learning and data analysis methods to find the intrinsic connection between medical image features and pathological features, and establish a multimodal feature mapping relationship.

[0025] This mapping relationship can associate and integrate data from different modalities, so that the present invention can fully understand the characteristics of the disease from multiple perspectives. For example, through the mapping relationship, the present invention can know that a specific feature presented on a certain medical image corresponds to a certain type of lesion described in a pathology report, thereby providing a basis for the subsequent generation of a more accurate prompt.

[0026] Based on the established multimodal feature mapping relationship, the present invention further constructs an attention weight matrix for feature fusion. In the multimodal data fusion process, different features have different importance for generating accurate medical images. The role of the attention weight matrix is ​​to assign a reasonable weight to each feature to highlight important features and suppress irrelevant features.

[0027] The present invention uses the attention mechanism in deep learning, and through a large number of experiments and training, calculates the weight value of each feature. These weight values ​​reflect the importance of the feature in the process of generating medical images. Through the attention weight matrix, the present invention can more effectively fuse multimodal features and improve the quality and accuracy of generated images.

[0028] According to the attention weight matrix, the present invention generates a prompt grammatical structure with constraints. This grammatical structure specifies the format and rules of the prompt, and incorporates the various constraints and mapping relationships established in the previous steps. The prompt with constraints can more accurately guide the AIGC model to generate medical images that conform to medical practice.

[0029] For example, the prompt grammatical structure may stipulate that when describing a certain disease, it must include information such as specific anatomical locations, pathological features, and the relationship between them. In this way, the present invention can ensure that the generated medical images have high medical rationality and accuracy.

[0030] Finally, the present invention verifies and optimizes the generated prompt grammatical structure through the semantic verification module of the medical knowledge graph. The medical knowledge graph is a database containing rich medical knowledge and semantic relationships, which can comprehensively check and evaluate the prompt grammatical structure.

[0031] The semantic verification module will check whether the prompt grammatical structure conforms to medical logic and semantic rules, and whether there are any contradictions or unreasonable places. If problems are found, they will be corrected and optimized in time. Through this verification and optimization process, the present invention can ensure that the generated prompt grammatical structure is accurate and provides a reliable guarantee for the subsequent generation of high-quality medical images.

[0032] In another preferred embodiment of the present invention, the controllable fine-tuning module in step S2 is a key link in realizing the generation of accurate medical data based on AIGC. It can finely control the diffusion model to ensure that the generated data meets medical requirements. The following are the specific steps: First, the present invention constructs a medical feature embedding space. This space is a high-dimensional mathematical space that can represent various medical features in a compact and effective way. Medical features include anatomical features, pathological features, imaging features, etc. Through the embedding space, the present invention can uniformly encode and process these features.

[0033] The structured prompt is mapped into the latent space. The latent space is an abstract space inside the diffusion model, which contains the model's potential representation of the data. By mapping the structured prompt into the latent space, the present invention can guide the diffusion model to generate medical data related to the prompt. This mapping process is like giving the model a clear instruction, telling it what kind of medical data the present invention expects to generate.

[0034] In the medical feature embedding space, the present invention sets an anatomical structure attention guidance mechanism. The anatomical structure of the human body is very complex, and different anatomical parts have different importance for the diagnosis and treatment of diseases. The role of the attention guidance mechanism is to make the model pay more attention to the set key area features.

[0035] By defining attention weights and attention areas, the present invention enables the model to focus more attention on key anatomical structures during data generation. For example, when generating lung medical images, the present invention can set an attention guidance mechanism to allow the model to pay more attention to key features such as nodules and inflammation in the lungs, thereby improving the accuracy and pertinence of the generated data.

[0036] Based on the anatomical structure attention guidance mechanism, the present invention generates a pathological feature diffusion path constraint algorithm. The development of a disease usually has certain laws and paths. The role of the pathological feature diffusion path constraint algorithm is to control the generation path of the lesion features so that it conforms to the medical law of disease development. The generation process of the lesion features is constrained and guided. For example, when generating medical data on tumor development, the algorithm will control the growth direction, size change and other characteristics of the tumor so that it conforms to the actual development process of the tumor inside the human body. At the same time, the algorithm will also optimize the tissue texture of the generated data to simulate the real pathological tissue more realistically.

[0037] In order to ensure that the generated data has high quality and consistency at different resolutions, the present invention sets a multi-scale feature consistency loss function. In medical images, different resolutions may present different feature information. The role of the multi-scale feature consistency loss function is to calculate the difference between key area features at different resolutions.

[0038] By minimizing this loss function, the present invention can adjust the parameters of the model so that the generated data can maintain feature consistency at different resolutions. For example, when generating high-resolution and low-resolution lung images, the loss function ensures that key features such as lung nodules and textures can be accurately presented at both resolutions.

[0039] Finally, the present invention verifies whether the generated data is consistent with the structured prompt through a semantic alignment verifier. The semantic alignment verifier analyzes and compares the semantic information of the generated data to check whether it meets the requirements specified in the structured prompt.

[0040] If the generated data is found to be inconsistent with the prompt, the present invention will repeat the above process to further adjust and optimize the model until the generated data is consistent with the structured prompt. Through this verification and iterative optimization process, the present invention can ensure that the generated medical data accurately reflects the medical information described in the structured prompt, thereby improving the quality and reliability of the generated data.

[0041] In another preferred embodiment of the present invention, the data dynamic enhancement system in step S4 plays a vital role in enriching the medical data set and simulating the real pathological condition, and its specific implementation is as follows: First, the generated data is subjected to basic geometric transformations with the aid of the anatomical space transformation engine. These transformations mainly include translation, rotation, and scaling operations. The translation operation can simulate the movement of the position of the lesion in the human anatomical space, such as the displacement of a tumor that may occur in the body. The rotation operation can be used to present the morphological characteristics of the lesion at different angles, just like observing the diseased tissue from different perspectives. The scaling operation can simulate the change in the size of the lesion, which is critical for studying the growth or atrophy process of the lesion. In the process of performing these geometric transformations, the present invention will also synchronously adjust the tissue density in the generated data. Changes in tissue density are often closely related to the degree of development of the lesion. For example, the internal tissue density of a tumor may be different at different stages. By reasonably adjusting the tissue density, the generated data can be made closer to the real medical scene.

[0042] Secondly, the lesion timeline is set based on rich medical knowledge. The medical field has accumulated a large number of research results on the development process of various lesions. The present invention uses this knowledge to carefully divide the lesion process into several stages. Each stage has unique feature changes, which reflect the state of the lesion at different time points. At each stage, the present invention will adjust the lesion features in the image in a targeted manner according to the feature changes of the current stage. Lesion features mainly involve size, shape and density. For the size change and shape change of lesion features, the present invention simulates by geometrically transforming the generated data. For example, in the early stage of lesion development, the tumor may be small and the shape is relatively regular. As time goes by, the tumor gradually increases and the shape may become irregular. The present invention can simulate this change through geometric transformations such as scaling and translation. For the density change of lesion features, the present invention is achieved by adjusting the tissue density in the generated image. For example, during the deterioration of the tumor, the internal tissue density may gradually increase, and the present invention correspondingly increases the tissue density in the generated data.

[0043] Finally, the present invention obtains image parameters of known time points in the lesion timeline. These image parameters of known time points are obtained based on actual medical research or clinical data, and have high accuracy and representativeness. Interpolation calculations are performed between the parameters of adjacent time points, and the parameter values ​​of the intermediate time points are estimated by mathematical methods. In this way, a smooth lesion evolution sequence with a preset time point density can be generated. This sequence can clearly show the continuous change process of the lesion from one stage to another, which is of great significance for medical research and model training. In addition, in this evolution sequence, the present invention will also add artifact features that conform to the laws of physiological motion. The organs and tissues inside the human body are in constant motion, and these movements will produce some artifacts in medical images. Adding artifact features that conform to the laws of physiological motion can make the generated data more realistic and further improve the adaptability of the model to real medical scenes.

[0044] In another preferred embodiment of the present invention, the dynamic weight mixing in step S5 is a key step to optimize the representation space of the diffusion model and improve the model performance. The specific operation is as follows: First, the present invention calculates the feature distribution distance between the generated data and the real data in real time. The feature distribution distance is an important indicator to measure the degree of difference in the feature distribution of two sets of data. Through advanced data analysis methods, the present invention can accurately calculate the feature distribution distance between the two. Based on this feature distribution distance, the present invention can evaluate the data domain difference between the generated data and the real data. The data domain difference reflects the distribution difference between the generated data and the real data in the feature space. If the difference is too large, it may cause the model to deviate when processing data.

[0045] Next, based on the calculated feature distribution distance, the present invention uses KL divergence (Kullback-Leibler divergence) to adaptively adjust the mixing ratio of generated data and real data. KL divergence is a method for measuring the difference between two probability distributions, which can help the present invention dynamically adjust the mixing ratio according to the actual situation of the data feature distribution. When the feature distribution difference between the generated data and the real data is large, the present invention will appropriately reduce the proportion of generated data and increase the proportion of real data to ensure that the model can learn more features of the real data. On the contrary, the proportion of generated data is appropriately increased to make full use of the diversity of generated data.

[0046] Then, according to the adjusted mixing ratio, the present invention designs a hierarchical feature space alignment loss function. The function of this loss function is to optimize the feature representation of the data so that the generated data and the real data can be better aligned in the feature space. The hierarchical feature space alignment takes into account the characteristics and importance of features at different levels. By minimizing the loss function, the model can learn the essential characteristics of the data more effectively.

[0047] Afterwards, the present invention will evaluate the confidence of the generated data. The confidence reflects the reliability and accuracy of the generated data. The present invention will set a confidence threshold, and for generated data with a confidence lower than the threshold, the present invention will remove it. This can avoid the negative impact of low-quality generated data on model training and improve the efficiency and accuracy of model training.

[0048] Finally, the present invention calculates the similarity between medical image features and pathology report features through a loss function. Medical image features and pathology report features are two different modal data that reflect the information of lesions from different angles. The similarity between them is measured by a loss function, and then the model parameters are adjusted by minimizing this loss function. The purpose of this is to align the features of the two modal data in a common feature space, so that the model can better integrate data from different modalities and improve the model's comprehensive analysis ability and diagnostic accuracy for lesions.

[0049] In another preferred embodiment of the present invention, extracting the shared feature base layer of real data and generated data in step S6 is a complex and critical process, which is of great significance for improving model performance and data fusion effect. The specific steps are as follows: First, the present invention constructs a shared feature encoder. This encoder is designed based on deep learning technology, and its core purpose is to accurately extract shared features from generated data and real data. Shared features refer to information that exists in both generated data and real data and can reflect the essential characteristics of the data. By carefully designing the structure and parameters of the encoder, it is possible to deeply mine and analyze data from different sources to find common features. For example, in medical image data, shared features may include some basic anatomical structure features, common lesion texture features, etc.

[0050] Based on the extracted shared features, the present invention further distinguishes the unique features of the generated data and the real data. Unique features are feature information that is unique to each data set and different from other data sets. By comparing the shared features and the original data, the present invention can use feature analysis algorithms and pattern recognition techniques to find features that only exist in the generated data or the real data. This step helps the present invention to gain a deeper understanding of the characteristics and differences of the two types of data, and provide more targeted information for subsequent feature processing and model training.

[0051] Next, the present invention introduces a cross-domain feature alignment loss function. Since the generated data and the real data may come from different data sources or have different distribution characteristics, there may be differences in the spatial distribution of the same features between the two types of images. The role of the cross-domain feature alignment loss function is to measure this difference and minimize this loss function through an optimization algorithm, thereby achieving spatial distribution alignment of the same features between the two types of images. This is like calibrating the positions of the same objects in two different coordinate systems so that they have consistent representations in a unified space. Through feature alignment, the model can better fuse the information of generated data and real data, and improve the processing capabilities of different types of data.

[0052] Finally, according to the distribution of the aligned features, the present invention performs a shuffle operation on the features. The purpose of shuffling the features is to break the original order and association between the features and avoid the model from being overly dependent on a specific feature arrangement. Then, the present invention integrates feature information at different levels and scales. Features at different levels reflect the information of the data at different levels of abstraction, while features at different scales cover the features of the data at different sizes and ranges. By integrating these feature information, the present invention can provide a more comprehensive and richer input for the model, thereby improving the performance and generalization ability of the model.

[0053] In another preferred embodiment of the present invention, gradually increasing the training weight of the real data to a preset ratio in step S6 is a key step in dynamically adjusting the model training process, and the specific operations are as follows: First, the present invention evaluates the importance of each feature channel in the model. Feature channels are channels in the model used to process different feature information, and different feature channels may have different effects on the output results of the model. The present invention can determine the importance score of each feature channel through a feature importance evaluation algorithm, such as gradient-based feature importance analysis, information gain-based feature selection method, etc. Based on these scores, the present invention can identify key feature channels. Key feature channels are those channels that have a greater impact on model performance, and they contain the most critical information in the data.

[0054] During the model training process, the present invention freezes the parameters of the key feature channels. Freezing the parameters means that these parameters are not updated during the training process. The purpose of this is to keep the information learned by the key feature channels stable and avoid the degradation of model performance due to parameter updates in the later stages of training. At the same time, according to the changes in the training stage and model performance parameters, the present invention adaptively adjusts the learning rate of model training. The learning rate is an important hyperparameter for controlling the step size of model parameter updates. In the early stages of training, the present invention can set a larger learning rate so that the model can converge quickly; as the training progresses, when the model approaches the optimal solution, the present invention gradually reduces the learning rate to avoid the model skipping the optimal solution. By adaptively adjusting the learning rate, the present invention can improve the training efficiency and stability of the model.

[0055] During the model training process, the present invention gradually increases the proportion of real data in each training batch. Real data has high credibility and representativeness. Increasing its proportion in the training batch can allow the model to learn more data features of the real world and improve the generalization ability of the model. At the same time, the present invention reconstructs and classifies the features of the real data. Feature reconstruction refers to the recombination and representation of the features of the real data to extract more valuable feature information; feature classification is to divide the real data into different categories so that the model can better learn the feature differences of different categories of data.

[0056] In another preferred embodiment of the present invention, in step S7, generating an evaluation data set of the same type as the current training sample in real time, and testing the model until the set indicators of the model reach the preset standards is an important step to ensure the performance and reliability of the model. The specific process is as follows: The present invention performs a series of transformation operations on the current training sample. These transformation operations include rotation, flipping, scaling and adding noise. The rotation operation can simulate the presentation of the object at different angles, the flipping operation can increase the symmetry change of the data, the scaling operation can change the size ratio of the data, and the addition of noise can simulate the interference factors that may appear in practical applications. Through these transformation operations, the present invention can generate diversified sample data and expand the diversity of data. At the same time, the present invention samples from the original training data set. The sampling process follows certain rules, such as random sampling or stratified sampling, to ensure that the sampled data can represent the characteristic distribution of the original data set. The sampled data and the changed training samples form a new evaluation data set.

[0057] Next, the present invention inputs the generated evaluation data set into the currently trained diffusion model. The model processes each sample in the evaluation data set and outputs a prediction result. The present invention records the prediction results of the diffusion model in detail and calculates the performance of the model on the evaluation data set according to the set indicators. The set indicators can be accuracy, recall rate, F1 value, etc. These indicators can fully reflect the performance of the model.

[0058] According to the test results, the present invention adjusts the hyperparameters of the model. Hyperparameters are parameters that need to be preset before model training, such as learning rate, batch size, regularization coefficient, etc. By adjusting the hyperparameters, the present invention can optimize the training process of the model and improve the performance of the model. At the same time, the present invention will also modify the number of neurons and the number of layers of the model. Adjustment of the number of neurons and the number of layers will affect the complexity and expressiveness of the model. According to the test results, the present invention can increase or decrease the number of neurons and the number of layers to find the model structure that best suits the current task.

[0059] After adjusting the model, the present invention generates an evaluation data set of the same type as the current training sample again to test the model. The present invention continuously repeats the above process, just like constantly polishing a piece of art, and gradually optimizes the performance of the model. Until the set indicators of the model reach the preset standards, the model has high accuracy and reliability and can meet the needs of practical applications.

[0060] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.

Claims

1. A method for constructing a medical dataset based on AIGC image generation, characterized in that: The following steps are involved: S1. Establish multimodal semantic associations between medical image features, pathology report texts and anatomical markers, construct a semantic constraint matrix in the medical field, and generate a structured prompt template library based on the semantic constraint matrix; S2, a controllable fine-tuning module based on LORA, inputs the real medical image and the structured prompt into the diffusion model, establishes a mapping relationship between medical features and latent space, and the diffusion model generates data; S3. Verify the rationality of the anatomical structure of the generated data to determine whether the anatomical features are consistent with the biological features. If not, make the organ morphological parameters consistent with medical prior knowledge through a cyclic correction mechanism; S4, generating variants of different scales according to the characteristics of the target lesion, wherein the scales include anatomical position offset, tissue density gradient, and lesion stage evolution, and forming a three-dimensional continuous parameter space according to the scale changes; S5, mixing the real data and the generated data according to the dynamic weights, and optimizing the representation space of the diffusion model by a hierarchical feature alignment algorithm; S6, extracting a shared feature base layer of the real data and the generated data, and applying the shared feature base layer to the pre-training stage of the diffusion model; in the later stage of the diffusion model training, gradually increasing the training weight of the real data to a preset ratio, and freezing the feature channel corresponding to the generated data; S7. Monitor the characteristic response patterns of the diffusion model training process. When it is identified that the set indicators of the model do not meet the preset standards, generate an evaluation data set of the same type as the current training sample in real time and test the model until the set indicators of the model meet the preset standards.

2. The method for constructing a medical data set based on AIGC image generation according to claim 1, characterized in that: In step S1, the construction of the structured prompt template library includes: Extract anatomical marking information from medical data in DICOM format, and establish a basic anatomical structure framework based on the anatomical marking information; based on the anatomical structure framework, extract key description sentences in the pathology report, and build a pathology feature dictionary based on the key description sentences; combine the pathology feature dictionary to analyze different medical imaging features and establish a multimodal feature mapping relationship; based on the multimodal feature mapping relationship, build a feature fusion attention weight matrix; based on the attention weight matrix, generate a prompt grammatical structure with constraints; finally, verify and optimize the prompt grammatical structure through the semantic verification module of the medical knowledge graph.

3. The method for constructing a medical data set based on AIGC image generation according to claim 1, characterized in that: In step S2, the controllable fine-tuning module includes: Construct a medical feature embedding space, map the structured prompt into the latent space, set an anatomical structure attention guidance mechanism in the embedding space, and strengthen the set key area features; based on the attention guidance mechanism, generate a pathological feature diffusion path constraint algorithm to control the generation path of lesion features, optimize the tissue texture of the generated data, set a multi-scale feature consistency loss function, calculate the difference of key area features at different resolutions, and adjust the model parameters until the loss function converges; verify whether the generated data is consistent with the structured prompt through a semantic alignment verifier, otherwise repeat the above process.

4. The method for constructing a medical data set based on AIGC image generation according to claim 1, characterized in that: In step S4, the implementation of the data dynamic enhancement system includes: Perform basic geometric transformations on the generated data through the anatomical space transformation engine, including translation, rotation and scaling; during the geometric transformation process, adjust the tissue density in the generated data; A lesion timeline is set according to medical knowledge, and the lesion process is divided into several stages. At each stage, the lesion features in the image are adjusted according to the feature changes of the current stage, including the size, shape and density of the lesion features, wherein the size change and shape change of the lesion features are simulated by geometrically transforming the generated data, and the density of the lesion features is simulated by adjusting the tissue density in the generated image; The image parameters of known time points in the lesion timeline are obtained, and interpolation calculations are performed between the parameters of adjacent time points to obtain the parameter values ​​of the intermediate time points, thereby generating a smooth lesion evolution sequence with a preset time point density, and adding artifact features that conform to the laws of physiological movement to the evolution sequence.

5. The method for constructing a medical data set based on AIGC image generation according to claim 1, characterized in that: In step S5, the dynamic weight mixing includes: Calculate the feature distribution distance between the generated data and the real data in real time, and evaluate the data domain difference between the generated data and the real data according to the feature distribution distance; use KL divergence to adaptively adjust the mixing ratio of the generated data and the real data according to the feature distribution distance; design a hierarchical feature space alignment loss function according to the mixing ratio to optimize the feature representation of the data; evaluate the confidence of the generated data, and remove the generated data with a confidence lower than a threshold; The similarity between medical image features and pathology report features is calculated through the loss function. By minimizing the loss function, the model parameters are adjusted to align the features of the two modal data in a common feature space.

6. The method for constructing a medical data set based on AIGC image generation according to claim 1, characterized in that: In step S6, extracting the shared feature base layer of the real data and the generated data includes: A shared feature encoder is constructed to extract the shared features of generated data and real data. Based on the shared features, the unique features of the generated data and the real data are distinguished. A cross-domain feature alignment loss function is introduced to align the spatial distribution of the same features between the two types of images. According to the aligned feature distribution, the features are shuffled to integrate feature information at different levels and scales.

7. The method for constructing a medical data set based on AIGC image generation according to claim 1, characterized in that: In step S6, gradually increasing the training weight of the real data to a preset ratio includes: Evaluate the importance of each feature channel in the model, identify key feature channels, freeze the parameters of key feature channels during model training, adaptively adjust the learning rate of model training according to the changes in the training stage and model performance parameters, and gradually increase the proportion of real data in each training batch during model training, and reconstruct and classify the features of real data.

8. The method for constructing a medical data set based on AIGC image generation according to claim 1, characterized in that: In step S7, an evaluation data set of the same type as the current training sample is generated in real time, and the model is tested until the set index of the model reaches the preset standard, including: Perform transformation operations on the current training sample, including rotation, flipping, scaling, and adding noise, and sample from the original training data set to form a new evaluation data set with the changed training sample. Input the generated evaluation data set into the currently trained diffusion model, record the prediction results of the diffusion model, and calculate the performance of the diffusion model on the evaluation data set according to the set indicators. According to the test results, adjust the hyperparameters of the model, and modify the number of neurons and layers of the model. After adjusting the model, generate an evaluation data set of the same type as the current training sample again to test the model. Repeat the above process until the set indicators of the model reach the preset standards.

Citation Information

Patent Citations

  • Diffusion model-based medical image and pixel-level annotation generation method and device

    CN116109824A

  • Semi-supervised medical image segmentation method based on data enhancement strategy

    CN117710681A

  • Histopathology image generation method and device based on hidden space diffusion model

    CN117994374A

  • Multi-modal medical image conversion method and system based on potential diffusion model

    CN118172237A

  • Medical image generation method based on adversarial probability diffusion model

    CN118247374A

Cited By

  • Automatic SEM image analysis and process defect detection system based on full database

    CN120707514A

  • Radiology report generation method based on comparative learning and adaptive knowledge integration

    CN120809049A

  • Multi-stage scanning image quality control method and device

    CN120894297A