A Method and System for Generating Mechanical Indicators of Visceral Tissue Images Based on Contrast Learning
By establishing a neural network regression model based on contrastive learning, the problems of expensive and highly specialized traditional mechanical index measurement equipment are solved, realizing non-invasive, low-cost, and high-precision acquisition of mechanical indexes, which is applicable to the measurement of various internal organs and tissues.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN UNIV
- Filing Date
- 2023-12-29
- Publication Date
- 2026-08-04
AI Technical Summary
Traditional mechanical index measurement techniques cannot effectively obtain mechanical indexes from images of internal organs and tissues, and the measurement equipment is expensive and requires a high level of expertise.
A contrastive learning-based approach is used to collect historical images of visceral tissues and their corresponding mechanical indices, establish a neural network regression model, train it, obtain the target mechanical indices of the visceral tissue images to be detected, and generate an evaluation reference report.
It enables the non-invasive and low-cost acquisition of high-precision mechanical parameters from visceral tissue images, solving the problems of expensive equipment and high professional requirements, and providing a non-invasive and widely applicable method for measuring mechanical parameters.
Smart Images

Figure CN117788966B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method, system, terminal, and computer-readable storage medium for generating mechanical indices of visceral tissue images based on contrastive learning. Background Technology
[0002] Biological tissue imaging has become a powerful, non-invasive, and widely used tool in the biomedical field. These images can be used to obtain information about the structure, properties, and function of biological tissues. Mechanical parameters are of great importance for measuring and assessing the health status of the human body.
[0003] Taking liver assessment as an example, the Liver Stiffness Measurement (LSM) is an indicator for assessing liver fibrosis and cirrhosis, and can provide highly accurate histological information.
[0004] However, traditional methods for measuring liver stiffness still have several limitations. They are invasive procedures that may cause discomfort and pain to the patient, require specialized training, and the equipment is expensive. Another example is ultrasound elastography, such as TE (transient elastography), which, while non-invasive, is limited by its one-dimensional or limited visualization, lacking intuitive image information and failing to effectively acquire mechanical parameters. Furthermore, some ultrasound elastography methods require expensive equipment, limiting their availability in resource-scarce areas.
[0005] Therefore, existing technologies still need to be improved and developed. Summary of the Invention
[0006] The main objective of this invention is to provide a method, system, terminal, and computer-readable storage medium for generating mechanical indicators from visceral tissue images based on contrastive learning. This aims to solve the problems in the prior art where traditional mechanical indicator measurement techniques cannot effectively obtain mechanical indicators from visceral tissue images, and the measurement equipment is expensive and requires a high level of expertise.
[0007] To achieve the above objectives, this invention provides a method for generating mechanical parameters of visceral tissue images based on contrastive learning. This method includes the following steps:
[0008] Collect historical images of internal organs and the corresponding mechanical indices, and use the historical images of internal organs and the corresponding mechanical indices as a dataset;
[0009] A neural network regression model is established, and the neural network regression model is trained based on the dataset to obtain the target network model;
[0010] The image of the visceral tissue to be detected is obtained, and the image of the visceral tissue to be detected is input into the target network model for prediction, and the target mechanical index of the visceral tissue to be detected is output.
[0011] An evaluation reference report is generated based on the target mechanical indicators to obtain the image of the visceral tissue to be detected, and the evaluation reference report is stored.
[0012] Optionally, the method for generating mechanical parameters of visceral tissue images based on contrastive learning further includes, after collecting historical visceral tissue images:
[0013] The historical visceral tissue images are subjected to random rotation, random flipping, brightness adjustment, contrast adjustment, deformation transformation, color transformation, and data balancing.
[0014] Optionally, in the method for generating mechanical indices of visceral tissue images based on contrastive learning, the neural network regression model includes: a feature extractor, a contrastive learning branch, and a regression learning branch.
[0015] The feature extractor includes a feature extraction backbone network and an adaptive average pooling layer; the contrastive learning branch includes a series of fully connected layers and an L2 norm normalization layer; and the regression learning branch includes the series of fully connected layers.
[0016] Optionally, the method for generating mechanical parameters of visceral tissue images based on contrastive learning, wherein training the neural network regression model based on the dataset to obtain the target network model specifically includes:
[0017] The dataset is divided into a training set, a validation set, and a test set according to a preset ratio;
[0018] The feature extraction backbone network is weighted based on the pre-trained model, and the number of channels of the feature extraction backbone network is set to be consistent with the number of channels of the historical visceral tissue images in the dataset, thus obtaining the initialized feature extraction backbone network.
[0019] The training set is input into the initialized feature extraction backbone network for feature extraction to obtain a feature map. The feature map is then input into the adaptive average pooling layer for adaptive average pooling and flattening operations to obtain a vector of the same dimension as the number of channels.
[0020] The dimension vector is input into the contrastive learning branch, and linear mapping is performed in a series of fully connected layers. The linearly mapped dimension vector is then standardized through the L2 norm normalization layer to obtain contrastive features of a preset dimension.
[0021] The dimension vector is input into the regression learning branch, and the regression task is output through a series of fully connected layers to obtain the model's predicted value.
[0022] The loss function of the contrastive learning branch is calculated based on the contrastive features, and the loss function of the regression learning branch is calculated based on the predicted values.
[0023] The total loss function of the neural network regression model is calculated based on the loss function of the contrastive learning branch and the loss function of the regression learning branch, until the total loss function reaches a preset convergence condition.
[0024] Optionally, the method for generating mechanical parameters of visceral tissue images based on contrastive learning, wherein the step of calculating the total loss function of the neural network regression model based on the loss function of the contrastive learning branch and the loss function of the regression learning branch until the total loss function reaches a preset convergence condition, further includes:
[0025] The parameters of the trained neural network regression model are adjusted using the validation set, and the capabilities of the trained neural network regression model are initially evaluated.
[0026] The test set is input into a preliminarily qualified neural network regression model for testing, and the prediction results are obtained using R. 2 The evaluation indicators are used to evaluate the prediction results to obtain the evaluation results;
[0027] If the evaluation results meet the preset requirements, the target network model is obtained.
[0028] Optionally, the method for generating mechanical parameters of visceral tissue images based on contrastive learning, wherein calculating the loss function of the contrastive learning branch based on the contrastive features and calculating the loss function of the regression learning branch based on the predicted values of the model specifically includes:
[0029] The loss function of the contrastive learning branch is calculated using the Siamese contrastive loss function formula:
[0030]
[0031] Where N is the total number of samples, n is the ordinal number of the sample, and d represents the Euclidean distance between the features of two samples, d = ||a n -b n ||2,a n and b nThese are the contrast features of the two samples, where y represents the label indicating whether the two samples match. y=1 indicates that the two samples are similar or match, while y=0 indicates that they do not match. margin represents a pre-set threshold.
[0032] Using R 2 The loss function formula is used to calculate the loss function of the regression learning branch:
[0033]
[0034] Among them, y i It is the actual target value. It is the predicted value of the model. It is the mean of the target variable.
[0035] Optionally, the method for generating mechanical parameters of visceral tissue images based on contrastive learning, wherein calculating the total loss function of the neural network regression model according to the loss function of the contrastive learning branch and the loss function of the regression learning branch specifically includes:
[0036] The total loss function of the neural network regression model is calculated based on the loss function of the contrastive learning branch and the loss function of the regression learning branch: L total =γ con L con +γ reg L reg ;
[0037] Where, γ con γ represents the hyperparameter of the loss function that weighs the contrastive learning branch. reg This represents the hyperparameter of the loss function that weighs the regression learning branch.
[0038] Furthermore, to achieve the above objectives, the present invention also provides a system for generating mechanical indices from visceral tissue images based on contrastive learning, wherein the system for generating mechanical indices from visceral tissue images based on contrastive learning includes:
[0039] The historical data acquisition module is used to collect historical visceral tissue images and the mechanical indicators corresponding to the historical visceral tissue images, and to use the historical visceral tissue images and the mechanical indicators corresponding to the historical visceral tissue images as a dataset.
[0040] The network construction and training module is used to build a neural network regression model, and train the neural network regression model according to the dataset to obtain the target network model;
[0041] The mechanical index generation module is used to acquire images of the visceral tissue to be detected, input the images of the visceral tissue to be detected into the target network model for prediction, and output the target mechanical indexes of the images of the visceral tissue to be detected.
[0042] An evaluation and storage module is used to generate an evaluation reference report of the image of the visceral tissue to be detected based on the target mechanical index, and to store the evaluation reference report.
[0043] Furthermore, to achieve the above objectives, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a mechanical index generation program for visceral tissue images based on contrastive learning, which is stored in the memory and can run on the processor. When the mechanical index generation program for visceral tissue images based on contrastive learning is executed by the processor, it implements the steps of the mechanical index generation method for visceral tissue images based on contrastive learning as described above.
[0044] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program for generating mechanical indices of visceral tissue images based on contrastive learning, and when the program for generating mechanical indices of visceral tissue images based on contrastive learning is executed by a processor, it implements the steps of the method for generating mechanical indices of visceral tissue images based on contrastive learning as described above.
[0045] In this invention, historical images of visceral tissues and their corresponding mechanical indices are collected, and these images and indices are used as a dataset. A neural network regression model is established and trained on the dataset to obtain a target network model. Images of the visceral tissues to be detected are acquired and input into the target network model for prediction, outputting the target mechanical indices of the detected visceral tissues. An evaluation reference report of the detected visceral tissues is generated based on the target mechanical indices and stored. This invention effectively obtains mechanical indices from visceral tissue images and solves the problems of high cost and high professional requirements for mechanical index measurement equipment during the generation process. Attached Figure Description
[0046] Figure 1 This is a flowchart of a preferred embodiment of the method for generating mechanical indices of visceral tissue images based on contrastive learning according to the present invention;
[0047] Figure 2 This is a schematic diagram of the principle of the method for generating mechanical indices of visceral tissue images based on contrastive learning according to the present invention.
[0048] Figure 3This is an architecture diagram of the neural network regression model in the method for generating mechanical indicators of visceral tissue images based on contrastive learning in this invention;
[0049] Figure 4 This is a flowchart of the process of training the neural network regression model in the method for generating mechanical indicators of visceral tissue images based on contrastive learning in this invention.
[0050] Figure 5 This is a schematic diagram illustrating the principle of a preferred embodiment of the mechanical index generation system for visceral tissue images based on contrastive learning according to the present invention.
[0051] Figure 6 This is a schematic diagram of the operating environment of a preferred embodiment of the terminal of the present invention. Detailed Implementation
[0052] This application provides a method and related equipment for generating mechanical parameters of visceral tissue images based on contrastive learning. To make the objectives, technical solutions, and effects of this application clearer and more explicit, the following detailed description is provided with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining this application and are not intended to limit this application.
[0053] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0054] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0055] The preferred embodiment of the present invention describes a method for generating mechanical parameters of visceral tissue images based on contrastive learning, such as... Figure 1 and Figure 2 As shown, the method for generating mechanical parameters of visceral tissue images based on contrastive learning includes the following steps:
[0056] Step S100: Collect historical visceral tissue images and the corresponding mechanical indices, and use the historical visceral tissue images and the corresponding mechanical indices as a dataset.
[0057] Specifically, historical visceral tissue images and corresponding mechanical indices are collected from the hospital, and the historical visceral tissue images and corresponding mechanical indices are used as a dataset, wherein the historical visceral tissue images are used as features of the dataset, and the corresponding mechanical indices are used as labels of the dataset.
[0058] For example, taking the liver as an internal organ, 1000 samples were collected from a hospital: liver ultrasound images (i.e., historical images of the internal organ tissue). The LSM (Liver Muscular Strength) corresponding to each ultrasound image was measured using specialized medical equipment, with LSM ranging from 2 kPa to 60 kPa. Understandably, this process should follow best practices in the relevant field to ensure the system's performance, accuracy, and security. Furthermore, data privacy and ethical issues need to be considered to ensure compliance with relevant laws, regulations, and ethical guidelines.
[0059] Furthermore, after collecting historical visceral tissue images, the process also includes:
[0060] The historical visceral tissue images are subjected to random rotation, random flipping, brightness adjustment, contrast adjustment, deformation transformation, color transformation, and data balancing.
[0061] Understandably, since the collected historical images of internal organs may not be uniform in size (e.g., the size of each liver ultrasound image is not uniform), the training effect of the regression model may be unsatisfactory. Therefore, all data are first adjusted to a uniform size.
[0062] To further improve the performance and robustness of subsequent models, this invention performs data augmentation on resized historical visceral tissue images. Data augmentation includes applying random rotation and flipping, brightness and contrast adjustments, deformation transformations, color transformations, and data balancing. These data augmentation methods not only expand the dataset but also provide the model with greater diversity and adaptability to different clinical scenarios.
[0063] Random rotation and flipping allow the model to learn liver images from different viewpoints and positions, improving its adaptability. Brightness and contrast adjustments make the model more robust, helping it handle images under different lighting conditions. Deformation transformations simulate different liver shapes and deformations, helping the model achieve good performance in various scenarios. Color transformations increase data diversity and improve the model's generalization ability. Data balancing techniques ensure that the model can learn samples with different liver stiffness values in a balanced way, preventing bias when processing imbalanced data. Through the combined use of these data augmentation techniques, the model becomes more powerful, capable of predicting liver stiffness values more accurately, improving the reliability of the task and its application prospects.
[0064] It should be noted that the above data augmentation methods are for reference only. In actual implementation, other methods may be added or some methods may be removed.
[0065] Step S200: Establish a neural network regression model, train the neural network regression model according to the dataset, and obtain the target network model.
[0066] The neural network regression model includes: a feature extractor, a contrastive learning branch, and a regression learning branch.
[0067] The feature extractor includes a feature extraction backbone network and an adaptive average pooling layer; the contrastive learning branch includes a series of fully connected layers and an L2 norm normalization layer; and the regression learning branch includes the series of fully connected layers.
[0068] like Figure 3 As shown, the neural network regression model includes a feature extractor, a contrastive learning branch, and a regression learning branch; wherein, the feature extractor includes a feature extraction backbone network and an adaptive average pooling layer. This invention uses ResNet-50 (a residual network) as the feature extraction backbone network, which can effectively capture features in ultrasound images, including texture, shape, and structure, which helps the model to identify and learn features related to liver stiffness.
[0069] Furthermore, this invention simultaneously includes a contrastive learning branch and a regression branch. The contrastive learning branch comprises a series of fully connected layers, activation functions, and L2-norm normalized layers, while the regression learning branch comprises the same series of fully connected layers. This multi-task learning approach improves the robustness of the model and its feature representation. Contrastive learning, used to learn the similarities and differences between images in the data, is a powerful self-supervised learning method that helps learn features with good discriminative power. The regression branch can handle the task of directly predicting liver stiffness values, making the model's output easier to understand and interpret, which is particularly important for applications in the medical field.
[0070] It should be noted that the model structure described above is just one example in this embodiment. Regarding model selection, an appropriate neural network architecture can be chosen based on specific performance and resource constraints to meet the requirements of different applications. Alternatively, traditional machine learning algorithms, such as random forests or support vector machines, can be used to perform feature regression on ultrasound images. This alternative implementation provides more options to meet the needs of hardness value prediction in different scenarios.
[0071] like Figure 4 As shown, training the neural network regression model based on the dataset to obtain the target network model specifically includes:
[0072] S201. Divide the dataset into a training set, a validation set, and a test set according to a preset ratio.
[0073] Specifically, the dataset is divided into training, validation, and test sets according to a preset ratio (this preset ratio is adjusted based on actual circumstances). For example, the dataset can be divided into training, validation, and test sets in a 7:2:1 ratio. The purpose of this is to select the model with the best performance and generalization ability.
[0074] The training set is used to fit the neural network regression model. By setting the classifier parameters, the neural network regression model is trained. Later, when combined with the validation set, different values of the same parameter are selected to fit multiple classifiers. The validation set is used to identify the best-performing model after training multiple models. Each model is used to predict on the validation set data, and the model accuracy is recorded. The parameters corresponding to the best-performing model are then used to adjust the model parameters. After obtaining the optimal model using the training and validation sets, the test set is used for model prediction. The test set is used to measure the performance and classification ability of the optimal model. In other words, the test set can be treated as a dataset that has never existed before; once the model parameters are determined, the test set is used to evaluate the model performance.
[0075] S202. Based on the pre-trained model, the feature extraction backbone network is weighted and the number of channels of the feature extraction backbone network is set to be consistent with the number of channels of the historical visceral tissue images in the dataset, so as to obtain the initialized feature extraction backbone network.
[0076] Understandably, during model initialization, weights are loaded onto the feature extraction backbone network based on a pre-trained model (e.g., a pre-trained ImageNet model). Weight initialization is the first step in neural network training, determining the network's initial learning ability. A good weight initialization method can accelerate network convergence and improve training performance, while an inappropriate initialization method may cause the network to get stuck in local optima or fail to converge. Loading weights onto the feature extraction backbone network based on a pre-trained model enables the model to learn general features of images and improves the model's convergence speed.
[0077] Furthermore, the number of channels in the feature extraction backbone network is set to be consistent with the number of channels in the historical visceral tissue images in the dataset. Here, the historical visceral tissue images are illustrated by taking liver ultrasound images as an example. Since liver ultrasound images are single-channel medical images, we change the number of input channels of the first convolutional layer of the model from 3 to 1 to make the number of channels in the model consistent with the number of channels in the image.
[0078] S203. Input the training set into the initialized feature extraction backbone network to extract features and obtain a feature map. Input the feature map into the adaptive average pooling layer to perform adaptive average pooling and flattening operations to obtain a dimension vector with the same number of channels.
[0079] Understandably, taking liver ultrasound images as an example, when the neural network regression model performs forward propagation, the input liver ultrasound image passes through the feature extraction backbone network, and then undergoes adaptive average pooling (AdaptiveAvgPool2d) to make the feature map size 1×1. Then, the 1×1 feature map is flattened to reduce its dimension to a one-dimensional vector. In other words, after feature extraction and flattening, the dimension of the resulting vector is determined by the depth (number of channels) of the feature map.
[0080] S204. Input the dimension vector into the contrastive learning branch, perform linear mapping in a series of fully connected layers, and standardize the linearly mapped dimension vector through the L2 norm normalization layer to obtain the contrastive features of the preset dimension.
[0081] Specifically, the contrastive learning branch is used to learn the feature representation of the image and the objective for self-supervised learning. In this branch, the features extracted by the ResNet-50 backbone network are fed into a series of fully connected layers for linear mapping. The purpose is to gradually reduce the dimensionality of the features through the fully connected layers. The linearly mapped dimensional vector is then standardized by the L2 norm normalization layer. The contrastive features are standardized to an L2 norm of 1 for comparison and contrastive learning, ultimately producing contrastive features of a preset dimension. This preset dimension can be set according to the actual situation, such as 64-dimensional, 128-dimensional, or 256-dimensional contrastive features.
[0082] Understandably, this process essentially maps the original high-dimensional feature vectors to a lower-dimensional space through a linear mapping (fully connected layer), where each dimension corresponds to a learned high-level feature. This helps extract meaningful representations of the image for contrastive learning tasks; the preset dimensional features can be understood as 128 different features.
[0083] S205. Input the dimension vector into the regression learning branch, and output the regression task through a series of fully connected layers to obtain the model's predicted value.
[0084] The regression branch is used to directly predict task-related numerical results; for liver ultrasound images, the predicted numerical result is the LSM (Liver Small Scale). In this branch, features extracted by the ResNet-50 backbone are fed into a series of fully connected layers to produce outputs for the regression task. These fully connected layers gradually reduce the dimensionality, ultimately producing predicted values whose dimensionality corresponds to the number of target classes specified by the class parameter.
[0085] S206. Calculate the loss function of the contrastive learning branch based on the contrastive features, and calculate the loss function of the regression learning branch based on the predicted values.
[0086] This invention uses two different types of loss functions to train the model: one for contrastive learning and the other for regression tasks. In this embodiment, taking the Siamese contrastive loss function and the R2 loss function as examples, the loss function of the contrastive learning branch is calculated based on the contrastive features and the Siamese contrastive loss function formula, and the loss function of the regression learning branch is calculated based on the predicted values and the R2 loss function formula.
[0087] S207. Calculate the total loss function of the neural network regression model based on the loss function of the contrastive learning branch and the loss function of the regression learning branch, until the total loss function reaches the preset convergence condition.
[0088] Based on the loss functions of the contrastive learning branch and the regression learning branch, hyperparameters are set for the loss functions of the contrastive learning branch and the regression learning branch, respectively. The total loss function of the neural network regression model can then be calculated, and a preset convergence condition is set until the total loss function reaches the convergence condition, thus completing the training of the neural network regression model. In this way, the model can simultaneously optimize both contrastive learning and regression tasks to achieve good feature representation and prediction performance.
[0089] Further, the step of calculating the total loss function of the neural network regression model based on the loss function of the contrastive learning branch and the loss function of the regression learning branch, until the total loss function reaches a preset convergence condition, further includes:
[0090] The parameters of the trained neural network regression model are adjusted using the validation set, and the capabilities of the trained neural network regression model are initially evaluated.
[0091] The test set is input into a preliminarily qualified neural network regression model for testing, and the prediction results are obtained using R. 2 The evaluation indicators are used to evaluate the prediction results to obtain the evaluation results.
[0092] If the evaluation results meet the preset requirements, the target network model is obtained.
[0093] Specifically, taking a dataset of liver ultrasound images as an example, the parameters of the trained neural network regression model are adjusted using the validation set, and the capabilities of the trained neural network regression model are initially evaluated. The test set is then input into the neural network regression model that has passed the initial evaluation for testing. The model will predict the LSM for each liver ultrasound image in the test dataset, and then use R... 2 To conduct an evaluation, R 2 The value of is usually between 0 and 1. The closer it is to 1, the better the model fits the data, while the closer it is to 0, the worse the fit is. If the evaluation result meets the preset requirements, the target network model is obtained.
[0094] Furthermore, the step of calculating the loss function of the contrastive learning branch based on the contrastive features, and calculating the loss function of the regression learning branch based on the model's predicted values, specifically includes:
[0095] The loss function of the contrastive learning branch is calculated using the Siamese contrastive loss function formula:
[0096]
[0097] Where N is the total number of samples, n is the ordinal number of the sample, and d represents the Euclidean distance between the features of two samples, d = ||a n -b n ||2,a n and b n These are the contrast features of the two samples, where y represents the label indicating whether the two samples match. y=1 indicates that the two samples are similar or match, while y=0 indicates that they do not match. margin represents a pre-set threshold.
[0098] Understandably, the Siamese contrastive loss function is a loss function used for self-supervised learning, designed to learn feature representations of images. It encourages the model to bring similar samples closer together in the feature space and to keep dissimilar samples further apart, thus helping to improve the quality of image feature representations.
[0099] Using R 2 The loss function formula is used to calculate the loss function of the regression learning branch:
[0100]
[0101] Among them, y i It is the actual target value. It is the predicted value of the model. It is the mean of the target variable.
[0102] Understandably, the R2 loss function is used to directly predict the numerical values of mechanical parameters, mapping image features to numerical results. This enables the model to perform supervised learning tasks and predict the numerical values of mechanical parameters.
[0103] Furthermore, the step of calculating the total loss function of the neural network regression model based on the loss function of the contrast learning branch and the loss function of the regression learning branch specifically includes:
[0104] The total loss function of the neural network regression model is calculated based on the loss function of the contrastive learning branch and the loss function of the regression learning branch: L total =γ con L con +γ reg L reg .
[0105] Where, γ con γ represents the hyperparameter of the loss function that weighs the contrastive learning branch. reg This represents the hyperparameter of the loss function that weighs the regression learning branch.
[0106] It is understood that by calculating the total loss function of the neural network regression model based on the loss function of the contrastive learning branch and the loss function of the regression learning branch, the model can simultaneously optimize the contrastive learning and regression tasks to obtain good feature representation and prediction performance.
[0107] Step S300: Obtain the image of the visceral tissue to be detected, input the image of the visceral tissue to be detected into the target network model for prediction, and output the target mechanical index of the visceral tissue image to be detected.
[0108] Specifically, the method involves acquiring images of the internal organs to be detected using specialized equipment, inputting these images into the target network model for prediction, and outputting the target mechanical properties of the internal organs to be detected. Taking a liver dataset as an example, this invention obtains liver images using specialized ultrasound equipment, inputs these liver images into the target network model for prediction, and outputs the LSM (Liver Stiffness Scale) of the liver image.
[0109] Step S400: Generate an evaluation reference report of the image of the visceral tissue to be detected based on the target mechanical index, and store the evaluation reference report.
[0110] Specifically, based on the target mechanical indicators and in conjunction with existing evaluation standards, an evaluation reference report of the image of the internal organ tissue to be detected is generated and stored for subsequent use.
[0111] It should be noted that in this embodiment, the present invention mainly uses liver ultrasound images as an example to directly predict LSM. In practical applications, ultrasound images of other internal organs can be used to predict specific mechanical parameters, which may include, but are not limited to, liver stiffness. This alternative implementation can be applied to any internal organ, such as the heart, lungs, kidneys, spleen, etc.
[0112] Therefore, this invention provides a method for quantitatively predicting mechanical parameters (such as tissue elasticity or stiffness) using images of visceral tissues. This is achieved through the analysis and processing of image data, thus providing a non-invasive and high-precision method for measuring mechanical parameters. It solves the problems of expensive equipment and high levels of expertise required for mechanical parameter generation. It can extract high-resolution and multi-dimensional information from visceral tissue images, providing not only more accurate mechanical parameter measurements but also more detailed image information, helping doctors to more comprehensively understand the state of visceral tissues. This invention is non-invasive, requiring no invasive procedures or biological sample collection. Furthermore, this technology has broad applicability and can be used for measuring mechanical parameters of various visceral tissues and disease types.
[0113] Furthermore, such as Figure 5 As shown, based on the above-mentioned method for generating mechanical indices of visceral tissue images based on contrastive learning, the present invention also provides a system for generating mechanical indices of visceral tissue images based on contrastive learning, wherein the system for generating mechanical indices of visceral tissue images based on contrastive learning includes:
[0114] The historical data acquisition module 51 is used to collect historical visceral tissue images and the mechanical indicators corresponding to the historical visceral tissue images, and to use the historical visceral tissue images and the mechanical indicators corresponding to the historical visceral tissue images as a dataset.
[0115] The network construction and training module 52 is used to build a neural network regression model and train the neural network regression model according to the dataset to obtain the target network model.
[0116] The mechanical index generation module 53 is used to acquire the image of the visceral tissue to be detected, input the image of the visceral tissue to be detected into the target network model for prediction, and output the target mechanical index of the visceral tissue image to be detected.
[0117] The evaluation and storage module 54 is used to generate an evaluation reference report of the image of the visceral tissue to be detected based on the target mechanical index, and to store the evaluation reference report.
[0118] Furthermore, such as Figure 6 As shown, based on the above-mentioned method and system for generating mechanical indices of visceral tissue images based on contrastive learning, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 6 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0119] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card. Further, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code installed on the terminal. The memory 20 may also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores a mechanical index generation program 40 based on contrastive learning of visceral tissue images. This mechanical index generation program 40 can be executed by the processor 10 to implement the mechanical index generation method for visceral tissue images based on contrastive learning in this application.
[0120] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the method for generating mechanical indicators of visceral tissue images based on contrastive learning.
[0121] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0122] In one embodiment, when processor 10 executes a mechanical index generation program 40 for visceral tissue images based on contrast learning stored in memory 20, the following steps are performed:
[0123] Collect historical images of internal organs and the corresponding mechanical indices, and use the historical images of internal organs and the corresponding mechanical indices as a dataset;
[0124] A neural network regression model is established, and the neural network regression model is trained based on the dataset to obtain the target network model;
[0125] The image of the visceral tissue to be detected is obtained, and the image of the visceral tissue to be detected is input into the target network model for prediction, and the target mechanical index of the visceral tissue to be detected is output.
[0126] An evaluation reference report is generated based on the target mechanical indicators to obtain the image of the visceral tissue to be detected, and the evaluation reference report is stored.
[0127] The process of collecting historical visceral tissue images further includes:
[0128] The historical visceral tissue images are subjected to random rotation, random flipping, brightness adjustment, contrast adjustment, deformation transformation, color transformation, and data balancing.
[0129] The neural network regression model includes: a feature extractor, a contrastive learning branch, and a regression learning branch;
[0130] The feature extractor includes a feature extraction backbone network and an adaptive average pooling layer; the contrastive learning branch includes a series of fully connected layers and an L2 norm normalization layer; and the regression learning branch includes the series of fully connected layers.
[0131] The step of training the neural network regression model based on the dataset to obtain the target network model specifically includes:
[0132] The dataset is divided into a training set, a validation set, and a test set according to a preset ratio;
[0133] The feature extraction backbone network is weighted based on the pre-trained model, and the number of channels of the feature extraction backbone network is set to be consistent with the number of channels of the historical visceral tissue images in the dataset, thus obtaining the initialized feature extraction backbone network.
[0134] The training set is input into the initialized feature extraction backbone network for feature extraction to obtain a feature map. The feature map is then input into the adaptive average pooling layer for adaptive average pooling and flattening operations to obtain a vector of the same dimension as the number of channels.
[0135] The dimension vector is input into the contrastive learning branch, and linear mapping is performed in a series of fully connected layers. The linearly mapped dimension vector is then standardized through the L2 norm normalization layer to obtain contrastive features of a preset dimension.
[0136] The dimension vector is input into the regression learning branch, and the regression task is output through a series of fully connected layers to obtain the model's predicted value.
[0137] The loss function of the contrastive learning branch is calculated based on the contrastive features, and the loss function of the regression learning branch is calculated based on the predicted values.
[0138] The total loss function of the neural network regression model is calculated based on the loss function of the contrastive learning branch and the loss function of the regression learning branch, until the total loss function reaches a preset convergence condition.
[0139] The step of calculating the total loss function of the neural network regression model based on the loss function of the contrastive learning branch and the loss function of the regression learning branch, until the total loss function reaches a preset convergence condition, further includes:
[0140] The parameters of the trained neural network regression model are adjusted using the validation set, and the capabilities of the trained neural network regression model are initially evaluated.
[0141] The test set is input into a preliminarily qualified neural network regression model for testing, and the prediction results are obtained using R. 2 The evaluation indicators are used to evaluate the prediction results to obtain the evaluation results;
[0142] If the evaluation results meet the preset requirements, the target network model is obtained.
[0143] Specifically, the step of calculating the loss function of the contrastive learning branch based on the contrastive features, and calculating the loss function of the regression learning branch based on the model's predicted values, includes:
[0144] The loss function of the contrastive learning branch is calculated using the Siamese contrastive loss function formula:
[0145]
[0146] Where N is the total number of samples, n is the ordinal number of the sample, and d represents the Euclidean distance between the features of two samples, d = ||a n -b n ||2,a n and b n These are the contrast features of the two samples, where y represents the label indicating whether the two samples match. y=1 indicates that the two samples are similar or match, while y=0 indicates that they do not match. margin represents a pre-set threshold.
[0147] Using R 2 The loss function formula is used to calculate the loss function of the regression learning branch:
[0148]
[0149] Among them, y iIt is the actual target value. It is the predicted value of the model. It is the mean of the target variable.
[0150] Specifically, calculating the total loss function of the neural network regression model based on the loss function of the contrast learning branch and the loss function of the regression learning branch includes:
[0151] The total loss function of the neural network regression model is calculated based on the loss function of the contrastive learning branch and the loss function of the regression learning branch: L total =γ con L con +γ reg L reg ;
[0152] Where, γ con γ represents the hyperparameter of the loss function that weighs the contrastive learning branch. reg This represents the hyperparameter of the loss function that weighs the regression learning branch.
[0153] In summary, this invention provides a method and related equipment for generating mechanical indices from visceral tissue images based on contrastive learning. The method includes: collecting historical visceral tissue images and their corresponding mechanical indices, using these historical images and their corresponding mechanical indices as a dataset; establishing a neural network regression model, training the neural network regression model based on the dataset to obtain a target network model; acquiring an image of the visceral tissue to be detected, inputting the image into the target network model for prediction, and outputting the target mechanical indices of the visceral tissue to be detected; generating an evaluation reference report of the visceral tissue to be detected based on the target mechanical indices, and storing the evaluation reference report. This invention effectively obtains mechanical indices from visceral tissue images and solves the problems of high cost and high professional requirements for mechanical index measurement equipment during the generation process.
[0154] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes that element.
[0155] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0156] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. A method for generating mechanical parameters from visceral tissue images based on contrastive learning, characterized in that, The method for generating mechanical parameters of visceral tissue images based on contrastive learning includes: Collect historical images of internal organs and the corresponding mechanical indices, and use the historical images of internal organs and the corresponding mechanical indices as a dataset; A neural network regression model is established, and the neural network regression model is trained based on the dataset to obtain the target network model; The image of the visceral tissue to be detected is obtained, and the image of the visceral tissue to be detected is input into the target network model for prediction, and the target mechanical index of the visceral tissue to be detected is output. An evaluation reference report of the image of the visceral tissue to be detected is generated based on the target mechanical indicators, and the evaluation reference report is stored. The neural network regression model includes: a feature extractor, a contrastive learning branch, and a regression learning branch; The feature extractor includes a feature extraction backbone network and an adaptive average pooling layer; the contrastive learning branch includes a series of fully connected layers and an L2 norm normalization layer; and the regression learning branch includes the series of fully connected layers. The step of training the neural network regression model based on the dataset to obtain the target network model specifically includes: The dataset is divided into a training set, a validation set, and a test set according to a preset ratio; The feature extraction backbone network is weighted based on the pre-trained model, and the number of channels of the feature extraction backbone network is set to be consistent with the number of channels of the historical visceral tissue images in the dataset, thus obtaining the initialized feature extraction backbone network. The training set is input into the initialized feature extraction backbone network for feature extraction to obtain a feature map. The feature map is then input into the adaptive average pooling layer for adaptive average pooling and flattening operations to obtain a vector of the same dimension as the number of channels. The dimension vector is input into the contrastive learning branch, and linear mapping is performed in a series of fully connected layers. The linearly mapped dimension vector is then standardized through the L2 norm normalization layer to obtain contrastive features of a preset dimension. The dimension vector is input into the regression learning branch, and the regression task is output through a series of fully connected layers to obtain the model's predicted value. The loss function of the contrastive learning branch is calculated based on the contrastive features, and the loss function of the regression learning branch is calculated based on the predicted values. The total loss function of the neural network regression model is calculated based on the loss function of the contrastive learning branch and the loss function of the regression learning branch, until the total loss function reaches a preset convergence condition.
2. The method for generating mechanical parameters of visceral tissue images based on contrastive learning according to claim 1, characterized in that, The step of calculating the total loss function of the neural network regression model based on the loss function of the contrastive learning branch and the loss function of the regression learning branch, until the total loss function reaches a preset convergence condition, further includes: The parameters of the trained neural network regression model are adjusted using the validation set, and the capabilities of the trained neural network regression model are initially evaluated. The test set is input into the neural network regression model that has passed the initial evaluation for testing, and the prediction results are obtained. The prediction results are evaluated using the R2 evaluation index to obtain the evaluation results. If the evaluation results meet the preset requirements, the target network model is obtained.
3. The method for generating mechanical parameters of visceral tissue images based on contrastive learning according to claim 2, characterized in that, The step of calculating the loss function of the contrastive learning branch based on the contrastive features, and calculating the loss function of the regression learning branch based on the model's predicted values, specifically includes: The loss function of the contrastive learning branch is calculated using the Siamese contrastive loss function formula: ; in, It is the total number of samples. The ordinal number of the sample. This represents the Euclidean distance between two sample features. and These are the contrast features of the two samples. Labels indicating whether two samples match. =1 indicates that the two samples are similar or matched. =0 indicates no match. This indicates a pre-set threshold. The loss function of the regression learning branch is calculated using the R2 loss function formula: ; in, It is the actual target value. It is the predicted value of the model. It is the mean of the target variable.
4. The method for generating mechanical parameters of visceral tissue images based on contrastive learning according to claim 3, characterized in that, The step of calculating the total loss function of the neural network regression model based on the loss function of the contrast learning branch and the loss function of the regression learning branch specifically includes: The total loss function of the neural network regression model is calculated based on the loss function of the contrastive learning branch and the loss function of the regression learning branch: ; in, The hyperparameters of the loss function of the contrastive learning branch, The hyperparameters of the loss function of the regression learning branch.
5. A system for generating mechanical parameters from visceral tissue images based on contrastive learning, characterized in that, The mechanical index generation system for visceral tissue images based on contrastive learning is used to implement the mechanical index generation method for visceral tissue images based on contrastive learning as described in claims 1-4. The mechanical index generation system for visceral tissue images based on contrastive learning includes: The historical data acquisition module is used to collect historical visceral tissue images and the corresponding mechanical indicators of the historical visceral tissue images, and to use the historical visceral tissue images and the corresponding mechanical indicators of the historical visceral tissue images as a dataset; The network construction and training module is used to build a neural network regression model, and train the neural network regression model according to the dataset to obtain the target network model; The mechanical index generation module is used to acquire images of the visceral tissue to be detected, input the images of the visceral tissue to be detected into the target network model for prediction, and output the target mechanical indexes of the images of the visceral tissue to be detected. An evaluation and storage module is used to generate an evaluation reference report of the image of the visceral tissue to be detected based on the target mechanical index, and to store the evaluation reference report.
6. A terminal, characterized in that, The terminal includes: a memory, a processor, and a mechanical index generation program for visceral tissue images based on contrastive learning, which is stored in the memory and can run on the processor. When the mechanical index generation program for visceral tissue images based on contrastive learning is executed by the processor, it implements the steps of the mechanical index generation method for visceral tissue images based on contrastive learning as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program for generating mechanical parameters of visceral tissue images based on contrastive learning. When the program for generating mechanical parameters of visceral tissue images based on contrastive learning is executed by a processor, it implements the steps of the method for generating mechanical parameters of visceral tissue images based on contrastive learning as described in any one of claims 1-4.