Skin cancer classification method based on improved Shufflenetv2
By introducing the MBS module and CBAM attention module in the Shufflenetv2 model, combined with data enhancement technology, the problems of low detection accuracy and large parameters in skin cancer classification are solved, and an efficient and low-memory skin cancer classification model is realized, meeting the application needs of skin cancer classification.
Patent Information
- Application Number
- CN202411747088.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art has problems such as low detection accuracy, slow inference speed, and large parameters in the classification of skin cancer. Especially when faced with irregular skin cancer morphology and data imbalance, it is difficult to ensure the balance of high accuracy and low parameters.
The improved Shufflenetv2 model is adopted, and the MBS module and CBAM attention module are introduced into the original Shufflenetv2 model, and the original Shuffle module is replaced, the model's learning ability of the detailed characteristics and multi-scale characteristics of the lesion area is enhanced, and the number of samples in different categories is relatively balanced through data enhancement.
It realizes efficient computing, low memory footprint, high classification accuracy and modular design. The improved model has high detection accuracy, while ensuring a low parameter quantity, effectively balancing the relationship between detection accuracy and inference speed, and meeting the application needs of skin cancer classification.
Smart Images

Figure CN119723164A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image classification, and in particular to a skin cancer classification method based on an improved Shufflenetv2. Background Art
[0002] As the largest organ in the human body, the skin plays an important role in protecting the body from external damage. However, when skin cells begin to proliferate abnormally, the risk of skin cancer in the human body will greatly increase. Skin cancer is one of the most deadly cancers among the currently known types of cancer. Skin cancer can be mainly divided into two types: melanoma and non-melanoma. Due to its rapid spread and high mortality rate, the harm of malignant melanoma is far greater than that of non-melanoma. There are many factors that induce skin cancer. For example, long-term ultraviolet radiation may induce non-melanoma cancer, and abnormal proliferation of melanocytes in the skin may lead to melanoma cancer. In addition, viral infections may also cause skin cancer. At present, the diagnosis of skin cancer faces the following problems:
[0003] (1) The mismatch between the number of skin cancer patients and the number of dermatologists causes dermatologists to face high-intensity work, which inevitably leads to misjudgments. Once this happens, the patient's life safety will be greatly threatened.
[0004] (2) The morphology of the lesions of the same type of skin cancer may not be the same, which poses a great challenge to the professional knowledge and experience of dermatologists. Therefore, relying solely on manual inspection by dermatologists is not only inefficient, but also the accuracy of the detection cannot be guaranteed. Training an experienced dermatologist requires a lot of manpower, material resources and financial resources. In comparison, it is particularly important to develop a system that assists dermatologists in detecting patients' skin lesions.
[0005] In recent years, deep learning has achieved great success in the medical industry. Therefore, applying deep learning models to skin cancer classification can effectively reduce the occurrence of such cases. However, due to the irregularity of skin lesion categories, the different degrees of lesions caused by the different duration of illness in patients, and other damage caused by skin lesions to surrounding tissues, some redundant features will appear. These situations place high demands on the accuracy of deep learning models. In addition, the data imbalance caused by the difference in the number of patients with different types of skin cancer will also cause a certain bias in model training. Therefore, a high-precision skin cancer classification model has great development and application prospects. Summary of the invention
[0006] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a skin cancer classification method based on an improved Shufflenetv2, which has high detection accuracy while ensuring a low number of parameters, effectively balancing the relationship between detection accuracy and reasoning speed, and meeting the application requirements of skin cancer classification.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] A skin cancer classification method based on improved Shufflenetv2, comprising the following steps:
[0009] S1. Obtain a public skin cancer image dataset, preprocess the image data and divide the dataset;
[0010] S2. In the original Shufflenetv2 model, the MBS module is used to replace the Shuffle module in the original network, and the CBAM attention module is introduced to obtain an improved Shufflenetv2 skin cancer classification model;
[0011] S3, input the data set obtained in S1 into the improved Shufflenetv2 skin cancer classification model in S2 for training, and obtain the weight file with the best performance on the validation set;
[0012] S4: input the skin cancer image to be detected, load the optimal model weight of S3 for classification, and output the final result of the skin cancer image to be detected.
[0013] The present invention also has the following technical features:
[0014] Preferably, the S1 comprises the following sub-steps:
[0015] S11. Perform data enhancement on the number of skin cancer image samples of different categories in the dataset so that the number of samples of different categories is relatively balanced.
[0016] S12. Divide the image data of the dataset into a training set and a validation set for model training.
[0017] Preferably, the processing process of the MBS module is expressed by a formula:
[0018]
[0019]
[0020] F i ,F j =M chunk (I o ) (3)
[0021]
[0022] F o ′=SiLU(BN(conv2d(M se (F o ))) (5)
[0023] I o ′=M cs (Concat(F o ′,E o ′)+I o ) (6)
[0024]
[0025] I o =M cs (Concat(H o ,K o )) (8)
[0026]
[0027]
[0028] K o =ReLU(BN(conv2d(F i ′)) (11)
[0029] In the above formula represents a 3×3 depth-wise separable convolutional module, Represents a 5×5 depth-wise separable convolutional module; I o Represents the feature map of the input multi-scale separable module, Mchunk represents the average division of the input feature map into Fi and Fj in the channel dimension; Mrfb represents the input feature map through the RFB module; F′ o Represents the feature map of the left branch output of the MBS module with a stride of 1, E′ o represents the feature map of the right branch output of the MBS module with a step size of 1; Ko represents the feature map of the left branch output of the MBS module with a step size of 2, and Ho represents the feature map of the right branch output of the MBS module with a step size of 2; Mcs represents the channel shuffle operation; I′ o It represents the concatenation of the output feature maps of the two branches of the MBS module with a step size of 1 and the addition of the feature maps of the input MBS module, followed by a channel-shuffle operation; o ″ represents concatenating the output feature maps of the two branches of the MBS module with a stride of 2 and then performing a channel shuffle operation.
[0030] Furthermore, the workflow of the RFB module includes the following steps:
[0031] 1) Input feature map: The RFB module receives the feature map from the previous layer of the network as input;
[0032] 2) Multi-branch convolution: The RFB module contains multiple branches, each of which uses convolution kernels of different sizes for convolution operations; these branches include:
[0033] Branch 1: Use 1x1 convolution kernel for dimensionality reduction, and then use 3x3 convolution kernel for feature extraction;
[0034] Branch 2: Also uses 1x1 convolution kernel for dimensionality reduction, but then uses 5x5 convolution kernel for feature extraction to capture a larger receptive field;
[0035] Branch 3: Use the 1x1 convolution kernel again for dimensionality reduction, and then use the 7x7 convolution kernel for feature extraction to further increase the receptive field;
[0036] 3) Dilated convolution: In this branch, dilated convolution is introduced to simulate the eccentricity adjustment in the human visual system;
[0037] 4) Feature reorganization and integration: combine and adjust the output feature maps of each branch to generate the final feature representation;
[0038] 5) Output feature map: After being processed by the RFB module, a feature map containing richer feature information is output for further processing and recognition by subsequent network layers.
[0039] Furthermore, the CBAM workflow includes the following steps:
[0040] First, the feature map is multiplied by the channel attention map, and then the output feature map is multiplied by the spatial attention to obtain the output feature map of the CBAM module.
[0041] Further, the processing process of the CBAM is expressed by the formula:
[0042]
[0043]
[0044] Among them, the input feature map F∈C×H×W, 1D channel attention map M C ∈C×1×1 and 2D spatial attention map M S ∈1×H×W.
[0045] Preferably, the S3 comprises the following sub-steps:
[0046] Use the public skin cancer image dataset obtained in S1 to train the improved Shufflenetv2 skin cancer classification model, set the batch-size, initial learning rate, number of training rounds and optimizer training parameters, and save the best performing model weights as the file best.pt.
[0047] Preferably, S4 comprises the following sub-steps:
[0048] S41, inputting the image to be detected into the improved Shufflenetv2 skin cancer classification model, loading the pre-trained optimal weight file for detection, and marking the detected object category on the output image;
[0049] S42. Verify the accuracy of the improved Shufflenetv2 skin cancer classification model, and use accuracy and recall as key indicators to evaluate the model performance.
[0050] Furthermore, the processing of the accuracy and recall rate is expressed as follows:
[0051]
[0052]
[0053] Among them, Accuracy stands for accuracy, which means the proportion of samples correctly classified by the model to the total number of samples; Recall stands for recall, which means the proportion of positive samples predicted correctly by the model among all true positive samples.
[0054] Compared with the prior art, the present invention has the following technical effects:
[0055] The skin cancer classification method based on the improved Shufflenetv2 proposed in the present invention has the advantages of efficient calculation, low memory usage, high classification accuracy, and modular design. The improved model has high detection accuracy and ensures a low number of parameters, effectively balancing the relationship between detection accuracy and reasoning speed, and meeting the application requirements of skin cancer classification.
[0056] The present invention performs data enhancement on the number of skin cancer image samples of different categories in the data set, so that the number of samples of different categories is relatively balanced to meet the application requirements; the multi-branch structure of the MBS module is introduced to enhance the network's ability to extract features of different texture details, and the depthwise separable convolution in the MBS module can greatly reduce the number of model parameters, enhance the model's attention to the lesion area, and filter out noise interference; the CBAM attention module is introduced to further enhance the model's ability to pay attention to the lesion area, thereby improving the performance of the model and ensuring a higher detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 This is an example diagram of the HAM10000 data set in the present invention;
[0058] Figure 2 This is a diagram of the skin cancer classification network structure based on the improved Shufflenetv2 of the present invention;
[0059] Figure 3 This is an example diagram of the Shuffle module in the original Shufflenetv2 model;
[0060] Figure 4 is an example diagram of the MBS module in the present invention;
[0061] Figure 5 This is an example diagram of the CBAM module;
[0062] Figure 6 This is an example diagram of the RFB module;
[0063] Figure 7 Graph showing test results of some test sets in an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The specific contents of the present invention are further explained in detail below in conjunction with embodiments.
[0065] This embodiment provides a skin cancer classification method based on an improved Shufflenetv2, comprising the following steps:
[0066] S1. Obtain a public skin cancer image dataset, preprocess the image data in the dataset and divide the dataset;
[0067] S11. Perform data enhancement on the number of samples of skin cancer images of different categories in the dataset so that the number of samples of different categories is relatively balanced; e.g. Figure 1As shown, this embodiment uses the public HAM10000 data set, which contains a total of 7 types: actinic keratosis (AKIEC), basal cell carcinoma (BCC), seborrheic keratosis (BKL), dermatofibroma (DF), melanocytic nevus (NV), vascular disease (VASC), and malignant melanoma (TRICYCLE). The image data of the data set is enhanced. In practical applications, thermal noise in image sensors, random currents in electronic components, etc. can cause image pixel values to shift and fluctuate, and salt noise or pepper noise may also appear randomly during digital image transmission and storage. In view of the above situation, we use Gaussian noise and salt and pepper noise enhancement methods to simulate possible situations of the device. At the same time, we use random cropping and scaling and random rotation of the image by 90° to simulate shooting conditions at different fields of view and distances, so that the model can learn features at different scales and different viewing angles. Finally, we also use mixed enhancement (including brightness, contrast, color, and sharpness) to simulate image conditions under different lighting conditions, device states, or visual processing requirements in the real world. After repeating these steps many times, except for the number of samples of melanocytic nevus (NV) which is 6699, the number of samples of other categories all reached 3000 or more, and the total number of samples in the data set reached 30371, and the samples between each category were relatively balanced. These methods can enable the model to learn on more data, thereby improving its generalization ability and robustness.
[0068] S12, dividing the enhanced data set into a training set and a validation set in a ratio of 4:1 for model training;
[0069] S2. Improve the Shufflenetv2 skin cancer classification model to improve the performance of the model in the skin cancer classification task. The structure of the improved model is shown in the figure below. Figure 2 ;
[0070] The specific steps include:
[0071] S21. In the original Shufflenetv2 model, the MBS module is used to replace the Shuffle module in the original network. The Shuffle module and the MBS module are as follows: Figure 3 , as shown in 4, the MBS module processing process includes:
[0072] S21. In the original Shufflenetv2 model, the MBS module is used to replace the Shuffle module in the original network to enhance the model's learning of the detailed features and multi-scale features of the lesion area, making the model's classification accuracy higher; the MBS module consists of two branches, left and right; when the stride (step length) is equal to 1, the input feature map is divided into two parts in the channel dimension, and enters the left and right branches respectively. The left branch consists of a cascaded RFB module, a 3*3 depth-separable convolution module, an SE attention module and a 1*1 convolution module, and the right branch consists of a 5*5 depth-separable convolution module and an RFB module ... ) is equal to 2, the input feature map is input into the left and right branches respectively, the left branch is composed of a cascaded 5*5 depth-separable convolution module and a 1*1 convolution module, and the right branch is composed of a cascaded 1*1 convolution module and a 5*5 depth-separable convolution module; when stride is equal to 2, the output feature maps of the left and right branches are spliced and channel-shuffled as the output feature map of the MBS module; when stride is equal to 1, the output feature maps of the left and right branches are spliced, residually connected to the feature map of the input MBS module, and then channel-shuffled as the output feature map of the MBS module;
[0073] The principle of the MBS module is shown in the following formula;
[0074]
[0075]
[0076] F i ,F j =M chunk (I o ) (3)
[0077]
[0078] F 0 ′=SiLU(BN(conv2d(M se (F o ))) (5)
[0079] I o ′=M cs (Concat(F o ′,E o ′)+I o ) (6)
[0080]
[0081] I o =Mcs (Concat(H o ,K o )) (8)
[0082]
[0083]
[0084] K o =ReLU(BN(conv2d(F i ′)) (11)
[0085] In the above formula represents a 3×3 depth-wise separable convolutional module, Represents a 5×5 depthwise separable convolutional module. o Represents the feature map of the input multi-scale separable module, Mchunk represents the average division of the input feature map into Fi and Fj in the channel dimension. Mrfb represents the input feature map passing through the RFB module. F′ o Represents the feature map of the left branch output of the MBS module with a stride of 1, E′ o represents the feature map of the right branch output of the MBS module with a stride of 1. Ko represents the feature map of the left branch output of the MBS module with a stride of 2, and Ho represents the feature map of the right branch output of the MBS module with a stride of 2. Mcs represents the channel shuffle operation. I′ o It represents concatenating the output feature maps of the two branches of the MBS module with a stride of 1, adding them to the feature map of the input MBS module, and then performing a channel-shuffle operation. o ″ represents concatenating the output feature maps of the two branches of the MBS module with a stride of 2 and then performing a channel shuffle operation.
[0086] like Figure 6 As shown in the figure, the workflow of the RFB module mainly includes the following steps:
[0087] 1) Input feature map: The RFB module receives the feature map from the previous layer as input; the feature map contains the preliminary feature information in the image;
[0088] 2) Multi-branch convolution: The RFB module contains multiple branches, each of which uses convolution kernels of different sizes for convolution operations; these branches include:
[0089] Branch 1: Use 1x1 convolution kernel for dimensionality reduction, and then use 3x3 convolution kernel for feature extraction;
[0090] Branch 2: Also uses 1x1 convolution kernel for dimensionality reduction, but then uses 5x5 convolution kernel for feature extraction to capture a larger receptive field;
[0091] Branch 3: Use the 1x1 convolution kernel again for dimensionality reduction, and then use the 7x7 convolution kernel for feature extraction to further increase the receptive field;
[0092] 3) Dilated convolution: In this branch, dilated convolution is introduced to simulate the eccentricity adjustment in the human visual system; by increasing the interval between convolution kernel elements, the receptive field can be expanded and a wider range of contextual information can be captured without increasing the number of parameters or the amount of computation;
[0093] 4) Feature reorganization and integration: Combine and adjust the output feature maps of each branch to generate the final feature representation; this step usually includes operations such as adding and normalizing feature maps to ensure that the model can utilize information from different receptive fields and improve the model's recognition ability;
[0094] 5) Output feature map: After being processed by the RFB module, a feature map containing richer feature information is output for further processing and recognition by subsequent network layers.
[0095] S22. Introduce the CBAM module into the original Shufflenetv2 model to enhance the model's focus on the lesion area; as a lightweight module, CBAM can be easily integrated into the convolutional neural network model without adding almost any parameters, and perform end-to-end training to improve the classification accuracy of the network model. Figure 5 As shown in Figure 2, after the feature map enters CBAM, attention maps of different dimensions will be generated. The main workflow of CBAM can be summarized as follows: first, the feature map is multiplied by the channel attention map, and then the output feature map is multiplied by the spatial attention map to obtain the output feature map of the CBAM module.
[0096] The CBAM module processing includes:
[0097] Calculate the average pooling and maximum pooling of each channel of the input feature map to obtain two one-dimensional vectors;
[0098] Input the two vectors into two neural networks (MLP) respectively to obtain two one-dimensional vectors;
[0099] Add two vectors to get a one-dimensional vector;
[0100] Pass the one-dimensional vector through the Sigmoid function to obtain the channel attention weight vector;
[0101] Multiply each channel in the feature map by the corresponding channel attention weight to obtain a feature map with channel attention weighting;
[0102] Calculate the maximum pooling and average pooling of each position in the feature map to obtain two two-dimensional tensors;
[0103] Input the two tensors into two convolutional neural networks (CNNs) respectively to obtain two two-dimensional tensors;
[0104] Add the two tensors together to get a two-dimensional tensor;
[0105] Pass the two-dimensional tensor through the Sigmoid function to obtain the spatial attention weight tensor;
[0106] Multiply each position in the feature map by the corresponding spatial attention weight to obtain a feature map with spatial attention weighting;
[0107] Multiply the feature map weighted by channel attention with the feature map weighted by spatial attention to obtain the final feature map;
[0108] The processing of CBAM is expressed as follows:
[0109]
[0110]
[0111] Among them, the input feature map F∈C×H×W, 1D channel attention map M C ∈C×1×1 and 2D spatial attention map M S ∈1×H×W.
[0112] S3, input the data set obtained in S1 into the improved Shufflenetv2 skin cancer classification model in step 2 for training, obtain the weight file with the best performance on the validation set, and save it as best.pt;
[0113] The specific experimental environment configuration for model training is shown in Table 1. The relevant parameters for model training are set. The training image size is fixed to 224×224, BatchSize is set to 32, the initial learning rate is set to 0.0005, the final learning rate is set to 0.000001, and the weight decay coefficient is 0.02. The loss function used in the training script is the cross entropy loss function, and each model is trained for 200 epochs. The optimizer uses the AdamW optimizer. In the initial training stage, we performed a 1-epoch warm-up training, during which one-dimensional linear interpolation was used to update the learning rate. After the warm-up training, we used the cosine decay function to update the learning rate; after the training, the best performing model weights were saved as the file best.pt for subsequent skin cancer classification tasks.
[0114] Table 1 Experimental environment parameters
[0115]
[0116] S4, input the skin cancer image to be detected, load the optimal model weights of step 3 for classification, and output the final result of the skin cancer image to be detected, such as Figure 7 shown.
[0117] S41. Input the image to be detected into the improved Shufflentv2 skin cancer classification model, load the pre-trained best weight file best.pt for detection, and the detected object category will be marked on the output image.
[0118] S42. Verify the accuracy of the improved Shufflentv2 skin cancer classification model. Accuracy and Recall are used as key indicators to evaluate the model performance.
[0119] The processing of precision and recall is expressed as follows:
[0120]
[0121]
[0122] Among them, Accuracy stands for accuracy, which means the proportion of samples correctly classified by the model to the total number of samples; Recall stands for recall, which means the proportion of positive samples predicted correctly by the model among all true positive samples.
[0123] The comparative experimental results are shown in Table 2. It can be seen that the accuracy of the improved model is improved by 2.1% compared with Shufflenetv2, and the recall rate of the model is improved by 2.9%, indicating that the missed detection and false detection of the improved model have been greatly improved.
[0124] Table 2 Comparison of different algorithm models
[0125]
[0126] It should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it; without departing from the concept of the present invention, the deduction or replacement made by those skilled in the art shall fall within the protection scope of the present invention.
Claims
1. A skin cancer classification method based on improved Shufflenetv2, characterized in that: The following steps are involved: S1. Obtain a public skin cancer image dataset, preprocess the image data and divide the dataset; S2. In the original Shufflenetv2 model, the MBS module is used to replace the Shuffle module in the original network, and the CBAM attention module is introduced to obtain an improved Shufflenetv2 skin cancer classification model; S3, input the data set obtained in S1 into the improved Shufflenetv2 skin cancer classification model in S2 for training, and obtain the weight file with the best performance on the validation set; S4: input the skin cancer image to be detected, load the optimal model weight of S3 for classification, and output the final result of the skin cancer image to be detected.
2. The skin cancer classification method based on improved Shufflenetv2 as claimed in claim 1, characterized in that: The S1 comprises the following sub-steps: S11. Perform data enhancement on the number of skin cancer image samples of different categories in the dataset so that the number of samples of different categories is relatively balanced. S12. Divide the image data of the dataset into a training set and a validation set for model training.
3. The skin cancer classification method based on improved Shufflenetv2 as claimed in claim 1, characterized in that: The processing process of the MBS module is expressed by the formula: F i ,F j =M chunk (I o ) (3) F o ′=SiLU(BN(conv2d(M se (F o ))) (5) I′ o =M cs (Concat(F o ′,E′ o )+I o ) (6) I o ″=M cs (Concat(H o ,K o )) (8) K o =ReLU(BN(conv2d(F i ′)) (11) In the above formula represents a 3×3 depth-wise separable convolutional module, Represents a 5×5 depth-wise separable convolutional module; I o represents the feature map of the input multi-scale separable module, Mchunk represents the average division of the input feature map into Fi and Fj in the channel dimension; Mrfb represents the input feature map passing through the RFB module; F o ′ represents the feature map output by the left branch of the MBS module with a stride of 1, E′ o represents the feature map of the right branch output of the MBS module with a step size of 1; Ko represents the feature map of the left branch output of the MBS module with a step size of 2, and Ho represents the feature map of the right branch output of the MBS module with a step size of 2; Mcs represents the channel shuffle operation; I′ o It represents the concatenation of the output feature maps of the two branches of the MBS module with a step size of 1 and the addition of the feature maps of the input MBS module, followed by a channel-shuffle operation; o ″ represents concatenating the output feature maps of the two branches of the MBS module with a stride of 2 and then performing a channel shuffle operation.
4. The skin cancer classification method based on improved Shufflenetv2 as claimed in claim 3, characterized in that: The workflow of the RFB module includes the following steps: 1) Input feature map: The RFB module receives the feature map from the previous layer of the network as input; 2) Multi-branch convolution: The RFB module contains multiple branches, each of which uses convolution kernels of different sizes for convolution operations; these branches include: Branch 1: Use 1x1 convolution kernel for dimensionality reduction, and then use 3x3 convolution kernel for feature extraction; Branch 2: Also uses 1x1 convolution kernel for dimensionality reduction, but then uses 5x5 convolution kernel for feature extraction to capture a larger receptive field; Branch 3: Use the 1x1 convolution kernel again for dimensionality reduction, and then use the 7x7 convolution kernel for feature extraction to further increase the receptive field; 3) Dilated convolution: In this branch, dilated convolution is introduced to simulate the eccentricity adjustment in the human visual system; 4) Feature reorganization and integration: combine and adjust the output feature maps of each branch to generate the final feature representation; 5) Output feature map: After being processed by the RFB module, a feature map containing richer feature information is output for further processing and recognition by subsequent network layers.
5. The skin cancer classification method based on improved Shufflenetv2 as claimed in claim 1, characterized in that: The workflow of CBAM includes the following steps: First, the feature map is multiplied by the channel attention map, and then the output feature map is multiplied by the spatial attention to obtain the output feature map of the CBAM module.
6. The skin cancer classification method based on improved Shufflenetv2 as claimed in claim 5, characterized in that: The processing of CBAM is expressed by the formula: Among them, the input feature map F∈C×H×W, 1D channel attention map M C ∈C×1×1 and 2D spatial attention map M S ∈1×H×W.
7. The skin cancer classification method based on improved Shufflenetv2 as claimed in claim 1, characterized in that: The S3 comprises the following sub-steps: Use the public skin cancer image dataset obtained in S1 to train the improved Shufflenetv2 skin cancer classification model, set the batch-size, initial learning rate, number of training rounds and optimizer training parameters, and save the best performing model weights as the file best.pt.
8. The improved Shufflenetv2 skin cancer classification algorithm according to claim 1, characterized in that: The S4 comprises the following sub-steps: S41, inputting the image to be detected into the improved Shufflenetv2 skin cancer classification model, loading the pre-trained optimal weight file for detection, and marking the detected object category on the output image; S42. Verify the accuracy of the improved Shufflenetv2 skin cancer classification model, and use accuracy and recall as key indicators to evaluate the model performance.
9. The improved Shufflenetv2 skin cancer classification algorithm according to claim 8, characterized in that: The processing of precision and recall is expressed as follows: Among them, Accuracy stands for accuracy, which means the proportion of samples correctly classified by the model to the total number of samples; Recall stands for recall, which means the proportion of positive samples correctly predicted by the model among all true positive samples.