Skin cancer image classification model training method and device

Iterative training of the skin cancer image classification model through meta-learning strategies solves the problems of scarcity of skin cancer image data and category imbalance, and improves the classification performance and generalization ability of the model.

CN119723221AActive Publication Date: 2025-03-28HUBEI UNIV OF TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510225464.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-03-28
Estimated Expiration
2045-02-27

AI Technical Summary

Technical Problem

In the prior art, skin cancer image data is scarce, category imbalance, insufficient diagnostic accuracy and limited model generalization capabilities.

Method used

By acquiring the skin cancer image dataset, preprocessing iteratively build the support set and query set, using meta-learning strategies to train the skin cancer image classification model, including external circulation optimization and internal circulation optimization, updating global parameters, and optimizing model parameters through rapid learning of a small number of samples.

Benefits of technology

The model classification performance under small sample conditions is improved, the problem of small sample and data imbalance is solved, and the recognition performance of a few categories is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119723221A_ABST
    Figure CN119723221A_ABST
Patent Text Reader

Abstract

The invention discloses a skin cancer image classification model training method and device. The method comprises the steps that a skin cancer image data set is acquired and preprocessed; constructing a support set and a query set; inputting the skin cancer image data set in the support set into a skin cancer image classification model to obtain a first skin cancer classification result; constructing a first loss function based on the first skin cancer classification result, and performing iterative training on a skin cancer image classification model through a meta-learning strategy based on the first loss function: performing external loop optimization and internal loop optimization based on the first loss function to obtain global parameters of the updated skin cancer image classification model; and inputting the query set into the skin cancer image classification model to obtain a second skin cancer classification result, and updating the updated global parameters again based on the second skin cancer classification result. The problems of scarcity of skin cancer image data, unbalanced categories, insufficient diagnosis accuracy and limited model generalization ability in the prior art can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a skin cancer image classification model training method, device, storage medium and electronic device. Background Art

[0002] Skin cancer is one of the most common malignant tumors worldwide, especially high-risk types such as melanoma, whose incidence is increasing. Early detection and diagnosis play a vital role in the treatment effect and survival rate of patients. However, traditional skin cancer diagnosis relies on experienced dermatologists, and the diagnosis results are greatly affected by the doctor's subjective factors, which can easily lead to missed diagnosis and misdiagnosis. In addition, traditional diagnostic methods are usually time-consuming and labor-intensive, and it is difficult to meet the efficiency requirements of modern medical care.

[0003] In recent years, the application of artificial intelligence technology in the medical field has become increasingly widespread, bringing new hope to the diagnosis of skin cancer. For example, the current skin cancer recognition technology uses GAN to enhance skin cancer image data, and the GAN discriminator is used as a classifier to identify 7 types of skin cancer.

[0004] However, due to the diversity of lesions and the continuous emergence of new lesions, current skin cancer recognition technology is difficult to identify when faced with new lesion images or complex images. Summary of the invention

[0005] The embodiments of the present application provide a skin cancer image classification model training method, device, storage medium and electronic device, which can solve the problems of scarcity of skin cancer image data, category imbalance, insufficient diagnostic accuracy and limited model generalization ability in the prior art.

[0006] The present application embodiment provides a skin cancer image classification model training method, comprising: Get the skin cancer image dataset; Preprocessing the skin cancer image samples in the skin cancer image dataset; Construct support and query sets based on the preprocessed skin cancer image dataset; Inputting the skin cancer image dataset in the support set into a skin cancer image classification model to obtain a first skin cancer classification result; constructing a first loss function based on the first skin cancer classification result and the true value labels corresponding to the skin cancer image samples in the support set, and iteratively training the skin cancer image classification model through a meta-learning strategy based on the first loss function; The iterative training of the skin cancer image classification model through a meta-learning strategy based on the first loss function includes: performing outer loop optimization and inner loop optimization based on the first loss function to obtain global parameters of the updated skin cancer image classification model; inputting the query set into the skin cancer image classification model to obtain a second skin cancer classification result, and updating the updated global parameters again based on the second skin cancer classification result.

[0007] Furthermore, in the above-mentioned skin cancer image classification model training method, outer loop optimization is performed based on the first loss function, including: The outer loop optimization is performed by a first optimization formula to update the global parameters, wherein the first formula is:

[0008] in, is a global parameter, is the learning rate, is the gradient, is the first loss function, represents a skin cancer image classification model, Indicates update.

[0009] Furthermore, in the above-mentioned skin cancer image classification model training method, inner loop optimization is performed based on the first loss function, including: The outer loop optimization is performed by a second optimization formula to update the global parameters, wherein the second optimization formula is:

[0010] in, are the global parameters of the updated skin cancer image classification model, is the learning rate.

[0011] Furthermore, in the above-mentioned skin cancer image classification model training method, the step of re-updating the updated global parameter based on the second skin cancer classification result comprises: constructing a second loss function based on the second skin cancer classification result and the true value labels corresponding to the skin cancer image samples in the query set; The updated global parameters are updated again based on the second loss function.

[0012] Furthermore, in the above-mentioned skin cancer image classification model training method, the step of re-updating the updated global parameter based on the second loss function comprises: Update again through the third optimization formula, the third optimization formula is:

[0013] in, are the global parameters of the updated skin cancer image classification model, is the learning rate, is the second loss function, represents the i-th task of training, Represents the updated skin cancer image classification model.

[0014] Furthermore, the above-mentioned skin cancer image classification model training method, after the step of re-updating the updated global parameters based on the second loss function, comprises: Adaptively optimize the skin cancer image classification model:

[0015]

[0016] in, t is the number of iterations, , are the exponential decay rates of momentum, and is the bias-corrected estimate of the first-order moment estimate and the second-order moment estimate, is the learning rate, is a constant, is the gradient.

[0017] Furthermore, in the above-mentioned skin cancer image classification model training method, the skin cancer image classification model comprises: A preliminary feature extraction module, used for performing preliminary feature extraction on the skin cancer image to obtain preliminary image features; A multi-scale feature extraction module, used for performing multi-scale feature extraction and fusion on the preliminary image features to obtain fused image features; A dimension reduction processing module, used for performing dimension reduction processing on the fused image features; The pooling layer and the linear activation layer are used to further process and feature map the fused image after dimensionality reduction to obtain the skin cancer classification result.

[0018] The present application embodiment also provides a skin cancer image classification model training device, comprising: An acquisition module, used to acquire a skin cancer image dataset; A preprocessing module, used for preprocessing the skin cancer image samples in the skin cancer image dataset; A construction module for constructing support and query sets based on the preprocessed skin cancer image dataset; A classification module, used to input the skin cancer image dataset in the support set into a skin cancer image classification model to obtain a first skin cancer classification result; a training module, configured to construct a first loss function based on the first skin cancer classification result and the true value labels corresponding to the skin cancer image samples in the support set, and iteratively train the skin cancer image classification model based on the first loss function; The iterative training of the skin cancer image classification model based on the first loss function includes: performing outer loop optimization and inner loop optimization based on the first loss function to obtain updated global parameters of the skin cancer image classification model; inputting the query set into the skin cancer image classification model to obtain a second skin cancer classification result, and updating the updated global parameters again based on the second skin cancer classification result.

[0019] An embodiment of the present application also provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions are suitable for being loaded by a processor to execute any of the above-mentioned skin cancer image classification model training methods.

[0020] An embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is used for the steps in any of the above-mentioned skin cancer image classification model training methods.

[0021] The present application provides a skin cancer image classification model training method, device, storage medium and electronic device. The present application trains the skin cancer image classification model through inner loop optimization and outer loop optimization, optimizes model parameters through rapid learning of a small number of samples, improves the model classification performance under small sample conditions, solves the problems of small samples and data imbalance, and significantly improves the recognition performance of a few categories. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The technical solution and other beneficial effects of the present application will be made apparent by describing in detail the specific implementation methods of the present application in conjunction with the accompanying drawings.

[0023] Figure 1 This is a flowchart of a skin cancer image classification model training method provided in an embodiment of the present application.

[0024] Figure 2 Another flow chart of the skin cancer image classification model training method provided in an embodiment of the present application.

[0025] Figure 3 This is a training flowchart of the skin cancer image classification model provided in an embodiment of the present application.

[0026] Figure 4 A schematic diagram of MAML performing two-level operations of local update and global update provided in an embodiment of the present application.

[0027] Figure 5 A schematic diagram of the structure of the Inception-ResNetV2 network model provided in an embodiment of the present application.

[0028] Figure 6 This is a schematic diagram of the structure of a skin cancer image classification model training device provided in an embodiment of the present application.

[0029] Figure 7 Another schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0031] The present application provides a method, device, storage medium and electronic device for training a skin cancer image classification model. The present application provides a skin cancer image classification model training device, which can be integrated into an electronic device, which can be a terminal, a server and other devices, wherein the terminal can include a tablet computer, a laptop computer, a personal computer (PC), a micro-processing box, or other devices.

[0032] See also Figure 1 and Figure 2 , Figure 1 This is a flowchart of the skin cancer image classification model training method provided in an embodiment of the present application. Figure 2 Another flow chart of the skin cancer image classification model training method provided in an embodiment of the present application, which is applied to an electronic device, and the skin cancer image classification model training method includes the following steps: S1, obtain the skin cancer image dataset.

[0033] As an example, the publicly available HAM10000 dataset can be used, which contains seven different types of skin lesion images, covering a variety of lesion characteristics.

[0034] The skin cancer image dataset was divided into training set, validation set, and test set in a ratio of 8:1:1 to ensure that the training set had sufficient data volume and that the test set and validation set could fully evaluate the performance of the skin cancer image classification model.

[0035] S2, preprocessing the skin cancer image samples in the skin cancer image dataset.

[0036] In one embodiment, step S2 comprises the following steps: S21, perform missing value processing: For the missing areas or noise points in the skin cancer image, use bilateral filtering technology to fill and smooth them to eliminate possible interference.

[0037] S22, perform data balancing processing: In view of the problem of category imbalance in the HAM10000 data set, the present invention adopts a random oversampling strategy to optimize data distribution.

[0038] Specifically, taking the category with the largest number of samples (NV) in the dataset as the benchmark, for categories with fewer samples, samples are randomly selected and repeated until the number of samples in each category is equal to the benchmark category, thus constructing a balanced dataset.

[0039] S23, denoising and normalization: resize all images to a uniform size (224×224) and apply Z-score normalization:

[0040] in, is the sample mean, is the standard deviation of the sample.

[0041] In skin cancer images, due to the instability of shooting conditions, there are often uneven lighting and color distortion, resulting in noise in skin cancer images. These noises not only affect the visual quality of the image, but also pose a challenge to subsequent experiments. In order to overcome this challenge, the present invention combines Dropout and attention mechanisms for denoising. Dropout technology randomly sets some neuron outputs to zero, obtains different network structures in each iteration, and enhances the generalization ability of the model. In this way, even in noisy images, the model can adapt and learn more robust features during the training process.

[0042] S24, perform data enhancement processing: Random transformations: including horizontal and vertical flipping, random rotation (angle range [-45°, 45°]), affine transformation, and random cropping to increase the diversity of skin cancer image samples.

[0043] Color jitter: By randomly adjusting brightness, contrast, and saturation, skin lesion images under different lighting conditions are simulated to improve the model's adaptability to real scenes.

[0044] Shape enhancement: Perform shape enhancement processing on images with blurred lesion boundaries to enhance boundary features and help the model capture key areas.

[0045] Random affine transformation: By performing operations such as translation, scaling, and shearing on the image to enrich the image features, the skin cancer image classification model is trained with enriched images to enhance the generalization ability of the skin cancer image classification model.

[0046] S3, constructs support and query sets based on the preprocessed skin cancer image dataset.

[0047] Specifically, multiple groups of skin cancer images are randomly sampled from the training set to form a support set , used for task-specific optimization of initial model parameters. The support set samples are augmented (such as affine transformation, cropping, etc.) to improve the generalization ability of the model, and then the query set is separated from the training data , used to verify the performance of the model after training on the support set.

[0048] S4, inputting the skin cancer image dataset in the support set into the skin cancer image classification model to obtain a first skin cancer classification result.

[0049] S5, constructing a first loss function based on the first skin cancer classification result and the true value labels corresponding to the skin cancer image samples in the support set, and iteratively training the skin cancer image classification model through a meta-learning strategy based on the first loss function.

[0050] Among them, based on the first loss function, the skin cancer image classification model is iteratively trained through a meta-learning strategy, including: performing outer loop optimization and inner loop optimization based on the first loss function to obtain the updated global parameters of the skin cancer image classification model; inputting the query set into the skin cancer image classification model to obtain a second skin cancer classification result, and updating the updated global parameters again based on the second skin cancer classification result. Figure 3 This is a training flow chart of the skin cancer image classification model provided in the embodiment of the present application. The following steps can be referred to Figure 3 .

[0051] In the traditional field of machine learning, model training is usually carried out according to specific task requirements. However, when faced with new task challenges, this often means that the model needs to be retrained, a process that is not only time-consuming but also requires a large amount of data resources as support. In contrast, meta-learning, as a task-oriented method, is centered on accumulating meta-knowledge by training a variety of tasks. This meta-knowledge provides valuable information gain for the model, which enables the model to demonstrate excellent convergence characteristics and generalization capabilities when dealing with new tasks.

[0052] In the embodiment of the present application, a model-independent meta-learning strategy (MAML) is proposed to train a skin cancer image classification model. MAML is a model-independent meta-learning algorithm that can be used to quickly adapt to new tasks. The algorithm considers the model f and the task p (T), the goal is to train a model f that can exploit p (T) to find the knowledge learned in new tasks Parameters for rapid adaptation , as shown in Figure 4, Figure 4 The schematic diagram of MAML performing local update and global update operations provided in the embodiment of the present application is as follows. Figure 4 In the figure, the blue branch lines represent the local update direction of different tasks during the training process. These updates reflect the adaptive adjustment of the model for specific tasks; while the blue main axis represents the final update trend of the model parameters in the global scope, reflecting the meta-knowledge accumulated by the model after training on multiple tasks. The final dotted line depicts the fine-tuning process of the model when facing new tasks, reflecting the model's ability to quickly adapt to new tasks using the accumulated meta-knowledge.

[0053] In one embodiment, performing outer loop optimization based on the first loss function includes: S51, performing outer loop optimization through a first optimization formula to update global parameters, the first formula is:

[0054] in, is a global parameter, is the learning rate, is the gradient, is the first loss function, represents a skin cancer image classification model, Indicates update.

[0055] Through outer loop optimization, global parameters are optimized on a support set with multiple tasks to learn common features between tasks, ensuring that the skin cancer image classification model can be quickly migrated to new tasks and improving the generalization ability of its initial parameters.

[0056] In one embodiment, the first loss function is inner-loop optimized, including: S52, performing outer loop optimization through a second optimization formula to update global parameters, the second formula is:

[0057] in, are the global parameters of the updated skin cancer image classification model, is the learning rate.

[0058] Through inner loop optimization, it supports further optimization of task-specific global parameters within the set to make them more suitable for the current task and improve the performance on the current task.

[0059] In one embodiment, updating the updated global parameter again based on the second skin cancer classification result includes: S53, constructing a second loss function based on the second skin cancer classification result and the true value labels corresponding to the skin cancer image samples in the query set; S54, updating the updated global parameters again based on the second loss function.

[0060] Specifically, step S54 includes: Update again through the third optimization formula, the third optimization formula is:

[0061] in, are the global parameters of the updated skin cancer image classification model, is the learning rate, is the second loss function, represents the i-th task of training, Represents the updated skin cancer image classification model.

[0062] Furthermore, the skin cancer image classification model is adaptively optimized by the following formula, and the learning rate of the skin cancer image classification model is adjusted to accelerate convergence:

[0063]

[0064] in, t is the number of iterations, , are the exponential decay rates of momentum, and is the bias-corrected estimate of the first-order moment estimate and the second-order moment estimate, is the learning rate, is a constant, is the gradient.

[0065] Furthermore, in the model training phase, the embodiment of the present application adopts an L2 regularization strategy to address the overfitting problem. Specifically, in the construction of the optimizer, a Weight_decay parameter is introduced, which is used to control the L2 regularization strength. At the same time, the optimizer automatically calculates the L2 regularization term based on the parameter and integrates it into the original loss function to form an enhanced loss function. In each iterative update, the optimizer updates the model weights based on this enhanced loss function, which effectively improves the robustness and generalization ability of the model.

[0066] Furthermore, in order to prevent overfitting during model training, the embodiment of the present application adopts an early stopping strategy. By monitoring the accuracy (ACC) of the skin cancer image classification model on the validation set, when the validation accuracy does not improve or decreases after multiple training cycles, it is considered as an overfitting phenomenon and the training is stopped immediately. At this time, the model with the best previously verified performance is selected as the final model for evaluation. The early stopping strategy not only improves the generalization ability of the model, but also saves computing resources.

[0067] As an example, the skin cancer image classification model can use the Inception-ResNetV2 network model. As an advanced deep convolutional neural network architecture, Inception-ResNetV2 significantly combines the multi-scale feature extraction capabilities of the Inception module with the residual connection mechanism of ResNet. The model starts with the input block and initially extracts image features through convolution and pooling operations. Its core lies in a series of interwoven Inception modules and residual connections to jointly build a feature extraction network. Each Inception module uses convolution kernels of different sizes to process input data in parallel, splice multi-scale feature maps, and enhance feature representation capabilities. At the same time, in order to reduce computational complexity, 1×1 convolution is introduced before the large convolution kernel for dimensionality reduction. The residual connection solves the gradient vanishing problem through a short-circuit mechanism to ensure training stability. These combined blocks deepen the model depth and improve the expressiveness. Finally, the fully connected layer processes the features and outputs the prediction results. The Inception-ResNetV2 network model includes: A preliminary feature extraction module, used for performing preliminary feature extraction on the skin cancer image to obtain preliminary image features; A multi-scale feature extraction module (Inception-ResNet-A / B / C), used to perform multi-scale feature extraction and fusion on the preliminary image features to obtain fused image features; A dimension reduction processing module, used for performing dimension reduction processing on the fused image features; The pooling layer and the linear activation layer are used to further process and feature map the fused image after dimensionality reduction to obtain the skin cancer classification result.

[0068] Figure 5 The schematic diagram of the structure of the Inception-ResNetV2 network model provided in the embodiment of the present application is as follows: Figure 5 As shown in the figure, the preliminary feature extraction module includes an input layer and a stem layer (Stem module) connected in sequence, and the multi-scale feature processing module is connected to the multi-dimensionality reduction processing module, specifically including 5×Inception-ResNet-A, dimensionality reduction module-A, 10×Inception-ResNet-B, dimensionality reduction module-B, 5×Inception-ResNet-C, and dimensionality reduction module-C connected in sequence. The pooling layer and the linear activation layer include a global average pooling (Average Pooling), a discard layer (Dropout) and a classification layer (Softmax) connected in sequence.

[0069] Specifically, Dropout and Average Pooling are used to further optimize feature expression, and the Softmax classification head is used to map the features output by the model to seven skin lesion categories to obtain skin cancer classification results.

[0070] Furthermore, after the skin cancer image classification model is trained, the model performance can be verified and evaluated by calculating the accuracy, recall, precision, F1-Score and other evaluation indicators to evaluate the model performance.

[0071] In one embodiment, in order to explore the impact of the number of filters in the Inception module and the number of elements in the fully connected layer in the skin cancer image classification model on the model performance, the embodiment of the present application conducts an ablation experiment, and aims to find the optimal parameter setting by systematically adjusting the parameters and comparing the experimental results under different configurations to optimize the classification performance of the skin cancer image classification model.

[0072] The detailed steps of the ablation experiment are as follows: First, the other parameters of the Inception-ResNetV2-MAML optimization model are fixed, and only the number of elements in the fully connected layer is adjusted, and the classification accuracy (ACC) of the model after each adjustment is recorded. Then, after determining the appropriate range of the number of elements in the fully connected layer, the number of filters of the model is further adjusted, and the ACC value after each adjustment is also recorded. Finally, the ACC values ​​under different configurations are compared, and the ablation experiment results are shown in Table 1.

[0073] Table 1 Ablation experiment results

[0074] The experimental results show that when the number of filters increases from 32 to 64, the model classification performance is significantly improved (from 81.47% to 84.97%), indicating that increasing the number of filters helps the model capture more image features to improve classification accuracy. However, when the number of filters increases to 96, the performance drops slightly to 83.50%, which may be due to the introduction of too much noise or redundant information. For the number of features in the fully connected layer, the performance increases slightly from 2048 to 4096 (from 90.28% to 90.43%), indicating that a larger fully connected layer can enhance the model's representation capabilities. However, the performance at 1024 features (89.97%) is not significantly behind, indicating that smaller fully connected layers may also provide sufficient representation capabilities in specific tasks.

[0075] This application trains the skin cancer image classification model through inner loop optimization and outer loop optimization, optimizes the model parameters through rapid learning of a small number of samples, improves the model classification performance under small sample conditions, solves the problems of small samples and data imbalance, and significantly improves the recognition performance of minority categories.

[0076] According to the method described in the above embodiment, this embodiment will be further described from the perspective of a skin cancer image classification model training device. The skin cancer image classification model training device can be implemented as an independent entity or integrated in an electronic device. The electronic device can be a terminal, a server, etc., wherein the terminal can include a tablet computer, a laptop computer, a personal computer (PC), a micro processing box, or other devices.

[0077] See also Figure 6 , Figure 6 The skin cancer image classification model training device provided in the embodiment of the present application is specifically described, and is applied to an electronic device. The skin cancer image classification model training device may include: An acquisition module, used to acquire a skin cancer image dataset; A preprocessing module, used for preprocessing the skin cancer image samples in the skin cancer image dataset; A construction module for constructing support and query sets based on the preprocessed skin cancer image dataset; A classification module, used to input the skin cancer image dataset in the support set into a skin cancer image classification model to obtain a first skin cancer classification result; a training module, configured to construct a first loss function based on the first skin cancer classification result and the true value labels corresponding to the skin cancer image samples in the support set, and iteratively train the skin cancer image classification model based on the first loss function; The iterative training of the skin cancer image classification model based on the first loss function includes: performing outer loop optimization and inner loop optimization based on the first loss function to obtain updated global parameters of the skin cancer image classification model; inputting the query set into the skin cancer image classification model to obtain a second skin cancer classification result, and updating the updated global parameters again based on the second skin cancer classification result.

[0078] During specific implementation, the above modules and / or units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above modules and / or units can refer to the previous method embodiments. The specific beneficial effects that can be achieved can also refer to the beneficial effects in the previous method embodiments, which will not be repeated here.

[0079] In addition, an embodiment of the present application also provides an electronic device, which may be a computer, a tablet computer, or other device. Figure 7 The specific structural block diagram of the electronic device provided in the embodiment of the present invention is shown, and the electronic device can be used to implement the skin cancer image classification model training method provided in the above embodiment. The electronic device 500 can be a terminal, a server, etc., wherein the terminal can include a tablet computer, a laptop computer, a personal computer (PC, Personal Computer), a micro processing box, or other devices.

[0080] The RF circuit 510 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The RF circuit 510 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity module (SIM) cards, memories, etc. The RF circuit 510 can communicate with various networks such as the Internet, corporate intranets, wireless networks, or communicate with other devices through wireless networks. The above-mentioned wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. The above-mentioned wireless networks may use various communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (such as Institute of Electrical and Electronics Engineers standards IEEE 802.11a, IEEE 802.11b, IEEE802.11g and / or IEEE802.11n), Voice over Internet Protocol (VoIP), Worldwide Interoperability for Microwave Access (Wi-Max), other protocols for email, instant messaging and short messages, and any other suitable communication protocols, even those that have not yet been developed.

[0081] The memory 520 can be used to store software programs and modules, such as the corresponding program instructions / modules in the above embodiments. The processor 580 executes various functional applications and data processing by running the software programs and modules stored in the memory 520, that is, realizing the functions of taking pictures with the front camera, processing the captured images, and switching the display color of the display content on the display screen. The memory 520 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 520 may further include a memory remotely arranged relative to the processor 580, and these remote memories may be connected to the electronic device 500 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0082] The input unit 530 may be used to receive input digital or character information, and generate a keyboard and a mouse related to user settings and function control. The display unit 540 may be used to display information input by the user or information provided to the user and various graphical user interfaces, which may be composed of graphics, text, icons, videos, and any combination thereof. The display unit 540 may include a display panel 541, which may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like.

[0083] The audio circuit 560, the speaker 561, and the microphone 562 can provide an audio interface between the user and the electronic device 500. The audio circuit 560 can transmit the electrical signal converted from the received audio data to the speaker 561, which is converted into a sound signal for output; on the other hand, the microphone 562 converts the collected sound signal into an electrical signal, which is received by the audio circuit 560 and converted into audio data, and then the audio data is output to the processor 580 for processing, and then sent to another terminal through the RF circuit 510, or the audio data is output to the memory 520 for further processing. The audio circuit 560 may also include an earplug jack to provide communication between an external headset and the electronic device 500.

[0084] The electronic device 500 can help the user receive requests, send information, etc. through the transmission module 570 (such as a Wi-Fi module), which provides the user with wireless broadband Internet access. Although the transmission module 570 is shown in the figure, it can be understood that it is not a necessary component of the electronic device 500 and can be omitted as needed without changing the essence of the invention.

[0085] The processor 580 is the control center of the electronic device 500. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 520, and calling data stored in the memory 520, it executes various functions of the electronic device 500 and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 580 may include one or more processing cores; in some embodiments, the processor 580 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 580.

[0086] The electronic device 500 also includes a power supply 590 (such as a battery) for supplying power to various components. In some embodiments, the power supply can be logically connected to the processor 580 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 590 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0087] Although not shown, the electronic device 500 also includes a camera (such as a front camera, a rear camera), a Bluetooth module, etc., which will not be described in detail here. Specifically in this embodiment, the display unit of the electronic device is a touch screen display, and the mobile terminal also includes a memory, and one or more programs, wherein one or more programs are stored in the memory, and are configured to be executed by one or more processors. One or more programs include instructions for performing the following operations: Get the skin cancer image dataset; Preprocessing the skin cancer image samples in the skin cancer image dataset; Construct support and query sets based on the preprocessed skin cancer image dataset; Inputting the skin cancer image dataset in the support set into a skin cancer image classification model to obtain a first skin cancer classification result; constructing a first loss function based on the first skin cancer classification result and the true value labels corresponding to the skin cancer image samples in the support set, and iteratively training the skin cancer image classification model based on the first loss function; The iterative training of the skin cancer image classification model based on the first loss function includes: performing outer loop optimization and inner loop optimization based on the first loss function to obtain updated global parameters of the skin cancer image classification model; inputting the query set into the skin cancer image classification model to obtain a second skin cancer classification result, and updating the updated global parameters again based on the second skin cancer classification result.

[0088] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities. The specific implementation of the above modules can be found in the previous method embodiments, which will not be repeated here.

[0089] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present invention provides a storage medium, which stores a plurality of instructions, and the instructions can be loaded by a processor to execute the steps of any embodiment of the skin cancer image classification model training method provided in the embodiment of the present invention.

[0090] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0091] Since the instructions stored in the storage medium can execute the steps in any embodiment of the skin cancer image classification model training method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any skin cancer image classification model training method provided in the embodiments of the present invention can be achieved. For details, please refer to the previous embodiments and will not be repeated here.

[0092] The above is a detailed introduction to a skin cancer image classification model training method, device, storage medium and electronic device provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present application.

Claims

1. A skin cancer image classification model training method, characterized in that: The method comprises: Get the skin cancer image dataset; Preprocessing the skin cancer image samples in the skin cancer image dataset; Construct support and query sets based on the preprocessed skin cancer image dataset; Inputting the skin cancer image dataset in the support set into a skin cancer image classification model to obtain a first skin cancer classification result; constructing a first loss function based on the first skin cancer classification result and the true value labels corresponding to the skin cancer image samples in the support set, and iteratively training the skin cancer image classification model through a meta-learning strategy based on the first loss function; The iterative training of the skin cancer image classification model through a meta-learning strategy based on the first loss function includes: performing outer loop optimization and inner loop optimization based on the first loss function to obtain global parameters of the updated skin cancer image classification model; inputting the query set into the skin cancer image classification model to obtain a second skin cancer classification result, and updating the updated global parameters again based on the second skin cancer classification result.

2. The skin cancer image classification model training method according to claim 1, characterized in that: Performing outer loop optimization based on the first loss function includes: The outer loop optimization is performed by a first optimization formula to update the global parameters, wherein the first formula is: in, is a global parameter, is the learning rate, is the gradient, is the first loss function, represents a skin cancer image classification model, Indicates update.

3. The skin cancer image classification model training method according to claim 1, characterized in that: Performing inner loop optimization based on the first loss function includes: The outer loop optimization is performed by a second optimization formula to update the global parameters, wherein the second optimization formula is: in, are the global parameters of the updated skin cancer image classification model, is the learning rate.

4. The skin cancer image classification model training method according to claim 1, characterized in that: The updating of the updated global parameter based on the second skin cancer classification result comprises: constructing a second loss function based on the second skin cancer classification result and the true value labels corresponding to the skin cancer image samples in the query set; The updated global parameters are updated again based on the second loss function.

5. The skin cancer image classification model training method according to claim 4, characterized in that: The updating the updated global parameter again based on the second loss function includes: Update again through the third optimization formula, the third optimization formula is: in, is the global parameter of the updated skin cancer image classification model, is the learning rate, is the second loss function, represents the i-th task of training, Represents the updated skin cancer image classification model.

6. The skin cancer image classification model training method according to claim 5, characterized in that: After the step of re-updating the updated global parameter based on the second loss function, the method further comprises: Adaptively optimize the skin cancer image classification model: in, t is the number of iterations, , are the exponential decay rates of momentum, and is the bias-corrected estimate of the first-order moment estimate and the second-order moment estimate, is the learning rate, is a constant, is the gradient, is the global parameter of the skin cancer image classification model at iteration number t.

7. The skin cancer image classification model training method according to claim 1, characterized in that: The skin cancer image classification model includes: A preliminary feature extraction module, used for performing preliminary feature extraction on the skin cancer image to obtain preliminary image features; A multi-scale feature extraction module, used for performing multi-scale feature extraction and fusion on the preliminary image features to obtain fused image features; A dimension reduction processing module, used for performing dimension reduction processing on the fused image features; The pooling layer and the linear activation layer are used to further process and feature map the fused image after dimensionality reduction to obtain the skin cancer classification result.

8. A skin cancer image classification model training device, characterized in that: include: An acquisition module, used to acquire a skin cancer image dataset; A preprocessing module, used for preprocessing the skin cancer image samples in the skin cancer image dataset; A construction module for constructing support and query sets based on the preprocessed skin cancer image dataset; A classification module, used to input the skin cancer image dataset in the support set into a skin cancer image classification model to obtain a first skin cancer classification result; a training module, configured to construct a first loss function based on the first skin cancer classification result and the true value labels corresponding to the skin cancer image samples in the support set, and iteratively train the skin cancer image classification model through a meta-learning strategy based on the first loss function; The iterative training of the skin cancer image classification model through a meta-learning strategy based on the first loss function includes: performing outer loop optimization and inner loop optimization based on the first loss function to obtain global parameters of the updated skin cancer image classification model; inputting the query set into the skin cancer image classification model to obtain a second skin cancer classification result, and updating the updated global parameters again based on the second skin cancer classification result.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the skin cancer image classification model training method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is used to execute the steps in the skin cancer image classification model training method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Rare disease classification method based on federal element learning

    CN114566277A

  • Target detection method based on meta-learning combination attention mechanism network model

    CN117576379A

  • Federal element learning image recognition method and system with enhanced noise robustness

    CN117994635A

  • Rare fundus disease automatic classification method and system based on OCT image

    CN118411573A

  • Deep interpretable skin disease identification method based on small sample learning

    CN119251228A