A method, system, device and storage medium for detecting skin fungi

By segmenting and randomly combining skin sample pictures, the neural network model is trained, and the existing skin fungus detection method is solved, achieving rapid and accurate skin fungus detection.

CN119784727BActive Publication Date: 2025-08-12JIANGSU MEDOMICS MEDICAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411936136.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-08-12
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

The existing skin fungus detection methods are cumbersome and time-consuming, resulting in slow detection speed and low detection efficiency.

Method used

The neural network model is used to segment, randomly combine and process the skin sample pictures, and the prediction model and target detection model are trained to quickly judge the existence and target position of skin fungi.

Benefits of technology

The prediction model and object detection model trained by a large number of samples reduce detection time and improve the efficiency and accuracy of skin fungi detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784727B_ABST
    Figure CN119784727B_ABST
Patent Text Reader

Abstract

The present application relates to a method, system, device and storage medium for detecting skin fungi, and relates to the field of fungus detection. The method includes: receiving a number of skin sample images and recording fungus information; dividing the skin sample images into a number of refined areas, randomly combining the several refined areas into a number of groups of sample areas and recording the combination information; processing the several refined areas to obtain a number of feature point descriptors, and obtaining a number of groups of training data based on the several feature point descriptors and the combination information; training a first neural network based on the several groups of training data and fungus information to obtain a prediction model; training a second neural network based on the several skin sample images, the prediction model and the fungus information to obtain a target detection model; when a skin sample to be detected is received, performing skin fungus detection on the skin sample through the prediction model and the target detection model. The technical effect of the present application is to improve the efficiency of skin fungus detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of fungus detection, and in particular to a method, system, device and storage medium for skin fungus detection. Background Art

[0002] Dermatophyte infections are a broad category of infections of the skin, appendages, subcutaneous tissue, and mucous membranes caused by pathogenic fungi. They are among the most common skin diseases. With the advancement of fungal detection technology, a growing number of methods are available for the detection and identification of fungi. Currently, commonly used methods for fungal detection include wet mount microscopy, Gram stain, fungal culture, and fluorescence detection.

[0003] The wet mount method is simple, but it places high demands on the inspectors, and very professional inspectors are needed to ensure the detection rate; Gram staining is cumbersome and time-consuming, and is easily affected by multiple factors such as the quality of the dye solution and the level of the inspectors; the culture method is time-consuming; although fluorescent staining significantly improves the sensitivity of fungal microscopy, it takes a long time to scan the entire sample, and the collected sample is thick, resulting in many targets not being able to be photographed or only a small number of targets being photographed.

[0004] At present, the existing commonly used fungus detection methods are slow and inefficient in skin fungus detection due to cumbersome operations and time-consuming reasons. Summary of the Invention

[0005] In order to improve the efficiency of skin fungus detection, the present application provides a skin fungus detection method, system, device and storage medium.

[0006] In a first aspect, the present application provides a method for detecting skin fungi, which adopts the following technical solution:

[0007] receiving a plurality of skin sample images and recording fungal information of the skin sample images;

[0008] Segmenting the skin sample image into a number of refined areas, randomly combining the refined areas into a number of groups of sample areas and recording combination information;

[0009] performing smoothing, grayscale processing, and binary assignment on the plurality of the refined regions in sequence to obtain a plurality of feature point descriptors, and obtaining a plurality of sets of training data according to the plurality of the feature point descriptors and the combined information;

[0010] Training a first neural network according to the plurality of sets of training data and the fungus information to obtain a prediction model;

[0011] Training a second neural network based on the skin sample images, the prediction model, and the fungus information to obtain a target detection model;

[0012] When a skin sample to be tested is received, skin fungus detection is performed on the skin sample using the prediction model and the target detection model.

[0013] Through the above technical solution, a prediction model is trained with a large number of samples to determine whether skin fungi are present, and a target detection model is trained to determine the target location of skin fungi. When actually performing skin fungus detection, the prediction model and the target detection model are used to reduce detection time and improve detection efficiency.

[0014] In a specific embodiment, the step of segmenting the skin sample image into a plurality of refined regions, randomly combining the plurality of refined regions into a plurality of groups of sample regions, and recording the combination information includes:

[0015] Evenly dividing the skin sample image into a number of refined areas;

[0016] A random number generator is used to randomly combine a number of the thinned areas that do not pass through a diagonal line of the skin sample image to obtain a number of groups of sample areas and record the combination information.

[0017] Through the above technical solution, the skin sample images are segmented and randomly grouped, and calculations are performed on the groups and put into training, which reduces computing power and improves efficiency.

[0018] In a specific embodiment, the step of training a first neural network to obtain a prediction model based on several sets of training data and fungal information includes:

[0019] encoding a plurality of sets of the training data to obtain a plurality of sets of encoded training data;

[0020] Importing the encoded training data into the multi-head attention mechanism layer of the first neural network to obtain a plurality of attention data;

[0021] Superimposing several groups of the encoded training data and several groups of the attention data and then performing regularization processing to obtain regularized data;

[0022] Processing the regularized data sequentially through a convolutional layer, a nonlinear transformation layer, an upsampling layer, and a fully connected layer of the first neural network to obtain detection results of several groups of the skin sample images;

[0023] A prediction model is obtained according to the fungal information, the detection results and the first neural network.

[0024] Through the above technical solution, the data processing layer of the neural network is preset, and the neural network is repeatedly trained according to the standards to obtain the parameters of the neural network that meet the requirements, which facilitates the further generation of the prediction model.

[0025] In a specific embodiment, obtaining a prediction model based on the fungal information, the detection results, and the first neural network includes:

[0026] Calculating a loss value using a first loss function according to the fungus information and the detection result;

[0027] Determining whether the loss value is less than a preset value;

[0028] If the loss value is less than a preset value, the training is stopped and a prediction model that can be put into use is obtained based on the trained first neural network;

[0029] If the loss value is not less than a preset value, the first neural network is optimized using a stochastic gradient descent optimization method and then training is continued.

[0030] Through the above technical solution, by calculating the loss value and setting the standard of the loss value, it is possible to determine when the neural network training is completed, which facilitates the further generation of the prediction model.

[0031] In a specific embodiment, the skin sample image further includes a correction sample image, and the prediction model that can be put into use based on the trained first neural network includes:

[0032] Obtaining corrected fungal information of the corrected sample image;

[0033] determining whether the corrected fungal information is consistent with the detection result;

[0034] If the corrected fungal information is consistent with the detection result, a prediction model that can be put into use is obtained based on the trained first neural network.

[0035] Through the above technical solution, after the loss value meets the standard, a corrected sample image is retained for each sample when the sample is collected. By comparing the fungal information of the corrected sample image with the test results, further corrections are made to make the prediction model more accurate.

[0036] In a specific embodiment, the training of a second neural network to obtain a target detection model based on the plurality of skin sample images, the prediction model, and the fungus information includes:

[0037] Screening the plurality of skin sample images through the prediction model to obtain a plurality of positive skin sample images with fungi present, and recording the prediction model data;

[0038] Processing the positive skin sample images using the prediction model data sequentially through the first convolutional layer, the second convolutional layer, the nonlinear transformation layer, the hidden layer, the first upsampling layer, the first upsampling layer, and the fully connected layer of the second neural network to obtain a plurality of prediction images;

[0039] A target detection model is obtained according to the plurality of predicted images, the fungus information and the second neural network.

[0040] Through the above technical solution, the data processing layer of the neural network is preset, and the neural network is repeatedly trained according to the standards to obtain the parameters of the neural network that meet the requirements, which facilitates the further generation of the target detection model.

[0041] In a specific embodiment, the predicted image includes predicted target information, the fungus information includes manually annotated target information, and obtaining a target detection model based on the predicted images, the fungus information, and the second neural network includes:

[0042] Calculating a second loss value using a second loss function according to the manually labeled target information and the predicted target information;

[0043] Determining whether the second loss value is less than a second preset value;

[0044] If the second loss value is less than a second preset value, the training is stopped, and a target detection model that can be put into use is obtained based on the trained second neural network;

[0045] If the second loss value is not less than a second preset value, the second neural network is optimized using a stochastic gradient descent optimization method and then training is continued.

[0046] Through the above technical solution, by calculating the loss value and setting the loss value standard, it is possible to determine when the neural network training is completed, which facilitates the further generation of the target detection model.

[0047] In a second aspect, the present application provides a skin fungus detection system, which adopts the following technical solution: the system includes:

[0048] A skin sample image receiving module, configured to receive a plurality of skin sample images and record fungal information of the skin sample images;

[0049] An image segmentation and combination module, which segments the skin sample image into a number of refined areas, randomly combines the several refined areas into a number of groups of sample areas and records the combination information;

[0050] a training data generating module, configured to sequentially perform smoothing, grayscale processing, and binary assignment on the plurality of the refined regions to obtain a plurality of feature point descriptors, and to obtain a plurality of sets of training data based on the plurality of feature point descriptors and the combined information;

[0051] A prediction model generation module, configured to train a first neural network according to the plurality of sets of training data and the fungal information to obtain a prediction model;

[0052] a target detection model generation module, configured to train a second neural network based on the plurality of skin sample images, the prediction model, and the fungus information to obtain a target detection model;

[0053] The skin fungus detection module is used to perform skin fungus detection on the skin sample by using the prediction model and the target detection model when receiving the skin sample to be detected.

[0054] In a third aspect, the present application provides a computer device that adopts the following technical solution: it includes a memory and a processor, and the memory stores a computer program that can be loaded by the processor and execute a skin fungus detection method such as the above-mentioned method.

[0055] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: storing a computer program that can be loaded by a processor and execute the above-mentioned skin fungus detection method.

[0056] In summary, this application has the following beneficial technical effects:

[0057] (1) An optimized artificial intelligence model is proposed, which can detect fungi after taking a small number of pictures. The computing power required by the model is extremely low, so the artificial intelligence model can be deployed without burden even in community hospitals.

[0058] (2) Artificial intelligence models include prediction models and target detection models. The prediction model is trained with a large number of samples to determine whether skin fungi exist, and the target detection model is trained to determine the target of skin fungi. When actually performing skin fungus detection, the use of prediction models and target detection models can reduce detection time and improve detection efficiency.

[0059] (3) Different neural networks are designed based on the prediction model and target detection model, and the sample data are used to train the neural network to generate a prediction model and target detection model that can accurately detect skin fungi, thereby ensuring the accuracy of skin fungus detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 Flowchart of the method for detecting skin fungi in the embodiment of the present application.

[0061] Figure 2 This is a schematic diagram of the segmentation combination of skin sample images.

[0062] Figure 3 This is the first neural network data training flow chart.

[0063] Figure 4 This is the second neural network data training flow chart.

[0064] Figure 5 is the output image where the prediction result is negative.

[0065] Figure 6 is the probability of a positive prediction image with the target labeled and the target possibility.

[0066] Figure 7 It is a structural block diagram of the skin fungus detection method in the embodiment of the present application.

[0067] Reference numerals: 701, skin sample image receiving module; 702, image segmentation and combination module; 703, training data generation module; 704, prediction model generation module; 705, target detection model generation module; 706, skin fungus detection module. DETAILED DESCRIPTION

[0068] The following is combined with Figure 1-Figure 7 This application is described in further detail.

[0069] The present invention discloses a method for detecting skin fungi, which is used to improve the efficiency of skin fungi detection.

[0070] Dermatophyte infections are a broad category of infections of the skin, appendages, subcutaneous tissue, and mucous membranes caused by pathogenic fungi. They are among the most common skin diseases. With the advancement of fungal detection technology, a growing number of methods are available for the detection and identification of fungi. Currently, commonly used methods for fungal detection include wet mount microscopy, Gram stain, fungal culture, and fluorescence detection.

[0071] The wet mount method is simple, but it places high demands on the inspectors, and very professional inspectors are needed to ensure the detection rate; Gram staining is cumbersome and time-consuming, and is easily affected by multiple factors such as the quality of the dye solution and the level of the inspectors; the culture method is time-consuming.

[0072] Although fluorescent staining has significantly improved the sensitivity of fungal microscopy, it still faces some challenges. First, because skin sample collection is complex, scanning the entire sample is time-consuming and cannot meet the hundreds of tests required daily by many hospitals. Second, due to thickness, many targets can only be partially imaged. For example, in some samples, core targets such as hyphae may only be imaged to one-tenth of their original size. The remaining portion cannot be properly imaged due to sample thickness, non-uniformity, and excessive fluorescence intensity.

[0073] At present, the existing commonly used fungus detection methods are slow and inefficient in skin fungus detection due to cumbersome operations and time-consuming reasons.

[0074] Therefore, the present application proposes a method for detecting skin fungi, which is used to improve the efficiency of skin fungi detection.

[0075] like Figure 1 As shown, the method includes:

[0076] S10, receiving a plurality of skin sample pictures, and recording fungal information of the skin sample pictures.

[0077] Specifically, a skin sample with fungi is a positive skin sample, and a skin sample without fungi is a negative skin sample. This application will collect positive skin samples and negative skin samples in a certain ratio, and take several skin sample pictures for each skin sample. The skin sample pictures taken for each sample will be distributed as training skin sample pictures and test correction sample pictures in a certain ratio. For example, in actual operation, about one hundred samples are used for training, where the ratio of negative to positive is 1:1. For a sample after fluorescent staining of the skin, we need to take about one hundred pictures, and the pictures taken for each sample are randomly distributed in a ratio of 8:2, where the larger part is used for training and the smaller part is used for test correction. At the same time, the fungal information of each skin sample picture should be recorded, mainly including whether the skin sample picture includes fungi (that is, whether the skin sample picture is negative or positive). When the skin sample picture contains fungi, the manually labeled target information should also be recorded.

[0078] S20, dividing the skin sample image into a number of refined regions, randomly combining the several refined regions into a number of groups of sample regions and recording the combination information.

[0079] Specifically, in actual operation, taking a picture as an example, first, the resolution of the skin sample picture taken is 1200*1200, and the picture is evenly cut into 8*8 small squares. These small squares are randomly combined into several groups of sample areas, and the combination information is recorded, such as the sample area to which a small square belongs.

[0080] S30 , performing smoothing processing, grayscale processing, and binary assignment on the plurality of refined regions in sequence to obtain a plurality of feature point descriptors, and obtaining a plurality of sets of training data according to the plurality of feature point descriptors and the combined information.

[0081] Specifically, several refined areas, i.e., each small square, are smoothed using the existing convolution kernel, and the small squares are grayscaled after smoothing. Then, the pixels in each small square are binary assigned to obtain assignment data. The assignment data of each pixel can be combined to obtain the feature point descriptor of each small square, and several feature point descriptors are combined according to the combined information to obtain several groups of training data.

[0082] S40, training a first neural network according to several sets of training data and fungal information to obtain a prediction model.

[0083] Specifically, several sets of training data from skin sample images are fed into a first neural network, which is configured with layers to generate a prediction model. This prediction model is then used to determine whether the skin sample image is positive. Training is performed using actual fungal information as a criterion, while also setting a loss function to achieve a relatively accurate first neural network and generate a prediction model.

[0084] S50: Training a second neural network according to the plurality of skin sample images, the prediction model, and the fungus information to obtain a target detection model.

[0085] Specifically, several skin sample images are fed into a second neural network, which is configured with layers to generate a target detection model. The target detection model then generates a predicted image containing predicted target information. The second neural network then determines the presence of targets in positive skin sample images. The predicted target information and manually annotated target information are combined using a loss function to calculate a loss value, resulting in a more accurate second neural network and the target detection model.

[0086] S60: When a skin sample to be tested is received, skin fungus detection is performed on the skin sample using the prediction model and the target detection model.

[0087] Specifically, after obtaining a more accurate prediction model and target detection model, when encountering a skin sample that needs to be tested, first take a small number of pictures of the skin sample, and then use the prediction model and target detection model to detect and analyze the pictures to obtain the test results.

[0088] This application uses a large number of samples to train a prediction model to determine whether skin fungi are present, and trains a target detection model to determine the target of skin fungi. When actually performing skin fungus detection, the use of the prediction model and the target detection model can reduce detection time and improve detection efficiency.

[0089] In one embodiment, to improve the efficiency of skin fungus detection, the step of segmenting a skin sample image into several refined regions, randomly combining the several refined regions into several groups of sample regions, and recording the combination information can be specifically performed as follows:

[0090] First, the skin sample image is evenly divided into several refined areas. Specifically, in actual operation, taking a picture as an example, the resolution of the skin sample image is generally 1200*1200. The picture is evenly cut into 8*8 small squares, and the small squares are the refined areas.

[0091] Next, use a random number generator to randomly combine several refined areas that do not pass through the diagonal line of the skin sample image to obtain several groups of sample areas and record the combination information. Specifically, in actual operation, the skin sample image has a diagonal line from the upper left to the lower right. Except for the small squares passing through the diagonal line, the other small squares are divided into small blocks of different categories using two random number generators. The first time is to randomly select how many colors of small blocks to be divided into, and the range is 5 to 15. The second random number specifies the category to which each small block belongs. Assuming that the range randomly selected for the first time is 9, then when the random number is selected for the second time, each small block will be divided into categories 1 to 9. The figure below uses color to represent the type of each small square after randomization. In this way, we can obtain several groups of sample areas and record the combination information, such as the sample area to which a small square belongs.

[0092] This application segments skin sample images and randomly groups them, performs calculations on each group, and puts them into training, which reduces computing power and improves efficiency.

[0093] It should be noted that Figure 2 For example, the skin sample image is randomly divided into 15 groups of sample areas using the grouping method described above, and each small square is randomly assigned to one of these 15 groups. Based on this, several refined areas are smoothed, grayscaled, and binary-valued to obtain several feature point descriptors. Based on these feature point descriptors and the combined information, several sets of training data are obtained. This step can be specifically performed as follows:

[0094] We extract features from each small square. Taking one of the small squares as an example, we first smooth the square. Because skin fluorescence images have a lot of noise interference, we adopt a more focused smoothing strategy. After a lot of experiments, the smoothing convolution kernel customized for skin images is:

[0095]

[0096] Use the convolution kernel to smooth the pixels in each small square. If the point where the square is located is at the edge and cannot form a complete 3*3 matrix, the missing part will be padded with the value 0; then the image is grayscaled; then each pixel in the small square is assigned a binary value. Taking one of the points as an example, assuming that the point is P, we take a 17*17 area with P as the center. In this area, we grab 128 groups of points other than the center point, randomly match them in pairs, and form 128 groups of data for binary assignment. Assuming we randomly select two points x and y, use the following formula to assign values:

[0097]

[0098] Where p(x) and p(y) represent the grayscale values of the randomly selected points x and y.

[0099] Since we have 128 sets of data, the value of the i-th set of data can be expressed as:

[0100] b i =τ(p;x i ,y i )

[0101] In this way we will get a feature point descriptor:

[0102] B=b0b1…b i …b 128

[0103] Each small square gets a feature point descriptor. The skin sample image is evenly cut into 8*8 small squares, which can generate 64 feature point descriptors. According to the recorded combination information (the sample area to which a small square belongs), the 64 feature point descriptors are distributed to 15 groups of sample areas to obtain 15 groups of training data.

[0104] The data is processed to highly condense the effective information of the image, eliminate noise interference, reduce invalid calculations, and reduce dependence on computing power. In addition, the key information is connected in series through the white part of the middle diagonal line to ensure that there is always a part of the information that runs through the entire image during feature extraction. It ensures that at least one set of feature points covers the entire image during feature extraction and can extract global information. At the same time, other random blocks are used to allow the feature extraction network to avoid path dependence of feature extraction in a random manner, maintaining better interactivity even for distant blocks.

[0105] In one embodiment, in order to improve the efficiency of skin fungus detection, Figure 3 To illustrate, the step of training the first neural network to obtain a prediction model based on several sets of training data and fungal information can be specifically performed as follows:

[0106] like Figure 3 The first neural network consists of the following layers: a multi-head attention mechanism, a convolutional layer, a nonlinear transformation layer, an upsampling layer, and a fully connected layer. The multi-head attention mechanism has a very large receptive field of view, and because of its multiple heads, it can extract multi-dimensional feature information, allowing the entire model to better understand the data from multiple dimensions. The convolutional layer, nonlinear transformation layer, and upsampling layer are used to process the data. Only one layer is set because the data processing before this is relatively clean and the data volume is small. The fully connected layer is used to output the detection results.

[0107] Based on the first neural network, the establishment of the prediction model includes the following steps:

[0108] First, several groups of training data are encoded to obtain several groups of encoded training data, and then these groups of encoded training data are imported into the multi-head attention mechanism layer of the first neural network. Specifically, the multi-head attention mechanism layer extracts multi-dimensional feature information to obtain several groups of attention data, so that the entire model can better understand the data from multiple dimensions. At the same time, the multi-head attention mechanism layer is calculated in parallel, which conforms to the current mainstream hardware architecture and saves computing resources.

[0109] Next, several groups of encoded training data and several groups of attention data are superimposed and regularized to obtain regularized data. Specifically, because it was found through actual operation that superposition is required for data enhancement, the data that has passed the attention mechanism layer and the data that has not passed it are superimposed. In order to suppress the risk of overfitting, the superimposed and enhanced data is regularized. By increasing the deviation to reduce the variance, the accuracy of the model can be improved.

[0110] Furthermore, the regularized data is processed in sequence through the convolution layer, nonlinear transformation layer, upsampling layer and fully connected layer of the first neural network to obtain the detection results of several groups of skin sample images, and a prediction model is obtained based on the fungal information, the detection results and the first neural network. Specifically, the data is input into the convolution layer, the nonlinear transformation layer and the upsampling layer, and the detection result is output after passing through the fully connected layer. The output result is whether the image is positive. The detection result also includes the probability that the category of the skin sample predicted by the first neural network is positive. Finally, a prediction model is constructed based on the fungal information of the skin sample (whether it is positive), the detection result (whether the sample is detected positive by the first neural network) and the first neural network.

[0111] The data processing steps of the neural network are preset, and the neural network is repeatedly trained according to the standards to obtain the parameters of the neural network that meet the requirements, so as to facilitate the further generation of the prediction model.

[0112] In one embodiment, to improve the efficiency of skin fungus detection, the step of obtaining a prediction model based on fungus information, detection results, and the first neural network can be specifically performed as follows:

[0113] First, the loss value is calculated using the first loss function based on the fungal information and detection results. Specifically, during the training process, we use the following formula as the loss function:

[0114]

[0115] Where N is the total number of samples we put into training, and y i It represents the category of the i-th sample. If it is positive, y i The value is 1, if it is negative, y i The value of p is 0, i It represents the probability that the category of the i-th sample predicted by our neural network is positive.

[0116] Then, determine whether the loss value is less than the preset value; if the loss value is less than the preset value, stop training and obtain a prediction model that can be put into use based on the trained first neural network; if the loss value is not less than the preset value, use the stochastic gradient descent optimization method to optimize the first neural network and continue training. Specifically, first set the parameters of the training cycle, for example, the training cycle epochs is 2000, the batch size is 128, the initial learning rate is 0.05, and the learning rate decay strategy is to multiply the original learning rate by 0.1 when the epoch is 100 and 1000, that is, at the 100th and 1000th epochs, the learning rates are 0.005 and 0.0005 respectively.

[0117] During the training process, the Loss value, that is, the value of the loss function, is calculated. For example, in actual applications, the preset value is 0.5. If the Loss value is less than 0.5, we stop training and assume that the first neural network can generate fluorescent images with clear textures and edges. Based on the trained first neural network, we obtain a usable prediction model. If the Loss value is greater than 0.5, we use the stochastic gradient descent optimization method to optimize the first neural network and continue training until the epoch reaches 2,000.

[0118] By calculating the loss value and setting the loss value standard, we can determine when the neural network training is completed, which facilitates the further generation of the prediction model.

[0119] In one embodiment, in order to improve the efficiency of skin fungus detection, the step of obtaining a usable prediction model based on the trained first neural network can be specifically performed as follows:

[0120] After the loss function loss value is less than the preset value, it is necessary to test and correct it.

[0121] First, obtain the corrected fungal information of the corrected sample image. Specifically, for a sample of skin after fluorescent staining, we need to take about one hundred pictures. The pictures taken for each sample are randomly distributed in an 8:2 ratio, of which the larger part is used for training and the smaller part is used for test correction. When the training data of the same sample is completed and the loss value is less than the preset value, it is also necessary to call the fungal information of the test-corrected skin sample of the sample (whether it is positive).

[0122] Then, it is determined whether the corrected fungal information is consistent with the test result; if the corrected fungal information is consistent with the test result, a prediction model that can be put into use is obtained based on the trained first neural network. Specifically, for the same sample, the test result (whether it is positive) obtained by the first neural network of the sample image used for training and the fungal information (whether it is positive) of the skin sample used for testing the correction are consistent; if they are consistent, the verification is passed, and a prediction model that can be put into use is obtained based on the trained first neural network; if they are inconsistent, the first neural network is optimized using the stochastic gradient descent optimization method and then training is continued.

[0123] After the loss value meets the standard, a corrected sample image is retained for each sample when the sample is collected. By comparing the fungal information of the corrected sample image with the test results, further corrections are made to make the prediction model more accurate.

[0124] In one embodiment, in order to improve the efficiency of skin fungus detection, Figure 4 To illustrate, the step of training the second neural network to obtain the target detection model based on several skin sample images, prediction models, and fungal information can be specifically performed as follows:

[0125] like Figure 4 The first neural network consists of the following layers: the first convolutional layer, the second convolutional layer, the nonlinear transformation layer, the hidden layer, the first sampling layer, the second sampling layer, and the fully connected layer. The convolutional layer is used to perform local perception and feature extraction on the input data. The nonlinear transformation enables the neural network to fit and express complex nonlinear relationships. The hidden layer maps the input data to a higher-level feature space, thereby capturing the complex patterns and relationships in the input data. Upsampling gradually restores the data to an image based on the previous data. The fully connected layer is used to output the results.

[0126] First, several skin sample images are screened through the prediction model to obtain several positive skin sample images with fungi, and the prediction model data is recorded. Specifically, the several skin sample images include positive skin samples and negative skin samples. The skin sample images are tested by the prediction model to screen out positive skin samples, that is, skin sample images with fungi. The prediction model is processed by the first neural network and the prediction model data is recorded, such as the prediction model convolution layer data, the prediction model nonlinear transformation data, the prediction model upsampling layer data and the prediction model fully connected layer data. If the input image is negative, the prediction result is directly output as a negative image, such as Figure 5 .

[0127] Then, the prediction model data is used to sequentially process a number of positive skin sample images through the first convolution layer, the second convolution layer, the nonlinear transformation layer, the hidden layer, the first upsampling layer, the first upsampling layer and the fully connected layer of the second neural network to obtain a number of prediction images. Specifically, taking an image with an image size of 1200*1200*3 as an example, after the first convolution, the data size is 600*600*6. After inputting the prediction model convolution layer data, the data size becomes 602*602*6. After the second convolution, the data size generated is 301*301*12. After adding the prediction model convolution layer data, it becomes 302*302*12. The data is then processed. After performing nonlinear transformation and adding the data of the nonlinear transformation of the prediction model, the data dimension becomes 303*303*12. The data is then put into the hidden layer, and the data dimension does not change. Subsequently, the first upsampling is started, and the upsampling layer data of the balance model is fused. After sampling, the data size is 150*150*24. The first upsampled data and the data of the third convolutional layer are added, and the second upsampling is performed. The upsampling layer data of the prediction model is also fused to obtain a data size of 300*300*12. The data is then put into the fully connected layer and the fully connected layer data of the prediction model is fused. Finally, a prediction picture of size 1200*1200*3 is obtained as shown below. Figure 6 , which includes predicted targets.

[0128] Finally, a target detection model is obtained based on several predicted images, fungal information and the second neural network. Specifically, the target detection model is constructed based on the fungal information of the skin sample (manually labeled target information), the predicted image (predicted target information) and the second neural network.

[0129] Set up the data processing steps of the neural network, repeatedly train the neural network according to the standards to obtain the parameters of the neural network that meet the requirements, and facilitate the further generation of the target detection model. In this process, the integration of the prediction model data can reduce the amount of calculation of the subsequent model, ensuring the accuracy of the results while saving computing power.

[0130] In one embodiment, to improve the efficiency of skin fungus detection, the step of obtaining a target detection model based on the plurality of predicted images, fungus information, and the second neural network can be specifically performed as follows:

[0131] First, the second loss value is calculated using the second loss function based on the manually annotated target information and the predicted target information. Specifically, assuming that M targets are manually annotated in one of the predicted images, the loss is calculated by comparing the results of the M targets predicted by artificial intelligence with the results of the manual prediction. This loss consists of three loss functions. The first is the center position of the predicted target:

[0132]

[0133] x j and z j It represents the horizontal and vertical coordinates of the center position of the j-th predicted target, x j and z j It represents the horizontal and vertical coordinates of the center position of the jth manually marked target.

[0134] The second step is to predict the length and width of the target box. The calculation formula is as follows:

[0135]

[0136] where w j and h j It represents the length and width of the box of the j-th predicted target, w j and h j It represents the length and width of the box of the jth manually labeled target.

[0137] Finally, the probability of predicting whether the target type is correct is calculated using the following formula:

[0138]

[0139] where p j It represents the probability that the neural network predicts that the jth target is the correct target, is the correct target manually marked, and its value is 1 for any j.

[0140] After calculating the above three loss functions, add the three loss functions together to get the loss function of a single image:

[0141] Loss 总 =Loss pos +Loss W&H +Loss cate

[0142] This loss function is the loss function of a single image, and the final overall loss function is the average of the loss functions of all images.

[0143] Then, determine whether the second loss value is less than the second preset value; if the second loss value is less than the second preset value, stop training, and obtain a target detection model that can be put into use based on the trained second neural network; if the second loss value is not less than the second preset value, use the stochastic gradient descent optimization method to optimize the second neural network and continue training. Specifically, first set the parameters of the training cycle, the training cycle epochs is 2000, the batch size is 32, the initial learning rate is 0.01, and the learning rate decay strategy is to multiply the original learning rate by 0.1 when the epoch is 100 and 1000, that is, at the 100th and 1000th epochs, the learning rates are 0.001 and 0.0001 respectively. During the training process, we calculate the value of Loss.

[0144] During the training process, the average value of the loss function, namely the second loss value, is calculated. For example, in actual applications, the second preset value is 3. If the loss value is less than 3, we stop training and believe that the model can generate fluorescent images with clear textures and edges. Based on the trained second neural network, we obtain a target detection model that can be put into use. If it is greater than 3, we use the stochastic gradient descent optimization method to optimize the first neural network and continue training until the epoch reaches 2,000.

[0145] By calculating the loss value and setting the loss value standard, we can determine when the neural network training is completed, which facilitates the further generation of the target detection model.

[0146] Based on the above method, the present application also discloses an embodiment. Figure 7 , the system includes the following modules:

[0147] The skin sample picture receiving module 701 is used to receive a number of skin sample pictures and record fungal information of the skin sample pictures;

[0148] The image segmentation and combination module 702 segments the skin sample image into a number of refined regions, randomly combines the refined regions into a number of groups of sample regions and records the combination information;

[0149] The training data generation module 703 is used to sequentially perform smoothing, grayscale processing, and binary assignment on the plurality of refined regions to obtain a plurality of feature point descriptors, and obtain a plurality of sets of training data based on the plurality of feature point descriptors and the combined information;

[0150] A prediction model generating module 704 is configured to train a first neural network based on a plurality of training data sets and fungal information to obtain a prediction model;

[0151] A target detection model generation module 705 is configured to train a second neural network based on a plurality of skin sample images, a prediction model, and fungal information to obtain a target detection model;

[0152] The skin fungus detection module 706 is configured to, when receiving a skin sample to be detected, perform skin fungus detection on the skin sample using the prediction model and the target detection model.

[0153] In one embodiment, the image segmentation and combination module 702 is specifically configured to evenly segment the skin sample image into a plurality of refined regions; use a random number generator to randomly combine the plurality of refined regions that do not pass through the diagonal line of the skin sample image to obtain a plurality of groups of sample regions and record the combination information.

[0154] In one embodiment, the prediction model generation module 704 is specifically used to encode several groups of training data to obtain several groups of encoded training data; import the several groups of encoded training data into the multi-head attention mechanism layer of the first neural network to obtain several groups of attention data; superimpose the several groups of encoded training data and the several groups of attention data and then perform regularization processing to obtain regularized data; process the regularized data in sequence through the convolution layer, nonlinear transformation layer, upsampling layer and fully connected layer of the first neural network to obtain detection results of several groups of skin sample images; and obtain a prediction model based on the fungal information, the detection results and the first neural network.

[0155] In one embodiment, the prediction model generation module 704 is specifically used to calculate the loss value through the first loss function based on the fungal information and the detection results; determine whether the loss value is less than a preset value; if the loss value is less than the preset value, stop training and obtain a usable prediction model based on the trained first neural network; if the loss value is not less than the preset value, use the stochastic gradient descent optimization method to optimize the first neural network and continue training.

[0156] In one embodiment, the prediction model generation module 704 is specifically configured to obtain corrected fungal information of the corrected sample image; determine whether the corrected fungal information is consistent with the detection result; and if the corrected fungal information is consistent with the detection result, obtain a usable prediction model based on the trained first neural network.

[0157] In one embodiment, the target detection model generation module 705 is specifically used to screen a number of skin sample images through a prediction model to obtain a number of positive skin sample images with fungi present, and record the prediction model data; use the prediction model data to sequentially process the number of positive skin sample images through the first convolution layer, the second convolution layer, the nonlinear transformation layer, the hidden layer, the first upsampling layer, the first upsampling layer and the fully connected layer of the second neural network to obtain a number of predicted images; and obtain a target detection model based on the number of predicted images, fungal information and the second neural network.

[0158] In one embodiment, the target detection model generation module 705 is specifically used to calculate a second loss value through a second loss function based on manually labeled target information and predicted target information; determine whether the second loss value is less than a second preset value; if the second loss value is less than the second preset value, stop training and obtain a target detection model that can be put into use based on the trained second neural network; if the second loss value is not less than the second preset value, use the stochastic gradient descent optimization method to optimize the second neural network and continue training.

[0159] The embodiment of the present application also discloses a computer device.

[0160] Specifically, the computer device includes a memory and a processor, and the memory stores a computer program that can be loaded by the processor and execute the above-mentioned skin fungus detection method.

[0161] The embodiment of the present application also discloses a computer-readable storage medium.

[0162] Specifically, the computer-readable storage medium stores a computer program that can be loaded by a processor and executed as a skin fungus detection method as described above. The computer-readable storage medium includes, for example, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0163] This specific embodiment is merely an explanation of the present invention and is not intended to limit the present invention. After reading this specification, those skilled in the art may make non-creative modifications to this embodiment as needed. However, as long as such modifications are within the scope of the claims of the present invention, they are protected by patent law.

Claims

1. A method for detecting skin fungi, characterized in that: The method comprises: receiving a plurality of skin sample images and recording fungal information of the skin sample images; Segmenting the skin sample image into a number of refined areas, randomly combining the refined areas into a number of groups of sample areas and recording combination information; performing smoothing, grayscale processing, and binary assignment on the plurality of the refined regions in sequence to obtain a plurality of feature point descriptors, and obtaining a plurality of sets of training data according to the plurality of the feature point descriptors and the combined information; Training a first neural network according to the plurality of sets of training data and the fungus information to obtain a prediction model; Training a second neural network based on the skin sample images, the prediction model, and the fungus information to obtain a target detection model; When a skin sample to be tested is received, performing skin fungus detection on the skin sample using the prediction model and the target detection model; The step of training a first neural network according to the plurality of sets of training data and the fungus information to obtain a prediction model comprises: encoding a plurality of sets of the training data to obtain a plurality of sets of encoded training data; Importing the encoded training data into the multi-head attention mechanism layer of the first neural network to obtain a plurality of attention data; Superimposing several groups of the encoded training data and several groups of the attention data and then performing regularization processing to obtain regularized data; Processing the regularized data sequentially through a convolutional layer, a nonlinear transformation layer, an upsampling layer, and a fully connected layer of the first neural network to obtain detection results of several groups of the skin sample images; A prediction model is obtained according to the fungal information, the detection results and the first neural network.

2. The method according to claim 1, characterized in that The step of dividing the skin sample image into a plurality of refined regions, randomly combining the plurality of refined regions into a plurality of groups of sample regions, and recording combination information includes: Evenly dividing the skin sample image into a number of refined areas; A random number generator is used to randomly combine a number of the thinned areas that do not pass through a diagonal line of the skin sample image to obtain a number of groups of sample areas and record the combination information.

3. The method according to claim 1, characterized in that The obtaining of a prediction model according to the fungus information, the detection result and the first neural network includes: Calculating a loss value using a first loss function according to the fungus information and the detection result; Determining whether the loss value is less than a preset value; If the loss value is less than a preset value, the training is stopped and a prediction model that can be put into use is obtained based on the trained first neural network; If the loss value is not less than a preset value, the first neural network is optimized using a stochastic gradient descent optimization method and then training is continued.

4. The method according to claim 3, characterized in that The skin sample image also includes a corrected sample image, and the prediction model that can be put into use based on the trained first neural network includes: Obtaining corrected fungal information of the corrected sample image; determining whether the corrected fungal information is consistent with the detection result; If the corrected fungal information is consistent with the detection result, a prediction model that can be put into use is obtained based on the trained first neural network.

5. The method according to claim 1, characterized in that: The training of a second neural network to obtain a target detection model based on the plurality of skin sample images, the prediction model, and the fungus information includes: Screening the plurality of skin sample images through the prediction model to obtain a plurality of positive skin sample images with fungi present, and recording the prediction model data; Processing the positive skin sample images using the prediction model data sequentially through the first convolutional layer, the second convolutional layer, the nonlinear transformation layer, the hidden layer, the first upsampling layer, the first upsampling layer, and the fully connected layer of the second neural network to obtain a plurality of prediction images; A target detection model is obtained according to the plurality of predicted images, the fungus information and the second neural network.

6. The method according to claim 5, characterized in that The predicted image includes predicted target information, the fungus information includes manually annotated target information, and obtaining a target detection model based on the predicted images, the fungus information, and the second neural network includes: Calculating a second loss value using a second loss function according to the manually labeled target information and the predicted target information; Determining whether the second loss value is less than a second preset value; If the second loss value is less than a second preset value, the training is stopped, and a target detection model that can be put into use is obtained based on the trained second neural network; If the second loss value is not less than a second preset value, the second neural network is optimized using a stochastic gradient descent optimization method and then training is continued.

7. A skin fungus detection system, characterized in that: The system comprises: A skin sample picture receiving module (701) is used to receive a number of skin sample pictures and record fungal information of the skin sample pictures; An image segmentation and combination module (702) segments the skin sample image into a number of refined areas, randomly combines the several refined areas into a number of groups of sample areas and records the combination information; A training data generation module (703) is used to sequentially perform smoothing, grayscale processing, and binary assignment on a number of the refined areas to obtain a number of feature point descriptors, and to obtain a number of sets of training data based on the number of feature point descriptors and the combination information; The prediction model generation module (704) is used to train the first neural network according to the plurality of sets of training data and the fungal information to obtain a prediction model; encode the plurality of sets of training data to obtain a plurality of sets of encoded training data; import the plurality of sets of encoded training data into the multi-head attention mechanism layer of the first neural network to obtain a plurality of sets of attention data; superimpose the plurality of sets of encoded training data and the plurality of sets of attention data and perform regularization processing to obtain regularized data; sequentially process the regularized data through the convolution layer, nonlinear transformation layer, upsampling layer and fully connected layer of the first neural network to obtain detection results of a plurality of sets of skin sample images; and obtain a prediction model according to the fungal information, the detection results and the first neural network; A target detection model generation module (705) is used to train a second neural network based on the skin sample images, the prediction model and the fungus information to obtain a target detection model; The skin fungus detection module (706) is configured to, when receiving a skin sample to be detected, perform skin fungus detection on the skin sample using the prediction model and the target detection model.

8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Skin automatic detection method based on integrated learning

    CN110008925A

  • Weak supervision semantic segmentation method, system and equipment based on random combination and medium

    CN115761234A