A method for generating medical records based on neural network technology
Automatically generates medical electronic medical records through neural network technology, solving the problem of time-consuming manual entry of medical records, improving the accuracy and efficiency of medical records, and reducing the work burden of medical staff.
Patent Information
- Application Number
- CN202411147021.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-08-21
AI Technical Summary
Manually entering medical records takes a lot of time for medical staff, limits work efficiency, and doctors spend a lot of non-medical time on handling medical records.
The medical record generation method based on neural network technology is adopted to generate high-accurate medical electronic medical records through automatic speech recognition, homophone mistranslation correction, word embedding, encoder extraction features, conditional generation decoder and bidirectional long and short-term memory network.
It improves the relevance and accuracy of medical record generation, reduces the work burden of medical staff, improves the efficiency of medical record records, and reduces the time cost of generating medical records.
Smart Images

Figure CN118657136B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electronic medical records, and in particular relates to a medical record generation method based on neural network technology. Background Art
[0002] At present, hospital medical staff talk with patients and then manually enter the patient's basic information and medication information into the electronic medical record. This operation method has the following problems: manually entering medical history and case information into the electronic medical record consumes a lot of time of medical staff and limits their work efficiency.
[0003] Some studies show that for every hour doctors spend with patients, they spend an additional two hours on medical record paperwork, and doctors spend an additional one to two hours on medical record paperwork after get off work. Other studies have shown that doctors spend about 24% of their working time on non-medical medical record paperwork tasks. Summary of the invention
[0004] In view of this, the present invention aims to propose a medical record generation method based on neural network technology, in order to solve at least one of the above-mentioned technical problems.
[0005] To achieve the above object, the technical solution of the present invention is achieved as follows:
[0006] The first aspect of the present invention provides a method for generating medical records based on neural network technology, comprising the following steps:
[0007] S1. Collect medical audio data and convert the medical audio data into medical text record data using automatic speech recognition technology;
[0008] S2. Identify and correct homophone mistranslations in medical text records;
[0009] S3, word embedding for the corrected medical text records;
[0010] S4, extract features using encoder;
[0011] S5, use the conditional generation decoder to generate multiple short text outputs according to the features obtained in S4;
[0012] Use a bidirectional long short-term memory network to capture the dependencies of the features obtained by S4 based on the context information to generate a high-dimensional feature;
[0013] S6, the conditional random field layer optimizes the prediction of the label sequence based on the high-dimensional features obtained from the bidirectional long short-term memory network.
[0014] Further, the S2 comprises the following steps:
[0015] S21, performing word segmentation processing on the medical text record data to divide the continuous text into vocabulary units;
[0016] S22, establish a correspondence between pronunciation and medical vocabulary, and add numbers arranged in sequence after words with the same or similar pronunciation to distinguish them;
[0017] S23, use one-hot encoding to map these words into the embedding space;
[0018] S24. Build a collection of medical terms, use the acoustic similarity function to measure the similarity between two embedding vectors, and use cosine similarity to measure similarity;
[0019] S25. If the transcribed vocabulary does not belong to the medical term set, the transcribed vocabulary is replaced with a backup vocabulary in the medical term set, and the similarity between the two vectors is calculated. If the similarity is greater than a set threshold, the transcribed vocabulary is replaced with the backup vocabulary.
[0020] Further, the S3 comprises the following steps:
[0021] S31, use Word2vec to map words to vectors of fixed dimension;
[0022] S32. Use SegmentEmbeddings segment embedding technology to convert the entire sentence or text paragraph into a vector of fixed dimension;
[0023] S33, encoding the position information through a rotation matrix to embed the position information.
[0024] Furthermore, the specific process of S4 is as follows:
[0025] Using Hierarchical Transformer Encoders to Process Long Texts
[0026] S41, the primary Transformer layer performs local encoding to process small text blocks;
[0027] S42, the high-level Transformer layer performs global encoding to integrate the locally encoded text blocks to form a representation of the entire text;
[0028] Sparse self-attention mechanism implemented using the BigBird method.
[0029] Furthermore, in S5, the conditional generative decoder is a Transformer-based decoder, and the conditional generative decoder is composed of multiple layers of Transformer decoder layers, each of which includes two main parts: a multi-head self-attention mechanism and a feedforward neural network;
[0030] Each task has an independent decoding path, and the query vector of the multi-head attention layer of the Transformer decoder layer is set for its own task;
[0031] Each head of the conditional generative decoder is regarded as an independent task, responsible for processing the information generation or extraction of the specified task;
[0032] All tasks are jointly trained in the same model, sharing the underlying encoder representation for generating medical records.
[0033] Furthermore, in S6, the conditional random field layer utilizes the high-dimensional features provided by the bidirectional long short-term memory network to optimize the prediction of the label sequence through global normalization, and outputs the optimal prediction of the sequence label.
[0034] Furthermore, the prediction results of S7, the conditional random field layer, replace the placeholders in the medical record template, where the medical record template includes diagnosis results, differential diagnosis, current medical history, past medical history, personal history, physical examination, laboratory examination, and imaging examination.
[0035] A second aspect of the present invention provides an electronic device, comprising a processor and a memory communicatively connected to the processor and used to store instructions executable by the processor, wherein the processor is used to execute the method described in the first aspect above.
[0036] The third aspect of the present invention provides a server, comprising at least one processor, and a memory communicatively connected to the processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the processor so that the at least one processor executes the method described in the first aspect.
[0037] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method described in the first aspect.
[0038] Compared with the prior art, the medical record generation method based on neural network technology described in the present invention has the following beneficial effects:
[0039] (1) The medical record generation method based on neural network technology described in the present invention combines a conditional generative decoder and a bidirectional long short-term memory network so that the generated short text is not only based on the information of the full text, but also takes into account the importance of the local context, thereby improving the relevance and accuracy of the generated text and improving the accuracy of the output medical electronic medical record.
[0040] (2) The present invention discloses a method for generating medical records based on neural network technology. The setting of multi-layer Transformer decoder layers can simultaneously learn and execute multiple generation tasks without the need to train a separate model for each task. The design of this architecture not only improves computational efficiency, but also enhances the effect of the model through shared representation. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:
[0042] Figure 1 The figure is a flow chart of the method for generating an electronic medical record according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0044] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and the like are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", and the like may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0045] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood by specific circumstances.
[0046] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0047] Embodiment 1:
[0048] like Figure 1 As shown, a medical record generation method based on neural network technology includes the following steps:
[0049] S1. Collect medical audio data and convert the medical audio data into medical text record data using automatic speech recognition technology;
[0050] Automatic speech recognition technology adopts but is not limited to existing services provided by iFlytek and Amazon.
[0051] S2. Identify and correct homophone mistranslations in medical text records;
[0052] This application uses a deep learning-based natural language processing (NLP) system, whose goal is to automatically identify and correct homophone mistranslations in medical records. The following is an overview of the technology and the mathematical model:
[0053] The S2 comprises the following steps:
[0054] First, the medical transcript data was prepared and cleaned;
[0055] Define a word embedding function , which converts any given word Map to a In a dimensional vector space, the formula is as follows:
[0056] ;
[0057] in, is the dimension of the embedding vector.
[0058] S21, performing word segmentation processing on the medical text record data to divide the continuous text into vocabulary units;
[0059] S22, establish a correspondence between pronunciation and medical vocabulary, and add numbers arranged in sequence after words with the same or similar pronunciation to distinguish them;
[0060] S23. Use one-hot encoding to map these words to the embedding space; use the adam optimizer and cosine similarity loss function to train and obtain the encoding method.
[0061] The specific process is as follows:
[0062] S231, using a one-hot encoding method to encode to obtain a high-dimensional sparse vector, and normalizing the one-hot encoded features so that each feature has an equal impact on the learning process;
[0063] S232. Define an embedding layer. The embedding layer maps the high-dimensional vector of the one-hot encoding to a low-dimensional space. The weights of the embedding layer are the parameters that the model needs to learn. They will capture the complex relationship between categories.
[0064] S233. Use cosine similarity as the loss function, which measures the similarity of two vectors in direction rather than their Euclidean distance;
[0065] S234, use Adam optimizer to adaptively adjust the learning rate;
[0066] S235. Input the processed data into the neural network; use the back-propagation algorithm and Adam optimizer to update the network weights to minimize the cosine similarity loss; monitor the value of the loss function during training.
[0067] S24. Construct a medical term collection, use the acoustic similarity function S to measure the similarity between two embedding vectors, and use cosine similarity to measure the similarity;.
[0068] The formula is as follows:
[0069] ;
[0070] in, are two word embedding vectors.
[0071] The process of building a collection of medical terms is as follows:
[0072] make Represents a collection of medical terms, each of which Each has its corresponding embedding vector .
[0073] S25. If the transcribed word does not belong to the medical term set, the transcribed word is replaced with a backup word in the medical term set, and the similarity between the two vectors is calculated. If the similarity is greater than the set threshold , the alternate vocabulary is used to replace the transcribed vocabulary.
[0074] For each transcription word , if the transcribed vocabulary does not belong to the set of medical terms, then find one , so that: ;
[0075] .
[0076] The one-way replacement rules that need to be followed during the replacement process are as follows:
[0077] .
[0078] The entire replacement process can be expressed in the following mathematical form:
[0079] ;
[0080] in, is the replaced word.
[0081] This approach not only effectively replaces everyday language with medical terms, but also ensures that replacement is only made when there is a high degree of similarity, thereby reducing the risk of incorrect replacement.
[0082] S3, word embedding for the corrected medical text records;
[0083] The S3 comprises the following steps:
[0084] S31, use Word2vec to map words to vectors of fixed dimension;
[0085] S32, use Segment Embeddings to convert the entire sentence or text paragraph into a vector of fixed dimension. Unlike Word2vec, Segment Embeddings focuses on larger text units, such as sentences or paragraphs, and tries to capture their overall semantics;
[0086] S33, encoding the position information through a rotation matrix to embed the position information.
[0087] Since the length of the doctor-patient conversations input to the model is often long, Rotary Positional Embedding (RoPE) is used to replace the traditional position embedding to enhance the model's ability to handle long-distance dependencies.
[0088] The encoding formula of RoPE is as follows:
[0089] ;
[0090] In this way, the feature corresponding to each dimension is rotated according to its position in the sequence. .
[0091] S4, extract features using encoder;
[0092] The specific process of S4 is as follows:
[0093] Using Hierarchical Transformer Encoders to Process Long Texts
[0094] S41, the primary Transformer layer performs local encoding to process small text blocks;
[0095] S42, the high-level Transformer layer performs global encoding to integrate the locally encoded text blocks to form a representation of the entire text;
[0096] Sparse self-attention mechanism implemented using the BigBird method.
[0097] Using a sparse self-attention mechanism in the global encoding (using the BigBird approach) allows the model to handle longer sequences.
[0098] The BigBird mechanism uses a generalized attention mechanism at each level, which is represented by a directed graph D, whose vertex set is [n]={1,...,n}. The edges (directed edges) in the graph represent the internal product set that the attention mechanism will consider. The output vector of the generalized attention mechanism for the i-th input is:
[0099] ;
[0100] in, The scoring function (e.g. softmax or hardmax), and H is the number of heads. The above parameters are the inputs concerned by the i-th query.
[0101] FeedForwardNetworks: Each attention layer is followed by a feedforward network with SwiGLU activation function.
[0102] Normalization: A Pre-Normalization strategy (normalization before each sub-layer) is used to improve the training stability of the model.
[0103] MaskedLanguageModel(MLM):
[0104] During the pre-training phase, some tokens in the input text are randomly masked, and then the model needs to predict these masked tokens. This method helps the model learn richer and deeper language representations.
[0105] S5, use the conditional generation decoder to generate multiple short text outputs according to the features obtained in S4;
[0106] The conditional generative decoder is a Transformer-based decoder. The conditional generative decoder consists of multiple layers of Transformer decoder layers, each of which contains two main parts: a multi-head self-attention mechanism and a feedforward neural network; the feedforward network provides a nonlinear transformation after each attention module.
[0107] The input of the conditional generation decoder is the output of the encoder, which is a high-dimensional representation of the text, and the decoder generates a target sequence based on a custom query vector for a specific task.
[0108] Each task has an independent decoding path, and the query vector of the multi-head attention layer of the Transformer decoder layer is set for its own task;
[0109] Each specific decoding path corresponds to a multi-head attention layer, whose query vector is targeted at a specific task, so that each task can focus on its specific important information.
[0110] These multi-head attention layers can process each head of the conditional generative decoder in parallel. Each decoder is an independent task responsible for processing information generation or extraction and generation for a specified task; multi-head attention layers can process different information in parallel. This structure allows the model to share knowledge during training while focusing on different output tasks.
[0111] All tasks are jointly trained in the same model, and the underlying encoder representation is shared to generate medical records, which speeds up the generation of medical records and enhances the model's overall understanding of the text.
[0112] The setting of multi-layer Transformer decoder layers can learn and perform multiple generation tasks simultaneously without the need to train a separate model for each task. This architectural design not only improves computational efficiency, but also enhances the effect of the model through shared representation.
[0113] Use a bidirectional long short-term memory network to generate a high-dimensional representation based on the features obtained by S4 based on the context information;
[0114] Specifically, the contextual information in the sequence is captured through the forward and backward hidden layer states. The bidirectional long short-term memory network BiLSTM is used to capture the dependencies between the features extracted by the encoder (S4 step). These features are abstract representations of the text and contain the semantic and structural information of the text.
[0115] S6. Generate a label for each short text, and the conditional random field layer optimizes the prediction of the label sequence from the high-dimensional features obtained from the bidirectional long short-term memory network.
[0116] In S6, the conditional random field layer uses the high-dimensional features provided by the bidirectional long short-term memory network to optimize the prediction of the label sequence through global normalization and outputs the optimal prediction of the sequence label.
[0117] The short text output generated by the conditional generative decoder CRF depends on the representation of the full text, that is, the high-dimensional features provided by the encoder.
[0118] BiLSTM processes the high-dimensional features provided by the encoder and further captures the dependencies between words to generate richer and more contextual feature representations. Through the conditional generative decoder CRF, BiLSTM settings can efficiently use past and future labels to predict the current label.
[0119] The combination of the conditional generation decoder and the bidirectional long short-term memory network makes the generated short text not only based on the information of the full text, but also takes into account the importance of the local context, thereby improving the relevance and accuracy of the generated text, enabling it to generate short text output that conforms to the global semantics and takes into account the local context, thereby improving the accuracy of the output medical electronic medical records.
[0120] S7. The prediction results of the conditional random field layer replace the placeholders in the medical record template, where the medical record template includes diagnosis results, differential diagnosis, current medical history, past medical history, personal history, physical examination, laboratory examination, and imaging examination. In some embodiments, the specific steps of S7 are as follows:
[0121] S71. Create a text template file that contains basic information and medical history information, and set a unique placeholder for each information; save it in JSON format;
[0122] S72. Create a CSV file and check the description of the information, format requirements, and placeholders corresponding to the information in the file;
[0123] The CSV file can be represented as a Python string. This dictionary contains all the required information and their corresponding placeholders;
[0124] S73, combining the information in the check file and the corresponding tag specific requirements, output template, and general requirements and inputting them into the prediction model to obtain the prediction result;
[0125] The editing function replaces the corresponding placeholders in the template file with the prediction results to generate cases;
[0126] The function replaces the data in the prediction results with the placeholders in the template, generates the medical record text in PDF format, and returns it as the final medical record file.
[0127] In some other embodiments, the specific steps of S7 are as follows:
[0128] S71, creating a template file, the template file is a word file, and the template file includes: basic information and medical history;
[0129] The basic information includes name, gender, age and other information, and each basic information is followed by a unique placeholder;
[0130] Medical history information includes: chief complaint, current medical history, past medical history, personal history, physical examination, laboratory examination, and imaging examination. Each piece of medical history information is followed by a unique placeholder;
[0131] S72. Create a check file, which is an execl file. The check file includes basic information and medical history information, as well as placeholders corresponding to each information. Each information has corresponding specified settings and output templates.
[0132] There are common settings for all information;
[0133] S73. Check the information in the file and the corresponding specified settings, output template, and general settings and input them into the prediction model to obtain the prediction results. Replace the placeholders in the template file with the placeholders corresponding to the prediction results to generate the medical records.
[0134] Through speech recognition, homophone correction, deep text encoding and decoding, and sequence annotation, structured electronic medical records can be automatically generated, which not only reduces the workload of doctors, but also improves the accuracy and efficiency of medical record keeping.
[0135] Embodiment 2:
[0136] An electronic device comprises a processor and a memory which is communicatively connected to the processor and is used to store instructions executable by the processor, wherein the processor is used to execute the method described in the first embodiment above.
[0137] Embodiment three:
[0138] A server includes at least one processor and a memory communicatively connected to the processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor so that the at least one processor executes the method described in Example 1.
[0139] Embodiment 4:
[0140] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in embodiment 1 is implemented.
[0141] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.
[0142] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A medical record generation method based on neural network technology, characterized in that: The following steps are involved: S1. Collect medical audio data and convert the medical audio data into medical text record data using automatic speech recognition technology; S2. Identify and correct homophone mistranslations in medical text records; S3, word embedding for the corrected medical text records; S4, extract features using encoder; S5, use the conditional generation decoder to generate multiple short text outputs according to the features obtained in S4; Use a bidirectional long short-term memory network to capture the dependencies of the features obtained by S4 based on the context information to generate a high-dimensional feature; S6, the conditional random field layer optimizes the prediction of the label sequence based on the high-dimensional features obtained from the bidirectional long short-term memory network; S7, the prediction results replace the placeholders in the medical record template to form a case; The S2 comprises the following steps: S21, performing word segmentation processing on the medical text record data to divide the continuous text into vocabulary units; S22, establish a correspondence between pronunciation and medical vocabulary, and add numbers arranged in sequence after words with the same or similar pronunciation to distinguish them; S23, use one-hot encoding to map these words into the embedding space, and use the adam optimizer and cosine similarity loss function to train and obtain the encoding; S24. Build a collection of medical terms, use the acoustic similarity function to measure the similarity between two embedding vectors, and use cosine similarity to measure similarity; S25. If the transcribed vocabulary does not belong to the medical term set, the transcribed vocabulary is replaced with a backup vocabulary in the medical term set, and the similarity between the two vectors is calculated. If the similarity is greater than a set threshold, the transcribed vocabulary is replaced with the backup vocabulary.
2. A method for generating medical records based on neural network technology according to claim 1, characterized in that: The S3 comprises the following steps: S31, use Word2vec to map words to vectors of fixed dimension; S32. Use SegmentEmbeddings segment embedding technology to convert the entire sentence or text paragraph into a vector of fixed dimension; S33, encoding the position information through a rotation matrix to embed the position information.
3. The medical record generation method based on neural network technology according to claim 1, characterized in that: The specific process of S4 is as follows: Using Hierarchical Transformer Encoders to Process Long Texts S41, the primary Transformer layer performs local encoding to process small text blocks; S42, the high-level Transformer layer performs global encoding to integrate the locally encoded text blocks to form a representation of the entire text; Sparse self-attention mechanism implemented using the BigBird method.
4. The method for generating medical records based on neural network technology according to claim 3, characterized in that: In S5, the conditional generative decoder is a Transformer-based decoder, which is composed of multiple layers of Transformer decoder layers, each of which contains two main parts: a multi-head self-attention mechanism and a feedforward neural network; Each task has an independent decoding path, and the query vector of the multi-head attention layer of the Transformer decoder layer is set for its own task; Each head of the conditional generative decoder is regarded as an independent task, responsible for processing the information generation or extraction of the specified task; All tasks are jointly trained in the same model, sharing the underlying encoder representation for generating medical records.
5. The method for generating medical records based on neural network technology according to claim 1, characterized in that: In S6, the conditional random field layer uses the high-dimensional features provided by the bidirectional long short-term memory network to optimize the prediction of the label sequence through global normalization and outputs the optimal prediction of the sequence label.
6. A method for generating medical records based on neural network technology according to claim 5, characterized in that: Also includes: S7. The medical record template includes diagnosis results, differential diagnosis, current medical history, past medical history, personal history, physical examination, laboratory tests, and imaging examinations.
7. An electronic device, comprising a processor and a memory connected to the processor for storing instructions executable by the processor, characterized in that: The processor is used to execute the method described in any one of claims 1 to 6.
8. A server, characterized in that: It includes at least one processor and a memory communicatively connected to the processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor so that the at least one processor executes the method according to any one of claims 1-6.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and system for automatic recognition of medical text terms based on long-term and short-term memory network
CN109002436A
Equipment measurement data processing method and system based on deep neural network, and terminal
CN113326380A
Composite neural network psychological medical knowledge graph construction method and system
CN115879546A
Traditional Chinese medicine text named entity recognition method based on vocabulary enhancement
CN115906857A
Chinese named entity recognition model based on attention mechanism and BiLSTM
CN116306652A
