Object analysis method, device, computer equipment and storage medium
By performing sequence conversion and feature extraction on images of diabetic retinopathy, combined with clinical data and large-scale language analysis models, the problem of single feature extraction and poor accuracy in traditional methods is solved, and a more accurate diagnosis of diabetic retinopathy is achieved.
Patent Information
- Application Number
- CN202311846783.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-12-29
AI Technical Summary
Traditional diagnostic methods for diabetic retinopathy (DR) are difficult to achieve timely and accurate diagnosis in resource-poor and primary medical environments. They are based on global convolution feature extraction and ignore some features, and the analysis factors are single, resulting in poor accuracy of diagnosis and treatment results.
An object analysis method is adopted to obtain target image sequences and clinical data, use pre-trained feature extractors and classification sub-models to perform feature extraction and analysis, and combine the large-scale language analysis model to perform object analysis on the results to improve the performance of the image processing model. Feature extraction capabilities and analysis accuracy.
The image processing model improves the feature extraction capability of the detailed parts of the image to be detected, enhances the accuracy of analysis, and improves the accuracy of object analysis results through multiple factor analysis.
Smart Images

Figure CN117912672B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an object analysis method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] Diabetic retinopathy (DR) is one of the leading causes of visual impairment and blindness worldwide. Current DR diagnostic methods rely mainly on visual inspection and evaluation by professional ophthalmologists. However, timely and accurate diagnosis and treatment of DR has become a challenge in resource-poor and primary care settings.
[0003] In traditional technology, neural networks and machine learning techniques are applied to train the DR diagnostic model based on a large number of retinal fundus image data sets, and the retinal fundus images provided by the patient are analyzed based on the CNN (Convolutional Neural Networks) model. The fundus images are convoluted through the CNN model to output the current patient's diagnosis and treatment results.
[0004] However, in traditional technology, global convolution is performed on fundus images to extract features, which ignores some features and only analyzes the symptoms contained in the fundus images. The analysis factors are relatively simple, resulting in poor accuracy of diagnosis and treatment results. Summary of the invention
[0005] Based on this, it is necessary to provide an object analysis method, apparatus, computer device, computer-readable storage medium and computer program product to address the above technical issues.
[0006] In a first aspect, the present application provides an object analysis method, comprising:
[0007] Obtaining a target image sequence, clinical data and an image processing model; the target image sequence is obtained by performing image sequence conversion on the image to be detected; the image processing model includes a pre-trained feature extractor and a trained classification sub-model;
[0008] Extracting features from the target input sequence by the feature extractor, and analyzing and processing the result of the feature extraction by the classification sub-model to obtain a target analysis result;
[0009] Based on a large-scale language analysis model, object analysis is performed on the target analysis results and the clinical data to obtain object analysis results.
[0010] In one embodiment, acquiring a target image sequence includes:
[0011] Segment the image to be detected according to a preset segmentation method to obtain multiple image blocks;
[0012] Convolution processing is performed on each of the image blocks to obtain a target input sequence.
[0013] In one embodiment, the feature extractor includes a multi-head self-attention structure and a multi-layer perceptron;
[0014] The feature extractor is used to extract features from the target input sequence, and the classification sub-model is used to analyze and process the result of the feature extraction to obtain the target analysis result, including:
[0015] Calculating triplet features of the target image sequence;
[0016] The triplet features are transformed based on a multi-head self-attention structure and a multi-layer perceptron to obtain a target feature vector;
[0017] The target feature vector is classified according to the classification sub-model to obtain a target analysis result.
[0018] In one embodiment, the transforming of the triple features based on the multi-head self-attention structure and the multi-layer perceptron to obtain the target feature vector includes:
[0019] Mapping the triplet features according to each self-attention layer in the multi-head self-attention mechanism to obtain a mapping result of each self-attention layer, and obtaining a joint mapping result based on each mapping result;
[0020] The joint mapping result is transformed through a multi-layer perceptron to obtain a target feature vector.
[0021] In one of the embodiments, the classification sub-model includes a quality assessment sub-model, a first symptom classification sub-model, a second symptom judgment sub-model and a lesion segmentation sub-model;
[0022] The classifying process of the target feature vector according to the classification sub-model to obtain the target analysis result includes:
[0023] The target feature vector is classified and processed according to the image quality assessment sub-model, the first symptom grading sub-model, the second symptom judgment sub-model and the lesion segmentation sub-model to obtain an image quality assessment result, a first symptom grade, a second symptom diagnosis result and a lesion segmentation result, respectively.
[0024] The image quality assessment result, the first symptom level, the second symptom diagnosis result and the lesion segmentation result are used as target analysis results.
[0025] In one embodiment, before acquiring the target image sequence, clinical data and image processing model, the method further includes:
[0026] Acquire a sample image set, and perform data enhancement on each sample image in the sample image set to obtain a first reconstructed image block and a second reconstructed image block;
[0027] Performing feature extraction on the first reconstructed image block and the second reconstructed image block respectively to obtain query features and a key feature sequence, and determining a contrast loss value based on the query features and the key feature sequence;
[0028] Reconstructing the reconstructed image block according to a preset decoder to obtain a reconstructed image, and determining a reconstruction loss value based on the reconstructed image and the sample image corresponding to the reconstructed image;
[0029] The feature extraction sub-model included in the image processing model is trained based on the contrast loss value and the reconstruction loss value to obtain the trained feature extraction sub-model.
[0030] In one embodiment, extracting features from the first reconstructed image block and the second reconstructed image block respectively to obtain query features and a key feature sequence, and determining the contrast loss value based on the query features and the key feature sequence includes:
[0031] For each of the first reconstructed image block and the second reconstructed image block in the sample image set, extract features from the first reconstructed image block according to the first encoder to obtain query features, and extract features from the second reconstructed image block according to the second encoder to obtain key features;
[0032] Each key feature in the key feature sequence is matched with the query feature, and the key feature sequence and the positive sample key features in the key feature sequence are determined based on the matching results, and the comparison loss value is determined by the similarity between the query feature and the positive sample key features in the key feature sequence, and between the query feature and other key features in the key feature sequence.
[0033] In a second aspect, the present application further provides an object analysis device, comprising:
[0034] An acquisition module is used to acquire a target image sequence, clinical data and an image processing model; the target image sequence is obtained by performing image sequence conversion on the image to be detected; the image processing model includes a pre-trained feature extractor and a trained classification sub-model;
[0035] A first analysis module is used to extract features from the target input sequence through the feature extractor, and analyze and process the feature extraction results through the classification sub-model to obtain a target analysis result;
[0036] The second analysis module is used to perform object analysis on the target analysis results and the clinical data based on a large-scale language analysis model to obtain object analysis results.
[0037] In one of the embodiments, the acquisition module is specifically used to perform image segmentation on the image to be detected according to a preset segmentation method to obtain multiple image blocks;
[0038] Convolution processing is performed on each of the image blocks to obtain a target input sequence.
[0039] In one embodiment, the feature extractor includes a multi-head self-attention structure and a multi-layer perceptron;
[0040] The first analysis module is specifically used to calculate the triplet features of the target image sequence;
[0041] The triplet features are transformed based on a multi-head self-attention structure and a multi-layer perceptron to obtain a target feature vector;
[0042] The target feature vector is classified according to the classification sub-model to obtain a target analysis result.
[0043] In one embodiment, the first analysis module is specifically used to map the triple feature according to each self-attention layer in the multi-head self-attention mechanism, obtain a mapping result of each self-attention layer, and obtain a joint mapping result based on each mapping result;
[0044] The joint mapping result is transformed through a multi-layer perceptron to obtain a target feature vector.
[0045] In one of the embodiments, the classification sub-model includes a quality assessment sub-model, a first symptom classification sub-model, a second symptom judgment sub-model and a lesion segmentation sub-model;
[0046] The first analysis module is specifically used to classify the target feature vector according to the image quality assessment sub-model, the first symptom grading sub-model, the second symptom judgment sub-model and the lesion segmentation sub-model to obtain an image quality assessment result, a first symptom level, a second symptom diagnosis result and a lesion segmentation result.
[0047] The image quality assessment result, the first symptom level, the second symptom diagnosis result and the lesion segmentation result are used as target analysis results.
[0048] In one embodiment, the device further comprises:
[0049] A data enhancement module, used to obtain a sample image set, and perform data enhancement on each sample image in the sample image set to obtain a first reconstructed image block and a second reconstructed image block;
[0050] a feature extraction module, configured to extract features from the first reconstructed image block and the second reconstructed image block respectively, obtain query features and a key feature sequence, and determine a contrast loss value based on the query features and the key feature sequence;
[0051] A reconstruction module, configured to reconstruct the reconstructed image block according to a preset decoder to obtain a reconstructed image, and determine a reconstruction loss value based on the reconstructed image and the sample image corresponding to the reconstructed image;
[0052] A training module is used to train the feature extraction sub-model included in the image processing model based on the contrast loss value and the reconstruction loss value to obtain the trained feature extraction sub-model.
[0053] In one of the embodiments, the feature extraction module is specifically used to extract features from the first reconstructed image block and the second reconstructed image block in the sample image set according to the first encoder to obtain query features, and to extract features from the second reconstructed image block according to the second encoder to obtain key features;
[0054] Each key feature in the key feature sequence is matched with the query feature, and the key feature sequence and the positive sample key features in the key feature sequence are determined based on the matching results, and the comparison loss value is determined by the similarity between the query feature and the positive sample key features in the key feature sequence, and between the query feature and other key features in the key feature sequence.
[0055] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0056] Obtaining a target image sequence, clinical data and an image processing model; the target image sequence is obtained by performing image sequence conversion on the image to be detected; the image processing model includes a pre-trained feature extractor and a trained classification sub-model;
[0057] Extracting features from the target input sequence by the feature extractor, and analyzing and processing the result of the feature extraction by the classification sub-model to obtain a target analysis result;
[0058] Based on a large-scale language analysis model, object analysis is performed on the target analysis results and the clinical data to obtain object analysis results.
[0059] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0060] Obtaining a target image sequence, clinical data and an image processing model; the target image sequence is obtained by performing image sequence conversion on the image to be detected; the image processing model includes a pre-trained feature extractor and a trained classification sub-model;
[0061] Extracting features from the target input sequence by the feature extractor, and analyzing and processing the result of the feature extraction by the classification sub-model to obtain a target analysis result;
[0062] Based on a large-scale language analysis model, object analysis is performed on the target analysis results and the clinical data to obtain object analysis results.
[0063] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0064] Obtaining a target image sequence, clinical data and an image processing model; the target image sequence is obtained by performing image sequence conversion on the image to be detected; the image processing model includes a pre-trained feature extractor and a trained classification sub-model;
[0065] Extracting features from the target input sequence by the feature extractor, and analyzing and processing the result of the feature extraction by the classification sub-model to obtain a target analysis result;
[0066] Based on a large-scale language analysis model, object analysis is performed on the target analysis results and the clinical data to obtain object analysis results.
[0067] The object analysis method, device, computer equipment, storage medium and computer program product described above obtain a target image sequence, clinical data and an image processing model; the target image sequence is obtained by performing image sequence conversion on the image to be detected; the image processing model includes a pre-trained feature extractor and a trained classification sub-model; the feature extractor performs feature extraction on the target input sequence, and the classification sub-model performs analysis and processing on the feature extraction result to obtain a target analysis result; the target analysis result and the clinical data are subjected to object analysis based on a large-scale language analysis model to obtain an object analysis result. By adopting this method, the image to be detected image is subjected to sequence conversion, so that the image processing model can improve its feature extraction capability for the details in the image to be detected, and the image processing model can improve its analysis accuracy for the image to be detected through the pre-trained feature extractor and the trained classification sub-model, and the large-scale language analysis model can perform object analysis on the target prediction result combined with the clinical data, and can analyze according to multiple factors to improve the accuracy of the object analysis result. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0069] Figure 1 An application environment diagram of an object analysis method in an embodiment;
[0070] Figure 2 A schematic diagram of a training principle of a large-scale language analysis model in one embodiment;
[0071] Figure 3 A schematic diagram of a process of performing image sequence conversion on an image to be detected in one embodiment;
[0072] Figure 4 A schematic diagram of a flow chart of an image processing model analyzing and processing a target image sequence in one embodiment;
[0073] Figure 5 is a schematic diagram of the structure of a feature extractor in one embodiment;
[0074] Figure 6 A schematic diagram of a process of determining a target feature vector by a feature extractor in one embodiment;
[0075] Figure 7 is a schematic diagram of the model structure of each classification sub-model in an embodiment;
[0076] Figure 8 A schematic diagram of a flow chart of a training step of a feature extraction sub-model in one embodiment;
[0077] Fig. 9 is a schematic diagram of a pre-trained network of an image processing model in one embodiment;
[0078] Fig.10 A flowchart of detailed steps for determining contrast loss in another embodiment;
[0079] Fig.11 A flowchart of an example of an object analysis method in one embodiment;
[0080] Fig.12 is a structural block diagram of an object analysis device in one embodiment;
[0081] Fig.13 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0082] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0083] In one embodiment, Figure 1 As shown, an object analysis method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0084] Step 102: Obtain target image sequence, clinical data and image processing model.
[0085] The target image sequence is obtained by performing image sequence transformation on the image to be detected.
[0086] Among them, the image processing model includes a pre-trained feature extractor and a trained classification sub-model.
[0087] In the embodiment of the present application, the terminal obtains the image to be detected and clinical data input by the user, and obtains the trained image processing model. Among them, the image to be detected can be a medical image. The embodiment of the present application takes the image to be detected as a fundus image for detecting diabetic retinopathy as an example for explanation. The terminal converts the image sequence of the image to be detected into a one-dimensional embedding sequence to obtain a target image sequence corresponding to the image to be detected.
[0088] Clinical data can be the examination data of the object (patient) to be tested, such as gender, age, height, weight, blood pressure and other data obtained from examination forms. Among them, multiple data types are preset in clinical data. There may be missing data based on the clinical data provided by different objects to be tested. At this time, the terminal can set the data type corresponding to the missing data to the default state in the preset data type, that is, all data with examination records can be included and saved in the form of a dictionary. The image processing model is a trained model, which is used to perform image analysis on the image to be tested and determine the disease analysis results contained in the image to be tested.
[0089] Step 104, extract features from the target input sequence through a feature extractor, and analyze and process the result of the feature extraction through a classification sub-model to obtain a target analysis result.
[0090] In an embodiment of the present application, the terminal can use a feature extractor of an image processing model to extract key features from a one-dimensional target input sequence. The feature extractor can be a method based on deep learning, such as Transformer (an attention mechanism model), convolutional neural network (CNN) or long short-term memory network (LSTM, Long short-term memory), etc. Then, the terminal inputs the result obtained by feature extraction into the classification sub-model, classifies the result of feature extraction through the classification sub-model, and uses the classification result as the target analysis result. Optionally, the classification sub-model serves as a downstream task of the image processing model. There can be multiple classification sub-models, each of which has different points of interest during training. Image analysis can be performed for different task types, and the analysis results of different dimensions are summarized to obtain the target analysis result.
[0091] Step 106, performing object analysis on the target analysis results and clinical data based on the large-scale language analysis model to obtain object analysis results.
[0092] In an embodiment of the present application, the large-scale language analysis model can be an LLaMA large language model as a framework. The terminal fuses the target analysis results in text form and the clinical data, and inputs the fused text data into the large-scale language analysis model. The large-scale language analysis model is used to process the data to obtain the object analysis results of the object to be detected.
[0093] Among them, the training process of large-scale language analysis models is as follows Figure 2As shown in the figure, the large-scale language analysis model includes additional network layers, including an Adapter network embedded in the Transformer layer and a LoRA (Low-Rank Adaptation of Large Language Models) module set in the bypass of the LLaMA model. Among them, the Adapter is located after the feedforward network layer and before the residual connection. The Adapter is a two-layer MLP (Multilayer Perceptron), which is responsible for reducing and increasing the dimension of the feature expression of the Transformer. Based on the Adapter method, effective parameter learning for the pre-trained large-scale language analysis model only requires adding a small number of trainable parameters to approach the effect of full parameter training, thereby significantly saving time during the training process and improving time efficiency. Therefore, in practical applications, for specific tasks, the terminal does not need to re-fine-tune all the parameters of the pre-trained large-scale language analysis model, but only needs to save the Adapter, while the other parameters of the pre-trained large-scale language analysis model remain in the original pre-trained state, thereby optimizing space efficiency.
[0094] In the process of training the pre-trained large-scale language analysis model based on LoRA, the dimension reduction matrix A and the dimension increase matrix B in the LoRA module in the bypass are replaced, and only the dimension reduction matrix A and the dimension increase matrix B are updated in the downstream task processing. One dimension reduction and one dimension increase operation are performed to simulate the intrinsic rank, ensuring that the input and output dimensions of the pre-trained large-scale language analysis model remain unchanged, and the outputs of the dimension reduction matrix A and the dimension increase matrix B are superimposed with the parameters of LLaMA. Specifically, the terminal uses a random Gaussian distribution to initialize the dimension reduction matrix A and the dimension increase matrix B with a zero matrix, so as to ensure that the matrix of this bypass is still a zero matrix at the beginning of training. When fine-tuning a pre-trained language model in the downstream task, the formula for updating the parameters of the pre-trained large-scale language analysis model is as follows:
[0095] (1)
[0096] in, Initialize the parameters of the pre-trained model. is the parameter that needs to be updated. It can be seen that fine-tuning all parameters of a large language model is very challenging under limited computing resources. Early research found that pre-trained language models have low "internal dimensions", that is, during task adaptation, even random projections to smaller subspaces can effectively learn. Therefore, the LoRA module can add a small parameter module to learn the change amount During the training process, Is fixed, only the dimension reduction matrix A and the dimension increase matrix B contain training parameters that can change, and in the process of reasoning, only this change amount needs to be re-embedded into the pre-trained large-scale language analysis model, and no delay will be generated. Therefore, in this embodiment, the terminal uses the doctor-patient dialogue information as a training sample to analyze the diagnosis and treatment plan of diabetic retinopathy on the pre-trained large-scale language analysis model, wherein the doctor-patient dialogue information contains 500,000 paired data of doctor's diagnosis and patient information, and the paired data contains symptom descriptions of fundus images and clinical data of patients. Specifically, the dimension reduction matrix A and the dimension increase matrix B are removed from the model, and then the trained dimension increase matrix Bʹ and the dimension reduction matrix Aʹ obtained by training with the doctor-patient dialogue information as training samples are added, so as to complete the personalized training of the diagnosis and treatment plan for outputting diabetic retinopathy, and improve the accuracy of the generated diagnosis and treatment plan.
[0097] In the above-mentioned object analysis method, by performing sequence transformation on the image to be detected, the feature extraction capability of the image processing model for the detail parts in the image to be detected can be improved. The analysis accuracy of the image processing model for the image to be detected can be improved through the pre-trained feature extractor and the trained classification sub-model. The target prediction results can be combined with clinical data for object analysis through a large-scale language analysis model. The analysis can be performed based on multiple factors, which can improve the accuracy of the object analysis results.
[0098] In an exemplary embodiment, before extracting features from an image to be detected, in order to improve the effect of feature extraction, the image to be detected needs to be preprocessed, such as Figure 3 As shown, step 102 includes steps 302 to 304. Among them:
[0099] Step 302: segment the image to be detected according to a preset segmentation method to obtain a plurality of image blocks.
[0100] In the embodiment of the present application, the input sequence length of the Transformer layer is fixed, and the feature embedding received is a sequence As input, is the length of the sequence, is the hidden channel size, so the terminal needs to obtain the image to be detected Convert to , where H is the height of the image to be detected and W is the width of the image to be detected. Specifically, the input sequence length of Transformer is As shown below:
[0101] (2)
[0102] Therefore, the terminal divides the image to be detected into image blocks.
[0103] Step 304: Perform convolution mapping on each image block to obtain a target input sequence.
[0104] In the embodiment of the present application, after the terminal segments the image to be detected, a two-dimensional convolution operation is performed on each image block. , where p represents a vector image block and C is the dimension. The terminal further maps each vector image block p to a potential representation space of dimension C, that is, generates a one-dimensional embedding sequence of the image to be detected. The convolution kernel size of the two-dimensional convolution operation can be , the step size can be 16. Optionally, based on the different sizes of the images to be detected, the parameters of the two-dimensional convolution operation can be adaptively adjusted. Optionally, in order to encode the spatial information of each image block, the terminal can use the method of truncated normal distribution to convert each position Learn to embed specific , and embed the Add to , The feature vector representing the image block at each position i contains the visual features of the image block, and represents the spatial embedding vector of position i, which is used to capture the spatial information of position i. The final target input sequence can be expressed as .
[0105] In this embodiment, by performing image segmentation on the image to be detected, more comprehensive detail features are obtained for each image block when the image processing model performs feature extraction. At the same time, each image block is convolutionally mapped, and the final sequence obtained not only contains the visual features of the image block, but also contains the spatial information of each position of the image block. The image processing model processes the positional relationship between the image blocks to provide more accurate feature extraction results.
[0106] In an exemplary embodiment, Figure 4 As shown, the feature extractor includes a multi-head self-attention structure and a multi-layer perceptron, and step 104 includes steps 402 to 406. Among them:
[0107] Step 402, calculating triplet features of the target image sequence.
[0108] In the present application embodiment, Figure 5As shown in the figure, the feature extractor of the image processing model consists of 24 stacked Transformer layers. Each Transformer layer has a global receptive field and is composed of a multi-headed self-attention module (MSA) and a multi-layer perceptron (MLP). The input of each Transformer layer is The triples calculated in (query vector , key vector , value vector ),Right now:
[0109] (3)
[0110] in, are the learnable weight parameters in the three linear mapping layers, is the feature dimension of the triple, The l represents the number of Transformer layers. Since the number of Transformer layers in this embodiment is 24, The range is 1 to 24. Therefore, the terminal first calculates the triplet feature corresponding to the image to be detected, that is, the query vector , key vector , value vector .
[0111] Step 404, transform the triplet features based on the multi-head self-attention structure and the multi-layer perceptron to obtain the target feature vector.
[0112] In an embodiment of the present application, the terminal maps the triple features to different self-attention layers through a multi-head self-attention structure, where each self-attention layer learns a specific focus point. In each attention layer, the correlation of the input features is calculated according to the self-attention mechanism to obtain a more discriminative feature representation. The terminal applies a multi-layer perceptron to transform the fused feature vector. MLP consists of multiple fully connected layers, each of which contains a set of weights and activation functions. By stacking multiple fully connected layers, MLP can nonlinearly change the representation of the feature vector, and can obtain a more compact and expressive target feature vector by reducing dimensions and other operations.
[0113] Step 406, classify the target feature vector according to the classification sub-model to obtain the target analysis result.
[0114] In an embodiment of the present application, the terminal transmits the feature vector extracted by the feature extractor to the molecular class model of the downstream task, classifies the target feature vector through the classification sub-model, and obtains the type of lesions that may exist in the image to be detected as the target analysis result.
[0115] In this embodiment, a multi-head self-attention mechanism and a multi-layer perceptron are used to perform conversion operations on the triple features of the image to be detected to obtain a target feature vector, which can improve the performance and accuracy of the image processing model and enhance the perception and recognition capabilities of the image processing model for analyzing lesions contained in the image to be detected.
[0116] In an exemplary embodiment, Figure 6 As shown, step 404 includes steps 602 to 604. Among them:
[0117] Step 602, mapping the triplet features according to each self-attention layer in the multi-head self-attention mechanism, obtaining the mapping result of each self-attention layer, and obtaining the joint mapping result based on each mapping result.
[0118] In the embodiment of the present application, each self-attention mechanism (SA) of the multi-head self-attention structure can be expressed as:
[0119] (4)
[0120] The terminal maps the joint mapping result of the joint output of the self-attention mechanism operation of each self-attention layer according to the multi-head self-attention structure, that is:
[0121] (5)
[0122] in, , Usually set to , C represents the number of channels, m represents the number of attention heads, and represents the number of parallel heads used in the multi-head self-attention structure.
[0123] Step 604: transform the joint mapping result through a multi-layer perceptron to obtain a target feature vector.
[0124] In the embodiment of the present application, the terminal transforms the output of the multi-head self-attention structure through a multi-layer perceptron, and uses the residual connection as the output of the layer:
[0125] (6)
[0126] In addition, if Figure 5As shown, layer normalization is applied before MSA and MLP, and As the feature of the Transformer layer, that is, the target feature vector.
[0127] In this embodiment, a multi-head self-attention mechanism and a multi-layer perceptron are used to perform conversion operations on the triple features of the image to be detected to obtain a target feature vector, which can improve the performance and accuracy of feature extraction of the image processing model.
[0128] In an exemplary embodiment, the classification submodel includes a quality assessment submodel, a first symptom classification submodel, a second symptom judgment submodel and a lesion segmentation submodel, and step 406 includes steps 4061 to 4062, wherein:
[0129] The target feature vector is classified and processed according to the image quality assessment sub-model, the first symptom grading sub-model, the second symptom judgment sub-model and the lesion segmentation sub-model respectively to obtain the image quality assessment result, the first symptom grade, the second symptom diagnosis result and the lesion segmentation result.
[0130] In the embodiment of the present application, the classification and discrimination process is described by taking the image to be detected as a fundus image as an example. The model structures of the quality assessment sub-model, the first symptom classification sub-model, the second symptom judgment sub-model and the lesion segmentation sub-model are as follows: Figure 7 As shown, after the terminal obtains the target feature vector, it transmits the target feature vector to different classification sub-models of the downstream task respectively, and performs quality assessment on the fundus image through the quality assessment sub-model to determine the image quality assessment result of the fundus image, wherein the quality assessment result of the fundus image can be used to reflect whether the current fundus image to be used is available. The first symptom grading sub-model can be a DR grading sub-model of the fundus image, and the fundus image is analyzed by the DR grading sub-model to obtain the patient's DR grading result (level 0 to level 5). The second symptom judgment sub-model can be a DME (Diabetic Macular Edema) classification model to obtain the analysis result of whether the fundus image contains diabetic macular edema. The lesion segmentation sub-model segments the lesions that may exist in the fundus image to obtain the lesion segmentation result, for example, whether the fundus image contains lesions such as microaneurysms, hemorrhage, soft infiltration and hard infiltration. After the classification sub-models of each downstream task output the analysis results of the fundus image, the terminal constructs each analysis result into a dictionary format, for example<key,value> The final classification result of the fundus image is formed in the form of.
[0131] Specifically, the image quality assessment submodel involves a binary classification task, with labeled sample images of different clarity as training samples of the image quality assessment submodel. After the input fundus image passes through the encoder, it is connected with a mean pooling layer and a linear layer to output the probability of the predicted category. In the training of the image quality assessment submodel, the supervised loss of the input labeled sample image can be calculated by the binary cross entropy loss, thereby completing the training of the image quality assessment submodel. The first symptom grading submodel involves a 5-classification task, with labeled sample images of different DR levels as training samples of the first symptom grading submodel. After the input fundus image passes through the encoder, it is connected with a mean pooling layer and a linear layer to output the probability of the predicted category. The training of the first symptom grading submodel can use the cross entropy loss to fine-tune the labeled sample image to obtain the trained first symptom grading submodel. The second symptom judgment submodel involves a binary classification task. Sample images with labels containing DME and those without DME are used as training samples for the second symptom judgment submodel. After the input image passes through the encoder, it is connected to a mean pooling layer and a linear layer to output the probability of the predicted category. The labeled image is fine-tuned using binary cross entropy loss to obtain the trained second symptom judgment submodel. The lesion segmentation submodel involves a 5-category segmentation task. Sample images with labels containing different lesions are used as training samples for the lesion segmentation submodel. After the input image passes through the encoder-decoder, the predicted mask map is output. The cross entropy loss is used to fine-tune the training to obtain the trained lesion segmentation submodel.
[0132] Step 4062, taking the image quality assessment result, the first symptom level, the second symptom diagnosis result and the lesion segmentation result as target analysis results.
[0133] In an embodiment of the present application, the terminal summarizes and processes the image quality assessment result, the first symptom level, the second symptom diagnosis result and the lesion segmentation result to obtain the target analysis result.
[0134] In this embodiment, the image to be detected is analyzed by the downstream classification submodel of the quality assessment submodel, the first symptom grading submodel, the second symptom judgment submodel and the lesion segmentation submodel to obtain analysis results in multiple dimensions. Through the analysis results of the image to be detected in multiple dimensions, the data processing accuracy of the large-scale language analysis model can be improved, thereby improving the accuracy of the object analysis results.
[0135] In an exemplary embodiment, before using the image processing model, the image processing model needs to be trained, such as Figure 8 As shown, step 102 includes steps 802 to 808. Among them:
[0136] Step 802: Obtain a sample image set, and perform data enhancement on each sample image in the sample image set to obtain a first reconstructed image block and a second reconstructed image block.
[0137] In the embodiment of the present application, the pre-trained network of the image processing model adopts a dual self-supervised network (DSN, Dual-Supervised Nets) method to maximize the learning of unlabeled fundus image features, and its structure is as follows: Fig. 9 As shown in Figure 1, the missing image blocks are reconstructed in the local view, while the similarity of positive and negative samples is measured in the global view. It includes an image block generation step, two encoders and a decoder. The image block generation step is to divide the input unlabeled sample fundus image into regular non-overlapping image blocks. Then, the terminal samples a part of the image blocks and masks the rest of the image blocks (see Fig. 9 The gray image block in the figure) and set the masking ratio to 0.75. The encoders are and , both encoders are based on the Transformer structure. and Respectively and The parameters of are calculated by adopting the following momentum update strategy :
[0138] (7)
[0139] in, is the momentum coefficient, which can be 0.999. Note that only the parameter Updated by back propagation. From the momentum update strategy in the above equation, we can see that The change ratio Smoother.
[0140] In addition, the decoder uses Transformer as the decoder structure, which reduces the training time due to its fewer layers.
[0141] The terminal performs two data enhancements on each sample image, such as Fig. 9 As shown, the first reconstructed image block x is obtained. q and the second reconstructed image block x k .
[0142] Step 804 , extract features from the first reconstructed image block and the second reconstructed image block respectively to obtain query features and key feature sequences, and determine contrast loss values based on the query features and the key feature sequences.
[0143] In the embodiment of the present application, the terminal extracts features from the first reconstructed image block and the second reconstructed image block respectively according to different encoders to obtain the query feature corresponding to the first reconstructed image block, that is, Fig. 9 The query feature q in , and the key feature sequence corresponding to the second reconstructed image block is obtained, that is, Fig. 9 The contrast loss value is calculated by calculating the similarity between the query feature and each key feature in the key feature sequence.
[0144] Step 806 , reconstruct the reconstructed image block according to a preset decoder to obtain a reconstructed image, and determine a reconstruction loss value based on the reconstructed image and a sample image corresponding to the reconstructed image.
[0145] In the present application embodiment, Fig. 9 As shown in the figure, the terminal decodes and reconstructs the reconstructed image through the encoder and decoder respectively to obtain the reconstructed image. Then, the terminal calculates the reconstruction loss value according to the difference between the original sample image and the reconstructed image. In the encoder-decoder branch for image reconstruction, the terminal uses the mean square error (MSE) between the reconstructed image and the original fundus image as the reconstruction loss ( ). Finally, for an unlabeled fundus image, the unsupervised loss The calculation method is:
[0146] (8)
[0147] in, and are two learnable parameters used to weight and , and their initial values are empirically set to 0.4 and 0.6.
[0148] Step 808: Train the feature extraction sub-model included in the image processing model based on the contrast loss value and the reconstruction loss value to obtain a trained feature extraction sub-model.
[0149] In the embodiment of the present application, the terminal forward propagates the sample image in the pre-trained network to obtain the output result of the training network, calculates the comparison loss value according to the output result, and the terminal obtains the reconstruction loss value according to the output result of the pre-trained network and the original sample image. The terminal obtains the total loss according to the comparison loss value and the reconstruction loss value, and uses the total loss to perform back propagation and update the network parameters of the pre-trained network until the pre-trained network meets the preset training conditions, and obtains the feature extraction sub-model of the training network. Among them, the preset training condition can be to meet the preset number of iterations, or the total loss is lower than the preset loss threshold.
[0150] In this embodiment, by training the feature extraction sub-model based on the contrast loss value and the reconstruction loss value, the image processing model's ability to extract image features can be improved, the generalization ability of the feature extraction sub-model for feature extraction of images to be detected of different qualities can be improved, the accuracy of the target input sequence can be improved, and the accuracy of the object analysis results can be improved.
[0151] In an exemplary embodiment, Fig.10 As shown, step 804 includes steps 1002 to 1006. Among them:
[0152] Step 1002: for each first reconstructed image block and second reconstructed image block in the sample image set, extract features from the first reconstructed image block according to the first encoder to obtain query features, and extract features from the second reconstructed image block according to the second encoder to obtain key features.
[0153] In the present application embodiment, Fig. 9 As shown, the terminal reconstructs the first image block Passing in an encoder , through a pooling layer and a batch normalization (BN) layer, generate query features At the same time, the terminal passes the second reconstructed image block to the momentum encoder , generating a key feature , and then add it to an initially defined dictionary queue. As the iteration proceeds, the queue will generate a set of encoder key features Among them, the terminal fixes the dimensions of the query feature q and the key feature k through the global average pooling layer and the batch normalization layer.
[0154] Step 1004, matches each key feature in the key feature sequence with the query feature, and determines the key feature sequence and the positive sample key features in the key feature sequence based on the matching results, and determines the comparison loss value through the similarity between the query feature and the positive sample key features in the key feature sequence, and the query feature and other key features in the key feature sequence.
[0155] In the embodiment of the present application, in the dictionary, there is a single key feature (expressed as ), used to query features Then, the terminal will query the characteristics As query features, as positive samples, and all other key features in the dictionary as negative samples. Therefore, the terminal The contrast loss is calculated by making the query feature and the key features as positive samples similar and dissimilar to other key features, that is:
[0156] (9)
[0157] in, is a temperature hyperparameter, whose value is empirically set to 0.07. The length of the queue K can be set to 16,384. The summation in the above equation is for one positive sample and K negative samples. Intuitively, is a logarithmic loss based on a (K+1)-class softmax classifier, trying to classify q as k+.
[0158] In this embodiment, the sample images in the sample image set that serve as positive samples are determined through unsupervised contrast loss, and there is no need to label the sample images. This allows the feature extractor to be learned for a large number of sample images, thereby improving the learning efficiency of the feature extractor.
[0159] In an exemplary embodiment, Fig.11 As shown, in the first stage: the terminal obtains the patient's left eye fundus image and right eye fundus image, and predicts the left eye fundus image and the right eye fundus image respectively through the TransDR model to obtain the fundus image prediction results. In an example, the prediction result can be: "{Eye examination: [{left eye or right eye (0-left; 1-right): 1, DR grade (0-1-2-3-4-5): 2, DME grade (0-1)): 0}, {left eye or right eye (0-left; 1-right): 0, DR grade (0-1-2-3-4): 2, DME grade (0-1): 0]}".
[0160] In the second stage, the terminal obtains the patient's clinical data. In an example, the patient's clinical data can be: "{Gender: Male, Date of Birth: 1977 / 8 / 27 0:00, Examination Date: 2018 / 11 / 20, Age: 41, Systolic Blood Pressure: 157, Diastolic Blood Pressure: 100, Heart Rate: 112, Smoking: No Smoking, Drinking: No Drinking, Blood Pressure History: Physical Examination Blood Pressure is High, Self-Measured Blood Pressure is Normal, Circulatory System History: Denial of Chest Tightness, Chest Pain and Other Discomforts Family History: Father Has Hypertension and Diabetes, Dietary Habits: Balanced Meat and Vegetables, Exercise Method: Physical Exercise Frequency: Walk 15,000 Times a Day Step 1, endocrine system medical history: diagnosed with type 2 diabetes at around 36 years old, currently under diet control, methotrexate, and insulin treatment. Usual monitoring of fasting blood sugar is around 9mmol / 1, 2-hour postprandial blood sugar is around 11mmol / , serum triglycerides: 2.8, total cholesterol: 6.56, high-density lipoprotein: 1.3, low-density lipoprotein: 4.3, eGFR: 110.6508, fasting serum glucose: 11.91, glycosylated hemoglobin: 9.9, aspartate aminotransferase: 28.1, alanine aminotransferase: 39.6, r-glutamyl transpeptidase (GGT): 65}".
[0161] In the third stage, the terminal integrates the fundus image prediction results with the patient's clinical data to form the consultation content, which serves as the input information of the large-scale language analysis model.
[0162] In the fourth stage, the terminal inputs the consultation content and the language model prompts into the large-scale language analysis model, analyzes and processes the consultation content through the large-scale language analysis model, and obtains a personalized diagnosis and treatment plan for the current patient. Among them, the large-scale language analysis model is a large language model that has been fine-tuned for model parameters based on a large amount of consultation data. The language model prompt represents the task identifier of the large-scale language analysis model, which is used to indicate the task type of data processing by the large-scale language analysis model. In one example, the personalized diagnosis and treatment plan output by the large-scale language analysis model can be: "For this patient, according to the Chinese Diabetes Prevention and Treatment Guidelines, I recommend: 1. In terms of blood sugar control, it is recommended to continue active treatment, strengthen diet control and exercise, and adjust the insulin dosage according to blood sugar levels. The recommended medication regimen is: Insulin Humulin is maintained at the original dosage in the morning and evening, and oral drugs such as insulin-like substances or a-glycosidase inhibitors are considered to be added to lower blood sugar levels as much as possible. It is recommended to monitor blood sugar regularly to achieve the target range of reasonable control of diabetes. 2. In terms of blood lipid management, it is recommended to increase the intake of foods rich in dietary fiber and w-3 fatty acids, and actively engage in aerobic exercise, control weight, stop smoking, and limit bad living habits such as drinking. The recommended drug treatment plan is: oral statins, such as atorvastatin, to control total cholesterol and low-density lipoprotein levels. 3. In terms of blood pressure management, it is recommended to continue taking drugs such as lisinopril and levamlodipine to control blood pressure within the target range. It is recommended to monitor blood pressure regularly and adjust medication. 4. Pay attention to ophthalmological examinations, perform retinal examinations regularly, and deal with diabetic retinopathy in a timely manner. 5. Maintain a positive mental state, avoid mood swings, maintain a stable lifestyle, follow a healthy diet and lifestyle, strengthen exercise, and properly control weight. I hope these suggestions are helpful to you. If you have any questions or need more details, please feel free to consult a doctor. This patient advocates annual fundus follow-up and ophthalmological follow-up when eye discomfort occurs."
[0163] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0164] Based on the same inventive concept, the embodiment of the present application also provides an object analysis device for implementing the object analysis method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more object analysis device embodiments provided below can refer to the limitations on the object analysis method above, and will not be repeated here.
[0165] In an exemplary embodiment, Fig.12 As shown, an object analysis device 1200 is provided, comprising: an acquisition module 1201, a first analysis module 1202 and a second analysis module 1203, wherein:
[0166] The acquisition module 1201 is used to acquire a target image sequence, clinical data and an image processing model; the target image sequence is obtained by performing image sequence conversion on the image to be detected; the image processing model includes a pre-trained feature extractor and a trained classification sub-model;
[0167] The first analysis module 1202 is used to extract features from the target input sequence through a feature extractor, and analyze and process the feature extraction results through a classification sub-model to obtain a target analysis result;
[0168] The second analysis module 1203 is used to perform object analysis on the target analysis results and clinical data based on a large-scale language analysis model to obtain object analysis results.
[0169] In one embodiment, the acquisition module 1201 is specifically used to perform image segmentation on the image to be detected according to a preset segmentation method to obtain multiple image blocks;
[0170] Convolution is performed on each image block to obtain the target input sequence.
[0171] In one embodiment, the feature extractor includes a multi-head self-attention structure and a multi-layer perceptron;
[0172] The first analysis module 1202 is specifically used to calculate the triplet features of the target image sequence;
[0173] Based on the multi-head self-attention structure and multi-layer perceptron, the triple features are transformed to obtain the target feature vector;
[0174] The target feature vector is classified according to the classification sub-model to obtain the target analysis result.
[0175] In one embodiment, the first analysis module 1202 is specifically used to map the triple feature according to each self-attention layer in the multi-head self-attention mechanism, obtain the mapping result of each self-attention layer, and obtain the joint mapping result based on each mapping result;
[0176] The joint mapping result is transformed through a multi-layer perceptron to obtain the target feature vector.
[0177] In one of the embodiments, the classification sub-model includes a quality assessment sub-model, a first symptom classification sub-model, a second symptom determination sub-model, and a lesion segmentation sub-model;
[0178] The first analysis module 1202 is specifically used to classify the target feature vector according to the image quality assessment sub-model, the first symptom classification sub-model, the second symptom judgment sub-model and the lesion segmentation sub-model, to obtain the image quality assessment result, the first symptom level, the second symptom diagnosis result and the lesion segmentation result.
[0179] The image quality assessment results, the first symptom level, the second symptom diagnosis results and the lesion segmentation results are taken as the target analysis results.
[0180] In one embodiment, the apparatus 1200 further includes:
[0181] A data enhancement module is used to obtain a sample image set and perform data enhancement on each sample image in the sample image set to obtain a first reconstructed image block and a second reconstructed image block;
[0182] A feature extraction module, used to extract features from the first reconstructed image block and the second reconstructed image block respectively, obtain a query feature and a key feature sequence, and determine a contrast loss value based on the query feature and the key feature sequence;
[0183] A reconstruction module, used to reconstruct the reconstructed image block according to a preset decoder to obtain a reconstructed image, and determine a reconstruction loss value based on the reconstructed image and a sample image corresponding to the reconstructed image;
[0184] The training module is used to train the feature extraction sub-model included in the image processing model based on the contrast loss value and the reconstruction loss value to obtain a trained feature extraction sub-model.
[0185] In one embodiment, the feature extraction module is specifically used for performing feature extraction on the first reconstructed image block according to the first encoder to obtain the query feature, and performing feature extraction on the second reconstructed image block according to the second encoder to obtain the key feature for each first reconstructed image block and the second reconstructed image block in the sample image set;
[0186] Each key feature in the key feature sequence is matched with the query feature, and the key feature sequence and the positive sample key features in the key feature sequence are determined based on the matching results, and the contrast loss value is determined by the similarity between the query feature and the positive sample key features in the key feature sequence, and the query feature and other key features in the key feature sequence.
[0187] Each module in the above object analysis device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0188] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.13 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store target image sequences and clinical data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an object analysis method is implemented.
[0189] Those skilled in the art will understand that Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0190] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0191] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0192] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0193] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0194] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0195] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0196] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An object analysis method, characterized in that: The method comprises: Obtaining a target image sequence, clinical data and an image processing model; the target image sequence is obtained by performing image sequence conversion on the image to be detected; the image processing model includes a pre-trained feature extractor and a trained classification sub-model; Extracting features from the target image sequence by using the feature extractor, and analyzing and processing the feature extraction results by using the classification sub-model to obtain a target analysis result; Performing object analysis on the target analysis result and the clinical data based on a large-scale language analysis model to obtain an object analysis result; The feature extractor includes a multi-head self-attention structure and a multi-layer perceptron; The feature extractor is used to extract features from the target image sequence, and the classification sub-model is used to analyze and process the result of the feature extraction to obtain the target analysis result, including: Calculating triplet features of the target image sequence; The triplet features are transformed based on a multi-head self-attention structure and a multi-layer perceptron to obtain a target feature vector; Classify the target feature vector according to the classification sub-model to obtain a target analysis result; The triplet features are transformed based on the multi-head self-attention structure and the multi-layer perceptron to obtain the target feature vector, including: Mapping the triplet features according to each self-attention layer in the multi-head self-attention mechanism to obtain a mapping result of each self-attention layer, and obtaining a joint mapping result based on each mapping result; The joint mapping result is transformed by a multi-layer perceptron to obtain a target feature vector; The classification sub-model includes an image quality assessment sub-model, a first symptom classification sub-model, a second symptom judgment sub-model and a lesion segmentation sub-model; The classifying process of the target feature vector according to the classification sub-model to obtain the target analysis result includes: The target feature vector is classified and processed according to the image quality assessment sub-model, the first symptom grading sub-model, the second symptom judgment sub-model and the lesion segmentation sub-model to obtain an image quality assessment result, a first symptom grade, a second symptom diagnosis result and a lesion segmentation result, respectively. The image quality assessment result, the first symptom level, the second symptom diagnosis result and the lesion segmentation result are used as target analysis results.
2. The method according to claim 1, characterized in that The step of acquiring a target image sequence comprises: Segment the image to be detected according to a preset segmentation method to obtain multiple image blocks; Convolution processing is performed on each of the image blocks to obtain a target image sequence.
3. The method according to claim 1, characterized in that Before acquiring the target image sequence, clinical data and image processing model, the method further includes: Acquire a sample image set, and perform data enhancement on each sample image in the sample image set to obtain a first reconstructed image block and a second reconstructed image block; Performing feature extraction on the first reconstructed image block and the second reconstructed image block respectively to obtain query features and a key feature sequence, and determining a contrast loss value based on the query features and the key feature sequence; Reconstructing the reconstructed image block according to a preset decoder to obtain a reconstructed image, and determining a reconstruction loss value based on the reconstructed image and the sample image corresponding to the reconstructed image; The feature extraction sub-model included in the image processing model is trained based on the contrast loss value and the reconstruction loss value to obtain the trained feature extraction sub-model.
4. The method according to claim 3, characterized in that The extracting features of the first reconstructed image block and the second reconstructed image block respectively to obtain query features and a key feature sequence, and determining the contrast loss value based on the query features and the key feature sequence, comprises: For each of the first reconstructed image block and the second reconstructed image block in the sample image set, extract features from the first reconstructed image block according to the first encoder to obtain query features, and extract features from the second reconstructed image block according to the second encoder to obtain key features; Each key feature in the key feature sequence is matched with the query feature, and the key feature sequence and the positive sample key features in the key feature sequence are determined based on the matching results, and the comparison loss value is determined by the similarity between the query feature and the positive sample key features in the key feature sequence, and between the query feature and other key features in the key feature sequence.
5. An object analysis device, characterized in that: The device comprises: An acquisition module is used to acquire a target image sequence, clinical data and an image processing model; the target image sequence is obtained by performing image sequence conversion on the image to be detected; the image processing model includes a pre-trained feature extractor and a trained classification sub-model; A first analysis module is used to extract features from the target image sequence through the feature extractor, and to analyze and process the feature extraction results through the classification sub-model to obtain a target analysis result; A second analysis module is used to perform object analysis on the target analysis result and the clinical data based on a large-scale language analysis model to obtain an object analysis result; The feature extractor includes a multi-head self-attention structure and a multi-layer perceptron; The first analysis module is specifically used to calculate the triplet features of the target image sequence; The triplet features are transformed based on a multi-head self-attention structure and a multi-layer perceptron to obtain a target feature vector; Classify the target feature vector according to the classification sub-model to obtain a target analysis result; The first analysis module is specifically used to map the triple feature according to each self-attention layer in the multi-head self-attention mechanism, obtain a mapping result of each self-attention layer, and obtain a joint mapping result based on each mapping result; The joint mapping result is transformed by a multi-layer perceptron to obtain a target feature vector; The classification sub-model includes an image quality assessment sub-model, a first symptom classification sub-model, a second symptom judgment sub-model and a lesion segmentation sub-model; The first analysis module is specifically used to classify the target feature vector according to the image quality assessment sub-model, the first symptom grading sub-model, the second symptom judgment sub-model and the lesion segmentation sub-model to obtain an image quality assessment result, a first symptom level, a second symptom diagnosis result and a lesion segmentation result. The image quality assessment result, the first symptom level, the second symptom diagnosis result and the lesion segmentation result are used as target analysis results.
6. The device according to claim 5, characterized in that The acquisition module is specifically used to perform image segmentation on the image to be detected according to a preset segmentation method to obtain multiple image blocks; Convolution processing is performed on each of the image blocks to obtain a target image sequence.
7. The device according to claim 5, characterized in that The device also includes: A data enhancement module, used to obtain a sample image set, and perform data enhancement on each sample image in the sample image set to obtain a first reconstructed image block and a second reconstructed image block; a feature extraction module, configured to extract features from the first reconstructed image block and the second reconstructed image block respectively, obtain query features and a key feature sequence, and determine a contrast loss value based on the query features and the key feature sequence; A reconstruction module, configured to reconstruct the reconstructed image block according to a preset decoder to obtain a reconstructed image, and determine a reconstruction loss value based on the reconstructed image and the sample image corresponding to the reconstructed image; A training module is used to train the feature extraction sub-model included in the image processing model based on the contrast loss value and the reconstruction loss value to obtain the trained feature extraction sub-model.
8. The device according to claim 7, characterized in that The feature extraction module is specifically configured to extract features from each of the first reconstructed image block and the second reconstructed image block in the sample image set according to the first encoder to obtain query features, and to extract features from the second reconstructed image block according to the second encoder to obtain key features; Each key feature in the key feature sequence is matched with the query feature, and the key feature sequence and the positive sample key features in the key feature sequence are determined based on the matching results, and the comparison loss value is determined by the similarity between the query feature and the positive sample key features in the key feature sequence, and between the query feature and other key features in the key feature sequence.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Patient assistance intelligent auditing system based on deep learning
CN111353445A
Multi-mode-based scanning copy paragraph structure reduction method and device and related equipment
CN113221735A
Information generation method, device and equipment and computer storage medium
CN114662457A
Pre-training method, device and equipment of image-text understanding model and storage medium
CN116796287A
Object analysis method and device, computer equipment and storage medium
CN118039124A
