A lightweight lung image classification method based on capsule network improvement

By employing a lightweight lung image classification method based on capsule networks, this method utilizes modules for large-kernel depthwise separable convolution, region of interest extraction, and grouped convolution feature extraction, combined with capsule network modules, to solve the problems of low computational efficiency and poor energy efficiency in lung image classification using deep learning models, thus achieving efficient and accurate lung image classification.

CN117671382BActive Publication Date: 2026-11-27CHONGQING JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311710459.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-13
Publication Date
2026-11-27
Estimated Expiration
2043-12-13

AI Technical Summary

Technical Problem

Existing deep learning models suffer from low computational efficiency and poor energy efficiency in lung image classification, making it difficult to balance classification speed and accuracy.

Method used

A lightweight lung image classification method based on capsule network improvement is adopted. By using a large kernel depth separable convolution module, a region of interest extraction module, a grouped convolution feature extraction module, and a capsule network module, the number of parameters and computational cost are reduced, while more feature information is extracted, thereby improving the model's expressive power and generalization performance.

Benefits of technology

It achieves lung image classification with low parameter and computational requirements, improves the accuracy and efficiency of classification processing, and solves the problems of low computational efficiency and poor energy efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117671382B_ABST
    Figure CN117671382B_ABST
Patent Text Reader

Abstract

The application discloses a kind of lightweight lung image classification methods based on capsule network improvement, which is classified with the aid of lightweight lung image classification network model to lung image and obtains classification recognition result;The lightweight lung image classification network model includes large core depth separable convolution module, region of interest extraction module, grouping convolution feature extraction module and capsule network module, with the aid of large core depth separable convolution module, while reducing a large number of parameter quantity and amount of calculation, more preliminary feature information is extracted;With the aid of region of interest extraction module, the calculation complexity and parameter quantity of the model are further reduced, and the region of interest in the lung image is accurately extracted;Local region feature extraction of region of interest is carried out through grouping convolution feature extraction module, to improve the expression ability and generalization performance of the model;Finally, the classification result is identified with the aid of capsule network module.The method has the advantages of low parameter quantity and amount of calculation, high classification accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of deep learning technology and image classification technology, specifically to a lightweight lung image classification method based on capsule network improvement. Background Technology

[0002] The application of computer image processing technology to assist in the diagnosis of lung diseases is becoming increasingly widespread. In these applications, in order to provide doctors with reliable diagnostic data and facilitate early detection and treatment of patients' conditions, it is usually necessary to classify and identify different organ regions or lesion regions in lung images to assist doctors in making preliminary judgments about organ lesions. Therefore, classification processing of lung images is needed to classify and identify different organ regions or lesion regions in lung images.

[0003] Deep learning is a machine learning method designed to solve complex tasks by mimicking the neural network structure of the human brain. It learns multi-layered abstract representations of data through stacked neural networks to identify patterns and features. Deep learning has achieved breakthroughs in numerous fields, including computer vision, natural language processing, and speech recognition.

[0004] Convolutional neural networks (CNNs) are a special type of neural network specifically designed to process data with a grid-like structure, such as images. They use convolutional and pooling layers to automatically extract features from images and fully connected layers to achieve classification. CNNs excel in tasks such as image recognition, object detection, and semantic segmentation, and have become a primary tool in the field of computer vision.

[0005] Capsule networks are a type of capsule-based neural network architecture designed to overcome some limitations of traditional convolutional neural networks. They capture the spatial hierarchy of objects by grouping input features and associating them with specific capsules. Capsule networks excel at handling visual object rotation, deformation, and spatial relationships, and are expected to become an important technology in image recognition.

[0006] Lightweighting refers to optimizing the size and computational complexity of neural network models to enable efficient operation on embedded, mobile, and edge devices. Lightweighting techniques include model compression, model quantization, network pruning, and designing more lightweight network structures. It aims to improve inference speed and save computational resources to meet the performance requirements of practical applications.

[0007] Although deep learning has achieved great success in various computer vision and natural language processing tasks, there are still some challenges and areas for improvement in terms of lightweighting.

[0008] 1. Computational Resource Consumption: Deep learning models typically require substantial computational resources for training and inference, posing a challenge for embedded, mobile, and edge devices. These devices often have limited computing power and storage space, making it difficult to efficiently run large deep learning models.

[0009] 2. Model Size: Most deep learning models require a significant amount of storage space during deployment, which is impractical for resource-constrained applications. Therefore, reducing model size has become an important goal for improving the lightweight performance of deep learning models.

[0010] 3. Energy efficiency: Large deep learning models often consume a lot of energy, which can lead to device overheating and rapid battery depletion. This is a very important issue in applications that require long-term operation.

[0011] While significant progress has been made in the application of deep learning for lung image classification, there is still considerable room for improvement in terms of lightweight design. Therefore, research on lung image classification technology will focus on improving the computational efficiency and energy efficiency of deep learning models, while simultaneously enhancing both processing speed and accuracy for lung image classification, to better adapt to application scenarios with varying resource conditions. Summary of the Invention

[0012] To address the shortcomings of the existing technologies, this invention provides a lightweight lung image classification method based on capsule network improvement, which solves the problems of low computational efficiency, poor energy efficiency, and difficulty in balancing classification speed and accuracy in existing lung image classification methods.

[0013] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0014] A lightweight lung image classification method based on capsule network improvement is proposed. The lung image to be processed is acquired and input into a pre-trained lightweight lung image classification network model to obtain the classification and recognition results of different local region features in the lung image to be processed.

[0015] The lightweight lung image classification network model includes a large-kernel depthwise separable convolution module, a region of interest (ROI) extraction module, a grouped convolutional feature extraction module, and a capsule network module. The large-kernel depthwise separable convolution module is used to extract preliminary features of the lung image. The ROI extraction module is used to perform dimensionality reduction and feature enhancement processing on the preliminary features of the lung image and extract the ROI from the lung image. The grouped convolutional feature extraction module is used to extract local region features from the ROI in the lung image to obtain a local region distribution feature map of the lung image. The capsule network module is used to extract edge texture features and calculate spatial pose information for each local region feature in the local region distribution feature map of the lung image, thereby determining the target category of each local region feature and obtaining the classification and recognition results of different local region features in the lung image to be processed.

[0016] Preferably, the large kernel depth-separable convolution module includes a large kernel convolution unit and a pointwise convolution unit; the large kernel convolution unit is used to extract the low-level features of the lung image; the pointwise convolution unit is used to perform fusion enhancement processing on the low-level features of the lung image to obtain the preliminary features of the lung image.

[0017] Preferably, the region of interest extraction module includes an adaptive max pooling unit, a convolutional kernel activation unit, and an ESE attention unit. The adaptive max pooling unit is used to perform dimensionality reduction processing on the preliminary features of the lung image to obtain dimensionality-reduced features. The convolutional kernel activation unit is used to enhance the dimensionality-reduced features of the lung image using convolutional kernels and the HardSigmoid activation function. The ESE attention unit is used to extract the region of interest from the enhanced dimensionality-reduced features to obtain the region of interest in the lung image.

[0018] Preferably, the grouped convolutional feature extraction module includes multiple grouped convolutional kernel units and fully connected units; different convolutional kernel units are used to extract features from different local regions of the region of interest in the lung image to obtain different local region features of the region of interest in the lung image; the fully connected units are used to connect and merge the local region features extracted by each different convolutional kernel unit to form a local region distribution feature map of the lung image.

[0019] Preferably, the capsule network module includes a main capsule unit, a digital capsule unit, and a decoding and classification unit. The main capsule unit is used to extract edge and texture features of each local region feature in the local region distribution feature map of the lung image, and encode them to form edge and texture feature encoding vectors of each local region feature. The digital capsule unit is used to calculate the spatial pose routing weights between each local region feature in the local region distribution feature map of the lung image through a dynamic routing algorithm, so as to characterize the spatial positional relationship and pose information between each local region feature, and to obtain the spatial pose vector of each local region feature by weighted summation of the edge and texture feature encoding vectors with spatial pose routing weights. The decoding and classification unit is used to compress and decode the spatial pose vectors of each local region feature in the lung image through a compression function, and to determine the target category of each local region feature according to the compression matrix obtained by compression and decoding, so as to obtain the classification and recognition results of different local region features in the lung image to be processed.

[0020] Preferably, the lightweight lung image classification network model is trained as follows: lung sample images with pre-labeled local region feature category labels are used as training samples to form a training sample set, which is then input into the lightweight lung image classification network model. The lightweight lung image classification network model processes the training samples to obtain the local region feature classification and recognition results. The training loss is calculated based on the local region feature classification and recognition results and local region feature category labels of the training samples, and the training loss is used to optimize the parameters of the lightweight lung image classification network model until the lightweight lung image classification network model converges, thus obtaining the trained lightweight lung image classification network model.

[0021] Preferably, in training a lightweight lung image classification network model, the training loss is calculated using the following formula:

[0022]

[0023] Where L is the overall loss function; T k It is the indicator function for the k-th category; if the k-th category identification result exists, then T... k =1, if the k-th classification result does not exist, then T k =0;m + Controlling the loss coefficient of the same category, m - Control the loss coefficients for different categories; v k The compressed matrix obtained by compressing and decoding the spatial pose vector output by the digital capsule corresponding to the k-th category, ||v k ||2 is the compression matrix v k The spectral norm; λ is a hyperparameter that balances the distances between capsules of the same and different classes.

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

[0025] This invention utilizes a lightweight lung image classification network model based on capsule networks to classify lung images, obtaining classification results for different local region features within the lung images. This lightweight lung image classification network model includes a large-kernel depthwise separable convolution module, a region of interest (ROI) extraction module, a grouped convolution feature extraction module, and a capsule network module. The large-kernel depthwise separable convolution module significantly reduces the number of parameters and computational cost while extracting more preliminary feature information. The ROI extraction module further reduces the model's computational complexity and number of parameters, accurately extracting the ROI from the lung images. The grouped convolution feature extraction module extracts local region features from the ROI, improving the model's expressive power and generalization performance. Finally, the capsule network module identifies the classification results. Experimental results demonstrate that this invention has low parameter and computational cost while exhibiting accurate classification results, effectively solving the problems of low computational efficiency, poor energy efficiency, and the difficulty in balancing classification speed and accuracy. Attached Figure Description

[0026] To make the objectives, technical solutions, and advantages of the invention clearer, the invention will now be described in further detail with reference to the accompanying drawings, wherein:

[0027] Figure 1 This is a schematic diagram of the network structure of the lightweight lung image classification network model in the method of the present invention.

[0028] Figure 2 This is a schematic diagram of the structure of a large-kernel depth separable convolutional module in a lightweight lung image classification network model. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but only to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0030] The terms "first," "second," and similar words used in the specification and claims of this patent application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, unless the context clearly indicates otherwise, the singular forms of "an," "a," or "the," etc., do not indicate a quantity limitation, but rather indicate the presence of at least one. Terms such as "comprising" or "including" mean that the element or object preceding "comprising" encompasses the features, integrals, steps, operations, elements, and / or components listed following "comprising" or "including," and do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; these relative positional relationships may change accordingly when the absolute position of the described object changes.

[0031] This invention provides a lightweight lung image classification method based on an improved capsule network. The method acquires a lung image to be processed, inputs it into a pre-trained lightweight lung image classification network model, and obtains classification and recognition results of different local region features in the lung image. A key improvement of this invention lies in the lightweight lung image classification network model based on an improved capsule network, such as... Figure 1 As shown, this lightweight lung image classification network model includes a large-kernel depthwise separable convolution module, a region of interest (ROI) extraction module, a grouped convolution feature extraction module, and a capsule network module. The large-kernel depthwise separable convolution module extracts preliminary features from the lung image. The ROI extraction module performs dimensionality reduction and feature enhancement on the preliminary features of the lung image and extracts the ROI from the lung image. The grouped convolution feature extraction module extracts local region features from the ROI in the lung image, obtaining a local region distribution feature map of the lung image. The capsule network module extracts edge texture features and calculates spatial pose information for each local region feature in the local region distribution feature map of the lung image, thereby determining the target category of each local region feature and obtaining the classification and recognition results of different local region features in the lung image to be processed.

[0032] The following is combined Figure 1 This paper provides a detailed explanation of a lightweight lung image classification network model. Figure 1 The main module terms involved are explained below:

[0033] LKDS combines large kernel convolution with depthwise separable convolution. In other words, the kernel of depthwise separable convolution is very large. For most tasks, the best results are achieved with kernel sizes of 21, 23, 25, and 27, which is task-dependent.

[0034] MaxPool: Adaptive max pooling.

[0035] CH: Conv kernel + HardSigmoid activation function.

[0036] ESE: Effective Squeeze and Extraction, attention mechanism.

[0037] 9xConv: Grouped convolution.

[0038] Flatten: Connects and merges to flatten.

[0039] PrimaryCaps: Main capsules.

[0040] DigitsCaps: Digital Capsules.

[0041] Squash: Squeeze function.

[0042] Output: The output result is a square matrix, where n represents the number of categories.

[0043] 1. Large Kernel Depthable Separable Convolutional Module (LKDS)

[0044] like Figure 2 As shown, the large kernel depth-separable convolution module includes a large kernel convolution unit (Part I) and a pointwise convolution unit (Part II). In the large kernel depth-separable convolution module of the present invention, the large kernel convolution unit is used to extract the low-level features of the lung image to expand the receptive field, and then the pointwise convolution unit is used to perform fusion enhancement processing on the low-level features of the lung image to obtain the preliminary features of the lung image.

[0045] Pointwise convolutional units are used to fuse and enhance low-level features of lung images, obtaining preliminary lung image features. Commonly used convolutional kernels in neural network convolutional layers are 3×3, 5×5, or 7×7. In practical applications, kernels larger than 9×9 are called large kernel convolutions (LKC). Existing research shows that the larger the convolutional kernel, the more image information is observed, and the better the feature learning. Compared to traditional convolution, the Large Kernel Depthwise Separable Convolutional (LKDS) module observes more feature information while significantly reducing the number of parameters and computational cost.

[0046] 2. Region of Interest Extraction Module

[0047] The region of interest (ROI) extraction module includes an adaptive max-pooling unit, a convolutional kernel activation unit, and an ESE attention unit. The adaptive max-pooling unit performs dimensionality reduction on the preliminary features of the lung image obtained from the Large Kernel Depth Separable Convolutional (LKDS) module, resulting in dimensionality-reduced features. The convolutional kernel activation unit enhances the dimensionality-reduced features of the lung image using convolutional kernels and the Hard Sigmoid activation function. Finally, the ESE attention unit extracts the ROI from the enhanced dimensionality-reduced features, obtaining the region of interest (ROI) in the lung image.

[0048] The advantages of the ESE attention mechanism (Effective Squeeze and Extraction) in lightweight lung image classification network models are mainly reflected in its ability to adaptively adjust the weights of channel features, enabling the model to focus more on important features while reducing the interference of irrelevant features, thereby improving the model's accuracy and generalization ability. In addition, the ESE attention mechanism is lightweight, which can effectively reduce the computational complexity and number of parameters of the model.

[0049] 3. Grouped Convolution Feature Extraction Module

[0050] The grouped convolutional feature extraction module includes multiple grouped convolutional kernel units and fully connected units. Different convolutional kernel units are used to extract features from different local regions of interest in the lung image, resulting in different local region features of the lung image. The fully connected units are used to connect and merge the local region features extracted by different convolutional kernel units to form a local region distribution feature map of the lung image.

[0051] Grouped convolution is a convolutional technique in deep learning that decomposes the traditional convolutional kernel into multiple smaller groups of kernels, each group responsible for extracting different aspects of the input features. This convolutional method significantly improves the efficiency and performance of the model, especially when handling large-scale datasets and complex tasks. Because grouped convolution decomposes the convolutional kernel into multiple smaller groups, it greatly reduces the number of model parameters, which not only reduces model complexity but also computational cost, thus improving efficiency. Simultaneously, grouped convolution divides the input features into multiple groups, each group being convolved by a smaller kernel. This approach allows for better extraction of different aspects of the input features, resulting in richer feature information. In the lightweight lung image classification network model of this invention, a grouped convolution feature extraction module is used to extract local region features from the regions of interest in lung images. Furthermore, while extracting features, grouped convolution also enables information exchange between different feature groups. This feature communication mechanism allows the network to better utilize the complementarity between low-level and high-level features, contributing to improved model expressive power and generalization performance.

[0052] 4. Capsule Network Module

[0053] The capsule network module includes a main capsule unit, a digital capsule unit, and a decoding and classification unit. The main capsule unit extracts edge and texture features from the local region distribution feature map of the lung image and encodes them to form edge and texture feature encoding vectors for each local region feature. The digital capsule unit calculates the spatial pose routing weights between local region features in the local region distribution feature map of the lung image using a dynamic routing algorithm. This weights represent the spatial positional relationships and pose information between the local region features. The digital capsule unit also calculates the spatial pose vectors of each local region feature by weighting and summing the edge and texture feature encoding vectors with the spatial pose routing weights. The decoding and classification unit compresses and decodes the spatial pose vectors of each local region feature in the lung image using a compression function. Based on the compression matrix obtained from the compression decoding, it determines the target category of each local region feature, thus obtaining the classification and recognition results of different local region features in the lung image to be processed.

[0054] In capsule networks, the master capsule unit and the digital capsule unit can be considered as coding units. The master capsule unit extracts the edge and texture features of each local region in the local region distribution feature map of the lung image, which can be represented by u. i For example, u1 represents a dark area feature in the left lobe region of the left lung region, u2 represents a bright area feature in the left lobe region of the left lung region, u1 represents a dark area feature in the right lobe region of the left lung region, ..., etc.; the main capsule unit also represents local region features u i Encode the edge texture feature to obtain its encoding vector. W ij Characterizes local region features u i In lung images, it is associated with another local region feature u j Spatial orientation and distance relationships between them, edge texture feature encoding vectors, etc. The direction represents the pose information of its features, and the edge texture feature encoding vector The spectral norm represents the probability of the feature's existence. The digital capsule unit then calculates the edge texture feature encoding vector for each local region using a dynamic routing algorithm. Spatial pose routing weights exist between them, denoted by c. ij The spatial pose routing weights are calculated by weighting and summing the edge texture feature encoding vectors with these weights, resulting in the spatial pose vector of the local region features. If there are n feature categories, then n spatial pose vectors s1, s2, ..., s2 are formed for local region features. nThe spatial attitude routing weight c is calculated using a dynamic routing algorithm. ij It can effectively characterize the features of a local region in a lung image. i With another local region feature u j The similarity in spatial orientation and posture between them; the higher the similarity, the higher the weight c. ij The larger the value, the better. Using dynamic routing algorithms allows different layers to communicate with each other, enabling better data transfer between network layers and improving time and space complexity.

[0055] The decoding and classification unit is mainly used for spatial pose vectors s j A nonlinear transformation is performed, using a squeezing function to ensure that short vectors shrink to almost zero length, while long vectors shrink to a length slightly less than 1, thereby reducing the spatial attitude vector s. j Compression decoding yields the corresponding compression matrix v j :

[0056]

[0057] Among them, ||s j || indicates the computation of the spatial attitude vector s j The spectral norm. Among them, The portion serves to scale the image. The part ensures that the vector direction does not change, and the compression matrix v j The modulus (spectral norm) is [0,1), and the compression matrix v j spectral norm ||v j The value of || represents the probability of detecting the corresponding local region features.

[0058] Therefore, the target category of each local region feature can be determined based on the compression matrix obtained from compression decoding, and the classification and recognition results of different local region features in the lung image to be processed can be obtained.

[0059] 5. Training of a lightweight lung image classification network model

[0060] The lightweight lung image classification network model is trained as follows: lung sample images with pre-labeled local region feature categories are used as training samples to form a training sample set, which is then input into the lightweight lung image classification network model. The lightweight lung image classification network model processes the training samples to obtain the local region feature classification and recognition results. The training loss is calculated based on the local region feature classification and recognition results and local region feature category labels of the training samples, and the parameters of the lightweight lung image classification network model are optimized based on the training loss until the lightweight lung image classification network model converges, resulting in the trained lightweight lung image classification network model.

[0061] In the traditional softmax loss function, each sample has only one correct class label. Therefore, this loss function often treats different samples within the same class as equivalent. In this case, if some samples appear in the test set that are different from those in the training set but still belong to a known class, the model may overfit or underfit, leading to a decrease in classification accuracy. Margin Loss introduces margin = {m + ,m - The parameters are used to mitigate overfitting or underfitting. In Margin Loss, each sample not only has a correct class label, but also a "valid region" within the margin, which is the range within which the model believes the sample can be correctly classified. This approach allows the model to focus more on the differences between different samples within the same class, thereby enhancing the model's generalization ability.

[0062] The original authors of the capsule network proposed a different loss function called "margin loss with reconstruction." This loss function combines "margin loss" and a reconstruction loss for simultaneously training the capsule network and a decoder. The form of the loss function is:

[0063]

[0064] Where L is the overall loss function, and k is the indicator function for class Tk, which is 1 if class k exists and 0 if it does not exist. + Controlling losses of the same category, m - Controlling different types of loss. k Let λ be the output vector of the k-th capsule, λ be a hyperparameter that balances the distance between capsules of the same and different classes, x and ^x be the input and reconstructed data respectively, and β be a hyperparameter that controls the weight of the reconstruction loss.

[0065] If the reconstruction loss from the original capsule network is used, the three fully connected layers not only introduce more parameters but also increase computational cost. To address the imbalanced positive and negative sample problem and effectively enhance the model's classification accuracy and recall while satisfying the output matrix of the backbone network, this invention proposes a spectral-norm-constrained margin loss (SN-Margin Loss), where the spectral norm is the compression matrix v. k The 2-norm, i.e., the compression matrix v k The maximum singular value. The loss function of the original capsule network is changed from the L2 norm of the vector to the compressed matrix v. k spectral norm ||v k2. Because after converting to a square matrix, the L2 norm of the original vector becomes the F-norm of the current square matrix, and the F-norm of a square matrix is ​​greater than or equal to its spectral norm. Therefore, the loss for the same category will increase, while the loss for different categories will decrease. The improved loss function, by increasing the loss for the same category, focuses more on the differences between categories, thus enhancing the discriminative ability within the same category and improving the model's classification accuracy; by reducing the loss for different categories, it makes the network focus more on the differences between different categories, thus reducing confusion between categories and improving the model's classification accuracy; simultaneously, it makes the model focus more on the differences between categories, thus improving the model's generalization ability and reducing the risk of overfitting. The improved training loss calculation formula is:

[0066]

[0067] Where L is the overall loss function; T k It is the indicator function for the k-th category; if the k-th category identification result exists, then T... k =1, if the k-th classification result does not exist, then T k =0;m + m controls the loss coefficient for the same category, while v controls the loss coefficient for different categories; k The compressed matrix obtained by compressing and decoding the spatial pose vector output by the digital capsule corresponding to the k-th category, ||v k ||2 is the compression matrix v k The spectral norm; λ is a hyperparameter that balances the distances between capsules of the same and different classes.

[0068] Where, if the correct label of the training sample is the k-th category, this means that the indicator function T in the loss function of the digital capsule output corresponding to the k-th category is... k The value is 1, and the rest are indicator functions T k- The value is 0, T k- This represents the indicator function in the loss function for the digital capsule output that is not in the k-th category.

[0069] When T k When T is 1, the coefficient of the right-hand side of the loss function in the training loss calculation formula is zero, meaning that the value of the loss function for the correct output term only includes the calculation of the left-hand side. Correspondingly, when T... k When the left coefficient is 0, the right coefficient is 1, and the value of the loss function for the erroneous output term only includes the calculation of the right term.

[0070] ||v k ||2 is the compression matrix v k The spectral norm, to some extent, represents the magnitude of the class probability; furthermore, a loss coefficient m controlling the class is pre-defined. + A loss coefficient m that controls different categories- This is used to measure whether the probability is appropriate; m + With ||v k The difference between ||2 and ||v|| gives the formula for the left-hand side, representing the probability of correctly outputting a term.||v|| k If ||2 is greater than this value, the loss is 0; the closer it is to this value, the smaller the loss. Similarly, let m... - With ||v k The difference between ||2 and ||v is the probability of an incorrect output term in the right-hand side of the formula. k If ||2 is less than this value, the loss is 0; the closer it is to this value, the smaller the loss. The right-hand side of the formula includes a hyperparameter λ to ensure numerical stability during training (the hyperparameter λ can be set to a fixed value of 0.5). The squares of these two terms are used to make the loss function conform to L2 regularization.

[0071] Example

[0072] In this embodiment, the input lung image is an RGB three-channel image. Its parameter count and computational complexity are related to the size of the input image. In deep learning, the width and height of the input image can be determined based on the specific application scenario and dataset requirements. The following example further illustrates the lightweight design:

[0073] Table 1: Case lung images displayed online.

[0074]

[0075] The method of this invention, along with some other network model algorithms in the prior art, was used to perform local feature category classification and recognition processing on lung images. Classification and recognition experiments with 2-class, 3-class, and 4-class classification were conducted on the lung image dataset. The experimental results are compared with those of other network models in the prior art, as shown in Table 2.

[0076] Table 2 Comparison of classification performance on lung image sets

[0077]

[0078] The comparison shows that the method of the present invention has the lowest number of parameters and computational cost, and exhibits better classification results, with an accuracy rate of 99.54% for 4-class classification, 99.6% for 3-class classification, and 99.86% for 2-class classification.

[0079] In summary, the method of this invention utilizes a lightweight lung image classification network model based on capsule networks to classify lung images, obtaining classification and recognition results for different local region features within the lung images. This lightweight lung image classification network model includes a large-kernel depthwise separable convolution module, a region of interest (ROI) extraction module, a grouped convolution feature extraction module, and a capsule network module. The large-kernel depthwise separable convolution module significantly reduces the number of parameters and computational load while extracting more preliminary feature information. The ROI extraction module further reduces the computational complexity and number of parameters of the model and accurately extracts the ROI from the lung images. The grouped convolution feature extraction module extracts local region features from the ROI, improving the model's expressive power and generalization performance. Finally, the capsule network module identifies the classification results. Experimental verification shows that the method of this invention has low parameter and computational load and exhibits accurate classification results, effectively solving the problems of low computational efficiency, poor energy efficiency, and the difficulty in balancing classification speed and accuracy.

[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit the technical solutions. Those skilled in the art should understand that any modifications or equivalent substitutions to the technical solutions of the present invention without departing from the spirit and scope of the present invention should be covered within the scope of the claims of the present invention.

Claims

1. A lightweight lung image classification method based on capsule networks, characterized in that, The lung image to be processed is acquired and input into a pre-trained lightweight lung image classification network model to obtain the classification and recognition results of different local region features in the lung image to be processed. The lightweight lung image classification network model includes a large kernel depthwise separable convolution module, a region of interest extraction module, a grouped convolution feature extraction module, and a capsule network module; The large kernel depth-separable convolution module is used to extract preliminary features of the lung image; the large kernel depth-separable convolution module includes a large kernel convolution unit and a pointwise convolution unit; the large kernel convolution unit is used to extract the low-level features of the lung image; the pointwise convolution unit is used to perform fusion enhancement processing on the low-level features of the lung image to obtain the preliminary features of the lung image. The region of interest extraction module is used to perform dimensionality reduction and feature enhancement processing on the preliminary features of the lung image, and to extract the region of interest in the lung image; the region of interest extraction module includes an adaptive max pooling unit, a convolutional kernel activation unit, and an ESE attention unit; The adaptive max pooling unit is used to reduce the dimensionality of the preliminary features of the lung image to obtain dimensionality-reduced features; The convolution kernel activation unit is used to enhance the dimensionality reduction features of the lung image using convolution kernels and the HardSigmoid activation function; the ESE attention unit is used to extract the region of interest from the enhanced dimensionality reduction features to obtain the region of interest in the lung image. The grouped convolutional feature extraction module is used to extract local region features from the region of interest in the lung image, resulting in a local region distribution feature map of the lung image. The grouped convolutional feature extraction module includes multiple grouped convolutional kernel units and fully connected units. Different convolutional kernel units are used to extract features from different local regions of the region of interest in the lung image, resulting in different local region features of the region of interest in the lung image. The fully connected units are used to connect and merge the local region features extracted by different convolutional kernel units to form a local region distribution feature map of the lung image. The capsule network module is used to extract edge texture features and calculate spatial pose information for each local region feature in the local region distribution feature map of the lung image, thereby determining the target category of each local region feature and obtaining the classification and recognition results of different local region features in the lung image to be processed. The capsule network module includes a main capsule unit, a digital capsule unit, and a decoding and classification unit. The main capsule unit is used to extract edge and texture features for each local region feature in the local region distribution feature map of the lung image and encode them to form edge texture feature encoding vectors for each local region feature. The digital capsule unit is used to calculate the spatial pose routing weights between each local region feature in the local region distribution feature map of the lung image through a dynamic routing algorithm, so as to characterize the spatial positional relationship and pose information between each local region feature, and to obtain the spatial pose vector of each local region feature by weighted summation of the edge texture feature encoding vectors with spatial pose routing weights. The decoding and classification unit is used to compress and decode the spatial pose vectors of each local region feature in the lung image through a compression function, and to determine the target category of each local region feature based on the compression matrix obtained by compression and decoding, thereby obtaining the classification and recognition results of different local region features in the lung image to be processed.

2. The lightweight lung image classification method based on capsule networks as described in claim 1, characterized in that, The lightweight lung image classification network model is trained in the following manner: Lung sample images with pre-labeled local region feature categories are used as training samples to form a training sample set. This set is then input into a lightweight lung image classification network model. The model processes the training samples to obtain the local region feature classification and recognition results. The training loss is calculated based on the local region feature classification and recognition results and the local region feature category labels. The parameters of the lightweight lung image classification network model are then optimized based on the training loss until the model converges, resulting in a trained lightweight lung image classification network model.

3. The lightweight lung image classification method based on capsule networks as described in claim 2, characterized in that, In training a lightweight lung image classification network model, the training loss is calculated using the following formula: Where 𝐿 is the overall loss function; 𝑇 𝑘 It is the indicator function for the k-th category. If the k-th category identification result exists, then 𝑇 𝑘 =1, if the k-th classification result does not exist, then 𝑇 𝑘 =0; 𝑚 + Controlling the loss coefficient of the same category, 𝑚 − Control the loss coefficients for different categories; The compression matrix is ​​obtained by compressing and decoding the spatial pose vector output by the digital capsule corresponding to the k-th category. For compression matrix The spectral norm; is a hyperparameter that balances the distances between capsules of the same and different classes.

Citation Information

Patent Citations

  • Identification and classification method for lung CT image

    CN112991269A

  • SAR image change detection method of capsule network based on attention mechanism

    CN113239895A