Method for predicting lung metastasis based on radiomics characteristics of CT image before metastasis

By extracting the radiomic features in the lung CT images before metastasis and building a predictive model, the problem that traditional CT imaging is difficult to detect lung micrometastasis is solved, and more accurate prediction of lung metastasis is achieved, helping to identify high-risk patients in the early stage.

CN120147299APending Publication Date: 2025-06-13SHANGHAI CHEST HOSPITAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510325150.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

Traditional CT imaging is difficult to detect lung micrometastasis and cannot predict the presence of lung metastasis before metastasis.

Method used

By obtaining lung CT image data of multiple lung cancer patients with intrapulmonary metastasis, the radiomic characteristics of lung metastasis lesions and their contralateral normal lung tissues in the thin-layer CT images of lungs before metastasis were extracted, the radiomic characteristic data set was established, and the KNN model was constructed for prediction.

Benefits of technology

More accurate predictions reflecting the development of lung metastasis are achieved, and the accuracy of prediction is improved, which helps to identify patients with high risk metastasis tendencies in the early stage and take timely and effective treatment measures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120147299A_ABST
    Figure CN120147299A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of CT (Computed Tomography) image processing, and particularly relates to a method for predicting lung metastasis based on radiomics characteristics of a CT image before metastasis, which comprises the following steps of: acquiring data of a plurality of lung CT images; a lung metastasis focus on the lung thin-layer CT image after metastasis is a first region of interest, the first region of interest is delineated, and a normal lung tissue on the opposite side of the first region of interest is a second region of interest; performing elastic registration on the lung thin-layer CT images after the transfer and before the transfer, and finding a third region of interest and a fourth region of interest in the lung thin-layer CT images after the registration and before the transfer; extracting radiomics features of a third region of interest and a fourth region of interest on the lung thin-layer CT image before transfer, establishing a radiomics feature data set, inputting the radiomics feature data set into a KNN model for training, and constructing a prediction model; and inputting the test sample into the prediction model for prediction. According to the method, the possibility of lung metastasis in the future is measured through the CT image before metastasis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of CT image processing, and particularly relates to a method for predicting lung metastasis based on radiomics features of pre-metastasis CT images. Background Art

[0002] Traditional CT imaging is the main method for detecting lung metastasis in clinical follow-up, but traditional CT imaging is still unable to detect the existence of pulmonary micrometastasis. Lung metastasis needs to be identified by the naked eye, but it is very difficult to judge tiny metastases.

[0003] As an emerging technical means, radiomics analysis can capture subtle differences that cannot be detected by the naked eye by analyzing the distribution and relationship of pixel intensities in CT images. In addition, radiomics data can be obtained from routine CT scans without additional imaging procedures. Secondly, there are differences in radiomics features between metastatic regions and non-metastatic regions in lung CT images.

[0004] In view of this, the present invention proposes a method for predicting lung metastasis based on radiomics features of pre-metastasis CT images. Summary of the Invention

[0005] In order to solve the technical problem of "traditional CT imaging is still unable to detect the existence of pulmonary micrometastasis and how to predict lung metastasis before metastasis", the present invention provides the following technical solutions:

[0006] A method for predicting lung metastasis based on radiomics features of pre-metastasis CT images, comprising the following steps:

[0007] Obtain the lung CT image data of multiple lung cancer patients with lung metastases as sample data, and screen out multiple groups of thin-layer lung CT images after metastasis and thin-layer lung CT images before metastasis;

[0008] Outline the boundary of the lung metastasis focus in each thin-layer lung CT image after metastasis, and the lung metastasis focus area where the boundary of the lung metastasis focus is located is defined as the first region of interest; copy the first region of interest to the normal lung tissue on the opposite side, and the region where the first region of interest is located in the normal lung tissue on the opposite side is defined as the second region of interest; set the three-dimensional parameters of the first region of interest and the second region of interest to generate three-dimensional segmentation models of the first region of interest and the second region of interest;

[0009] Set the fixed image for each patient as the thin-slice CT image of the lungs after metastasis, and the moving image as the thin-slice CT image of the lungs before metastasis. Perform elastic registration on the thin-slice CT images of the lungs after and before metastasis. After the thin-slice CT image of the lungs before metastasis after registration, find the corresponding region of the first region of interest and name this corresponding region the third region of interest; and the corresponding region of the non-metastatic part before metastasis corresponding to the second region of interest, named the fourth region of interest;

[0010] Extract the radiomics features of the third region of interest and the fourth region of interest from the screened thin-slice CT images of the lungs before metastasis, establish a radiomics feature dataset, and divide it into a training set, a test set, and a validation set;

[0011] For the screened thin-slice CT images of the lungs before metastasis, compare the radiomics features of the corresponding third region of interest of the lung metastasis focus on the thin-slice CT image of the lungs before metastasis and the corresponding fourth region of interest of the non-metastatic part on the contralateral side. Input the training set in the radiomics feature dataset into the KNN model for training to construct a prediction model;

[0012] Prepare test samples. After inputting the test samples into the prediction model, perform feature extraction and classification prediction on the CT images of the test samples, output the relevant parameters of metastasis occurrence, and predict the possibility of future lung metastasis.

[0013] Furthermore, use the open-source Pyradiomics software library to extract the radiomics features of the corresponding third region of interest of the lung metastasis focus on the thin-slice CT image of the lungs before metastasis and the corresponding fourth region of interest of the non-metastatic part before metastasis on the contralateral side to obtain a radiomics feature dataset.

[0014] Furthermore, the radiomics features include shape features, texture features, and density features.

[0015] Furthermore, input the radiomics feature dataset into the KNN model for training. The construction of the prediction model includes:

[0016] Perform data preprocessing on the extracted radiomics feature dataset;

[0017] Set the value of the number of neighbors K, and divide the preprocessed radiomics feature dataset into K equal parts; then, for each K value, perform K training and validation processes; in each process, use K - 1 parts as the training set and the remaining one part as the validation set; record the performance metrics including the accuracy, recall rate, and F1 score of each validation, and calculate the average value;

[0018] Train the training set by storing the training set data;

[0019] Select the radiomics feature datasets of the third and fourth regions of interest of the pre-metastatic thin-slice CT images of the lungs with distinct metastatic nodules as the test samples, and calculate their distances from all samples in the training set; after calculating the distances, find the K nearest neighbors of the test samples, extract the labels or target values of the K nearest neighbors, and obtain the prediction model;

[0020] Based on the K nearest neighbors, it is necessary to classify and perform regression prediction on the test samples to predict the ability of future pulmonary metastasis.

[0021] Furthermore, data preprocessing includes data cleaning, feature selection, and feature scaling; data cleaning includes handling missing values, outliers, and noisy data; feature selection is to select features that are helpful for model prediction; feature scaling is to scale the data to the same scale.

[0022] Furthermore, determine the value of the number of neighbors K through methods such as cross-validation, including dividing the preprocessed radiomics feature dataset into K equal parts; then, for each value of K, perform K training and validation processes; in each process, use K - 1 parts as the training set and the remaining one part as the validation set.

[0023] Furthermore, classify the test samples by using the majority voting method, count the number of each category among the K nearest neighbors, and divide the test samples into the category with the most occurrences to achieve the classification of the test samples.

[0024] Furthermore, perform regression prediction on the test samples by calculating the average value of the target values of the K nearest neighbors as the predicted value of the test samples to achieve the regression prediction of the test samples.

[0025] Furthermore, after calculating the distances, select the training samples corresponding to the first K smallest distances by sorting the distance list as the K nearest neighbors.

[0026] Furthermore, it also includes setting an independent test set, using the test set to evaluate the trained prediction model, calculating evaluation metrics including accuracy, recall rate, and F1 score; and evaluating the performance of the prediction model on different categories through a confusion matrix.

[0027] Compared with the prior art, the present invention has the following beneficial effects:

[0028] The method for predicting pulmonary metastasis based on radiomics features of pre-metastatic CT images of the present invention can more accurately predict and reflect the development of pulmonary metastasis and improve the prediction accuracy by extracting the radiomics features of pulmonary metastases and their corresponding normal lung tissues and constructing a prediction model.

[0029] It is possible to predict the likelihood of future lung metastasis using pre-metastatic CT image data in lung cancer patients before the occurrence of lung metastasis, which helps doctors identify patients with a high risk of metastatic tendency at an early stage, thereby taking more timely and effective treatment measures. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a flowchart of a method for predicting lung metastasis based on radiomics features of pre-metastatic CT images according to an embodiment of the present invention;

[0031] Figure 2 It is a thin-slice CT image of the lungs after metastasis of the present invention;

[0032] Figure 3 For the present invention Figure 2 It is a thin-slice CT image of the lungs after metastasis with the first region of interest and the second region of interest outlined. The yellow solid region is the first region of interest, and the blue solid region is the second region of interest;

[0033] Figure 4 It is a thin-slice CT image of the lungs before metastasis of the present invention, set as a moving image;

[0034] Figure 5 It is a thin-slice CT image of the lungs after metastasis with the first region of interest and the second region of interest outlined, set as a fixed image;

[0035] Figure 6 For Figure 4 Refer to Figure 5 The CT image after elastic registration, with the third region of interest and the fourth region of interest outlined. The yellow hollow region is the third region of interest, and the blue hollow region is the fourth region of interest. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0036] The technical solutions of the present invention will be clearly described below in conjunction with the drawings. Obviously, the described embodiments are not all embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0037] It should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "horizontal", "left", "right", "front", "rear", "lateral", "longitudinal", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present invention.

[0038] Embodiment

[0039] As Figure 1 shown, the present invention provides a method for predicting lung metastasis based on radiomics features of pre-metastasis CT images, comprising the following steps:

[0040] 1) Obtain the pulmonary CT image data of multiple lung cancer patients with intrapulmonary metastasis as sample data, and screen out the thin-layer CT images of the lungs after metastasis.

[0041] Specifically, collect the CT image data of the clinical, imaging and pathology of lung cancer patients with intrapulmonary metastasis, and screen out the thin-layer CT images of the lungs. The inclusion criteria for the CT image data include: lung cancer confirmed by histopathology, complete follow-up CT imaging records before the last metastasis and the earliest metastasis, pre-metastasis CT imaging reconstructed by a 1024 matrix, and cases with metastatic lesion diameter ≥ 5 mm.

[0042] The data exclusion criteria include: incomplete follow-up records; motion artifacts; diffuse nodules; and elastic registration failure.

[0043] 2) Outline the boundaries of the lung metastases in each thin-layer CT image of the lungs after metastasis. The region where the boundaries of the lung metastases are located is defined as the first region of interest, and the first region of interest is the lung metastasis; copy the first region of interest to the contralateral normal lung tissue, and the region where the first region of interest is located in the contralateral normal lung tissue is defined as the second region of interest; set the three-dimensional parameters of the first region of interest and the second region of interest, such as smoothness, resolution, etc., to generate three-dimensional segmentation models of the first region of interest and the second region of interest.

[0044] Combined with Figure 2 、 Figure 3 shown, specifically, import the thin-layer CT images of the lungs after metastasis in the complete follow-up CT imaging records into the 3D-slicer software, and outline the boundaries of the lung metastases in the thin-layer CT images of the lungs after metastasis layer by layer. Name the region where the outlined lung metastases are located as the first region of interest (lung metastasis) ROI1, set the color to solid yellow, copy the lung metastasis ROI1 to the contralateral normal lung tissue, and name the corresponding region of the normal lung tissue as the second region of interest ROI2, and set its color to solid blue; select the "ROI1" and "ROI2" segmentation regions, set parameters such as smoothness and resolution, and run the 3D-slicer software according to the selected ROI and the set parameters to generate three-dimensional segmentation models of the two regions ROI1 and ROI2.

[0045] 3) Combined with Figures 4 - 6As shown, set the fixed image as the thin-layer CT image of the lung after metastasis, and the moving image as the thin-layer CT image of the lung before metastasis. Perform elastic registration on the thin-layer CT images of the lung before and after metastasis. After the thin-layer CT image of the lung before metastasis after registration, find the corresponding area of the lung metastasis ROI1, and name this corresponding area of the lung metastasis ROI1 as the third region of interest ROI3, and set its color to yellow hollow; and the non-metastatic corresponding area corresponding to the second region of interest ROI2 on the opposite side of this lung metastasis ROI1, and name this non-metastatic area as the fourth region of interest ROI4, and set its color to blue hollow.

[0046] Specifically, through the elastic registration function of the 3D-slicer software, perform registration. On the thin-layer CT image of the lung before metastasis after registration, find the corresponding area of the lung metastasis, and name this corresponding area of the lung metastasis as ROI3, and set its color to yellow hollow; and the non-metastatic corresponding area before metastasis on the opposite side of this lung metastasis, and name this non-metastatic area as ROI4, and set its color to blue hollow.

[0047] 4) Extract the radiomics features of the corresponding third region of interest (ROI3, yellow hollow) of the lung metastasis (ROI1) and the corresponding fourth region of interest (ROI4, blue hollow) of the non-metastatic area on the opposite side on the above-mentioned multi-group thin-layer CT images of the lung before metastasis, and establish a radiomics feature dataset.

[0048] Specifically, use the open-source Pyradiomics software library to extract the radiomics features of the corresponding area (ROI3, yellow hollow) of the lung metastasis (ROI1) and the corresponding area (ROI4, blue hollow) of the non-metastatic area before metastasis on the opposite side on the above-mentioned thin-layer CT images of the lung before metastasis, and obtain a radiomics feature dataset; these radiomics features include shape features (such as volume, surface area), texture features (such as gray-level co-occurrence matrix, wavelet transform, etc.) and density features, etc.

[0049] Taking a pulmonary nodule lesion as an example, the original 3D image of the lesion and the corresponding binary mask are used as inputs. After calculation and processing by the Pyradiomics software library, a series of radiomics features of the lesion are finally obtained, including first-order features (statistics), shape features, gray-level co-occurrence matrix features, gray-level run-length matrix features, gray-level size zone matrix, adjacent gray-tone difference matrix, and gray-level dependence matrix. Multiplying the binary mask of each pulmonary nodule by the original 3D image can accurately obtain the image region that belongs only to this pulmonary nodule. The first-order features (statistics) describe the voxel density distribution of the target object in the image, such as mean, standard deviation, skewness, kurtosis, energy, entropy, etc. Shape features describe the size and shape of the target object, and these features are independent of voxel density, such as volume, surface area, sphericity, maximum diameter, minimum diameter, etc. Shape features have two forms: 3D and 2D. For the remaining gray-level co-occurrence matrix features, gray-level run-length matrix features, gray-level size zone matrix, adjacent gray-tone difference matrix, and gray-level dependence matrix, please refer to the pyradiomics (simulated omics) documentation, an open-source python package for extracting Radiomics features from medical imaging. Through this software package, a reference standard for radiomics analysis is established, and an open-source platform for simple and reproducible radiomics feature extraction that has been tested and maintained is provided.

[0050] Radiomics analysis is performed on pre-metastatic thin-slice CT images of the lungs using features including first-order gray-level co-occurrence matrix (glcm), gray-level dependence matrix (gldm), gray-level run-length matrix (glrlm), gray-level size zone matrix (glszm), neighborhood gray-tone difference matrix (ngtdm), high-order filtering features, and wavelet-based features.

[0051] 5) By comparing the radiomics features of the lung metastases corresponding to the third region of interest (ROI3, yellow hollow) on the pre-metastatic thin-slice CT images of the lungs and the corresponding fourth region of interest (ROI4, blue hollow) on the contralateral non-metastatic pre-metastatic side, a prediction model is built using these radiomics feature datasets. The classification algorithm of the prediction model can use methods such as logistic regression, support vector machine, random forest, or KNN.

[0052] Taking the K-neighbours Classifier (knn) model as an example, the process of building the prediction model includes:

[0053] 1. Preprocess the extracted radiomics feature dataset, including data cleaning, feature selection, and feature scaling; data cleaning includes handling missing values, outliers, and noisy data; feature selection: select features that are helpful for model prediction; feature scaling: since the KNN model is sensitive to the dimension of features, it is necessary to normalize or standardize the features to scale the data to the same scale to ensure that all features contribute equally to the distance calculation.

[0054] Specifically, data cleaning includes handling the missing values of the radiomics features of the extracted third region of interest (ROI3, yellow hollow) and the fourth region of interest by filling, deleting, or interpolation methods; and identifying and handling the outliers of the radiomics feature data of the third region of interest (ROI3, yellow hollow) and the fourth region of interest by statistical methods; and reducing the noisy data by methods such as smoothing filtering.

[0055] Select features that are helpful for predicting the metastasis status from the extracted radiomics features through statistical tests (such as t-test, ANOVA).

[0056] 2. Determine the optimal number of neighbors K value through methods such as cross-validation: divide the preprocessed radiomics feature dataset into K equal parts; then, for each K value, perform K training and validation processes. In each process, use K - 1 parts as the training set and the remaining one part as the validation set. Record performance metrics such as accuracy, recall, and F1 score for each validation and calculate the average. Select the K value that makes the performance of the validation set the best as the final choice.

[0057] 3. Train the model: store the training set data and train the training set; use the Euclidean distance for distance measurement.

[0058] KNN is a lazy learning algorithm that does not require an explicit training process and only needs to store the training set. Determine the distance metric: select a suitable distance metric method, such as Euclidean distance, Manhattan distance, etc.

[0059] 4. Build the model: prepare the test samples, for each test sample (select the features extracted from the pre-metastasis thin-slice CT images of the lungs with metastatic nodules as the test samples), calculate its distance from all samples in the training set; after calculating the distances, sort the distance list and select the training samples corresponding to the first K smallest distances as the nearest K neighbors, find the nearest K neighbors of the test sample, extract the labels or target values of the K neighbors, and obtain the prediction model.

[0060] 5. Make predictions: After finding the K nearest neighbors of the test sample, based on the K nearest neighbors, classification and regression predictions need to be made for the test sample pair; by using the majority voting method, that is, counting the number of each category among the K nearest neighbors, the test sample is assigned to the category with the most occurrences to achieve the classification of the test sample. Calculate the average of the target values of the K nearest neighbors as the predicted value of the test sample to achieve the regression of the test sample.

[0061] 6. Model evaluation: Prepare an independent test set in the dataset, use the test set to evaluate the trained prediction model, and calculate evaluation metrics such as accuracy, recall, and F1 score; the performance of the model on different categories can be viewed through the confusion matrix. The confusion matrix is a two-dimensional table, where the rows represent the actual categories and the columns represent the predicted categories, intuitively showing the prediction results of the model on different categories.

[0062] Through the confusion matrix, we can intuitively see the prediction results of the model on different categories.

[0063] Code example

[0064] A simple example code for KNN modeling using the scikit-learn library in Python is as follows:

[0065] from sklearn.neighbors import KNeighborsClassifier

[0066] from sklearn.model_selection import train_test_split

[0067] from sklearn.preprocessing import StandardScaler

[0068] from sklearn.metrics import classification_report,accuracy_score

[0069] from sklearn.datasets import load_iris

[0070] # Load the dataset

[0071] iris = load_iris()

[0072] X, y = iris.data, iris.target

[0073] # Data division

[0074] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 42)

[0075] # Feature scaling

[0076] scaler = StandardScaler()

[0077] X_train = scaler.fit_transform(X_train)

[0078] X_test = scaler.transform(X_test)

[0079] # Create a KNN model

[0080] knn = KNeighborsClassifier(n_neighbors = 5)

[0081] # Train the model

[0082] knn.fit(X_train, y_train)

[0083] # Make predictions

[0084] y_pred = knn.predict(X_test)

[0085] # Model evaluation

[0086] print(classification_report(y_test, y_pred))

[0087] print("Accuracy:", accuracy_score(y_test, y_pred))

[0088] First, the dataset is divided into a training set and a test set. Then, the features are standardized. Next, a KNN model is created and the value of K is specified as 5. Finally, the model is trained and predictions and evaluations are made.

[0089] The model is evaluated using the ROC curve. The model results show that the accuracy of predicting metastasis before metastasis visualization is 0.775, the sensitivity is 0.65, the specificity is 0.73, the recall rate reaches 0.65, and the AUC value is 0.8, indicating that the model has a certain ability to predict future lung metastasis based on pre-metastasis CT images.

[0090] The above technical features constitute the best embodiment of the present invention, which has strong adaptability and the best implementation effect. Non-essential technical features can be increased or decreased according to actual needs to meet the needs of different situations.

[0091] Finally, it should be noted that the above content is only used to illustrate the technical solution of the present invention, rather than limiting the protection scope of the present invention. Any simple modification or equivalent replacement of the technical solution of the present invention by those of ordinary skill in the art shall not depart from the essence and scope of the technical solution of the present invention.

Claims

1. A method for predicting lung metastasis based on radiomics features of pre-metastatic CT images, characterized in that: The steps include: Acquire lung CT image data of multiple lung cancer patients with intrapulmonary metastasis as sample data, and screen out multiple groups of lung thin-layer CT images after metastasis and corresponding lung thin-layer CT images before metastasis; Outline the boundary of each lung metastasis in the thin-section CT image of the lung after metastasis, and define the lung metastasis area where the boundary of the lung metastasis is located as the first region of interest; copy the first region of interest to the normal lung tissue on the opposite side, and define the area where the first region of interest is located in the normal lung tissue on the opposite side as the second region of interest; Setting three-dimensional parameters of the first region of interest and the second region of interest to generate three-dimensional segmentation models of the first region of interest and the second region of interest; The fixed image of each patient is set as the lung thin-layer CT image after metastasis, and the moving image is set as the lung thin-layer CT image before metastasis. The lung thin-layer CT images after metastasis and before metastasis are elastically registered. After the registered lung thin-layer CT images before metastasis, the corresponding area of ​​the first region of interest is found, and the corresponding area is named as the third region of interest; and the corresponding area of ​​the second region of interest before metastasis that is not metastatic is named as the fourth region of interest; Extract the radiomic features of the third and fourth regions of interest from the thin-section lung CT images before metastasis after screening and registration, establish a radiomic feature dataset, and divide it into a training set, a test set, and a validation set; For the thin-section CT images of the lungs before metastasis, the radiomic features of the third region of interest corresponding to the lung metastasis and the fourth region of interest corresponding to the contralateral non-metastasis on the thin-section CT images of the lungs before metastasis were compared, and the training set of the radiomic feature data set was input into the KNN model for training to construct a prediction model; Prepare test samples, input the test samples into the prediction model, perform feature extraction and classification prediction on the CT images of the test samples, output the relevant parameters of metastasis, and predict the possibility of lung metastasis in the future.

2. The method for predicting lung metastasis based on radiomics features of pre-metastasis CT images according to claim 1, characterized in that: The open source Pyradiomics software library was used to extract the radiomic features of the third region of interest corresponding to lung metastases and the fourth region of interest corresponding to the contralateral non-metastatic area on thin-section CT images of the lung before metastasis, and obtain a radiomic feature dataset.

3. The method for predicting lung metastasis based on radiomics features of pre-metastasis CT images according to claim 1, characterized in that: Radiomic features include shape features, texture features, and density features.

4. The method for predicting lung metastasis based on radiomics features of pre-metastasis CT images according to claim 1, characterized in that: The radiomics feature dataset is input into the KNN model for training. The prediction model is constructed by: Data preprocessing was performed on the extracted radiomics feature dataset; Set the neighbor number K value and divide the preprocessed radiomics feature dataset into K equal parts; then, for each K value, perform K training and validation processes; in each process, use K-1 parts as training sets and the remaining part as validation sets; record performance indicators including accuracy, recall, and F1 score of each validation, and calculate the average value; By storing the training set data, the training set is trained; The radiomic feature datasets of the third and fourth regions of interest of independent thin-layer CT images of lungs with metastatic nodules before metastasis were selected as test samples, and their distances from all samples in the training set were calculated. After the distances were calculated, the nearest K neighbors of the test samples were found, and the labels or target values ​​of the K neighbors were extracted to obtain a prediction model. Based on the K nearest neighbors, the test samples are classified and regressed to predict the ability of future lung metastasis.

5. The method for predicting lung metastasis based on radiomics features of pre-metastasis CT images according to claim 4, characterized in that: Data preprocessing, including data cleaning, feature selection and feature scaling; data cleaning includes processing missing values, outliers and noisy data; feature selection is to select features that are helpful for model prediction; Feature scaling is to scale the data to the same scale.

6. The method for predicting lung metastasis based on radiomics features of pre-metastasis CT images according to claim 4, characterized in that: The neighbor number K value is determined by a method such as cross-validation, including dividing the preprocessed radiomics feature dataset into K equal parts; then, for each K value, K training and validation processes are performed; In each process, K-1 parts are used as training sets and the remaining part is used as validation set.

7. The method for predicting lung metastasis based on radiomics features of pre-metastasis CT images according to claim 4, characterized in that: The test samples are classified by using the majority voting method, counting the number of each category in the K nearest neighbors, and dividing the test samples into the category with the largest number of occurrences to achieve the classification of the test samples.

8. The method for predicting lung metastasis based on radiomics features of pre-metastasis CT images according to claim 4, characterized in that: The regression prediction of the test sample is achieved by calculating the average of the target values ​​of the K nearest neighbors as the predicted value of the test sample.

9. The method for predicting lung metastasis based on radiomics features of pre-metastasis CT images according to claim 4, characterized in that: After calculating the distance, sort the distance list and select the training samples corresponding to the first K smallest distances as the nearest K neighbors.

10. The method for predicting lung metastasis based on radiomics features of pre-metastasis CT images according to claim 1, characterized in that: It also includes setting up an independent test set, using the test set to evaluate the trained prediction model, calculating evaluation indicators including accuracy, recall, and F1 score; and using the confusion matrix to evaluate the performance of the prediction model in different categories.