Medical hyperspectral image classification method of lightweight model based on improved CNN (Convolutional Neural Network)

By introducing deep separable convolution, KAN attention module and weight adaptive lightweight convolution into the CNN network, the problems of slow inference speed and difficulty in deployment caused by large parameters and calculations of traditional CNN models are solved, and efficient medical hyperspectral image classification is achieved.

CN119693715APending Publication Date: 2025-03-25KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411867892.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In medical hyperspectral image classification, traditional convolutional neural networks have large parameters and calculations, resulting in large models and slow inference speed, making it difficult to deploy and ensure classification accuracy.

Method used

A lightweight model based on improved CNN network is proposed. By introducing deep separation convolution, KAN spectral attention and spatial attention module, weight adaptive lightweight convolution and other technologies, the parameter quantity and calculation quantity are reduced, while improving feature extraction ability and classification accuracy.

Benefits of technology

It achieves the maintenance of high classification accuracy while reducing the amount of parameters and calculations, which can assist surgeons in quickly and accurately determining tumor boundaries and protecting normal tissues, making it suitable for real-time deployment and detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693715A_ABST
    Figure CN119693715A_ABST
Patent Text Reader

Abstract

The invention relates to a medical hyperspectral image classification method based on a lightweight model of an improved CNN network, and belongs to the technical field of hyperspectral image processing. The method comprises the following steps: firstly, carrying out black and white correction, wave band elimination, smooth dimensionality reduction and standardized preprocessing on a medical hyperspectral image data set, and then cutting a preprocessed medical hyperspectral image into overlapped 3D image blocks with a target category as a center; secondly, dividing a medical hyperspectral image data set into a training set, a verification set and a test set, constructing a lightweight architecture of an improved convolutional neural network, and learning spectral and spatial features; then, the learned features are input into a weight adaptive lightweight convolution module; and finally, a final classification result is obtained through Kolmogorov-Arnold Networks, and evaluation of classification precision is carried out in combination with an evaluation index and other models. According to the method, the parameter quantity and the calculation quantity of the model are reduced, meanwhile, accurate classification of the medical hyperspectral images can be achieved, and real-time detection can be carried out clinically.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a medical hyperspectral image classification method based on a lightweight model of an improved CNN network, and belongs to the technical field of hyperspectral image processing. Background Art

[0002] Hyperspectral images are images containing more than hundreds of spectral bands, covering the visible light, near infrared and short-wave infrared spectral ranges, and can record and observe the rich spectral features and spatial information of the scene. In recent years, medical hyperspectral images have the potential application value in diagnosis and image-guided surgery because of their non-contact and non-destructive characteristics, which can distinguish different types of tissues according to the composition of biological tissues. Especially in tumor resection, commonly used positioning methods mainly include computed tomography (CT), magnetic resonance imaging (MRI), ultrasound, and intraoperative fluorescence imaging. However, these methods have a long detection time and it is difficult to achieve real-time and accurate positioning. As a fast, non-contact, non-ionizing and highly safe imaging technology, hyperspectral imaging can improve images for surgeons without contrast agents or fluorescent agents, which meets the development needs of modern medical detection technology.

[0003] Traditional medical hyperspectral image classification methods usually extract features manually and then use machine learning classifiers for classification. However, this method has limitations in deep feature extraction and treats each pixel as an independent feature, ignoring the image spatial context information. In recent years, deep learning, as an end-to-end method that can effectively capture complex features in high-dimensional data, has begun to be applied to the field of medical hyperspectral image processing. Among them, convolutional neural networks (CNNs) are widely used in classification diagnosis tasks due to their excellent local feature extraction capabilities. Through convolution and pooling operations, convolutional neural networks can automatically learn and extract important features without manual design. This ability allows spectral and spatial information to be considered simultaneously when processing medical hyperspectral images, thereby improving the accuracy and robustness of classification diagnosis.

[0004] However, traditional convolutional neural networks usually contain a large number of parameters and computational complexity, resulting in large models and slow inference speed, which in turn makes them difficult to deploy. This poses a challenge to practical applications, especially in tumor resection surgery, where the composition of biological tissues in hyperspectral images needs to be inferred in real time to help surgeons accurately and quickly determine tumor boundaries and avoid loss of normal tissue. Therefore, in medical hyperspectral image classification and detection tasks, it is urgent to develop a more lightweight and efficient network architecture to achieve fast inference and deployment while maintaining high classification performance. Summary of the invention

[0005] The purpose of the present invention is to provide a medical hyperspectral image classification method based on a lightweight model of an improved CNN network, aiming to solve the technical problem that traditional convolutional neural networks contain a large number of parameters and calculations, resulting in a large model and slow inference speed, which in turn makes it difficult to deploy and ensure classification accuracy.

[0006] To achieve the above objectives, the present invention addresses the shortcomings of the prior art in the background technology and provides a medical hyperspectral image classification method based on a lightweight model of an improved CNN network. This method reduces the number of parameters and the amount of calculation while maintaining a high classification accuracy, and can assist surgeons in quickly and accurately determining tumor boundaries and protecting normal tissues during surgery.

[0007] The technical solution of the present invention is: a medical hyperspectral image classification method based on a lightweight model of an improved CNN network, firstly, the input hyperspectral image is preprocessed by black and white correction, band culling, smoothing dimensionality reduction and standardization; then the preprocessed hyperspectral image is cropped into an overlapped 3D image centered on the target category; then the data set is divided into a training set, a validation set and a test set; next, an improved lightweight architecture of a convolutional neural network is constructed to establish a hyperspectral image classification model; finally, the evaluation index is combined with other models for comparison to reflect the performance of the model of the present invention.

[0008] The specific steps are:

[0009] Step 1: Preprocess the hyperspectral image, including black and white correction, band removal, smoothing dimension reduction and standardization;

[0010] Step 2: Divide the preprocessed hyperspectral image into overlapping 3D blocks;

[0011] Step 3: Randomly divide the 3D blocks into training set, validation set and test set in proportion;

[0012] Step 4: Improve the traditional CNN network by introducing deep separable convolution to fuse channel information and reduce dimension, introduce KAN spectral attention and spatial attention modules to extract spectral and spatial information of feature maps, introduce weight adaptive lightweight convolution to optimize network structure and improve feature separation ability, use KAN module as output layer to generate classification results, use training set and validation set to train the lightweight model of improved CNN network, and build a hyperspectral image classification model;

[0013] Step 5: Use the test set to evaluate the constructed hyperspectral image classification model, calculate the evaluation indicators of the model on the test set, and complete the model evaluation.

[0014] The black and white correction, smoothing dimension reduction and standardization processing in Step 1 are specifically as follows:

[0015] In order to avoid the influence of external lighting conditions, spectral non-uniformity caused by insufficient lighting equipment, and dark current generated by the camera sensor, the original hyperspectral image is radiometrically corrected using a white reference image and a black reference image. The calculation formula for black and white correction is:

[0016]

[0017] in, is the rectified image, represents the original image, and They are white reference image and black reference image respectively;

[0018] In order to reduce the information redundancy between adjacent bands and reduce the dimension of spectral data, the hyperspectral image is spectrally averaged by spectral smoothing. The calculation formula for smoothing dimension reduction is:

[0019]

[0020] in, Indicates adjacent bands, represents the band after smoothing and dimensionality reduction, Represents the index of adjacent bands, represents the radius of the smoothing window, is the index of the current band;

[0021] In order to improve the stability and generalization of the model, the hyperspectral image is standardized. The calculation formula for the standardized processing is:

[0022]

[0023] in, is the normalized data point, is the original data point, is the mean value of the band data at the pixel point, is the standard deviation of the band data.

[0024] The band elimination specifically eliminates the noise spectral bands at both ends of the low signal-to-noise ratio, that is, the spectral bands between 400-450nm and 924-1000nm.

[0025] The 3D block in Step 2 is specifically:

[0026] Each 3D block uses neighboring pixels to form a new A 3D cube, where To select the block size, c is the total number of channels in the input feature map.

[0027] The Step 3 is specifically as follows:

[0028] The 3D image patches are randomly divided into 1% training set, 1% validation set and 98% test set.

[0029] The Step 4 is specifically as follows:

[0030] The introduction of deep separable convolution can effectively reduce the number of parameters and computational complexity of the model while retaining the key information of the image, thereby improving the computational efficiency and inference speed of the model; the introduction of Kolmogorov–Arnold Networks (KAN) spectral attention and spatial attention can help the model extract more refined features in different spectral bands, and further improve the classification accuracy by combining spatial information; the introduction of weight-adaptive lightweight convolution can improve the separation accuracy while reducing the number of parameters and computational complexity, and enable the model to obtain more feature representations while maintaining its lightweight, which can effectively improve the classification accuracy of hyperspectral images; the use of the KAN module as the output layer can help the model comprehensively evaluate the classification results through global information, thereby improving the robustness and accuracy of the classification.

[0031] Furthermore, the lightweight model of the improved CNN network is constructed using Python 3.8 language and Pytorch deep learning framework in Pycharm software;

[0032] Specifically:

[0033] Step 4.1: Input size is The 3D image block enters a depth-separable convolutional layer and obtains a size of The feature map of the depth separable convolution includes depth convolution and point-by-point convolution, and the calculation formula is as follows:

[0034]

[0035]

[0036] in, is the cth channel at position The value at is the first input feature map channels, is the convolution kernel The weights corresponding to the channels are represents the spatial coordinates of the convolution kernel, is the size of the convolution kernel in the convolution operation, is the output feature map at position The value at is the weight of the 1×1 convolution kernel, connecting the depth convolution output of c channels with the output channels, is the number of output channels of the depthwise separable convolution;

[0037] Step 4.2: Get The feature maps of are subjected to maximum pooling and average pooling operations respectively, and then the two pooling results are used as input and sent to the KAN network. The two output results obtained by the KAN network are then added together to obtain the spectral attention Finally, the results of the maximum pooling and average pooling operations are added together to obtain the spatial attention , this process is expressed as:

[0038]

[0039]

[0040] in, represents the Sigmoid function, and They are the maximum pooling operation and the average pooling operation, represents the input feature map, It is the KAN network;

[0041] Step 4.3: Input the new feature map with unchanged dimension into three consecutive weight-adaptive lightweight convolution modules. The weight-adaptive lightweight convolution consists of the following operations: The feature map is first obtained by a point-by-point convolution. , and then the feature map Perform group convolution to obtain feature maps , and finally introduce a learnable weight parameter , for the feature map and Multiply by the weight parameters (The initial value is set to 0.5), and then add them together to get the output feature map of the weight-adaptive lightweight convolution , the calculation formula of a weight-adaptive lightweight convolution is as follows:

[0042]

[0043]

[0044]

[0045] in, represents point-wise convolution, represents grouped convolution, represents the feature map input to the weight-adaptive lightweight convolution, Represents the feature map after point-by-point convolution, Represents the feature map after group convolution, is a learnable weight, represents the output of the weight-adaptive lightweight convolution, M, N, and L represent the height, width, and number of channels of the feature map, respectively; Indicates that Dimensional tensor space;

[0046] Step 4.4: The KAN module is based on the Kolmogorov-Arnold representation theorem to obtain the final classification probability. This module uses two layers of KAN, and the calculation of the first layer is:

[0047]

[0048] in, is the input feature of the first layer, is the KAN function matrix of the first layer, which contains the learnable activation function. is the output feature of the first layer;

[0049] The calculation of the second layer is:

[0050]

[0051] in, is the KAN function matrix of the second layer, which contains the learnable activation function. is the output feature of the second layer;

[0052] Finally, the output features of the second layer are transformed through the Softmax function. Convert to classification probability:

[0053]

[0054] in, is the classification probability distribution obtained by the Softmax function.

[0055] The Step 5 is specifically as follows:

[0056] The overall accuracy (OA), average accuracy (AA) and Kappa coefficient (KPP) of the model on the test set, as well as the model parameter quantity and calculation quantity indicators, among which OA reflects the proportion of the model correctly classified in all samples, AA reflects the average classification accuracy of each category, and KPP measures the consistency between the model prediction results and random predictions. The calculation formulas of the three indicators OA, AA and KPP are as follows:

[0057]

[0058]

[0059]

[0060]

[0061] TP represents a true positive example (the predicted result is a positive sample, and the actual sample is also a positive sample), TN represents a true negative example (the predicted result is a negative sample, and the actual sample is also a negative sample), FP represents a false positive example (the predicted result is a positive sample, and the actual sample is a negative sample), and FN represents a false negative example (the predicted result is a negative sample, and the actual sample is a positive sample). represents the probability of random consistency, that is, the probability that the model prediction result is consistent with the actual result under completely random guessing. It is used to measure the degree of match between the classification results caused by random reasons and the actual situation. It is the key part of calculating the Kappa coefficient. Kappa compares OA with To evaluate the predictive reliability of the model.

[0062] The beneficial effects of the present invention are as follows: for medical hyperspectral images, which are multidimensional data with rich spectral and spatial information, the present invention proposes an innovative lightweight CNN network framework. Compared with traditional CNN, this method can not only fully capture spectral and spatial information, but also achieve higher classification accuracy while reducing the number of parameters and calculations, thereby realizing real-time deployment and detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 It is a schematic diagram of the process of the present invention;

[0064] Figure 2 It is an architecture diagram of a lightweight model of an improved CNN network in an embodiment of the present invention;

[0065] Figure 3 is a schematic diagram of KAN spectral attention in an embodiment of the present invention;

[0066] Figure 4 is a schematic diagram of spatial attention in an embodiment of the present invention;

[0067] Figure 5 is a schematic diagram of an improved weight-adaptive lightweight convolution proposed in an embodiment of the present invention;

[0068] Figure 6 is a schematic diagram of the classification results of the 008-01 image on the In-Vivo human brain hyperspectral dataset using the method of the present invention;

[0069] Figure 7is a schematic diagram of the classification results of the 012-01 image on the In-Vivo human brain hyperspectral dataset using the method of the present invention;

[0070] Figure 8 It is a schematic diagram of the classification results of the 015-01 image on the In-Vivo human brain hyperspectral dataset using the method of the present invention. DETAILED DESCRIPTION

[0071] The present invention will be further described below in conjunction with the accompanying drawings and specific implementation methods.

[0072] Example 1: In this example, the medical hyperspectral image used is the In-Vivo human brain tumor hyperspectral dataset, and the acquisition system consists of a Hyperspec VNIR A-Series camera (HeadWallPhotonics Inc., Fitchburg, MA, USA), with a spectral range of 400-1000nm, a spectral resolution of 2-3nm, and can capture 826 spectral bands, with 1004 spatial pixels per row. Supported by the experience and knowledge of neurosurgeons, the pixels in each hyperspectral image are annotated, including four categories of normal tissue, tumor tissue, highly vascular tissue, and background.

[0073] Experimental platform used: All experiments were conducted on a computer equipped with an Intel Core i5-12600KF CPU, 32GB DDR4 memory, and a single Nvidia GeForce RTX 4060 Ti graphics card (16GB video memory). The software environment is Windows 11 operating system, Python 3.8, Pytorch 2.1.0, and CUDA 11.6.

[0074] like Figure 1 As shown, a medical hyperspectral image classification method based on a lightweight model of an improved CNN network includes the following steps:

[0075] Step 1: Preprocess the hyperspectral image, including black and white correction, band removal, smoothing dimension reduction and standardization;

[0076] Specifically, input the hyperspectral image, according to the formula The hyperspectral image data is corrected for black and white, where: is the rectified image, represents the original image, and They are white reference image and black reference image respectively; then the spectral bands between 400-450nm and 924-1000nm are eliminated; according to the formula Smooth dimension reduction is performed on the hyperspectral image data, where: Indicates adjacent bands, represents the band after smoothing and dimensionality reduction, Represents the index of adjacent bands, represents the radius of the smoothing window, is the index of the current band; then according to the formula The hyperspectral image data is standardized to obtain a standardized image, where: is the normalized data point, is the original data point, is the mean value of the band data at the pixel point, is the standard deviation of the band data.

[0077] Step 2: Divide the preprocessed hyperspectral image into overlapping 3D blocks;

[0078] Specifically, each 3D block uses neighboring pixels to form a new A 3D cube, where To select the block size, c is the total number of channels in the input feature map.

[0079] Step 3: Randomly divide the 3D blocks into training set, validation set and test set in proportion;

[0080] Specifically, the 3D image patches are randomly divided into 1% training set, 1% validation set and 98% test set.

[0081] Step 4: Improve the traditional CNN network by introducing deep separable convolution to fuse channel information and reduce dimension, introduce KAN spectral attention and spatial attention modules to extract spectral and spatial information of feature maps, introduce weight adaptive lightweight convolution to optimize network structure and improve feature separation ability, use KAN module as output layer to generate classification results, use training set and validation set to train the lightweight model of improved CNN network, and build a hyperspectral image classification model;

[0082] Specifically, the lightweight model of the improved CNN network is trained using the training set and the validation set to build a hyperspectral image classification model. The model network architecture is as follows: Figure 2 As shown in Figure 1, the network first passes through a deep separable convolutional layer to fuse channel information while reducing the dimension of the feature map; then, KAN spectral attention and spatial attention respectively extract the spectral and spatial features of the hyperspectral image, as shown in the schematic diagram Figure 3 and Figure 4As shown; then three weight-adaptive lightweight convolutions further extract features of the hyperspectral image, and in order to optimize information transfer, a residual connection is introduced between the first and last weight-adaptive lightweight convolution modules. The weight-adaptive lightweight convolution is as follows Figure 5 As shown in the figure, the key channel is enhanced by using an excitation module, which is mainly composed of two fully connected and one broadcast mechanism dot product to improve the feature expression ability of the network; finally, after passing through KAN, the final category probability and classification map are output. The lightweight model of the improved CNN network uses the cross entropy loss function, Adam optimizer, learning rate of 0.001, and training for 300 epochs. Further:

[0083] Step 4.1: Input size is The 3D image block enters a depth-separable convolutional layer and obtains a size of The feature map of the depth separable convolution includes depth convolution and point-by-point convolution, and the calculation formula is as follows:

[0084]

[0085]

[0086] in, is the cth channel at position The value at is the first input feature map channels, is the convolution kernel The weights corresponding to the channels are represents the spatial coordinates of the convolution kernel, is the size of the convolution kernel in the convolution operation, is the output feature map at position The value at is the weight of the 1×1 convolution kernel, connecting the depth convolution output of c channels with the output channels, is the number of output channels of the depthwise separable convolution;

[0087] Step 4.2: Get The feature maps of are subjected to maximum pooling and average pooling operations respectively, and then the two pooling results are used as input and sent to the KAN network. The two output results obtained by the KAN network are then added together to obtain the spectral attention Finally, the results of the maximum pooling and average pooling operations are added together to obtain the spatial attention , this process is expressed as:

[0088]

[0089]

[0090] in, represents the Sigmoid function, and They are the maximum pooling operation and the average pooling operation, represents the input feature map, It is the KAN network;

[0091] Step 4.3: Input the new feature map with unchanged dimension into three consecutive weight-adaptive lightweight convolution modules. The weight-adaptive lightweight convolution consists of the following operations: The feature map is first obtained by a point-by-point convolution. , and then the feature map Perform group convolution to obtain feature maps , and finally introduce a learnable weight parameter , for the feature map and Multiply by the weight parameters (The initial value is set to 0.5), and then add them together to get the output feature map of the weight-adaptive lightweight convolution The weight-adaptive lightweight convolution module maintains and exceeds the accuracy of traditional convolution while reducing parameters and computational complexity. The calculation formula for a weight-adaptive lightweight convolution is as follows:

[0092]

[0093]

[0094]

[0095] in, represents point-wise convolution, represents grouped convolution, represents the feature map input to the weight-adaptive lightweight convolution, Represents the feature map after point-by-point convolution, Represents the feature map after group convolution, is a learnable weight, represents the output of the weight-adaptive lightweight convolution, M, N, and L represent the height, width, and number of channels of the feature map, respectively; Indicates that Dimensional tensor space;

[0096] Step 4.4: The KAN module is based on the Kolmogorov-Arnold representation theorem to obtain the final classification probability. This module uses two layers of KAN, and the calculation of the first layer is:

[0097]

[0098] in, is the input feature of the first layer, is the KAN function matrix of the first layer, which contains the learnable activation function. is the output feature of the first layer;

[0099] The calculation of the second layer is:

[0100]

[0101] in, is the KAN function matrix of the second layer, which contains the learnable activation function. is the output feature of the second layer;

[0102] Finally, the output features of the second layer are transformed through the Softmax function. Convert to classification probability:

[0103]

[0104] in, is the classification probability distribution obtained by the Softmax function.

[0105] Step 5: Use the test set to evaluate the constructed hyperspectral image classification model, calculate the evaluation indicators of the model on the test set, and complete the model evaluation.

[0106] Specifically, the OA, AA and KPP of the model on the test set are calculated and compared with other methods. The larger the values ​​of the OA, AA and KPP evaluation indicators, the better the classification effect. In addition, the parameter quantity (Params) and the computational cost (MACs) of each model are calculated to verify the practicality of the proposed method. Table 1 shows the various evaluation indicators of the three data sets of 008-01 images, 012-01 images and 015-01 images on the In-Vivo human brain hyperspectral dataset. The three methods of Residual Spectral-Spatial Attention Network (RSSAN), Spectral-spatial attention network (SSAN) and Ghostnet are selected as comparisons for the method of the present invention. It can be seen from Table 1 that the present invention has achieved the highest accuracy in the classification of OA, AA and KPP indicators, and has the lowest requirements on Params and MACs, which can realize the convenience and real-time performance of model classification detection. The classification results are shown in the figure. Figure 6 , Figure 7 and Figure 8 As shown, the leftmost is a real human brain hyperspectral image, the middle is the actual image, and the rightmost is the predicted image. It can be seen from the figure that the classification result image of the present invention can accurately and quickly determine the actual area of ​​the tumor to assist surgical medicine in determining the tumor boundary.

[0107] Table 1 Classification performance of the present invention on various In-Vivo datasets

[0108]

[0109] The specific implementation methods of the method of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above examples. Various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.

Claims

1. A medical hyperspectral image classification method based on a lightweight model of an improved CNN network, characterized in that: The following steps are involved: Step 1: Preprocess the hyperspectral image, including black and white correction, band removal, smoothing dimension reduction and standardization; Step 2: Divide the preprocessed hyperspectral image into overlapping 3D blocks; Step 3: Randomly divide the 3D blocks into training set, validation set and test set in proportion; Step 4: Improve the traditional CNN network by introducing deep separable convolution to fuse channel information and reduce dimension, introduce KAN spectral attention and spatial attention modules to extract spectral and spatial information of feature maps, introduce weight adaptive lightweight convolution to optimize network structure and improve feature separation ability, use KAN module as output layer to generate classification results, use training set and validation set to train the lightweight model of improved CNN network, and build a hyperspectral image classification model; Step 5: Use the test set to evaluate the constructed hyperspectral image classification model, calculate the evaluation indicators of the model on the test set, and complete the model evaluation.

2. According to claim 1, a medical hyperspectral image classification method based on a lightweight model of an improved CNN network is characterized in that: The black and white correction, smoothing dimension reduction and standardization processing in Step 1 are specifically as follows: The calculation formula for black and white correction is: ; in, is the rectified image, represents the original image, and They are white reference image and black reference image respectively; The calculation formula for smooth dimensionality reduction is: ; in, Indicates adjacent bands, represents the band after smoothing and dimensionality reduction, Represents the index of adjacent bands, represents the radius of the smoothing window, is the index of the current band; The calculation formula for standardization is: ; in, is the normalized data point, is the original data point, is the mean value of the band data at the pixel point, is the standard deviation of the band data.

3. The medical hyperspectral image classification method based on a lightweight model of an improved CNN network according to claim 1, characterized in that: The 3D block in Step 2 is specifically: Each 3D block uses neighboring pixels to form a new A 3D cube, where To select the block size, c is the total number of channels in the input feature map.

4. The medical hyperspectral image classification method based on a lightweight model of an improved CNN network according to claim 1, characterized in that: The Step 4 is specifically as follows: Step 4.1: Input size is The 3D image block enters a depth-separable convolutional layer and obtains a size of The feature map of the depth separable convolution includes depth convolution and point-by-point convolution, and the calculation formula is as follows: ; ; in, is the cth channel at position The value at is the first input feature map channels, is the convolution kernel The weights corresponding to the channels are represents the spatial coordinates of the convolution kernel, is the size of the convolution kernel in the convolution operation, is the output feature map at position The value at is the weight of the 1×1 convolution kernel, connecting the depth convolution output of c channels with the output channels, is the number of output channels of the depthwise separable convolution; Step 4.2: Get The feature maps of are subjected to maximum pooling and average pooling operations respectively, and then the two pooling results are used as input and sent to the KAN network. The two output results obtained by the KAN network are then added together to obtain the spectral attention Finally, the results of the maximum pooling and average pooling operations are added together to obtain the spatial attention , this process is expressed as: ; ; in, represents the Sigmoid function, and They are the maximum pooling operation and the average pooling operation, represents the input feature map, It is the KAN network; Step 4.3: Input the new feature map with unchanged dimension into three consecutive weight-adaptive lightweight convolution modules. The weight-adaptive lightweight convolution consists of the following operations: The feature map is first obtained by a point-by-point convolution. , and then the feature map Perform group convolution to obtain feature maps , and finally introduce a learnable weight parameter , for the feature map and Multiply by the weight parameters Then add them together to get the output feature map of the weight-adaptive lightweight convolution , the calculation formula of a weight-adaptive lightweight convolution is as follows: ; ; ; in, represents point-wise convolution, represents grouped convolution, represents the feature map input to the weight-adaptive lightweight convolution, Represents the feature map after point-by-point convolution, Represents the feature map after group convolution, is a learnable weight, Represents the output of the weight-adaptive lightweight convolution, M, N, and L represent the height, width, and number of channels of the feature map, respectively; Indicates that Dimensional tensor space; Step 4.4: The KAN module is used to obtain the final classification probability. This module uses two layers of KAN. The calculation of the first layer is: ; in, is the input feature of the first layer, is the KAN function matrix of the first layer, which contains the learnable activation function. is the output feature of the first layer; The calculation of the second layer is: ; in, is the KAN function matrix of the second layer, which contains the learnable activation function. is the output feature of the second layer; Finally, the output features of the second layer are transformed through the Softmax function. Convert to classification probability: ; in, is the classification probability distribution obtained by the Softmax function.

Citation Information

Cited By

  • Cat food taurine detection method based on hyperspectral imaging and SG-CCK deep learning model

    CN122176541A