An unsupervised lung nodule malignancy diagnosis system based on reconstruction and multi-adversarial training
By developing an unsupervised lung nodule malignancy diagnosis system based on reconstruction and multi-adversarial training, utilizing the MARGAN model and multi-discriminator generative adversarial network, the system addresses the issues of dependence on labeled data and insufficient diagnostic accuracy in existing technologies, achieving efficient lung nodule malignancy detection.
Patent Information
- Application Number
- CN202311224307.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-20
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-09-20
AI Technical Summary
Existing deep learning-based lung nodule diagnostic systems rely on large-scale labeled datasets, making it difficult to fully utilize their performance in the medical field. Furthermore, traditional unsupervised learning methods lack sufficient accuracy in lung nodule diagnosis.
An unsupervised lung nodule malignancy diagnosis system based on reconstruction and multi-adversarial training is adopted. The MARGAN model is used in an encoder-decoder architecture, combined with a multi-discriminator generative adversarial network and a base module. Abnormal data of lung nodules are detected by reconstructing the residual values of positive and abnormal data.
It improves the accuracy and stability of pulmonary nodule diagnosis, reduces dependence on labeled data, and enhances the robustness and detection capability of the model.
Smart Images

Figure CN117611864B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical imaging technology, and in particular relates to an unsupervised malignant pulmonary nodule diagnostic system based on reconstruction and multi-adversarial training. Background Technology
[0002] Currently, CAD (Computer-aided Diagnosis) systems used for pulmonary nodule diagnosis can be broadly categorized into two types: those based on radiomics technology and those based on deep learning technology. Radiomics technology is primarily based on machine learning algorithms, and its advantage lies in its relatively low dependence on data volume. However, this method involves numerous steps, and any slight error in any step can affect subsequent progress. In contrast, CAD systems based on deep learning technology are much simpler, with the diagnostic process completed autonomously by the model without human intervention. This is why such systems have rapidly emerged and gradually become mainstream in recent years. Currently, deep learning technologies applied in pulmonary nodule diagnosis are still mainly supervised learning algorithms, which heavily rely on large-scale labeled datasets. However, in the medical field, obtaining labeled information is extremely difficult, making it very challenging to construct datasets suitable for model training. Consequently, the performance of such methods is often limited. Summary of the Invention
[0003] The technical problem to be solved by this invention is to propose an unsupervised lung nodule malignancy diagnosis system based on reconstruction and multi-adversarial training. It adopts an "encoder-decoder" architecture and detects abnormal data of lung nodules based on the different residual values obtained from reconstructing positive and abnormal data.
[0004] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0005] An unsupervised diagnostic system for malignant pulmonary nodules based on reconstruction and multi-adversarial training includes:
[0006] The lung nodule extraction module is used to segment the lung parenchyma from the original lung CT image, extract the lung nodules in the lung parenchyma, and store them as images of the appropriate size as experimental data.
[0007] The dataset construction module is used to divide the obtained lung nodule images into a training set and a test set. The data in the training set consists of benign nodules, while the test set consists of half benign and half malignant nodules.
[0008] The model training module is used to build the MARGAN (Multi-Adversarial Reconstructive Generative Adversarial Network) model and train it using samples from the training set. During this process, the hyperparameters are continuously adjusted and multiple training sessions are conducted to optimize the performance of the MARGAN model to its best.
[0009] The anomaly detection module is used to input samples from the test set into the MARGAN model for detection. The model will evaluate the anomaly score based on the degree of deviation between the sample to be detected and the samples in the training set. If the deviation is large, that is, the anomaly score is higher than the set threshold, the sample to be detected is judged as malignant; if the deviation is small, that is, the anomaly score is lower than the set threshold, the sample to be detected is judged as benign.
[0010] Furthermore, in the lung nodule extraction module, obtaining experimental data includes the following sub-steps:
[0011] S101. The image files are mainly lung CT images, each image is 512 pixels × 512 pixels in size and stored in DICOM format. However, the data used for model training is usually in JPG format. Therefore, to facilitate subsequent operations, the original lung CT images are converted to JPG format.
[0012] S102. Since the data used in the experiment is only lung nodule images, all information in the original CT images except for the lungs is useless. Before the lung nodule extraction operation, the lung parenchyma needs to be segmented. Therefore, the threshold segmentation method is used to segment the lung parenchyma from the original lung CT images.
[0013] S103. After the lung parenchyma is segmented, the lung nodules in the lung parenchyma are extracted according to the nodule location information and malignancy degree recorded in the annotation file, and stored as images of the corresponding size as the final experimental data.
[0014] Furthermore, the dataset construction module includes the following steps for dividing the training and test sets:
[0015] This invention adopts the concept of anomaly detection for diagnosing benign and malignant lung nodules. Benign lung nodules are considered normal data, while malignant lung nodules are considered abnormal data. A training set is constructed from several images of benign lung nodules, i.e., D. train Furthermore, the training set data does not include label information. A test set is constructed using several benign lung nodule images different from the training set, along with an equal number of malignant lung nodule images. testThe test set data includes label information, where {0,1} represents the label information, 0 refers to benign lung nodules and 1 refers to malignant lung nodules. However, the label information is only used in the testing phase to statistically analyze the model detection results.
[0016] Furthermore, the model training module includes the following sub-steps:
[0017] S301. Model Construction: The MARGAN model for pulmonary nodule diagnosis mainly consists of three components: encoder, basal module, and multi-discriminator generative adversarial network.
[0018] The encoder is used to reduce the dimensionality of the input data to obtain the latent representation; the basis module contains a basis vector memory and related coordinate transformation operators, which are used to fit the basis of the linear space where the training set samples are located, and reconstruct the latent representation into a linear representation under the basis; the multi-discriminator generative adversarial network is used to remap the linear representation back to the image space to obtain the reconstructed data, and to calculate the statistical information of the input data and the reconstructed data.
[0019] S302. The main task of the multi-discriminator generative adversarial network (GAN) is to map low-dimensional representations to images of lung nodules that tend towards benignity. Therefore, this invention trains it only with benign samples, aiming to enable it to reconstruct benign samples. In this model, a multi-discriminator GAN framework is used, replacing the single discriminator with a group of discriminators. The original single-adversarial training is transformed into multi-adversarial training, thus changing the model's training objective. Where D1,...,D T Let V(·) represent individual discriminators in the discriminator group, G represent the generator, V(·) represent the loss function, F(·) represent the ensemble strategy of the discriminator group, and T represent the total number of discriminators. Regardless of the ensemble strategy chosen, each discriminator in the discriminator group is trained independently without interference from others. The training objective is... The generator is trained based on feedback from the discriminator group. Compared to a single discriminator, the gradients provided by the discriminator group are smoother, which is more conducive to stable model training. This invention requires a powerful generator; therefore, a weighted averaging strategy is used to integrate multiple discriminators to weaken the inhibitory effect of the discriminators on the generator. The specific formula is as follows:
[0020]
[0021] Among them, AM soft Let represent the Pythagorean mean function; λ represents the parameters of the Pythagorean mean function, and λ≥0; w i Let represent the weight coefficient corresponding to the i-th discriminator, and D i D represents the i-th discriminator; j V(D) represents the j-th discriminator;i Let V(D,G) denote the loss function of the generative adversarial network, and let V(D,G) denote the loss function of the generative adversarial network. i ,G)<0.
[0022] This invention uses training set D train The multi-discriminator generative adversarial network was trained for epoch_1, using optimizer_1 with a learning rate of lr_1 and a batch size of batch_size_1. At this point, the multi-discriminator generative adversarial network has completed training.
[0023] S303. The encoder compresses the image data into a latent representation, and the basis modules then reconstruct the latent representation into a linear representation of the basis stored in the basis vector memory. Through their combined action, the image data is ultimately encoded into a low-dimensional representation that can be used to generate benign samples. Therefore, logically, these two can be considered as a whole. The trained multi-discriminator generative adversarial network (GAN) guides the training of the encoder and basis modules. The parameters of the GAN are kept constant; only the parameters of the encoder and basis modules are updated. The training set used is also D. train .
[0024] The key to the effectiveness of the MARGAN model lies in whether the basis vector memory learns a basis within the linear space containing the benign samples. According to relevant theorems in matrix theory, the basis of a finite-dimensional linear space is equivalent to the maximal linearly independent set of that space. Therefore, if the rank of the matrix can be restricted to approach a full-rank matrix, the basis vector memory can be prompted to fit the basis of the linear space. Thus, a rank loss function is defined to guide the training of the basis modules, with the specific formula as follows:
[0025] L rank =N-rank(BVM)
[0026] Among them, L rank Let N denote the rank loss function, N denote the linear space dimension, rank denote the rank of the matrix, and BVM denote the basis vector memory.
[0027] Furthermore, with the decoder parameters fixed, it is necessary to ensure that the encoder and basis modules map the image data to a latent representation that best matches the benign samples, in order to reduce the deviation between benign samples and reconstructed samples. Therefore, an image loss function is defined to guide the model to reduce the difference between benign samples and reconstructed samples at the image level. The specific formula is as follows:
[0028]
[0029] Among them, L image Denotes the image loss function, ||·|| 2 This represents the sum of squares of pixel differences, where n represents the number of pixels and x represents a benign sample. This indicates a reconstructed sample.
[0030] Image loss functions reduce the difference between benign and reconstructed samples at the pixel level; however, this alone is insufficient to minimize the deviation between them because it focuses only on visual similarity while ignoring feature differences. Therefore, a solution is adopted: a discriminator is used to calculate statistical information between the real and reconstructed images, and reducing the difference in statistical information is used as one of the training objectives of the model. This method is an improvement on feature matching techniques. Finally, a feature loss function is defined to guide the model to reduce the difference between benign and reconstructed samples in the feature space, with the specific formula as follows:
[0031]
[0032] Among them, L feature Let f represent the feature loss function. i (·) represents the intermediate layer output of a single discriminator in the i-th discriminator group, n d This indicates the output feature dimension, and max(·) indicates that the maximum value is returned.
[0033] In summary, the loss function used for training the encoder and base modules is as follows:
[0034] L(x) = k1·L rank +k2·L image (x)+k3·L feature (x)
[0035] Where L represents the loss function, and k1, k2 and k3 represent weighting factors.
[0036] Using training set D train The encoder and base module are trained for epoch_2 rounds. The optimizer used is optimizer_2, and the learning rate and batch size are lr_2 and batch_size_2, respectively.
[0037] Furthermore, the anomaly detection module performs anomaly detection on the sample to be detected, including the following sub-steps:
[0038] S401. After inputting the test set samples into the MARGAN model, the encoder maps the high-dimensional image data into a low-dimensional representation in the latent space, obtaining the latent representation. The specific formula is as follows:
[0039] z = E(y; θ) E )
[0040] Where z is the latent representation, θ E Here are the encoder parameters, and y represents the test set samples.
[0041] S402. Assuming that all benign samples originate from the same high-dimensional linear space, according to relevant theorems in matrix theory, any vector in a finite-dimensional linear space can be represented by the baseline of that linear space. The core of anomaly detection lies in making the model fit the distribution of benign samples as closely as possible. Therefore, if a basis can be obtained in the linear space where the benign samples are located, the entire distribution can be fitted. Thus, this invention proposes a basis module that reconstructs the latent representation into a linear representation under the basis based on the information stored in the basis vector memory. The combination coefficients are the coordinates of the given input under that basis. Since the fitted basis is only for the distribution space of benign samples, the model has a smaller bias when reconstructing benign samples, but a larger bias when reconstructing malignant samples. Finally, benign and malignant samples are distinguished by the degree of bias.
[0042] S403, the multi-discriminator generative adversarial network remaps the low-dimensional representation back to the image space to obtain reconstructed data samples. The specific formula is as follows:
[0043]
[0044] Where, θ G Indicates generator parameters, G represents the final reconstruction result after the base module, and G(·) represents the decoding process. This indicates a reconstructed data sample.
[0045] S404. The degree of deviation between the test set samples and the reconstructed data samples is evaluated, and the evaluation result is used as the anomaly score of the sample to be detected. The specific formula is as follows:
[0046]
[0047] Where A(y) represents the outlier score.
[0048] S405. Calculate the outlier scores of all samples to be detected to obtain an outlier score set. Normalize the outlier score set using the feature scaling formula to obtain a new outlier score set. The specific formula is as follows:
[0049]
[0050] S′={s′ k ,x∈D test}
[0051] Among them, s′ k Let S represent the normalized outlier scores; let S represent the set of outlier scores, and S = {s} k :A(x),x∈D test};S′ represents the new set of anomaly scores; S k This represents the abnormal score of the k-th sample to be detected in the abnormal score set.
[0052] S406. Define a threshold φ as a reference, and compare the scores in S′ with φ one by one. If s′ k If the value is greater than φ, the corresponding sample is marked as malignant; otherwise, it is marked as benign. This method is used to detect D. test Malignant lung nodule samples.
[0053] Furthermore, in step S402, the base module is configured to perform the following actions:
[0054] S4021. Assume that any basis vector in the linear space containing the test set samples contains N basis vectors of dimension N. Then the basis vector storage is a block matrix BVM∈R. N×N BVM i Let be the i-th column of BVM, representing a basis vector, where bvm i , Construct matrix E∈R N×N The specific formula for storing a set of natural bases in an N-dimensional linear space is as follows:
[0055]
[0056] Among them, (e1,e2,...,e n ) represents a natural radical.
[0057] S4022, Construct another matrix T∈R N×N As the transition matrix from the natural basis to the new basis, the basis transformation process is as follows:
[0058] (bvm1,bvm2,...,bvm n )=(e1,e2,...,e n )T
[0059] Among them, (bvm1,bvm2,...,bvm n ) indicates a new base.
[0060] S4023, Define column vector c∈R N Record the coordinates of the latent representation under the natural basis, expressed as:
[0061] z = (e1, e2, ..., e n )c
[0062] S4024. The latent representation is a linear representation under the new basis, and the specific formula is as follows:
[0063]
[0064] in, This represents the potential representation of a linear representation under the new basis.
[0065] Seek The final reconstruction result is:
[0066]
[0067] in, This indicates the final reconstruction result.
[0068] Furthermore, the present invention also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the action steps of the unsupervised lung nodule malignancy diagnosis system based on reconstruction and multi-adversarial training described above.
[0069] Furthermore, the present invention also proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the actions of the unsupervised lung nodule malignancy diagnosis system based on reconstruction and multi-adversarial training.
[0070] The present invention adopts the above technical solution, and its significant technical effects compared with the prior art are as follows:
[0071] (1) The present invention designs a general module called the base module. The main function of this module is to reconstruct the sample to be detected into a normal sample. The present invention applies it to the "encode-decode" framework, so that the residual value obtained by the model reconstructing abnormal data is higher than that of normal data, thereby reducing the detection error caused by the residual values of positive and abnormal samples being too similar.
[0072] (2) This invention extends the single discriminator framework of traditional generative adversarial networks to a multi-discriminator framework, and designs a multi-discriminator generative adversarial network as a decoder. The model uses a multi-adversarial strategy to train the generator, hoping to enhance its performance and thus improve the decoding accuracy. Attached Figure Description
[0073] Figure 1 This is a flowchart illustrating the overall implementation of the present invention.
[0074] Figure 2 This is a flowchart of the lung nodule sample extraction process of the present invention.
[0075] Figure 3 This is a schematic diagram of the MARGAN model structure of the present invention.
[0076] Figure 4 This is a schematic diagram of the base module of the present invention.
[0077] Figure 5 This is a schematic diagram of the multi-discriminator generative adversarial network structure of the present invention.
[0078] Figure 6This is the visualization result of the basis vectors in the embodiment of the present invention.
[0079] Figure 7 This is a visualization result of sample reconstruction in an embodiment of the present invention.
[0080] Figure 8 This is a performance comparison result between the embodiments of the present invention and other methods.
[0081] Figure 9 This is a comparison of the visualization results of sample reconstruction with those of other methods in this embodiment of the invention. Detailed Implementation
[0082] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0083] This embodiment describes an unsupervised pulmonary nodule malignancy diagnosis system based on reconstruction and multi-adversarial training, such as... Figure 1 As shown, it includes:
[0084] The lung nodule extraction module is used to segment the lung parenchyma from the original lung CT image, extract lung nodules from the lung parenchyma, and store them as images of appropriate size as experimental data. Specific details are as follows: Figure 2 As shown:
[0085] S101. The dataset used in this embodiment is LIDC-IDRI, which was initiated and collected by the National Cancer Institute of the United States. It contains 1018 research cases, each of which includes a corresponding chest medical image file and a diagnostic lesion annotation file. The image files are mainly lung CT images, each image is 512 pixels × 512 pixels, and is stored in DICOM format. However, the data used for model training is usually in JPG format. Therefore, to facilitate subsequent operations, the original lung CT images are converted to JPG format.
[0086] S102. Since the data used in the experiment is only lung nodule images, all information in the original CT images except for the lungs is useless. Before the lung nodule extraction operation, the lung parenchyma needs to be segmented. Therefore, the threshold segmentation method is used to segment the lung parenchyma from the original lung CT images.
[0087] S103. After the lung parenchyma is segmented, the lung nodules in the lung parenchyma are extracted according to the nodule location information and malignancy degree recorded in the annotation file, and stored as a 64-pixel × 64-pixel image as the final experimental data.
[0088] The dataset construction module is used to divide the obtained lung nodule images into a training set and a test set. The training set contains only benign nodules, while the test set consists of a 50 / 50 mix of benign and malignant nodules. Specifically:
[0089] This embodiment borrows the concept of anomaly detection to diagnose benign and malignant lung nodules. Benign lung nodules are considered normal data, while malignant lung nodules are considered abnormal data. The aim is for the model to fit the distribution of benign lung nodule samples, thereby identifying samples that do not conform to the distribution as malignant. Therefore, only benign lung nodule data is used to train the model. A training set of 1600 benign lung nodule images, namely D, is selected. train ={x1,x2,...,x 1600 Furthermore, the training set data does not include label information. An additional 250 images of benign lung nodules, different from the training set, and an equal number of images of malignant lung nodules are selected to form the test set, i.e., D. test ={(x1,0),...,(x 250 ,0),(x 251 ,1),...,(x 500 ,1)}, The test set data includes label information, where {0,1} represents label information, 0 refers to benign lung nodules, and 1 refers to malignant lung nodules. However, the label information is only used in the testing phase to statistically analyze the model detection results.
[0090] The model training module is used to build the MARGAN model and train it using samples from the training set. During this process, hyperparameters are continuously adjusted, and multiple training iterations are performed to optimize the MARGAN model's performance to its best. Specifically:
[0091] S301. Model Construction: The MARGAN model for pulmonary nodule diagnosis mainly consists of three components: an encoder, a basal module, and a multi-discriminator generative adversarial network. Figure 3 As shown.
[0092] The encoder is used to reduce the dimensionality of the input data to obtain the latent representation; the basis module contains a basis vector memory and related coordinate transformation operators, which are used to fit the basis of the linear space where the training set samples are located, and reconstruct the latent representation into a linear representation under the basis; the multi-discriminator generative adversarial network is used to remap the linear representation back to the image space to obtain the reconstructed data, and to calculate the statistical information of the input data and the reconstructed data.
[0093] S302. The model training is divided into two stages. The first stage trains the multi-discriminator generative adversarial network separately. The second stage uses the trained multi-discriminator generative adversarial network to guide the training of the encoder and base modules.
[0094] The primary task of a multi-discriminator generative adversarial network (GAN) is to map low-dimensional representations to images of lung nodules that tend towards benignity. Therefore, it is trained solely on benign samples, with the aim of developing its ability to reconstruct these samples. This model utilizes a multi-discriminator GAN framework, replacing the single discriminator with a group of discriminators. The original single-adversarial training is transformed into multi-adversarial training, thus changing the model's training objective. Where D1,...,D T Let V(·) represent individual discriminators in the discriminator group, G represent the generator, V(·) represent the loss function, F(·) represent the ensemble strategy of the discriminator group, and N represent the total number of discriminators. Regardless of the ensemble strategy chosen, each discriminator in the discriminator group is trained independently without interfering with others. The training objective is to... The generator is trained based on feedback from the discriminator group. Compared to a single discriminator, the gradients provided by the discriminator group are smoother, which is more conducive to stable model training. A weighted averaging strategy is used to integrate multiple discriminators to weaken the inhibitory effect of the discriminators on the generator. The specific formula is as follows:
[0095]
[0096] Among them, AM soft Let represent the Pythagorean mean function; λ represents the parameters of the Pythagorean mean function, and λ = 0; w i Let represent the weight coefficient corresponding to the i-th discriminator, and D i D represents the i-th discriminator; j V(D) represents the j-th discriminator; i Let V(D,G) denote the loss function of the generative adversarial network, and let V(D,G) denote the loss function of the generative adversarial network. i ,G)<0.
[0097] This embodiment uses training set D. train The multi-discriminator generative adversarial network was trained for 3000 epochs using RMSprop optimizer with a learning rate of 0.00003 and a batch size of 256. The multi-discriminator generative adversarial network has now completed training.
[0098] S303. Use the trained multi-discriminator generative adversarial network (GAN) to guide the training of the encoder and base modules. Keep the GAN parameters unchanged and only update the encoder and base module parameters. The training set used is also D. train .
[0099] The key to the effectiveness of the MARGAN model lies in whether the basis vector memory learns a basis within the linear space containing the benign samples. According to relevant theorems in matrix theory, the basis of a finite-dimensional linear space is equivalent to the maximal linearly independent set of that space. Therefore, if the rank of the matrix can be restricted to approach a full-rank matrix, the basis vector memory can be prompted to fit the basis of the linear space. Thus, a rank loss function is defined to guide the training of the basis modules, with the specific formula as follows:
[0100] L rank =N-rank(BVM)
[0101] Among them, L rank Let N denote the rank loss function, N denote the linear space dimension, rank denote the rank of the matrix, and BVM denote the basis vector memory.
[0102] Furthermore, with the decoder parameters fixed, it is necessary to ensure that the encoder and basis modules map the image data to a latent representation that best matches the benign samples, in order to reduce the deviation between benign samples and reconstructed samples. Therefore, an image loss function is defined to guide the model to reduce the difference between benign samples and reconstructed samples at the image level. The specific formula is as follows:
[0103]
[0104] Among them, L image Denotes the image loss function, ||·|| 2 This represents the sum of squares of pixel differences, where n represents the number of pixels and x represents a benign sample. This indicates a reconstructed sample.
[0105] Image loss functions reduce the difference between benign and reconstructed samples at the pixel level; however, this alone is insufficient to minimize the deviation between them because it focuses only on visual similarity while ignoring feature differences. Therefore, a solution is adopted: a discriminator is used to calculate statistical information between the real and reconstructed images, and reducing the difference in statistical information is used as one of the training objectives of the model. This method is an improvement on feature matching techniques. Finally, a feature loss function is defined to guide the model to reduce the difference between benign and reconstructed samples in the feature space, with the specific formula as follows:
[0106]
[0107] Among them, L feature Let f represent the feature loss function. i (·) represents the intermediate layer output of a single discriminator in the i-th discriminator group, n d This indicates the output feature dimension, and max(·) indicates that the maximum value is returned.
[0108] In summary, the loss function used for training the encoder and base modules is as follows:
[0109] L(x) = k1·L rank +k2·L image (x)+k3·L feature (x)
[0110] Where L represents the loss function, and k1, k2 and k3 represent weighting factors.
[0111] Using training set D train The encoder and base module were trained for 1000 epochs using the Adam optimizer, with a learning rate of 0.0001 and a batch size of 256. The weight factors k1, k2, and k3 were set to 1, 1, and 0.01, respectively. At this point, the encoder and base module training was complete.
[0112] The anomaly detection module is used to input samples from the test set into the MARGAN model for detection. The model assesses the anomaly score based on the degree of deviation between the sample to be detected and the training set samples. If the deviation is large, i.e., the anomaly score is higher than a set threshold, the sample to be detected is determined to be malignant; if the deviation is small, i.e., the anomaly score is lower than the set threshold, the sample to be detected is determined to be benign. Specifically:
[0113] S401, such as Figure 3 As shown, after inputting the test set samples into the MARGAN model, the encoder maps the high-dimensional image data into a low-dimensional representation in the latent space, obtaining the latent representation. The specific formula is as follows:
[0114] z = E(y; θ) E )
[0115] Where z is the latent representation, θ E Here are the encoder parameters, and y represents the test set samples.
[0116] S402, such as Figure 4 As shown, the basis module reconstructs the latent representation into a linear representation under the basis based on the information stored in the basis vector memory. The combination coefficients are the coordinates of the given input under that basis. Since the fitted basis is only for the distribution space of benign samples, the model has a smaller bias when reconstructing benign samples, but a larger bias when reconstructing malignant samples. Finally, benign and malignant samples are distinguished by the degree of bias. The specific sub-steps are as follows:
[0117] S4021. Assume that any basis vector in the linear space containing the test set samples contains N basis vectors of dimension N. Then the basis vector storage is a block matrix BVM∈R. N×N BVM i Let be the i-th column of BVM, representing a basis vector, where bvm i , Construct matrix E∈RN×N The specific formula for storing a set of natural bases in an N-dimensional linear space is as follows:
[0118]
[0119] Among them, (e1,e2,...,e n ) represents a natural radical.
[0120] S4022, Construct another matrix T∈R N×N As the transition matrix from the natural basis to the new basis, the basis transformation process is as follows:
[0121] (bvm1,bvm2,...,bvm n )=(e1,e2,...,e n )T
[0122] Among them, (bvm1,bvm2,...,bvm n ) indicates a new base.
[0123] S4023, Define column vector c∈R N Record the coordinates of the latent representation under the natural basis, expressed as:
[0124] z = (e1, e2, ..., e n )c
[0125] S4024. The latent representation is a linear representation under the new basis, and the specific formula is as follows:
[0126]
[0127] in, This represents the potential representation of a linear representation under the new basis.
[0128] Seek The final reconstruction result is:
[0129]
[0130] in, This indicates the final reconstruction result.
[0131] In summary, under ideal conditions, the process of the basis module reconstructing the latent representation of normal data should be equivalent to the identity mapping. However, when the input is a latent representation of anomalous data, the basis module forcibly reconstructs it into a latent representation of approximately normal data, thereby increasing the reconstruction bias.
[0132] S403, such as Figure 5 As shown, the multi-discriminator generative adversarial network remaps the low-dimensional representation back to the image space to obtain reconstructed data samples. The specific formula is as follows:
[0133]
[0134] Where, θ G Indicates generator parameters, G represents the final reconstruction result after the base module, and G(·) represents the decoding process. This indicates a reconstructed data sample.
[0135] Generative Adversarial Networks (GANs) have garnered widespread attention since their inception, with scholars not only applying the model but also striving to improve it. WGAN is one of the more prominent examples of such improvement. Training a GAN can be understood as optimizing the probability distribution differences between real and generated samples. Early methods often used JS divergence or KL divergence as metrics for these differences, but both exhibit abrupt changes and cannot stably provide gradients during training, leading to instability in early GAN training. This problem was completely solved with the advent of WGAN. Specifically, it employs a smoother Wasserstein distance metric to measure distribution differences and optimizes these differences under Lipschitz constraints. This improvement has resulted in significantly more stable GAN training compared to its predecessors.
[0136] S404. The degree of deviation between the test set samples and the reconstructed data samples is evaluated, and the evaluation result is used as the anomaly score of the sample to be detected. The specific formula is as follows:
[0137] A(y) = k2·L image (y)+k3·L feature (y)
[0138] Where A(y) represents the outlier score.
[0139] S405. Calculate the outlier scores of all samples to be detected to obtain an outlier score set. Normalize the outlier score set using the feature scaling formula to obtain a new outlier score set. The specific formula is as follows:
[0140]
[0141] S′={s′ k ,x∈D test}
[0142] Among them, s′ k Let S represent the normalized outlier scores; let S represent the set of outlier scores, and S = {s} k :A(x),x∈D test S′ represents the new set of abnormal scores, where all items are distributed in the interval [0,1]; S k This represents the abnormal score of the k-th sample to be detected in the abnormal score set.
[0143] S403. Define a threshold φ = 0.0093 as a reference, and compare the scores in S′ with φ one by one. If s′ k If the value is greater than φ, the corresponding sample is marked as malignant; otherwise, it is marked as benign. This method is used to detect D. test Malignant lung nodule samples.
[0144] Figure 6 To visualize the basis vectors in this embodiment of the invention, the basis vector elements in the BVM are randomly sampled. The sampled elements are then input into a generator for decoding. Finally, the generator produces an image based on the input basis vector elements, and the resulting image is the visualization result of the corresponding basis vector elements. Experimental results are as follows: Figure 6 As shown.
[0145] Figure 6 Figure 'a' shows a benign lung nodule sample (i.e., a training sample). Figure 6 'b' represents the decoded result of randomly sampled basis vector elements. Figure 6 It can be seen that although the decoded basis vector elements are relatively blurry, their general outlines are quite similar to those of lung nodule samples. Moreover, their shape and size seem to be closer to those of benign lung nodule samples. This result is consistent with the design concept of the base module.
[0146] Figure 7 To illustrate the visualization results of sample reconstruction in this invention, the present invention visualizes the sample reconstruction process of the MARGAN model, including one example each of benign and malignant lung nodules. Figure 7 'a' represents a benign sample reconstruction process. Figure 7 b represents the process of reconstructing malignant samples.
[0147] Depend on Figure 7 As can be seen from 'a', the image reconstructed from the model of a benign pulmonary nodule sample has little deviation from the original sample. Although there are differences in details, they are still largely similar in terms of overall outline and shape. Conversely, Figure 7 The reconstructed image obtained from the malignant pulmonary nodule sample (b) differs significantly from the original sample in terms of detail, contour, shape, and size. In summary, the reconstruction bias of malignant pulmonary nodule samples is much larger than that of benign pulmonary nodule samples. This is because the test samples are reconstructed based on elements stored in the basis vector memory, where the data is highly correlated with that of benign pulmonary nodule samples. Therefore, benign pulmonary nodule samples remain roughly similar before and after reconstruction, while malignant pulmonary nodule samples are reconstructed as approximately benign, resulting in a larger bias. This experiment further demonstrates the effectiveness of the MARGAN model.
[0148] Table 1 Figure 8The results show the performance comparison between the MARGAN model and other models, with AUC as the evaluation metric. AUC directly evaluates model performance; a higher value indicates better performance. This embodiment selects five models: AE, f-AnoGAN, MemAE, MDGAN, and EM-MDWGAN, all using reconstruction as the detection method. To avoid interference from other factors in the experimental design, this paper sets the network architecture, data, and other details to be identical. Under these conditions, model performance is determined by the algorithm's underlying principles and is unrelated to experimental details.
[0149] Table 1 Experimental results for each model
[0150]
[0151]
[0152] From Table 1, Figure 8 As can be seen, due to the limitations of the experimental dataset, the AUC values of the various models are not significantly different. Even so, the AUC value of the MARGAN model is still significantly higher than that of the other models, which proves that the performance of the MARGAN model on the dataset of this invention is better than that of the above models.
[0153] Figure 9 To illustrate the visualization results of sample reconstruction in this embodiment of the invention and other methods, one example each of benign and malignant lung nodules are provided. Figure 9 'a' represents a benign sample reconstruction process. Figure 9 b represents the process of reconstructing malicious samples. (By...) Figure 9 As can be seen from 'a', the ability of each model to reconstruct benign samples is roughly the same, and the reconstructed samples are all quite similar to the original samples. Conversely, Figure 9 Regarding b, the ability of each model to reconstruct malignant samples varies greatly. The AE and MemAE models are extremely strong at reconstructing malignant samples, but the reconstructed samples are too similar to the original samples, making detection difficult. The f-AnoGAN and MDGAN models, on the other hand, perform relatively well, producing samples that are significantly different from the original samples and are easier to detect. The MARGAN model shows the best detection performance, as the samples reconstructed by the MARGAN model show the most significant differences from the original samples and are very easy to detect. Furthermore, while the EM-MDWGAN model's ability to reconstruct malignant samples is significantly weaker than the MemAE model, the MemAE model's detection performance is inferior to the MARGAN model.
[0154] In summary, for the dataset of this invention, the MARGAN model outperforms all the aforementioned comparative models.
[0155] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An unsupervised diagnostic system for malignant pulmonary nodules based on reconstruction and multi-adversarial training, characterized in that, include: The lung nodule extraction module is used to segment the lung parenchyma from the original lung CT image, extract the lung nodules in the lung parenchyma, and store them as images of the appropriate size. The dataset construction module is used to divide the obtained lung nodule images into a training set and a test set. The data in the training set consists of benign nodules, while the test set consists of half benign and half malignant nodules. The model training module is used to build the MARGAN model and train it using samples from the training set; specifically: S301. Model Construction: The MARGAN model mainly consists of three components: encoder, base module, and multi-discriminator generative adversarial network. The encoder is used to reduce the dimensionality of the input data to obtain the latent representation; the basis module contains a basis vector memory and related coordinate transformation operators, which are used to fit the basis of the linear space where the training set samples are located, and reconstruct the latent representation into a linear representation under the basis; the multi-discriminator generative adversarial network is used to remap the linear representation back to the image space to obtain the reconstructed data, and to calculate the statistical information of the input data and the reconstructed data. S302. In a multi-discriminator generative adversarial network, each discriminator in the discriminator group is trained individually, with the training objective being: ; The multi-discriminator generative adversarial network is trained separately using benign samples, with the training objective being: ; in, Each represents a single discriminator in the discriminator group, and G represents the generator. Represents the loss function. This represents the discriminator group integration strategy, where T represents the total number of discriminators; A weighted averaging strategy is used to integrate multiple discriminators, with the specific formula as follows: ; in, Represents the Pythagorean mean function; Let represent the parameters of the Pythagorean mean function, and ; Let represent the weight coefficient corresponding to the i-th discriminator, and ;D i D represents the i-th discriminator; j This represents the j-th discriminator; Let represent the loss function of a generative adversarial network, and ; The multi-discriminator generative adversarial network was trained for epoch_1 rounds using the training set. The optimizer used during this period was optimizer_1, with a learning rate of lr_1 and a batch size of batch_size_1, respectively. S303. Use the trained multi-discriminator generative adversarial network to guide the training of the encoder and base modules. Keep the parameters of the multi-discriminator generative adversarial network unchanged, and only update the parameters of the encoder and base modules using the training set. The rank loss function is defined to guide the training of basis modules, and the specific formula is as follows: ; Among them, L rank Represents the rank loss function. Represents the dimension of a linear space. The rank of the matrix is represented by , and BVM stands for basis vector memory. The image loss function is defined to guide the model to reduce the difference between benign samples and reconstructed samples at the image level. The specific formula is as follows: ; Among them, L image Represents the image loss function. This represents the sum of squares of the pixel differences. Indicates the number of pixels. Indicates a benign sample. Indicates the reconstructed sample; The discriminator is used to calculate statistical information between the real and reconstructed images, and reducing the difference in statistical information is one of the training objectives of the model. A feature loss function is defined to guide the model to reduce the difference between benign samples and reconstructed samples in the feature space. The specific formula is as follows: ; Among them, L feature Represents the feature loss function, This represents the intermediate layer output of a single discriminator in the i-th discriminator group. Indicates the output feature dimension. This indicates that the maximum value should be returned. In summary, the loss function used for training the encoder and base modules is as follows: ; Where L represents the loss function, , and Indicates the weighting factor; The encoder and base module are trained for epoch_2 rounds using the training set. The optimizer used is optimizer_2, and the learning rate and batch size are lr_2 and batch_size_2, respectively. The anomaly detection module is used to input samples from the test set into the MARGAN model for detection. The model will evaluate the anomaly score based on the degree of deviation between the sample to be detected and the samples in the training set. If the deviation is large, that is, the anomaly score is higher than the set threshold, the sample to be detected is judged as malignant; if the deviation is small, that is, the anomaly score is lower than the set threshold, the sample to be detected is judged as benign.
2. The unsupervised pulmonary nodule malignancy diagnosis system based on reconstruction and multi-adversarial training according to claim 1, characterized in that, In the lung nodule extraction module, obtaining experimental data includes the following sub-steps: S101. Convert the original lung CT image to JPG format; S102. Use threshold segmentation to segment the lung parenchyma from the original lung CT image; S103. After the lung parenchyma is segmented, the lung nodules in the lung parenchyma are extracted according to the nodule location information and malignancy degree recorded in the annotation file, and stored as images of the corresponding size as the final experimental data.
3. The unsupervised pulmonary nodule malignancy diagnosis system based on reconstruction and multi-adversarial training according to claim 1, characterized in that, In the dataset building module, the division of the training set and the test set includes the following: Benign lung nodules were designated as normal data, and malignant lung nodules as abnormal data. A training set was constructed using several images of benign lung nodules, without accompanying labels. A test set was constructed using several benign lung nodule images (different from the training set) and an equal number of malignant lung nodule images, with accompanying labels. The label information is as follows: 0 indicates a benign lung nodule, and 1 indicates a malignant lung nodule.
4. The unsupervised pulmonary nodule malignancy diagnosis system based on reconstruction and multi-adversarial training according to claim 1, characterized in that, The anomaly detection module performs anomaly detection on the sample to be detected, which includes the following sub-steps: S401. After inputting the test set samples into the MARGAN model, the encoder maps the high-dimensional image data into a low-dimensional representation in the latent space, obtaining the latent representation. The specific formula is as follows: ; Where z is the latent representation, For encoder parameters, This represents the test set samples; S402. The basis module reconstructs the latent representation into a linear representation under the basis based on the information stored in the basis vector memory, and the combination coefficients are the coordinates of the given input under the basis. S403, the multi-discriminator generative adversarial network remaps the low-dimensional representation back to the image space to obtain reconstructed data samples. The specific formula is as follows: ; in, Indicates generator parameters, This represents the final reconstruction result after the base module. Indicates the decoding process. This represents a reconstructed data sample; S404. The degree of deviation between the test set samples and the reconstructed data samples is evaluated, and the evaluation result is used as the anomaly score of the sample to be detected. The specific formula is as follows: ; in, Indicates anomaly scores; S405. Calculate the outlier scores of all samples to be detected to obtain the outlier score set. The anomaly score set is normalized using a feature scaling formula to obtain a new anomaly score set. The specific formula is as follows: ; ; in, This represents the outlier score after normalization; S represents the new set of anomaly scores; k This represents the anomaly score of the k-th sample to be detected in the set of anomaly scores; S406, Define threshold As a reference, The scores contained herein and Compare them one by one, if If the result is positive, the corresponding sample will be marked as malignant; otherwise, it will be marked as benign. This method detects malignant lung nodule samples in the test set.
5. The unsupervised pulmonary nodule malignancy diagnosis system based on reconstruction and multi-adversarial training according to claim 4, characterized in that, In step S402, the base module is configured to perform the following actions: S4021. Assume that any basis within the linear space containing the test set samples contains... Each dimension is If the basis vectors are given, then the basis vector memory is a square matrix. , for The Column is a basis vector, and Constructing a matrix For storage A set of natural bases in a linear space, specifically formulated as follows: ; in, Indicates natural radical; S4022, Construct a matrix separately As the transition matrix from the natural basis to the new basis, the basis transformation process is as follows: ; in, Indicates a new base; S4023, Define column vectors Record the coordinates of the latent representation under the natural basis, expressed as: ; S4024. The latent representation is a linear representation under the new basis, and the specific formula is as follows: ; in, The latent representation represents the linear representation under the new basis; Seek The final reconstruction result is: ; in, This indicates the final reconstruction result.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it performs the steps of any one of claims 1 to 5.
7. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to perform the actions described in any one of claims 1 to 5.
