A kind of skin injury picture segmentation method based on depth networkTechnical field
The present invention relates to artificial intelligence fields, more particularly to a kind of skin injury picture based on depth network pointSegmentation method.
Background technique
Current skin image, which is divided, can be divided into two major classes according to the skin image classification used: based on skin lens imageMethod and based on general camera shooting image method.For the segmentation problem of skin lens image, have many research worksIt can achieve good result.But the acquisition of skin lens image can relatively complex and costly become the bottleneck of the relevant technologies.InstituteWith current cutting techniques are all more likely to the skin picture shot using general camera.As the mobile devices such as mobile phone are taken picturesFunction it is perfect, it is easy to obtain skin picture high-definition.Since these common skin pictures are illuminated by the light, shooting angle etc.Factor is influenced and is differed greatly, so higher requirements are also raised to cutting techniques.
Have many research achievements for the skin picture of general camera shooting, if Jeffrey was proposed in 2012,Using the TDLS dividing method of the texture conspicuousness of skin picture, Jafari etc. was proposed in 2016 based on convolutional neural networksParted pattern.But feature of the TDLS method based on manual extraction cannot effectively be directed to current segmentation task, thus leadIt causes the accuracy rate of segmentation lower, and the segmentation inefficiency of this method, needs could provide a skin picture completely within 1 minuteSegmentation result, it is poor in terms of user experience.On this basis, Jafari proposes the dividing method based on depth convolutional network,By the segmentation feature for learning to need automatically from training sample, segmentation performance is effectively promoted.But since this method is eachThe picture for needing to extract fixed window when predicting a location of pixels, be then input in network exported as a result, thus divideThe total time cut is approximately equal to: picture pixels number × network operation time.Certainly, in the case of considering by input is criticized, operationSpeed is slightly promoted.Runing time of the method that Jafari is proposed on GPU is substantially improved, but the operation on CPURate is still undesirable, does not accomplish to divide in real time.In addition, the method based on depth convolutional network has one intrinsic to askTopic: the segmentation result of output is more coarse, cannot completely keep the marginal information of original picture.
Summary of the invention
The present invention is split task without manual extraction skin picture feature, but is gone voluntarily using training dataStudy is suitable for the depth convolution feature of segmentation task;Pretreatment of the invention is very simple, only carries out picture pixels valueNormalization;In addition, compared to TDLS and Jafari using wave filter pretreatment mode solve illumination and contrast variation compared withBig problem, the present invention data enhance by way of enrich training data, allow model voluntarily learn optimal character representation withIt is split;The present invention has been more than existing method in the index of true positive rate, and the runing time on GPU and CPUIt is all far below existing model, can accomplish real-time skin image segmentation;Invention also uses the condition randoms connected entirelyField is used as post-processing approach, and the texture color feature of low level can be effectively utilized, sharpen the segmentation of fringe region.
To realize the above goal of the invention, the technical solution adopted is that:
A kind of skin injury picture segmentation method based on depth network, comprising the following steps:
Step S1: test image is enhanced and is pre-processed;
Step S2: it will be trained, obtain preliminary in pretreated test image is input to convolutional neural networksSegmentation result and probability output carry out parameter adjustment to convolutional neural networks according to preliminary segmentation result and probability output;
Step S3: training image is enhanced and is pre-processed;
Step S4: pretreated training image is input in the convolutional neural networks of training completion and is trained, obtainedTo preliminary segmentation result and probability output;
Step S5: segmentation result and probability output are iterated processing in the condition random field connected entirely;It obtains mostWhole segmentation result.
Preferably, the step S1 specifically includes the following steps:
Step S101: a compact No.1 rectangle frame is intercepted in picture, which surrounds in picture just damagesSkin area;
Step S102: random interception one includes No. two rectangle frames of No.1 rectangle frame;
Step S103: the picture re-scaling intercepted at random to fixed picture size;
Step S104: after scaling, random noise is introduced to picture, including change picture luminance and contrast at random;
Step S105: doing normalization operation to picture pixels value, so that treated, picture mean value is 0, variance 1.
Preferably, the picture size of the fixation of the step S103 is 224 × 224.
Preferably, the step S2 specifically includes the following steps:
Step S201: the energy function of setting condition random field is defined as follows:
Here y refers to the prediction result of full convolutional neural networks, and subscript i shows location of pixels, the first of energy functionItem is single potential-energy function ψu(yi)=- log P (yi), P (y herei) indicate neural network forecast location of pixels i classification yiProbability it is bigIt is small;
Step S202: the Section 2 of energy function is set is defined as:
Wherein, μ is the compatible function of label, fiAnd fjFor the picture feature of location of pixels i, κ(m)For m-th of kernel function andIts weight ω(m),
Step S203: following two kernel functions are used, are respectively as follows:
Wherein μ (yi, yj)=[yi≠yj], the feature input of kernel function includes location of pixels and RGB color information, i.e. public affairsP in formulai, pj, Ii, Ij。
Preferably, the training of convolutional neural networks is trained using the cross entropy loss function of two classification in step S2.
Compared with prior art, the beneficial effects of the present invention are:
1. the present invention proposes effective data enhanced scheme, existing data enhancing is random interception window, is causedThe picture of some interceptions cannot be guaranteed the integrality for damaging skin.Contrastingly, data enhanced scheme of the invention calculates firstThen compact damage skin area intercepts the rectangle frame comprising entire damage skin area again, is effectively guaranteed damageThe integrality of skin, thus accomplished that training is consistent with test data distribution unified.
2. the present invention learns a full convolutional neural networks to skin picture collection, therefore can be before only running primary networkTo in the case where propagation all over obtaining the result of all pixels position.Compared to the model based on window, full convolutional network of the inventionComputing repeatedly for convolution feature can be effectively avoided, thus the runing time on CPU and GPU greatly reduces, and can doTo real-time segmentation.
3. segmentation performance of the invention is good.
4. the present invention uses the condition random field connected entirely as post-processing approach, the segmentation knot of fringe region can be sharpenedFruit.Whether the model based on window or full convolutional network all fail the characteristics of image for considering low level, thus its segmentation knotFruit is not able to maintain the structure (such as texture, color) of these low levels, and the condition random field connected entirely can as a kind of graph modelThe segmentation in damage skin edge region is sharpened to make full use of these information, and gets rid of the erroneous segmentation area of small areaDomain.
Detailed description of the invention
Fig. 1 is flow chart of the invention.
Fig. 2 is influence of the data enhancing to segmentation result.
Fig. 3 is the segmentation result of different dividing methods.
Fig. 4 is that the time efficiency of different dividing methods compares.
Specific embodiment
The attached figures are only used for illustrative purposes and cannot be understood as limitating the patent;
Below in conjunction with drawings and examples, the present invention is further elaborated.
Embodiment 1
As shown in Figure 1, a kind of skin injury picture segmentation method based on depth network, comprising the following steps:
A kind of skin injury picture segmentation method based on depth network, comprising the following steps:
Step S1: test image is enhanced and is pre-processed;
Step S2: it will be trained, obtain preliminary in pretreated test image is input to convolutional neural networksSegmentation result and probability output carry out parameter adjustment to convolutional neural networks according to preliminary segmentation result and probability output;
Step S3: training image is enhanced and is pre-processed;
Step S4: pretreated training image is input in the convolutional neural networks of training completion and is trained, obtainedTo preliminary segmentation result and probability output;
Step S5: segmentation result and probability output are iterated processing in the condition random field connected entirely, obtained mostWhole segmentation result.
Preferably, the step S1 specifically includes the following steps:
Step S101: a compact No.1 rectangle frame is intercepted in picture, which surrounds in picture just damagesSkin area;
Step S102: random interception one includes No. two rectangle frames of No.1 rectangle frame;
Step S103: the picture re-scaling intercepted at random to fixed picture size;
Step S104: after scaling, random noise is introduced to picture, including change picture luminance and contrast at random;
Step S105: doing normalization operation to picture pixels value, so that treated, picture mean value is 0, variance 1.
Preferably, the picture size of the fixation of the step S103 is 224 × 224.
Preferably, the step S2 specifically includes the following steps:
Step S201: the energy function of setting condition random field is defined as follows:
Here y refers to the prediction result of full convolutional neural networks, and subscript i shows location of pixels, the first of energy functionItem is single potential-energy function ψu(yi)=- log P (yi), P (y herei) indicate neural network forecast location of pixels i classification yiProbability it is bigIt is small;
Step S202: the Section 2 of energy function is set is defined as:
Wherein, μ is the compatible function of label, fiAnd fjFor the picture feature of location of pixels i, κ(m)For m-th of kernel function andIts weight ω(m),
Step S203: following two kernel functions are used, are respectively as follows:
Wherein μ (yi, yj)=[yi≠yj], the feature input of kernel function includes location of pixels and RGB color information, i.e. public affairsP in formulai, pj, Ii, Ij。
Preferably, the training of convolutional neural networks is trained using the cross entropy loss function of two classification in step S2.
Embodiment 2
The present invention and existing TDLS and Jafari method are split result and model running rate by the present embodimentCompare.
For the fairness compared, the present embodiment is provided with identical experimental situation, and the training stage of model all usesFor 126 pictures of DermQuest database as training data, the inside includes 66 melanoma pictures and 60 non-melanoma figuresPiece.Since data are limited, the experimental program of cross validation is taken, training data 4 parts of sizes such as is randomly divided into, soThe 3 parts therein training for model are successively chosen afterwards, and remaining 1 part collects as evaluation and test, finally takes the flat of 4 experimental resultsMean value.In terms of evaluation metrics, three true positive rate, true negative rate and accuracy rate indexs are used.
Before comparison, it is first tested to verify the necessity of data enhancing module in the present invention, experimental result such as Fig. 2It is shown.Wherein, data enhancing one column × indicate without use data enhancement operations, and √ expression used the present invention to mentionData enhancement operations out.It can be seen that data enhancing influences the result of true positive rate obviously, to improve more than 12 percentagesPoint.
Fig. 3 gives the segmentation result of distinct methods.It can be seen that segmentation result of the invention is in true positive rate indexIt is higher than TDLS and Jafari method.
Fig. 4 gives the runing time comparison of different dividing methods.In order to accurately evaluate and test the different model running times,Different methods is run on identical machine.Since Jafari method segmentation accuracy rate is better than TDLS method, compare at thisThe method of the present invention and Jafari.Every kind of method is run 10 times when test, using this 10 runing time mean values as methodRuning time.The segmentation result of a 400*600 size picture in order to obtain, Jafari method is the case where batch size is 128Under circulate beyond 1800 results that can just obtain each location of pixels.But the present invention has been due to having used full convolutional neural networks,Only primary network, which need to be run, can obtain the result of whole picture.Finally, when operation on either CPU or GPUBetween, the present invention will be significantly faster than Jafari method.
Obviously, the above embodiment of the present invention be only to clearly illustrate example of the present invention, and not be pairThe restriction of embodiments of the present invention.For those of ordinary skill in the art, may be used also on the basis of the above descriptionTo make other variations or changes in different ways.There is no necessity and possibility to exhaust all the enbodiments.It is all thisMade any modifications, equivalent replacements, and improvements etc., should be included in the claims in the present invention within the spirit and principle of inventionProtection scope within.