Medical image intelligent generation method and device, storage medium and program product

CN122989906APending Publication Date: 2026-10-27BEIJING QINGSONG YIKANG INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611058823.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-16
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0003]目前医生获取医学图像主要有两种方式:一是从现有医学影像数据库检索,但数据库图像固定单一,难以适配不同场景需求,且检索筛选耗时;二是通过专业软件手动绘制,该方式需医生具备绘图技能,且绘制繁琐,严重占用临床诊疗时间,无法满足高效工作需求

Benefits of technology

[0016]本公开实施例提供的医学图像智能生成方法,通过连续对话数据驱动的方式,自动提取医生意图并生成专属医学提示词,医生只需像日常交流一样描述需求即可,无需具备任何绘图或提示词编写技能,大幅降低使用门槛。同时,时间衰减机制能够根据对话动态调整实体权重,适配紧急病例、课件制作、学术论文配图、医患沟通示意图等多种临床场景,响应速度快,能够即时生成符合场景需求的医学图像。整个流程从对话输入到图像输出实现了端到端的自动化,仅需医生进行对话,无需额外操作,显著提升了医学图像生成效率。医生在临床工作中可随时通过自然对话获得专业级图像,避免了因绘图技能不足或提示词撰写困难而导致的工作延误,真正实现了对话即生成的便捷体验。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989906A_ABST
    Figure CN122989906A_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a medical image intelligent generation method and device, a storage medium and a program product. The method comprises: acquiring continuous dialogue data of a doctor in a target scene, and extracting key entities therein; acquiring a weight coefficient of the key entities using a time decay algorithm; constructing an entity weight alignment vector based on the key entities, the weight coefficient of the key entities and the position of the key entities in the continuous dialogue data, inputting the entity weight alignment vector and the continuous dialogue data into an intention recognition model, and acquiring a core creative intention and required entities; generating a structured text based on the core creative intention and the required entities, and inputting the structured text into a pre-trained exclusive medical prompt word generation model to acquire exclusive medical prompt words; and inputting the exclusive medical prompt words into an image generation model to acquire exclusive medical images. The method can enable doctors to generate professional medical images suitable for different clinical scenes through daily conversations without the need for drawing skills.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a method, apparatus, storage medium, and program product for intelligent generation of medical images. Background Technology

[0002] In the medical field, in addition to clinical diagnosis and treatment, doctors also need to carry out tasks such as creating teaching materials, explaining cases, and communicating with patients. Medical images are a core element of these tasks, and their quality directly affects the efficiency of knowledge transfer, case interpretation, and communication.

[0003] Currently, doctors obtain medical images in two main ways: one is to retrieve them from existing medical image databases, but the images in the databases are fixed and limited, making it difficult to adapt to different scenarios and the retrieval and filtering process is time-consuming; the other is to manually draw them using professional software, which requires doctors to have drawing skills, is tedious, seriously occupies clinical diagnosis and treatment time, and cannot meet the needs of efficient work. Summary of the Invention

[0004] In view of this, the present disclosure provides a method, apparatus, storage medium and program product for intelligent generation of medical images, which enables doctors to quickly generate professional medical images adapted to different clinical scenarios without having drawing skills, simply through daily conversations.

[0005] In a first aspect, embodiments of this disclosure provide a method for intelligent generation of medical images, employing the following technical solution: Acquire continuous dialogue data of doctors in a target scenario, and extract key entities from the continuous dialogue data; The weight coefficients of the key entities are obtained using a time decay algorithm. Based on the key entity, the weight coefficient of the key entity, and the position of the key entity in the continuous dialogue data, an entity weight alignment vector is constructed. The continuous dialogue data and the entity weight alignment vector are input into the intent recognition model to obtain the core creative intent and the required entity of the core creative intent output by the intent recognition model. Based on the core creative intent and the required entities, structured text is generated and input into a pre-trained dedicated medical prompt word generation model to obtain the dedicated medical prompt words output by the dedicated medical prompt word generation model. The specific medical prompts are input into the image generation model to obtain the specific medical image output by the image generation model.

[0006] Optionally, obtaining the weight coefficients of the key entities using the time decay algorithm includes: Based on the target scenario, obtain the time decay coefficient; Based on the target scenario and the data types of the key entities, obtain the information importance coefficient; Based on the source timestamp, data processing timestamp, time decay coefficient, and information importance coefficient of the key entity, the corresponding weight coefficients are obtained.

[0007] Optionally, the intent recognition model includes a weighted feature fusion layer, a BERT encoding layer, and a dual-task prediction head; The weighted feature fusion layer is used to perform word segmentation on the continuous dialogue data to obtain a Token ID sequence and an attention mask; After dimensionally aligning the entity weight alignment vector with the token features corresponding to the token ID sequence, multiply them element by element to obtain the weighted dialogue feature vector. The BERT encoding layer is used to perform deep semantic encoding on the weighted dialogue feature vector based on the attention mask, and output a context-related semantic feature vector. The dual-task prediction head is used to decode and classify the semantic feature vector, and output the core creative intent and the required entities of different types.

[0008] Optionally, the dual-task prediction head includes an intent classification head and an entity regression classification head; The intent classification head is used to classify and identify the core creative intent and output the intent confidence score; the intent classification head uses Focal Loss as the loss function during training. The entity regression classification head is used to output the required entities of different types; during training, the entity regression classification head uses a weighted combination of CRF negative log-likelihood loss, mean squared error loss and cross-entropy loss as the joint loss function.

[0009] Optionally, the step of generating structured text based on the core creative intent and the required entities and inputting it into a pre-trained dedicated medical prompt word generation model to obtain the dedicated medical prompt words output by the dedicated medical prompt word generation model includes: Filter out historical contextual information related to the core creative intent from the continuous dialogue data; Detect historical doctor feedback information that matches the core creative intent; The core creative intent, the required entities, the historical context information, and the historical doctor feedback information are used to form structured input text; The structured input text is fed into the customized medical prompt word generation model after targeted fine-tuning training to obtain customized medical prompt words.

[0010] Optionally, the intelligent medical image generation method further includes: Construct a training sample set, wherein each training sample in the training sample set includes medical image prompts and corresponding medical images; Constructing a medical language loss function and a multi-dimensional cue word generation rule base; Using the medical language loss function as the optimization constraint and the multi-dimensional prompt word generation rule base as the generation constraint, the dedicated medical prompt word generation model is subjected to targeted fine-tuning training in conjunction with the training sample set.

[0011] Optionally, the intelligent medical image generation method further includes: Get feedback information from the doctor's current input; The feedback information is added to the continuous dialogue data, and the weight coefficients of the modified content in the entity weight alignment vector are updated based on the new continuous dialogue data. The new continuous dialogue data and the new entity weight alignment vector are input into the intent recognition model to obtain the new core creative intent and the new required entities; Based on the new core creative intent and the new required entities, new exclusive medical images are obtained.

[0012] Secondly, this disclosure also provides a medical image intelligent generation system, which adopts the following technical solution: The entity extraction module is used to acquire continuous dialogue data of doctors in a target scenario and extract key entities from the continuous dialogue data. The first acquisition module is used to acquire the weight coefficients of the key entities using a time decay algorithm; The vector construction module is used to construct an entity weight alignment vector based on the key entity, the weight coefficient of the key entity, and the position of the key entity in the continuous dialogue data. The second acquisition module is used to input the continuous dialogue data and the entity weight alignment vector into the intent recognition model to obtain the core creative intent and the required entity of the core creative intent output by the intent recognition model. The third acquisition module is used to generate structured text based on the core creative intent and the required entity, and input it into a pre-trained dedicated medical prompt word generation model to obtain the dedicated medical prompt words output by the dedicated medical prompt word generation model. The image output module is used to input the specific medical prompts into the image generation model and obtain the specific medical image output by the image generation model.

[0013] Thirdly, this disclosure also provides a computer device, which adopts the following technical solution: The computer device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform any of the above-described intelligent medical image generation methods.

[0014] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing computer instructions for causing a computer to execute any of the above-described intelligent medical image generation methods.

[0015] Fifthly, embodiments of this disclosure also provide a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of any of the methods described above.

[0016] The intelligent medical image generation method provided in this disclosure automatically extracts the doctor's intent and generates exclusive medical prompts through continuous dialogue data-driven processing. Doctors only need to describe their needs as in everyday communication, without requiring any drawing or prompt writing skills, significantly lowering the barrier to entry. Simultaneously, a time decay mechanism dynamically adjusts entity weights based on the dialogue, adapting to various clinical scenarios such as emergency cases, courseware production, academic paper illustrations, and doctor-patient communication diagrams. It offers fast response speed, instantly generating medical images that meet the needs of the scenario. The entire process, from dialogue input to image output, achieves end-to-end automation, requiring only doctor interaction without additional operations, significantly improving the efficiency of medical image generation. Doctors can obtain professional-grade images at any time through natural dialogue in clinical work, avoiding work delays caused by insufficient drawing skills or difficulties in writing prompts, truly achieving a convenient experience of instant generation through dialogue.

[0017] The above description is merely an overview of the technical solution disclosed herein. In order to better understand the technical means of this disclosure and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

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

[0019] Figure 1 A flowchart illustrating the intelligent medical image generation method provided in this embodiment of the disclosure; Figure 2 A flowchart illustrating the method for obtaining weight coefficients provided in this embodiment of the disclosure; Figure 3 A flowchart illustrating the method for obtaining specific medical prompts provided in this embodiment of the disclosure; Figure 4 A flowchart illustrating the targeted fine-tuning training method for the proprietary medical prompt word generation model provided in this embodiment of the disclosure; Figure 5 A schematic flowchart illustrating the proprietary medical image update method provided in this embodiment of the disclosure; Figure 6 A schematic diagram of the medical image intelligent generation system provided in the embodiments of this disclosure; Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. Detailed Implementation

[0020] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0021] It should be understood that the following specific examples illustrate the implementation of this disclosure, and those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. This disclosure can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0022] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.

[0023] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this disclosure. The drawings only show the components related to this disclosure and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0024] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.

[0025] Reference Figure 1 This disclosure provides a method for intelligent generation of medical images, including the following steps: S1: Obtain continuous dialogue data of doctors in the target scenario and extract key entities from the continuous dialogue data; S2: Use the time decay algorithm to obtain the weight coefficients of key entities; S3: Construct an entity weight alignment vector based on key entities, their weight coefficients, and their positions in continuous dialogue data; S4: Input the continuous dialogue data and entity weight alignment vector into the intent recognition model to obtain the core creative intent and the entities required for the core creative intent output by the intent recognition model; S5: Based on the core creative intent and the required entities, generate structured text and input it into a pre-trained dedicated medical prompt word generation model to obtain the dedicated medical prompt words output by the dedicated medical prompt word generation model; S6: Input the specific medical prompts into the image generation model to obtain the specific medical image output by the image generation model.

[0026] The intelligent medical image generation method disclosed herein automatically extracts the doctor's intent and generates exclusive medical prompts through continuous dialogue data-driven processing. Doctors only need to describe their needs as in everyday communication, without requiring any drawing or prompt writing skills, significantly lowering the barrier to entry. Simultaneously, the time decay mechanism dynamically adjusts entity weights based on the dialogue, adapting to various clinical scenarios such as emergency cases, courseware creation, academic paper illustrations, and doctor-patient communication diagrams. It offers fast response speed and can instantly generate medical images that meet the requirements of the specific scenario.

[0027] The entire process, from dialogue input to image output, is fully automated end-to-end. Doctors only need to engage in dialogue; no additional operations are required, significantly improving the efficiency of medical image generation. In clinical practice, doctors can obtain professional-grade images at any time through natural dialogue, avoiding delays caused by insufficient drawing skills or difficulties in writing prompts, truly achieving a convenient experience of generating images through dialogue.

[0028] In S1, continuous dialogue data includes current dialogue data and historical dialogue data. Key entities are divided into various types such as medical entities (e.g., anatomical locations), demand entities (e.g., accuracy requirements, focus), annotation entities (e.g., Chinese annotations, English annotations), and style entities (e.g., realistic style, 3D style).

[0029] The system uses a regular expression matching template library to remove invalid information such as interjections and repetitive sentences. Then, it uses semantic filtering to remove chatter content that is irrelevant to the generation of medical images. It calls a medical terminology dictionary that integrates SNOMED CT and ICD-11 standards, and combines it with a BiLSTM+CRF named entity recognition model to extract key medical entities based on the historical dialogue context.

[0030] In S2, refer to Figure 2 The flowchart illustrating the method for obtaining weight coefficients, specifically "Using the time decay algorithm to obtain the weight coefficients of key entities," includes the following steps: S21: Based on the target scenario, obtain the time decay coefficient; S22: Obtain the information importance coefficient based on the target scenario and the data type of key entities; S23: Obtain the corresponding weight coefficients based on the source timestamp, data processing timestamp, time decay coefficient, and information importance coefficient of the key entities.

[0031] The formula for calculating the weight coefficient of key entities is as follows: In the formula, Indicates the first Weight coefficients of key entities; Indicates the time decay coefficient; Represents the Euclidean constant (or Euler number); This represents the decay rate parameter; The data processing timestamp indicates the moment when the current data processing operation was performed; Indicates the first The source timestamp of a key entity refers to the recorded moment of the dialogue to which the key entity belongs, including the moment when the doctor inputs content or the moment when the chatbot outputs content. This represents the information importance coefficient.

[0032] The formula consists of two weighted terms, the first term... Achieving decay over time, based on the exponential function. The entity weight decreases exponentially as the dialogue time difference increases, where The first item is fixed at 0.3 to control the decay rate, ensuring that newer dialogues have higher weights for key entities, aligning with doctors' cognitive habits of prioritizing recent instructions over historical ones in continuous dialogues; the second item is the information importance item. ,pass Implement differentiated weighting for entity types. The contribution ratio of the two items is used to dynamically adjust the information; the more recent the information, the more important it is. The higher the value; A lower value indicates a greater reliance on the inherent importance of the entity type. For example, in emergency case scenarios, doctor's instructions are extremely time-sensitive, and recent information should have a much higher weight than historical information; therefore, a higher value is assigned. Take the value, therefore For academic paper illustration scenarios, it is necessary to balance recent discussions and prior settings, with a moderate to high time sensitivity. For the courseware production scenario, which falls under teaching, appropriate reference to historical dialogues is permissible, and the importance of entity types is relatively increased. The value is slightly lower, therefore For scenarios involving doctor-patient communication diagrams, a greater amount of historical information is tolerated, time sensitivity is low, and the semantic importance of the entities themselves is relied upon more heavily. .

[0033] It is evident that different scenarios exhibit varying sensitivities to information timeliness; therefore, the time decay coefficient... Based on dynamic configuration of the target scenario, the core importance of different entity types varies in different scenarios, and the semantic importance of the same entity type also differs in different scenarios. Therefore, the information importance coefficient... Dynamic configuration of data types based on target scenarios and key entities. This design method achieves dual adaptive weighting across time and semantic dimensions. It can automatically adjust the weight allocation strategy according to different scenarios such as emergency cases, courseware production, academic papers, and doctor-patient communication. It can distinguish the importance priority of different types of entities, such as medical entities, demand entities, style entities, and labeled entities, in specific scenarios, avoiding the loss of key information or the overemphasis of secondary information. Moreover, through this precise weight allocation, the downstream intent recognition model can focus more on high-value information, improving recognition accuracy.

[0034] Optionally, multiple basic scenarios are preset. When a doctor selects any basic scenario, the system checks whether the doctor's current input matches the current basic scenario. If it matches, the current basic scenario is used as the target scenario. If it does not match, the system checks if a matching basic scenario exists. If it does, the matching basic scenario is recommended to the doctor. If it does not exist, a suggestion to create a new scenario is output. When the doctor creates a new scenario, the new scenario is used as the target scenario. This method supports doctors in dialogues within different scenarios and allows doctors to add basic scenarios. When it detects that the doctor's current input does not match the current scenario, it can also remind the user and recommend existing basic scenarios or suggest creating a new scenario.

[0035] Optionally, the degree of inconsistency between the doctor's current input and the current scenario can be detected. If the degree of inconsistency is within the allowable range and the doctor still wants to use the current scenario, then the current scenario is used as the target scenario and the doctor is allowed to use it. This is a fault-tolerant use. If the degree of inconsistency is not within the allowable range, then a restatement suggestion is output, allowing the doctor to delete the seriously inconsistent input and re-output a dialogue that conforms to the current scenario.

[0036] The method detects the degree of conformity between the current output of the chatbot and the current scene. If the degree of conformity is greater than or equal to a threshold, the current output is used. If the degree of conformity is less than the threshold, the current output is determined to be inconsistent with the current scene, and the chatbot is required to re-output the content. This method can require the chatbot to re-output content when it is inconsistent with the current scene, until it is consistent with the current scene.

[0037] The number of historical dialogues for each scenario is detected separately. When the number of historical dialogues does not exceed X (e.g., 50), all dialogues are retained and used in the weighting coefficient calculation. When the number of dialogues is between X and Y (e.g., 200), the most recent X complete dialogues are retained, and a core information summary mechanism (generated by Med-DeepSeek, retaining only entity and intent information) is applied to the earlier dialogues. When the number of dialogues exceeds Y, a pop-up prompt is triggered and two options are provided: one is to create a new dialogue group (inheriting the current scenario configuration, and the original dialogues are automatically archived), and the other is to automatically clean up the early non-core dialogues (retaining only summary information).

[0038] In S3, based on the position information of key entities in the continuous dialogue data, the character range covered by the key entities is determined. The weight coefficient of each key entity is assigned to each character position in the corresponding character range, generating a one-dimensional vector with the same character length as the continuous dialogue data. This one-dimensional vector is the entity weight alignment vector. In this entity weight alignment vector, the value of each position is the weight coefficient of the key entity to which that position belongs. If it does not belong to any key entity, it is 0. If it belongs to multiple key entities, the maximum value is taken.

[0039] In S4, the intent recognition model includes a weighted feature fusion layer, a BERT encoding layer, and a dual-task prediction head. The weighted feature fusion layer segments the continuous dialogue data to obtain a token ID sequence and an attention mask. This layer uses a pre-trained tokenizer to divide the continuous dialogue data (in list form) into the smallest semantic units (i.e., tokens). For example, "left lung has nodules" is segmented into ["left", "lung", "have", "nodules", "nodules"]. By querying a dictionary, each token is mapped to a unique integer index, resulting in a token ID sequence (i.e., a word block number sequence), such as [101,2341,4562,3456,7891,7892,102]. Simultaneously, an attention mask is generated, which is a 0 / 1 vector of the same length as the token ID sequence (where the actual token position is 1 and the padding position is 0). This mask identifies the position of valid tokens to prevent the model from treating padding content as valid input.

[0040] The entity weight alignment vector is dimensionally aligned with the token features corresponding to the token ID sequence, and then multiplied element-wise to obtain the weighted dialogue feature vector. The token features are obtained by mapping the token ID sequence through the embedding layer; they are three-dimensional vectors with dimensions [batch, seq_len, hidden_dim]. Here, batch refers to the number of tokens, seq_len is the sequence length (i.e., the length of the feature vector corresponding to each token), and hidden_dim is the feature dimension (i.e., the length of the feature vector corresponding to each token).

[0041] In the process of dimensionally aligning the entity weight alignment vector with the token features, the weighted feature fusion layer determines the character range covered by each token based on the correspondence between characters and tokens. The maximum (or average) weight of the corresponding character position in the entity weight alignment vector within the range is taken as the weight of that token, resulting in a token-level weight vector. This token-level weight vector is then expanded to the same dimension as the token features (i.e., the dimension is also transformed to [batch, seq_len, hidden_dim]), and multiplied element-wise with the token features to output a weighted dialogue feature vector, thereby enhancing the feature representation of high-weight key entities.

[0042] The BERT encoding layer performs deep semantic encoding on weighted dialogue feature vectors based on attention masks, outputting context-relevant semantic feature vectors. This BERT encoding layer receives the weighted dialogue feature vectors output from the weighted feature fusion layer, and also receives the attention mask as auxiliary input. This layer consists of multiple stacked Transformer structures, utilizing a self-attention mechanism to perform contextual semantic encoding on the feature vector at each token location. During contextual semantic encoding, the attention mask is embedded in the self-attention calculation. That is, when calculating the attention score of a token to other tokens, positions with a mask value of 0 are assigned a very large negative value (such as -inf), causing their attention weights after softmax to approach 0, thus ensuring that the model ignores padding positions and only performs semantic interaction on real tokens.

[0043] After multiple Transformer encoding layers, the BERT encoding layer outputs a context-dependent semantic feature vector with dimensions maintained at [batch, seq_len, hidden_dim]. Each token position in this vector not only contains its own semantic information but also incorporates the associated information in its dialogue context (including historical rounds), providing rich feature representations for subsequent intent classification and entity extraction.

[0044] The dual-task prediction head is used to decode and classify semantic feature vectors, outputting the core creative intent and the required entities of different types. The dual-task prediction head includes an intent classification head and an entity regression classification head. The intent classification head is used to classify and identify the core creative intent and output the intent confidence score; the entity regression classification head is used to output the required entities of different types.

[0045] The intent classification head extracts the feature vector corresponding to the [CLS] (Classification Marker, a special marker added at the beginning of the input sequence, whose corresponding feature vector gathers the semantic information of the entire dialogue, suitable for classification tasks) position in the semantic feature vector. This is then input into a fully connected layer, and the probability distribution of various intents is output through a Softmax (normalized exponential function) activation function. The intent category corresponding to the maximum probability is the core creative intent, and this maximum value is also output as the intent confidence score. If the confidence score is greater than or equal to a preset confidence threshold (e.g., 0.8), the intent recognition is considered valid; if the confidence score is less than the preset confidence threshold, the query logic is triggered, and the chatbot proactively asks the doctor about the missing key entities.

[0046] The entity regression classification head contains multiple parallel branches, each responsible for outputting different types of required entities. The structure of each branch varies depending on the type. In this scheme, the required entity types primarily include medical, demand, and style; therefore, the entity regression classification head includes medical, demand, and style branches.

[0047] The medical branch outputs medical entities. This branch uses a CRF (Conditional Random Field) decoder to perform sequence labeling on each token position in the semantic feature vector (e.g., B-site, I-site, O, etc.), and decodes the globally optimal tag sequence using the Viterbi algorithm. Based on the tag sequence, the corresponding entity text is extracted from the original dialogue text (e.g., the tokens corresponding to the tags "B-site" and "I-site" are concatenated to form "left upper lobe of lung"), and finally, the medical entity text is output.

[0048] The requirement branch is used to output the requirement entity (such as accuracy requirements, emphasis, etc.). This branch extracts the feature vector at the [CLS] mark position in the semantic feature vector, performs a non-linear transformation through MLP (Multilayer Perceptron), outputs the category label (such as "high resolution") through the Softmax activation function for discrete requirement parameters (such as accuracy requirements), and outputs the specific value through the Linear activation function for continuous requirement parameters (such as emphasis score). Finally, the requirement entity text or value is output.

[0049] The style branch is used to output style entities (such as realistic style, 3D style, etc.). This branch extracts the feature vector at the [CLS] mark position in the semantic feature vector, performs a non-linear transformation through MLP, outputs the probability distribution of style category through the Linear activation function, and takes the style label corresponding to the maximum value (such as "realistic style"), and finally outputs the style entity text.

[0050] The outputs of the medical branch, demand branch, and style branch are aggregated to form a complete set of required entities, which, together with the core creative intent output by the intent classification head, serve as the final output of the intent recognition model.

[0051] The intent classification head uses Focal Loss as its loss function during training. The expression for this loss function is as follows: In the formula, The loss function representing the intent classification header; Indicates Focal Loss; This represents the predicted probability of the true category; This represents the category balance weight (0.75 in this scheme). This represents the focus adjustment factor (2 in this scheme), used to control the rate of weight decay of easy and difficult samples.

[0052] By introducing class balancing weights to compensate for prior distribution bias and prevent gradients from being overwhelmed by high-frequency classes, and by reducing the loss contribution of easily classified samples through a focusing adjustment factor, the model training is focused on the difficult-to-classify tail intent samples, thereby suppressing the dominant effect of high-frequency intents. This loss function design can optimize for the long-tail distribution problem in medical intent recognition (the top 3 intent classes account for 70%, while the tail 10 classes account for only 15%).

[0053] The entity regression classifier uses a weighted combination of CRF (Conditional Random Field) negative log-likelihood loss, mean squared error loss, and cross-entropy loss as a joint loss function during training. The expression for this joint loss function is as follows: In the formula, The loss function representing the entity regression classification head; The negative log-likelihood loss of CRF for medical entity sequence annotation; This represents the joint loss from extracting demand entities and style entities.

[0054] In the loss functions of entity regression classification heads, intent classification loss has the highest weight, followed by CRF negative log-likelihood loss, while the joint loss for demand entity and style entity extraction has the lowest weight. The loss is a weighted combination of mean squared error loss and cross-entropy loss. Mean squared error loss constrains the regression accuracy of continuous parameters (such as emphasis scores), while cross-entropy loss constrains the classification accuracy of discrete category parameters (such as high / medium / low accuracy requirements, realistic / 3D style, etc.). Because medical entity annotation requires ensuring the legality of label sequence transitions (e.g., "B-location" cannot be directly followed by "I-lesion"), the CRF negative log-likelihood loss can model the dependencies between labels through global decoding, avoiding illegal label sequences generated by independent classification. The weight allocation of the three losses is designed based on the error tolerance of the medical scenario. Since intent recognition errors directly lead to completely invalid generated content and overall failure, they are given the highest weight; medical entity recognition errors require additional correction, hence their second-highest weight; and the parameter deviation between demand entities and style entities can be corrected iteratively, hence their lowest weight. This design transforms the clinical risk level of the medical scenario into the optimization priority of model training, ensuring that the intent recognition model prioritizes avoiding fatal errors when resources are limited, rather than pursuing perfect details.

[0055] In S5, refer to Figure 3 The flowchart illustrating the method for obtaining personalized medical prompts includes the following steps: "Based on the core creative intent and required entities, structured text is generated and input into a pre-trained personalized medical prompt generation model to obtain the personalized medical prompts output by the model." S51: Filter out historical contextual information related to the core creative intent from continuous dialogue data; S52: Detection of historical doctor feedback information that matches the core creative intent; S53: Structure the input text by combining the core creative intent, required entities, historical context information, and historical doctor feedback information; S54: Input the structured input text into the dedicated medical prompt word generation model after targeted fine-tuning training to obtain dedicated medical prompt words.

[0056] In S51 and S52, relevant contextual information (such as constraints beyond the required entity range, like a doctor mentioning "normal lung tissue needs to be shown simultaneously for comparison") is filtered from historical dialogue data of continuous dialogue data based on the core creative intent and extracted as text fragments. Simultaneously, it checks whether there is doctor feedback information in the history that matches the current core creative intent from generated images (such as "the annotation font is too small" or "the lesion area needs to be highlighted"). If it exists, it is extracted as well; otherwise, the supplementary source is ignored.

[0057] In S53 and S54, the core creative intent and its required entities are used as the basic source, while historical contextual information and historical doctor feedback (if available) are used as supplementary sources. These two sources together form a structured input text, clearly distinguishing between basic parameters and supplementary constraints. This structured input text is then fed into the DeepSeek large model (i.e., the dedicated medical prompt generation model) fine-tuned with medical domain data. This model automatically integrates a built-in medical image generation rule library to generate a high-quality, dedicated medical prompt that accurately meets the current needs. The medical image generation rule library includes a multi-dimensional prompt generation rule library and a medical standard constraint rule library. The multi-dimensional prompt generation rule library guides the structured generation of prompts, while the medical standard constraint rule library ensures that the prompts conform to medical industry standards such as anatomical structure annotation specifications and style parameter value ranges.

[0058] Reference Figure 4 The flowchart illustrating the targeted fine-tuning training method for the dedicated medical prompt word generation model shows the following steps: S55: Construct a training sample set, in which each training sample includes a medical image prompt and a corresponding medical image; S56: Construct a medical language loss function and a multi-dimensional prompt word generation rule base; S57: Using the medical language loss function as the optimization constraint and the multi-dimensional prompt word generation rule base as the generation constraint, the dedicated medical prompt word generation model is fine-tuned by combining the training sample set.

[0059] In S55, the text of medical image prompts is extracted as model input from 50,000 pairs of medical image prompts and images covering scenarios such as anatomical structures, pathological features, and teaching diagrams. The corresponding medical images are used as supervision signals to construct a training sample set. The medical terms in the prompts need to be annotated and aligned using the SNOMED CT standard terminology library to support terminology-supervised learning.

[0060] In S56, the medical language loss function employs a dynamic weighted fusion of the base loss and the medical terminology loss, calculated as follows: In the formula, Represents the medical language loss function; Indicates the base loss weight; Indicates the loss weight of medical terminology; Represents the basic loss function; This represents the loss function for medical terminology.

[0061] The base loss function uses standard language modeling loss to ensure the fluency and logical coherence of the generated prompt words. Its calculation formula is as follows: In the formula, This indicates the total number of tokens in the prompt word sequence; Indicates the first A standard token for each location; Indicates the first The hidden state of a standard token; Represents the context encoding vector; This represents the probability predicted by the model. The standard tokens include medical terminology tokens and non-medical terminology tokens.

[0062] The medical terminology loss function introduces term embedding alignment constraints on top of the base loss to force the model output to conform to the SNOMED CT standard for medical terms. Its calculation formula is as follows: In the formula, This indicates the number of medical term tokens in the prompt sequence; Indicates the first Medical terminology tokens for each location; Indicates the first The hidden state of a medical term token; This represents the embedding alignment weight, used to balance the contributions of cross-entropy loss and cosine distance loss; Represents the cosine distance function; Indicates the first Each location generates an embedding vector for the medical term; Indicates the first The embedding vectors of SNOMED CT (Systematized Nomenclature of Medicine Clinical Terms) standard terms matched at each location serve as supervisory signals.

[0063] The base loss function employs standard language modeling loss to ensure the fluency and logical coherence of the generated prompts. The medical terminology loss function, building upon the base loss, introduces terminology embedding alignment constraints. It forces the model to accurately predict medical terminology tokens through a cross-entropy term and aligns the embedding vectors of generated terms to the SNOMED CT standard terminology embedding vectors through a cosine distance term. This weighted fusion of the base loss and medical terminology loss functions enables the model to simultaneously learn general text generation rules and medical terminology standards during training. The generated prompts utilize SNOMED CT standard terms with a usage rate exceeding 98%, addressing the issue of non-standard terminology used by ordinary doctors while maintaining both fluency and logical coherence.

[0064] The multi-dimensional prompt word generation rule base includes five dimensions: terminology standardization, accuracy parameters, anatomical perspective, annotation rules, and style rules. Specifically, the terminology standardization rules require all medical entities to use SNOMED CT standard terminology, prohibiting the use of colloquial or abbreviated expressions; the accuracy parameter rules specify the selectable resolution range (1024×1024, 2048×2048, or 4096×4096) and pixel density (fixed at 300dpi, suitable for printing and screen display), and supplement high-resolution images with block generation instructions; the anatomical perspective rules stipulate that anatomical structure images must specify a specific viewpoint (coronal, sagittal, transverse, or oblique), and for complex structures, multi-angle synthesis requirements can be added; the annotation rules specify that annotated images must specify annotation colors (e.g., dark red for lesions, light blue for normal tissue), font sizes (12 for titles, 10 for footnotes), and annotation positions (avoiding obscuring core structures); and the style rules require style entities to correspond to specific implementation standards, with realistic styles conforming to anatomical proportions, and 3D styles specifying lighting effects and rendering accuracy. The constraints of the rule base mentioned above ensure that the prompts output by the model are standardized and can be directly used in image generation models.

[0065] In S57, the model learns to generate prompts that conform to medical standards through the synergistic effect of real-time constraints of the multi-dimensional prompt word generation rule base and gradient optimization of the medical language loss function, ultimately constructing a dedicated medical prompt word generation model (Med-DeepSeek).

[0066] In S6, refer to Figure 5 The flowchart illustrating the method for updating customized medical images shows the following steps: S61: Obtain feedback information from the doctor's current input; S62: Add feedback information to the continuous dialogue data, and update the weight coefficients of the modified content in the entity weight alignment vector based on the new continuous dialogue data; S63: Input the new continuous dialogue data and the new entity weight alignment vector into the intent recognition model to obtain the new core creative intent and the new required entities; S64: Based on the new core creative intent and the new required entities, acquire new proprietary medical images.

[0067] In S61-S64, when the doctor does not request any modifications, it means that the currently output medical image is the result the doctor wants, and the doctor can download it. When the doctor requests modifications, the current feedback information is captured and added to the end of the continuous dialogue data, forming new continuous dialogue data. The entity weight alignment vector is updated according to a modification weight priority strategy. Regardless of whether the doctor's input modification content originally belonged to a medical entity, a demand entity, a style entity, a labeling entity, or other auxiliary entity type, its weight coefficient in the corresponding character range in the entity weight alignment vector is directly set to 0.95, instead of using the original default weight for that entity type (e.g., 0.9 for medical entities, 0.8 for demand entities, etc.). This process does not require re-executing the key entity extraction process and time decay algorithm; it only incrementally updates the entity weight alignment vector based on the newly added feedback content and historical weight information, while the weights of other unaffected entity positions remain unchanged.

[0068] The updated continuous dialogue data and the new entity weight alignment vector are input into the intent recognition model. Based on the new and modified content and historical weight information, the intent recognition model only updates the entity parameters involved in the modification (e.g., changing "3D style" to "2D realistic style" or adjusting the annotation color parameters), and outputs the new core creative intent and the new required entities. Skipping the complete retrieval step of the multi-dimensional prompt word generation rule library, the model directly calls the cached model parameters and the matching results of the multi-dimensional prompt word generation rule library. The new core creative intent and the new required entities are input into the dedicated medical prompt word generation model to generate optimized prompt words. Then, the image generation model outputs a new dedicated medical image. After the image is generated, basic format verification (resolution, pixel density compliance) is performed. If the verification fails, it is directly fed back to the dedicated medical prompt word generation model to correct the parameters and avoid invalid generation.

[0069] To address the issue of general practitioners struggling to write professional prompts, this solution employs a combination of a medical fine-tuning model and multiple rule constraints. By using a dual-source driven and iterative generation approach, it automatically generates prompts that meet both doctors' needs and medical standards, thus solving the industry-wide problem of general practitioners being unable to write professional prompts.

[0070] Reference Figure 6 This disclosure provides a medical image intelligent generation system, comprising: The entity extraction module 101 is used to acquire continuous dialogue data of doctors in a target scenario and extract key entities from the continuous dialogue data. The first acquisition module 102 is used to acquire the weight coefficients of key entities using a time decay algorithm; Vector construction module 103 is used to construct entity weight alignment vectors based on key entities, the weight coefficients of key entities, and the positions of key entities in continuous dialogue data. The second acquisition module 104 is used to input continuous dialogue data and entity weight alignment vector into the intent recognition model to obtain the core creative intent and the entity required by the core creative intent output by the intent recognition model. The third acquisition module 105 is used to generate structured text based on the core creative intent and the required entities and input it into the pre-trained dedicated medical prompt word generation model to obtain the dedicated medical prompt words output by the dedicated medical prompt word generation model. The image output module 106 is used to input the exclusive medical prompts into the image generation model and obtain the exclusive medical image output by the image generation model.

[0071] The various variations and specific examples of the intelligent medical image generation method provided above are also applicable to the intelligent medical image generation system provided in this disclosure. Through the foregoing detailed description of the intelligent medical image generation method, those skilled in the art can clearly understand the implementation method of the intelligent medical image generation system. For the sake of brevity, they will not be described in detail here.

[0072] A computer device according to embodiments of the present disclosure includes a memory and a processor. The memory is used to store non-transitory computer-readable instructions. Specifically, the memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, etc.

[0073] The processor may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the computer device to perform desired functions. In one embodiment of this disclosure, the processor is used to execute computer-readable instructions stored in the memory, causing the computer device to perform all or part of the steps of the medical image intelligent generation method of the foregoing embodiments of this disclosure.

[0074] Those skilled in the art will understand that, in order to solve the technical problem of how to achieve a good user experience, this embodiment may also include well-known structures such as communication buses and interfaces, and these well-known structures should also be included within the protection scope of this disclosure.

[0075] like Figure 7 This is a schematic diagram of a computer device provided for an embodiment of the present disclosure. It illustrates a structural schematic diagram suitable for implementing the computer device in the embodiments of the present disclosure. Figure 7 The computer device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0076] like Figure 7 As shown, a computer device may include a processor (such as a central processing unit, graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) or programs loaded from storage devices into random access memory (RAM). The RAM also stores various programs and data required for the operation of the computer device. The processor, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0077] Typically, the following devices can be connected to the I / O interface: input devices, such as sensors or visual information acquisition devices; output devices, such as displays; storage devices, such as magnetic tapes or hard drives; and communication devices. Communication devices allow the computer device to communicate wirelessly or wiredly with other devices (such as edge computing devices) to exchange data. Although Figure 7 A computer apparatus with various devices is shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or included alternatively.

[0078] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processor, all or part of the steps of the intelligent medical image generation method of embodiments of this disclosure are performed.

[0079] For a detailed description of this embodiment, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.

[0080] A computer-readable storage medium according to embodiments of the present disclosure stores non-transitory computer-readable instructions. When these non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the medical image intelligent generation method described in the foregoing embodiments of the present disclosure are performed.

[0081] The aforementioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or portable hard drive), media with built-in rewritable non-volatile memory (e.g., memory card), and media with built-in ROM (e.g., ROM cartridge).

[0082] For a detailed description of this embodiment, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.

[0083] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.

[0084] In this disclosure, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The block diagrams of devices, apparatuses, devices, and systems involved in this disclosure are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as "comprising," "including," "having," etc., are open-ended terms meaning "including but not limited to," and are used interchangeably with them. The terms "or" and "and" as used herein refer to the terms "and / or," and are used interchangeably with them unless the context clearly indicates otherwise. The term "such as" as used herein refers to the phrase "such as but not limited to," and is used interchangeably with it.

[0085] Additionally, as used herein, the "or" used in a list of items beginning with "at least one" indicates a separate list, such that a list of, for example, "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not imply that the described example is preferred or better than other examples.

[0086] It should also be noted that in the systems and methods of this disclosure, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions to this disclosure.

[0087] Various changes, substitutions, and modifications can be made to the technology described herein without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, events, means, methods, and actions described above. Currently existing or later-developed processes, machines, manufactures, events, means, methods, or actions that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein can be utilized. Therefore, the appended claims include such processes, machines, manufactures, events, means, methods, or actions within their scope.

[0088] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.

[0089] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.

Claims

1. A method for intelligent generation of medical images, characterized in that, include: Acquire continuous dialogue data of doctors in a target scenario, and extract key entities from the continuous dialogue data; The weight coefficients of the key entities are obtained using a time decay algorithm. Based on the key entity, the weight coefficient of the key entity, and the position of the key entity in the continuous dialogue data, an entity weight alignment vector is constructed. The continuous dialogue data and the entity weight alignment vector are input into the intent recognition model to obtain the core creative intent and the required entity of the core creative intent output by the intent recognition model. Based on the core creative intent and the required entities, structured text is generated and input into a pre-trained dedicated medical prompt word generation model to obtain the dedicated medical prompt words output by the dedicated medical prompt word generation model. The specific medical prompts are input into the image generation model to obtain the specific medical image output by the image generation model.

2. The intelligent medical image generation method according to claim 1, characterized in that, The method of using the time decay algorithm to obtain the weight coefficients of the key entities includes: Based on the target scenario, obtain the time decay coefficient; Based on the target scenario and the data types of the key entities, obtain the information importance coefficient; Based on the source timestamp, data processing timestamp, time decay coefficient, and information importance coefficient of the key entity, the corresponding weight coefficients are obtained.

3. The intelligent medical image generation method according to claim 1, characterized in that, The intent recognition model includes a weighted feature fusion layer, a BERT encoding layer, and a dual-task prediction head; The weighted feature fusion layer is used to perform word segmentation on the continuous dialogue data to obtain a Token ID sequence and an attention mask; After dimensionally aligning the entity weight alignment vector with the token features corresponding to the token ID sequence, multiply them element by element to obtain the weighted dialogue feature vector. The BERT encoding layer is used to perform deep semantic encoding on the weighted dialogue feature vector based on the attention mask, and output a context-related semantic feature vector. The dual-task prediction head is used to decode and classify the semantic feature vector, and output the core creative intent and the required entities of different types.

4. The intelligent medical image generation method according to claim 3, characterized in that, The dual-task prediction head includes an intent classification head and an entity regression classification head; The intent classification head is used to classify and identify the core creative intent and output the intent confidence score; the intent classification head uses Focal Loss as the loss function during training. The entity regression classification head is used to output the required entities of different types; during training, the entity regression classification head uses a weighted combination of CRF negative log-likelihood loss, mean squared error loss and cross-entropy loss as the joint loss function.

5. The intelligent medical image generation method according to claim 1, characterized in that, Based on the core creative intent and the required entities, structured text is generated and input into a pre-trained dedicated medical prompt word generation model to obtain the dedicated medical prompt words output by the dedicated medical prompt word generation model, including: Filter out historical contextual information related to the core creative intent from the continuous dialogue data; Detect historical doctor feedback information that matches the core creative intent; The core creative intent, the required entities, the historical context information, and the historical doctor feedback information are used to form structured input text; The structured input text is fed into the customized medical prompt word generation model after targeted fine-tuning training to obtain customized medical prompt words.

6. The intelligent medical image generation method according to claim 5, characterized in that, Also includes: Construct a training sample set, wherein each training sample in the training sample set includes medical image prompts and corresponding medical images; Constructing a medical language loss function and a multi-dimensional cue word generation rule base; Using the medical language loss function as the optimization constraint and the multi-dimensional prompt word generation rule base as the generation constraint, the dedicated medical prompt word generation model is subjected to targeted fine-tuning training in conjunction with the training sample set.

7. The intelligent medical image generation method according to claim 1, characterized in that, Also includes: Get feedback information from the doctor's current input; The feedback information is added to the continuous dialogue data, and the weight coefficients of the modified content in the entity weight alignment vector are updated based on the new continuous dialogue data. The new continuous dialogue data and the new entity weight alignment vector are input into the intent recognition model to obtain the new core creative intent and the new required entities; Based on the new core creative intent and the new required entities, new exclusive medical images are obtained.

8. A computer device, characterized in that, The computer device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the intelligent medical image generation method according to any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the intelligent medical image generation method according to any one of claims 1-7.

10. A computer program product comprising computer instructions, characterized in that, When executed by a processor, the computer instructions implement the steps of the intelligent medical image generation method according to any one of claims 1-7.