WO2021051497A1 - Pulmonary tuberculosis determination method and apparatus, computer device, and storage medium - Google Patents

Pulmonary tuberculosis determination method and apparatus, computer device, and storage medium Download PDF

Info

Publication number
WO2021051497A1
WO2021051497A1 PCT/CN2019/115946 CN2019115946W WO2021051497A1 WO 2021051497 A1 WO2021051497 A1 WO 2021051497A1 CN 2019115946 W CN2019115946 W CN 2019115946W WO 2021051497 A1 WO2021051497 A1 WO 2021051497A1
Authority
WO
WIPO (PCT)
Prior art keywords
training
network
resnet
target image
image sample
Prior art date
Application number
PCT/CN2019/115946
Other languages
French (fr)
Chinese (zh)
Inventor
任嘉祥
王健宗
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021051497A1 publication Critical patent/WO2021051497A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H50/00ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
    • G16H50/20ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for computer-aided diagnosis, e.g. based on medical expert systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation

Definitions

  • This application relates to the field of artificial intelligence technology, and in particular to a method, device, computer equipment and storage medium for determining tuberculosis.
  • Tuberculosis is a disease that affects many people and requires accurate diagnosis before it can be treated.
  • hospitals usually have X-ray machines, but some related staff lack radiology expertise to accurately evaluate images, resulting in poor diagnosis; some related staff can manually check X-rays, but the task is time-consuming and screening costs Larger.
  • the embodiments of the present application provide a tuberculosis determination method, device, computer equipment, and storage medium to solve the current problem that the rapid determination of tuberculosis cannot be achieved under the premise of ensuring a high accuracy rate.
  • an embodiment of the present application provides a method for determining tuberculosis, including:
  • the target image to be classified is input into the tuberculosis classification model to obtain a prediction probability.
  • the prediction probability is the probability that the tuberculosis is predicted to be positive. When the prediction probability is greater than a preset threshold, it is determined to be the same as the target to be classified.
  • the training sample set includes a target image sample for model training and a target image sample for model testing, the target image sample for model training and a target image sample for model testing There is no same target image sample between them;
  • an apparatus for determining tuberculosis including:
  • the first acquisition module is used to acquire a chest X-ray image to be classified
  • the second acquisition module is configured to convert the chest X-ray image to be classified into a target image to be classified according to preset image processing steps, wherein the resolution and dimension of the target image to be classified are the same as the training tuberculosis classification model The target image samples are the same;
  • the judging module is used to input the target image to be classified into the tuberculosis classification model to obtain the predicted probability.
  • the predicted probability is the probability that the predicted tuberculosis is positive.
  • the Tuberculosis is present in the chest X-ray image to be classified corresponding to the target image to be classified, wherein the tuberculosis classification model is obtained through a construction module, an initialization module, a training module, an update module, and a third acquisition module:
  • the construction module is used to construct a training sample set, wherein the training sample set includes a target image sample used for model training and a target image sample used for model testing, and the target image sample used for model training is used for model training. There is no identical target image sample among the tested target image samples;
  • the initialization module is used to use the ResNet-50 network as a deep neural network for training, and use the weights obtained by pre-training as the initial weights of the ResNet-50 network;
  • a training module configured to input the target image samples used for model training into the ResNet-50 network for training, and the output result is the predicted probability of pulmonary tuberculosis positive;
  • An update module configured to update the weight of the ResNet-50 network according to the predicted probability, and stop training until the updated change amount is less than a first preset threshold to obtain the model to be tested;
  • the third acquisition module is configured to use the target image sample for model testing to test the model to be tested, and when the accuracy of the test result output by the model to be tested is greater than the preset accuracy, the The model is used as the pulmonary tuberculosis classification model.
  • a computer device in a third aspect, includes a memory, a processor, and computer-readable instructions that are stored in the memory and can run on the processor, and the processor implements the foregoing when the computer-readable instructions are executed. The steps of the tuberculosis determination method.
  • an embodiment of the present application provides a computer non-volatile readable storage medium, including: computer readable instructions, which when executed by a processor, implement the steps of the above method for determining tuberculosis.
  • the tuberculosis classification model is used to realize the tuberculosis determination of the chest X-ray image to be classified.
  • the tuberculosis classification model uses the ResNet-50 network as the deep neural network for training, so that the trained tuberculosis classification model has strong feature extraction capabilities and high classification accuracy; in addition, the training tuberculosis classification model also uses migration learning Method, the weights obtained by pre-training are used as the initial weights of the ResNet-50 network, which can speed up model training and improve the accuracy of model classification.
  • the embodiment of the application uses the tuberculosis classification model trained for tuberculosis determination.
  • the tuberculosis determination can be achieved according to the predicted probability output by the tuberculosis classification model. , Under the premise of ensuring high accuracy, the rapid determination of tuberculosis can be realized.
  • Fig. 1 is a flowchart of a method for determining tuberculosis in an embodiment of the present application
  • Figure 2 is a schematic diagram of a tuberculosis determination device in an embodiment of the present application
  • Fig. 3 is a schematic diagram of a computer device in an embodiment of the present application.
  • first, second, third, etc. may be used in the embodiments of the present application to describe the preset range, etc., these preset ranges should not be limited to these terms. These terms are only used to distinguish the preset ranges from each other.
  • the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
  • the word “if” as used herein can be interpreted as “when” or “when” or “in response to determination” or “in response to detection”.
  • the phrase “if determined” or “if detected (statement or event)” can be interpreted as “when determined” or “in response to determination” or “when detected (statement or event) )” or “in response to detection (statement or event)”.
  • Fig. 1 shows a flow chart of the method for determining tuberculosis in this embodiment.
  • the tuberculosis determination method can be applied to the tuberculosis determination system, and the tuberculosis determination system can be used to determine the tuberculosis of the chest X-ray image.
  • the pulmonary tuberculosis determination system can be specifically applied to a computer device, where the computer device is a device that can perform human-computer interaction with a user, including but not limited to devices such as computers, smart phones, and tablets.
  • the method for determining tuberculosis includes the following steps:
  • the chest X-ray image that the user wants to determine for tuberculosis is the chest X-ray image to be classified.
  • S2 Convert the chest X-ray image to be classified into the target image to be classified according to the preset image processing steps, where the resolution and dimension of the target image to be classified are the same as the target image sample for training the tuberculosis classification model.
  • the directly obtained chest X-ray image to be classified needs to be converted into the target image to be classified before it can be input into the tuberculosis determination model for determination, so that its resolution and dimension are the same as the target image for training the tuberculosis classification model.
  • the samples are the same, thereby improving the accuracy of tuberculosis determination.
  • the resolution and dimension of the target image samples used for training the tuberculosis classification model are different from those of chest X-ray images.
  • the ability to extract features of the tuberculosis determination model can be improved, thereby improving the accuracy of tuberculosis determination. rate.
  • the preset image processing is the processing of the image samples of the chest X-ray film when constructing the training sample set in the following steps S11-S15.
  • S3 Input the target image to be classified into the tuberculosis classification model to obtain the predicted probability.
  • the predicted probability is the probability that the predicted tuberculosis is positive.
  • the predicted probability is greater than the preset threshold, determine the chest X-ray to be classified corresponding to the target image to be classified
  • the film image has tuberculosis.
  • the chest X-ray image to be classified can be classified according to whether there is tuberculosis, and the determination of tuberculosis is also completed during the classification.
  • the preset threshold can be specifically set to 0.5, and the accuracy of tuberculosis determination under the preset threshold is relatively high.
  • the model training steps adopted by the tuberculosis classification model include:
  • S10 Construct a training sample set, where the training sample set includes a target image sample used for model training and a target image sample used for model testing, between the target image sample used for model training and the target image sample used for model testing There are no identical target image samples.
  • the absence of the same target image sample between the target image sample used for model training and the target image sample used for model testing can improve the generalization ability of the tuberculosis classification model, and can deal with more tuberculosis judgments in different scenarios.
  • the step of constructing the training sample set specifically includes:
  • S12 Process the image sample into an image sample with a preset resolution, where, for an image sample with a resolution higher than the preset resolution, the down-sampling method is used to down-sample the resolution of the image sample to the preset resolution. For image samples whose resolution is lower than the preset resolution, use bilinear interpolation to upsample the resolution of the image samples to the preset resolution;
  • the preset resolution may be 512*512.
  • the tuberculosis classification model trained at this resolution has a faster calculation speed and a higher classification accuracy.
  • the resolution of the directly acquired image samples of the chest X-ray film may be too high or too low.
  • the image samples may be processed to a resolution that is beneficial for model training to ensure the accuracy of the model.
  • the normalized expression is specifically (x-127.5)/127.5.
  • the image sample is being copied, and the target image sample obtained by expanding the dimension of the image sample will be expressed as 512*512*N, where N is the number of times of copying. Copying the image sample and expanding the dimension of the image sample can increase the number of input samples, help the model to fully train, and improve the accuracy of tuberculosis determination.
  • S15 Use the target image samples to construct a training sample set, where the ratio of the target image samples used for model training and the target image samples used for model testing in the training sample set is 5:1.
  • the model training and model configuration can be completed well under this ratio, which is a better ratio.
  • steps S11-S15 a specific implementation manner for constructing a training sample set is provided, which can effectively process the image samples of the original chest X-ray film, so that the classification effect of the tuberculosis classification model is more accurate.
  • the ResNet-50 network contains a total of 49 convolutional layers, a standardized layer and a fully connected layer.
  • the classification effect of the ResNet-50 network is better.
  • the ResNet-50 network is used as the original model for training the tuberculosis classification model, and the migration learning method is adopted, and the weights obtained by pre-training are used as the initial weights of the ResNet-50 network.
  • the weight value obtained by the pre-training may specifically be the initial weight value used by the developer when dealing with other projects. Among them, the content of the project or the principle of function realization are more relevant to the tuberculosis classification, the better.
  • the speed of model training can be accelerated, and the accuracy of model classification can be improved. rate.
  • the input dimension of the ResNet-50 network can be specifically set to 512x512x3.
  • the target image samples used for model training are input into the ResNet-50 network for training, and a 256x256x64 feature map is obtained after a 7x7x64 convolutional layer and a 3x3 maximum pooling layer with a step size of 2; Then after 4 groups of residual modules, the output changes to 128x128x256, 64x64x512, 32x32x1024, 16x16x2048 feature maps (wherein, for feature maps with different dimensions, first use a 1x1 convolutional layer to adjust the dimensions of the input features to match the desired The dimension of the feature map is added, and then the elements of the corresponding position are added), and finally through the standardized layer and the fully connected layer of dimension 1, the output result is the predicted probability of pulmonary tuberculosis positive.
  • step of updating the weight of the ResNet-50 network according to the predicted probability specifically includes:
  • S42 Use a backpropagation algorithm to return the loss value generated during the training process to the ResNet-50 network, and update the weight of the ResNet-50 network according to the loss value returned during each training.
  • steps S41-S42 a specific implementation manner for updating the weights of the ResNet-50 network according to the predicted probability is provided, and the network parameters can be updated under supervised learning.
  • S50 Use the target image sample for model testing to test the model to be tested, and when the accuracy rate of the test result output by the model to be tested is greater than the preset accuracy rate, the model to be tested is used as a tuberculosis classification model.
  • the ResNet-50 network includes a convolutional layer, a standardization layer, and a fully connected layer.
  • the tuberculosis classification model first performs a preset number of passes on the convolutional layer in the ResNet-50 network when updating the weights of the ResNet-50 network. Update, after the preset number of training passes, freeze the weights of the convolutional layer in the ResNet-50 network, and use a learning rate of 0.001 to train the standardized layer and the fully connected layer in the ResNet-50 network for 1000 times. The weights of the standardized layer and the fully connected layer are updated, where freezing means that the weights of the convolutional layer in the ResNet-50 network are not updated.
  • the weights of the convolutional layer contain key features for distinguishing the target image samples, but the features reflected in the pre-training weights come from the sample training of other items and cannot be used to distinguish tuberculosis samples.
  • transfer learning is used to first train the convolutional layer to reflect the characteristics of judging tuberculosis disease; then freeze the convolutional layer, train the standardized layer and the fully connected layer, which can further improve the feature extraction ability of the model, and then improve the model The accuracy rate.
  • the tuberculosis classification model updates the weights of the ResNet-50 network
  • it first updates the convolutional layer in the ResNet-50 network within a preset number of passes.
  • the ResNet-50 network includes a convolutional layer, and the preset number of passes is specific It can be 3000 times.
  • the training process is to train the ResNet-50 network 3000 times with a learning rate of 0.0001, where each pass includes 10 target image samples for training.
  • the tuberculosis classification model is used to realize the tuberculosis determination of the chest X-ray image to be classified.
  • the tuberculosis classification model uses the ResNet-50 network as the deep neural network for training, so that the trained tuberculosis classification model has strong feature extraction capabilities and high classification accuracy; in addition, the training tuberculosis classification model also uses migration learning Method, the weights obtained by pre-training are used as the initial weights of the ResNet-50 network, which can speed up model training and improve the accuracy of model classification.
  • the embodiment of the application uses the tuberculosis classification model trained for tuberculosis determination.
  • the tuberculosis determination can be achieved according to the predicted probability output by the tuberculosis classification model. , Under the premise of ensuring high accuracy, the rapid determination of tuberculosis can be realized.
  • the embodiments of the present application further provide device embodiments that implement the steps and methods in the foregoing method embodiments.
  • Fig. 2 shows a principle block diagram of a tuberculosis determination device corresponding to the tuberculosis determination method in the embodiment one-to-one.
  • the tuberculosis determination device includes a first acquisition module 10, a second acquisition module 20, a determination module 30, a construction module 40, an initialization module 50, a training module 60, an update module 70 and a third acquisition module 80.
  • the implementation functions of the first acquisition module 10, the second acquisition module 20, the determination module 30, the construction module 40, the initialization module 50, the training module 60, the update module 70, and the third acquisition module 80 correspond to the tuberculosis determination method in the embodiment
  • the steps of are one-to-one correspondence, in order to avoid repetition, this embodiment will not describe them one by one.
  • the first acquisition module 10 is used to acquire a chest X-ray image to be classified.
  • the second acquisition module 20 is used to convert the chest X-ray image to be classified into a target image to be classified according to the preset image processing steps, wherein the resolution and dimension of the target image to be classified are the same as the target image for training the tuberculosis classification model The samples are the same.
  • the determination module 30 is used to input the target image to be classified into the tuberculosis classification model to obtain the predicted probability.
  • the predicted probability is the probability that the tuberculosis is predicted to be positive. When the predicted probability is greater than a preset threshold, determine the target image to be classified.
  • the classification of chest X-ray images has tuberculosis, and the tuberculosis classification model is obtained through the construction module, the initialization module, the training module, the update module, and the third acquisition module:
  • the construction module 40 is used to construct a training sample set, where the training sample set includes a target image sample used for model training and a target image sample used for model testing, a target image sample used for model training and a target used for model testing The same target image sample does not exist between the image samples.
  • the initialization module 50 is used to use the ResNet-50 network as a training deep neural network, and use the weights obtained by pre-training as the initial weights of the ResNet-50 network.
  • the training module 60 is used to input the target image samples used for model training into the ResNet-50 network for training, and the output result is the predicted probability of pulmonary tuberculosis positive.
  • the update module 70 is configured to update the weight of the ResNet-50 network according to the predicted probability, and stop training until the updated change amount is less than the first preset threshold to obtain the model to be tested.
  • the third acquisition module 80 is used to test the model to be tested using the target image sample for model testing, and when the accuracy of the test result output by the model to be tested is greater than the preset accuracy, the model to be tested is used as a tuberculosis classification model.
  • the building module 40 is specifically used for:
  • the image samples are processed into image samples with a preset resolution.
  • the down-sampling method is used to down-sample the resolution of the image samples to the preset resolution.
  • image samples lower than the preset resolution use bilinear interpolation to upsample the resolution of the image samples to the preset resolution;
  • the target image samples are used to construct a training sample set, where the ratio of the target image samples used for model training and the target image samples used for model testing in the training sample set is 5:1.
  • the ResNet-50 network includes a convolutional layer.
  • the training process is to use a learning rate of 0.0001 to train 3000 times the ResNet-50 network, where each training pass includes 10 A sample of the target image used for training.
  • the ResNet-50 network includes a convolutional layer, a standardization layer, and a fully connected layer.
  • the tuberculosis classification model first performs a preset number of passes to the convolutional layer in the ResNet-50 network when updating the weights of the ResNet-50 network After updating, the preset number of passes is trained, the weights of the convolutional layer in the ResNet-50 network are frozen, and the learning rate of 0.001 is used to train the standardized layer and the fully connected layer in the ResNet-50 network 1000 times.
  • the weights of the standardized layer and the fully connected layer are updated, where freezing means that the weights of the convolutional layer in the ResNet-50 network are not updated.
  • the update module 70 is specifically used for:
  • the cross entropy loss function is used to calculate the loss value generated during the training process, where the cross entropy loss function is expressed as: Represents the label of the target image sample used for training, and y represents the predicted probability;
  • the backpropagation algorithm is used to return the loss value generated during the training process to the ResNet-50 network, and the weight of the ResNet-50 network is updated according to the loss value returned during each training.
  • the tuberculosis classification model is used to realize the tuberculosis determination of the chest X-ray image to be classified.
  • the tuberculosis classification model uses the ResNet-50 network as the deep neural network for training, so that the trained tuberculosis classification model has strong feature extraction capabilities and high classification accuracy; in addition, the training tuberculosis classification model also uses migration learning Method, the weights obtained by pre-training are used as the initial weights of the ResNet-50 network, which can speed up model training and improve the accuracy of model classification.
  • the embodiment of the application uses the tuberculosis classification model trained for tuberculosis determination.
  • the tuberculosis determination can be achieved according to the predicted probability output by the tuberculosis classification model. , Under the premise of ensuring high accuracy, the rapid determination of tuberculosis can be realized.
  • This embodiment provides a computer non-volatile readable storage medium, the computer non-volatile readable storage medium stores computer readable instructions, and when the computer readable instructions are executed by a processor, the method for determining tuberculosis in the embodiment is implemented To avoid repetition, I won’t repeat them here.
  • the computer-readable instructions realize the functions of the various modules/units in the tuberculosis determination device in the embodiment when being executed by the processor. In order to avoid repetition, details are not repeated here.
  • Fig. 3 is a schematic diagram of a computer device provided by an embodiment of the present application.
  • the computer device 90 of this embodiment includes: a processor 91, a memory 92, and computer-readable instructions 93 stored in the memory 92 and running on the processor 91, and the computer-readable instructions 93 are processed.
  • the method for determining tuberculosis in the embodiment is implemented when the device 91 is executed. In order to avoid repetition, it will not be repeated here.
  • the computer-readable instruction 93 is executed by the processor 91, the function of each model/unit in the tuberculosis determination device in the embodiment is realized. In order to avoid repetition, it will not be repeated here.
  • the computer device 90 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the computer device 90 may include, but is not limited to, a processor 91 and a memory 92.
  • FIG. 3 is only an example of the computer device 90, and does not constitute a limitation on the computer device 90. It may include more or less components than those shown in the figure, or a combination of certain components, or different components.
  • computer equipment may also include input and output devices, network access devices, buses, and so on.
  • the so-called processor 91 may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 92 may be an internal storage unit of the computer device 90, such as a hard disk or a memory of the computer device 90.
  • the memory 92 may also be an external storage device of the computer device 90, such as a plug-in hard disk equipped on the computer device 90, a smart media card (SMC), a secure digital (SD) card, and a flash memory card (Flash). Card) and so on.
  • the memory 92 may also include both an internal storage unit of the computer device 90 and an external storage device.
  • the memory 92 is used to store computer readable instructions and other programs and data required by the computer equipment.
  • the memory 92 can also be used to temporarily store data that has been output or will be output.

Abstract

A pulmonary tuberculosis determination method and apparatus, a computer device, and a storage medium, relating to the technical field of artificial intelligence. The pulmonary tuberculosis determination method comprises: acquiring a chest X-ray image to be classified; converting, according to pre-configured image processing steps, the chest X-ray image into a target image to be classified, the resolution and the dimension of the target image are the same as those of a target image sample for training a pulmonary tuberculosis classification model; and inputting the target image into the pulmonary tuberculosis classification model to acquire a predicted probability, the predicted probability being the probability acquired by means of prediction that a test for pulmonary tuberculosis is positive, and when the predicted probability is greater than a pre-configured threshold, determining that pulmonary tuberculosis exists in the chest X-ray image corresponding to the target image. The pulmonary tuberculosis determination method ensures high accuracy, and achieves rapid determination of pulmonary tuberculosis.

Description

肺结核判定方法、装置、计算机设备及存储介质Tuberculosis determination method, device, computer equipment and storage medium
本申请以2019年9月16日提交的申请号为201910869773.6,名称为“肺结核判定方法、装置、计算机设备及存储介质”的中国发明专利申请为基础,并要求其优先权。This application is based on the Chinese invention patent application filed on September 16, 2019 with the application number 201910869773.6 and titled "Method, Apparatus, Computer Equipment and Storage Medium for Tuberculosis Determination", and claims its priority.
【技术领域】【Technical Field】
本申请涉及人工智能技术领域,尤其涉及一种肺结核判定方法、装置、计算机设备及存储介质。This application relates to the field of artificial intelligence technology, and in particular to a method, device, computer equipment and storage medium for determining tuberculosis.
【背景技术】【Background technique】
肺结核是一种影响着许多人口的疾病,需要准确的诊断后才可以进行治疗。目前医院中通常都有X光机,但部分相关工作人员缺乏放射学专业知识来准确评估图像,导致诊断效果差;部分相关工作人员可进行手动检查X光片,但是任务比较耗时,筛选成本较大。目前无法实现在保证准确率较高的前提下,实现对肺结核的快速判定。Tuberculosis is a disease that affects many people and requires accurate diagnosis before it can be treated. At present, hospitals usually have X-ray machines, but some related staff lack radiology expertise to accurately evaluate images, resulting in poor diagnosis; some related staff can manually check X-rays, but the task is time-consuming and screening costs Larger. At present, it is impossible to achieve rapid determination of tuberculosis under the premise of ensuring a high accuracy rate.
【发明内容】[Summary of the invention]
有鉴于此,本申请实施例提供了一种肺结核判定方法、装置、计算机设备及存储介质,用以解决目前无法实现在保证准确率较高的前提下,实现对肺结核的快速判定的问题。In view of this, the embodiments of the present application provide a tuberculosis determination method, device, computer equipment, and storage medium to solve the current problem that the rapid determination of tuberculosis cannot be achieved under the premise of ensuring a high accuracy rate.
第一方面,本申请实施例提供了一种肺结核判定方法,包括:In the first aspect, an embodiment of the present application provides a method for determining tuberculosis, including:
获取待分类胸部X光片图像;Acquire X-ray images of the chest to be classified;
按照预设的图像处理步骤,将所述待分类胸部X光片图像转换为待分类目标图像,其中,所述待分类目标图像的分辨率和维度与训练肺结核分类模型的目标图像样本相同;Converting the chest X-ray image to be classified into a target image to be classified according to a preset image processing step, wherein the resolution and dimension of the target image to be classified are the same as the target image sample for training the tuberculosis classification model;
将所述待分类目标图像输入到所述肺结核分类模型中,得到预测概率,所述预测概率为预测肺结核为阳性的概率,当所述预测概率大于预设阈值时,判定与所述待分类目标图像对应的所述待分类胸部X光片图像存在肺结核,其中,所述肺结核分类模型采用的模型训练步骤包括:The target image to be classified is input into the tuberculosis classification model to obtain a prediction probability. The prediction probability is the probability that the tuberculosis is predicted to be positive. When the prediction probability is greater than a preset threshold, it is determined to be the same as the target to be classified. There is tuberculosis in the chest X-ray image to be classified corresponding to the image, wherein the model training steps adopted by the tuberculosis classification model include:
构建训练样本集,其中,所述训练样本集包括用于模型训练的目标图像样本和用于模型测试的目标图像样本,所述用于模型训练的目标图像样本和用于模型测试的目标图像样本之间不存在相同的目标图像样本;Construct a training sample set, wherein the training sample set includes a target image sample for model training and a target image sample for model testing, the target image sample for model training and a target image sample for model testing There is no same target image sample between them;
采用ResNet-50网络作为训练的深度神经网络,并将预训练得到的权值作为所述ResNet-50网络初始的权值;Adopting the ResNet-50 network as the training deep neural network, and using the pre-trained weights as the initial weights of the ResNet-50 network;
将所述用于模型训练的目标图像样本输入到所述ResNet-50网络中训练,输出结果为肺结核阳性的预测概率;Input the target image sample used for model training into the ResNet-50 network for training, and the output result is the predicted probability of pulmonary tuberculosis positive;
根据所述预测概率更新所述ResNet-50网络的权值,直到更新的变化量均小于第一预设阈值时停止训练,得到待测试模型;Update the weight of the ResNet-50 network according to the predicted probability, and stop training until the updated change amount is less than the first preset threshold to obtain the model to be tested;
采用所述用于模型测试的目标图像样本测试所述待测试模型,当所述待测试模型输出的测试结果的准确率大于预设准确率时,将所述待测试模型作为所述肺结核分类模型。Use the target image sample for model testing to test the model to be tested, and when the accuracy rate of the test result output by the model to be tested is greater than the preset accuracy rate, use the model to be tested as the tuberculosis classification model .
第二方面,本申请实施例提供了一种肺结核判定装置,包括:In the second aspect, an embodiment of the present application provides an apparatus for determining tuberculosis, including:
第一获取模块,用于获取待分类胸部X光片图像;The first acquisition module is used to acquire a chest X-ray image to be classified;
第二获取模块,用于按照预设的图像处理步骤,将所述待分类胸部X光片图像转换为待分类目标图像,其中,所述待分类目标图像的分辨率和维度与训练肺结核分类模型的目标图像样本相同;The second acquisition module is configured to convert the chest X-ray image to be classified into a target image to be classified according to preset image processing steps, wherein the resolution and dimension of the target image to be classified are the same as the training tuberculosis classification model The target image samples are the same;
判定模块,用于将所述待分类目标图像输入到所述肺结核分类模型中,得到预测概率,所述预测概率为预测肺结核为阳性的概率,当所述预测概率大于预设阈值时,判定与所述待分类目标图像对应的所述待分类胸部X光片图像存在肺结核,其中,所述肺结核分类模型通过构建模块、初始化模块、训练模块、更新模块和第三获取模块得到:The judging module is used to input the target image to be classified into the tuberculosis classification model to obtain the predicted probability. The predicted probability is the probability that the predicted tuberculosis is positive. When the predicted probability is greater than a preset threshold, the Tuberculosis is present in the chest X-ray image to be classified corresponding to the target image to be classified, wherein the tuberculosis classification model is obtained through a construction module, an initialization module, a training module, an update module, and a third acquisition module:
构建模块,用于构建训练样本集,其中,所述训练样本集包括用于模型训练的目标图像样本和用于模型测试的目标图像样本,所述用于模型训练的目标图像样本和用于模型测试的目标图像样本之间不存在相同的目标图像样本;The construction module is used to construct a training sample set, wherein the training sample set includes a target image sample used for model training and a target image sample used for model testing, and the target image sample used for model training is used for model training. There is no identical target image sample among the tested target image samples;
初始化模块,用于采用ResNet-50网络作为训练的深度神经网络,并将预训练得到的权值作为所述ResNet-50网络初始的权值;The initialization module is used to use the ResNet-50 network as a deep neural network for training, and use the weights obtained by pre-training as the initial weights of the ResNet-50 network;
训练模块,用于将所述用于模型训练的目标图像样本输入到所述ResNet-50网络中训练,输出结果为肺结核阳性的预测概率;A training module, configured to input the target image samples used for model training into the ResNet-50 network for training, and the output result is the predicted probability of pulmonary tuberculosis positive;
更新模块,用于根据所述预测概率更新所述ResNet-50网络的权值,直到更新的变化量均小于第一预设阈值时停止训练,得到待测试模型;An update module, configured to update the weight of the ResNet-50 network according to the predicted probability, and stop training until the updated change amount is less than a first preset threshold to obtain the model to be tested;
第三获取模块,用于采用所述用于模型测试的目标图像样本测试所述待测试模型,当 所述待测试模型输出的测试结果的准确率大于预设准确率时,将所述待测试模型作为所述肺结核分类模型。The third acquisition module is configured to use the target image sample for model testing to test the model to be tested, and when the accuracy of the test result output by the model to be tested is greater than the preset accuracy, the The model is used as the pulmonary tuberculosis classification model.
第三方面,一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现上述肺结核判定方法的步骤。In a third aspect, a computer device includes a memory, a processor, and computer-readable instructions that are stored in the memory and can run on the processor, and the processor implements the foregoing when the computer-readable instructions are executed. The steps of the tuberculosis determination method.
第四方面,本申请实施例提供了一种计算机非易失性可读存储介质,包括:计算机可读指令,所述计算机可读指令被处理器执行时实现上述肺结核判定方法的步骤。In a fourth aspect, an embodiment of the present application provides a computer non-volatile readable storage medium, including: computer readable instructions, which when executed by a processor, implement the steps of the above method for determining tuberculosis.
在本申请实施例中,采用肺结核分类模型实现对待分类胸部X光片图像的肺结核判定。该肺结核分类模型采用ResNet-50网络作为训练的深度神经网络,使得训练得到的肺结核分类模型具有较强的特征提取能力,且分类准确率较高;另外,训练肺结核分类模型还采用了迁移学习的方法,将预训练得到的权值作为ResNet-50网络初始的权值,能够加快模型训练的速度,并且提高模型分类的准确率。本申请实施例通过针对肺结核判定所进行训练得到的肺结核分类模型,在输入由待分类胸部X光片图像转换得到的待分类目标图像后,即可根据肺结核分类模型输出的预测概率实现肺结核的判定,能够在保证准确率较高的前提下,实现对肺结核的快速判定。In the embodiment of the present application, the tuberculosis classification model is used to realize the tuberculosis determination of the chest X-ray image to be classified. The tuberculosis classification model uses the ResNet-50 network as the deep neural network for training, so that the trained tuberculosis classification model has strong feature extraction capabilities and high classification accuracy; in addition, the training tuberculosis classification model also uses migration learning Method, the weights obtained by pre-training are used as the initial weights of the ResNet-50 network, which can speed up model training and improve the accuracy of model classification. The embodiment of the application uses the tuberculosis classification model trained for tuberculosis determination. After inputting the target image to be classified converted from the chest X-ray image to be classified, the tuberculosis determination can be achieved according to the predicted probability output by the tuberculosis classification model. , Under the premise of ensuring high accuracy, the rapid determination of tuberculosis can be realized.
【附图说明】【Explanation of the drawings】
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative labor, other drawings can be obtained from these drawings.
图1是本申请一实施例中肺结核判定方法的一流程图;Fig. 1 is a flowchart of a method for determining tuberculosis in an embodiment of the present application;
图2是本申请一实施例中肺结核判定装置的一示意图;Figure 2 is a schematic diagram of a tuberculosis determination device in an embodiment of the present application;
图3是本申请一实施例中计算机设备的一示意图。Fig. 3 is a schematic diagram of a computer device in an embodiment of the present application.
【具体实施方式】【detailed description】
为了更好的理解本申请的技术方案,下面结合附图对本申请实施例进行详细描述。In order to better understand the technical solutions of the present application, the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
应当明确,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。It should be clear that the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
在本申请实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。 在本申请实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的相同的字段,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that the term "and/or" used herein is only a description of the same field of the associated object, indicating that there can be three relationships. For example, A and/or B can mean that A exists alone and A exists at the same time. And B, there are three cases of B alone. In addition, the character "/" in this text generally indicates that the associated objects before and after are in an "or" relationship.
应当理解,尽管在本申请实施例中可能采用术语第一、第二、第三等来描述预设范围等,但这些预设范围不应限于这些术语。这些术语仅用来将预设范围彼此区分开。例如,在不脱离本申请实施例范围的情况下,第一预设范围也可以被称为第二预设范围,类似地,第二预设范围也可以被称为第一预设范围。It should be understood that, although the terms first, second, third, etc. may be used in the embodiments of the present application to describe the preset range, etc., these preset ranges should not be limited to these terms. These terms are only used to distinguish the preset ranges from each other. For example, without departing from the scope of the embodiments of the present application, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”或“响应于检测”。类似地,取决于语境,短语“如果确定”或“如果检测(陈述的条件或事件)”可以被解释成为“当确定时”或“响应于确定”或“当检测(陈述的条件或事件)时”或“响应于检测(陈述的条件或事件)”。Depending on the context, the word "if" as used herein can be interpreted as "when" or "when" or "in response to determination" or "in response to detection". Similarly, depending on the context, the phrase "if determined" or "if detected (statement or event)" can be interpreted as "when determined" or "in response to determination" or "when detected (statement or event) )" or "in response to detection (statement or event)".
图1示出本实施例中肺结核判定方法的一流程图。该肺结核判定方法可应用在肺结核判定系统上,在对胸部X光片图像进行肺结核判定时可采用该肺结核判定系统进行判定。该肺结核判定系统具体可应用在计算机设备上,其中,该计算机设备是可与用户进行人机交互的设备,包括但不限于电脑、智能手机和平板等设备。如图1所示,该肺结核判定方法包括如下步骤:Fig. 1 shows a flow chart of the method for determining tuberculosis in this embodiment. The tuberculosis determination method can be applied to the tuberculosis determination system, and the tuberculosis determination system can be used to determine the tuberculosis of the chest X-ray image. The pulmonary tuberculosis determination system can be specifically applied to a computer device, where the computer device is a device that can perform human-computer interaction with a user, including but not limited to devices such as computers, smart phones, and tablets. As shown in Figure 1, the method for determining tuberculosis includes the following steps:
S1:获取待分类胸部X光片图像。S1: Obtain a chest X-ray image to be classified.
可以理解地,在未进行肺结核判定前,用户所要进行肺结核判定的胸部X光片图像即待分类胸部X光片图像。Understandably, before the tuberculosis determination is performed, the chest X-ray image that the user wants to determine for tuberculosis is the chest X-ray image to be classified.
S2:按照预设的图像处理步骤,将待分类胸部X光片图像转换为待分类目标图像,其中,待分类目标图像的分辨率和维度与训练肺结核分类模型的目标图像样本相同。S2: Convert the chest X-ray image to be classified into the target image to be classified according to the preset image processing steps, where the resolution and dimension of the target image to be classified are the same as the target image sample for training the tuberculosis classification model.
可以理解地,直接获取的待分类胸部X光片图像还需进行转换成待分类目标图像后才可输入到肺结核判定模型中进行判定,以使其分辨率和维度与训练肺结核分类模型的目标图像样本相同,从而提高肺结核判定的准确率。Understandably, the directly obtained chest X-ray image to be classified needs to be converted into the target image to be classified before it can be input into the tuberculosis determination model for determination, so that its resolution and dimension are the same as the target image for training the tuberculosis classification model. The samples are the same, thereby improving the accuracy of tuberculosis determination.
可以理解地,训练肺结核分类模型的目标图像样本采用的分辨率和维度与胸部X光片图像不同,经预设的图像处理后,可提高肺结核判定模型特征提取的能力,从而提高肺结核判定的准确率。其中,预设的图像处理如下述步骤S11-S15中在构建训练样本集时对胸部X光片的图像样本的处理。Understandably, the resolution and dimension of the target image samples used for training the tuberculosis classification model are different from those of chest X-ray images. After preset image processing, the ability to extract features of the tuberculosis determination model can be improved, thereby improving the accuracy of tuberculosis determination. rate. The preset image processing is the processing of the image samples of the chest X-ray film when constructing the training sample set in the following steps S11-S15.
S3:将待分类目标图像输入到肺结核分类模型中,得到预测概率,预测概率为预测肺结核 为阳性的概率,当预测概率大于预设阈值时,判定与待分类目标图像对应的待分类胸部X光片图像存在肺结核。S3: Input the target image to be classified into the tuberculosis classification model to obtain the predicted probability. The predicted probability is the probability that the predicted tuberculosis is positive. When the predicted probability is greater than the preset threshold, determine the chest X-ray to be classified corresponding to the target image to be classified The film image has tuberculosis.
可以理解地,根据预测概率可对待分类胸部X光片图像按是否存在肺结核进行分类,分类时也完成了肺结核的判定。Understandably, according to the predicted probability, the chest X-ray image to be classified can be classified according to whether there is tuberculosis, and the determination of tuberculosis is also completed during the classification.
其中,预设阈值具体可以设为0.5,该预设阈值下的肺结核判定准确率较高。Among them, the preset threshold can be specifically set to 0.5, and the accuracy of tuberculosis determination under the preset threshold is relatively high.
其中,肺结核分类模型采用的模型训练步骤包括:Among them, the model training steps adopted by the tuberculosis classification model include:
S10:构建训练样本集,其中,训练样本集包括用于模型训练的目标图像样本和用于模型测试的目标图像样本,用于模型训练的目标图像样本和用于模型测试的目标图像样本之间不存在相同的目标图像样本。S10: Construct a training sample set, where the training sample set includes a target image sample used for model training and a target image sample used for model testing, between the target image sample used for model training and the target image sample used for model testing There are no identical target image samples.
其中,用于模型训练的目标图像样本和用于模型测试的目标图像样本之间不存在相同的目标图像样本可以提高肺结核分类模型的泛化能力,可应对更多不同场景下的肺结核判定。Among them, the absence of the same target image sample between the target image sample used for model training and the target image sample used for model testing can improve the generalization ability of the tuberculosis classification model, and can deal with more tuberculosis judgments in different scenarios.
进一步地,在构建训练样本集的步骤中,具体包括:Further, the step of constructing the training sample set specifically includes:
S11:获取胸部X光片的图像样本以及图像样本的标签,其中,图像样本为肺结核阳性时,标签为1,图像样本为肺结核阴性时,标签为0;S11: Obtain the image sample of the chest X-ray film and the label of the image sample. When the image sample is positive for tuberculosis, the label is 1, and when the image sample is negative for tuberculosis, the label is 0;
S12:将图像样本处理为预设分辨率的图像样本,其中,对于分辨率高于预设分辨率的图像样本,采用下采样的方法将图像样本的分辨率下采样至预设分辨率,对于分辨率低于预设分辨率的图像样本,采用双线性插值法将图像样本的分辨率上采样至预设分辨率;S12: Process the image sample into an image sample with a preset resolution, where, for an image sample with a resolution higher than the preset resolution, the down-sampling method is used to down-sample the resolution of the image sample to the preset resolution. For image samples whose resolution is lower than the preset resolution, use bilinear interpolation to upsample the resolution of the image samples to the preset resolution;
其中,预设分辨率具体可以是512*512,基于该分辨率下训练的肺结核分类模型的运算速度较快,同时分类准确度也比较高。Among them, the preset resolution may be 512*512. The tuberculosis classification model trained at this resolution has a faster calculation speed and a higher classification accuracy.
可以理解地,直接获取的胸部X光片的图像样本的分辨率可能过高也可能过低,可先将图像样本处理成利于模型训练的分辨率,以保证模型的精度。It is understandable that the resolution of the directly acquired image samples of the chest X-ray film may be too high or too low. The image samples may be processed to a resolution that is beneficial for model training to ensure the accuracy of the model.
S13:将预设分辨率的图像样本的每个像素点的值归一化到[-1,1]的区间内;S13: Normalize the value of each pixel of the image sample of the preset resolution to the interval [-1, 1];
可以理解地,将像素值进行归一化可以压缩样本空间,提高运算效率。Understandably, normalizing the pixel value can compress the sample space and improve the computational efficiency.
具体地,当像素颜色数量为256时,归一化的表达式具体为(x-127.5)/127.5。Specifically, when the number of pixel colors is 256, the normalized expression is specifically (x-127.5)/127.5.
S14:将归一化处理后的图像样本进行复制,扩展图像样本的维度,得到目标图像样本;S14: Copy the normalized image sample, expand the dimension of the image sample, and obtain the target image sample;
在一实施例中,如预设分辨率为512*512,则图像样本在进行复制,扩展图像样本的维度后得到的目标图像样本将表示为512*512*N,其中N为复制的次数。将图像样本进行复制,扩展图像样本的维度可以增加输入的样本数,有助于帮助模型进行充分训练,提高肺结核判定的准确率。In one embodiment, if the preset resolution is 512*512, the image sample is being copied, and the target image sample obtained by expanding the dimension of the image sample will be expressed as 512*512*N, where N is the number of times of copying. Copying the image sample and expanding the dimension of the image sample can increase the number of input samples, help the model to fully train, and improve the accuracy of tuberculosis determination.
S15:采用目标图像样本构建训练样本集,其中,训练样本集中用于模型训练的目标图像 样本和用于模型测试的目标图像样本的比例为5:1。S15: Use the target image samples to construct a training sample set, where the ratio of the target image samples used for model training and the target image samples used for model testing in the training sample set is 5:1.
其中,在该比例下可较好地完成模型训练与模型配置,是一种较优的比例。Among them, the model training and model configuration can be completed well under this ratio, which is a better ratio.
在步骤S11-S15中,提供了一种构建训练样本集的具体实施方式,能够对原始的胸部X光片的图像样本进行有效处理,使得肺结核分类模型的分类效果更精确。In steps S11-S15, a specific implementation manner for constructing a training sample set is provided, which can effectively process the image samples of the original chest X-ray film, so that the classification effect of the tuberculosis classification model is more accurate.
S20:采用ResNet-50网络作为训练的深度神经网络,并将预训练得到的权值作为ResNet-50网络初始的权值。S20: Use the ResNet-50 network as the trained deep neural network, and use the pre-trained weights as the initial weights of the ResNet-50 network.
其中,ResNet-50网络总共包含49层卷积层,1层标准化层和1层全连接层。Among them, the ResNet-50 network contains a total of 49 convolutional layers, a standardized layer and a fully connected layer.
ResNet-50网络的分类效果较好,本实施例中采用ResNet-50网络作为训练肺结核分类模型的原始模型,并采用迁徙学习的方法,将预训练得到的权值作为ResNet-50网络初始的权值,该预训练得到的权值具体可以是开发者在处理其他项目时采用的初始权值,其中,项目的内容或功能实现的原理与肺结核分类越相关越好。The classification effect of the ResNet-50 network is better. In this embodiment, the ResNet-50 network is used as the original model for training the tuberculosis classification model, and the migration learning method is adopted, and the weights obtained by pre-training are used as the initial weights of the ResNet-50 network. The weight value obtained by the pre-training may specifically be the initial weight value used by the developer when dealing with other projects. Among them, the content of the project or the principle of function realization are more relevant to the tuberculosis classification, the better.
在一实施例中,通过采用ResNet-50网络作为训练的深度神经网络,并将预训练得到的权值作为ResNet-50网络初始的权值,能够加快模型训练的速度,并且提高模型分类的准确率。In one embodiment, by using the ResNet-50 network as the training deep neural network, and using the pre-trained weights as the initial weights of the ResNet-50 network, the speed of model training can be accelerated, and the accuracy of model classification can be improved. rate.
S30:将用于模型训练的目标图像样本输入到ResNet-50网络中训练,输出结果为肺结核阳性的预测概率。S30: Input the target image sample used for model training into the ResNet-50 network for training, and the output result is the predicted probability of pulmonary tuberculosis positive.
具体地,ResNet-50网络的输入维度具体可设为512x512x3。Specifically, the input dimension of the ResNet-50 network can be specifically set to 512x512x3.
在一实施例中,将用于模型训练的目标图像样本输入到ResNet-50网络中训练,将经过7x7x64的卷积层和3x3、步长为2的最大池化层后得到256x256x64的特征图;然后经过4组残差模块,其输出依次变化为128x128x256、64x64x512、32x32x1024、16x16x2048的特征图(其中,对于维度不同的特征图,先用1x1的卷积层调整输入特征的维度,使其匹配待相加的特征图维度,然后进行对应位置的元素相加),最后经过标准化层和维度为1的全连接层输出结果为肺结核阳性的预测概率。In an embodiment, the target image samples used for model training are input into the ResNet-50 network for training, and a 256x256x64 feature map is obtained after a 7x7x64 convolutional layer and a 3x3 maximum pooling layer with a step size of 2; Then after 4 groups of residual modules, the output changes to 128x128x256, 64x64x512, 32x32x1024, 16x16x2048 feature maps (wherein, for feature maps with different dimensions, first use a 1x1 convolutional layer to adjust the dimensions of the input features to match the desired The dimension of the feature map is added, and then the elements of the corresponding position are added), and finally through the standardized layer and the fully connected layer of dimension 1, the output result is the predicted probability of pulmonary tuberculosis positive.
S40:根据预测概率更新ResNet-50网络的权值,直到更新的变化量均小于第一预设阈值时停止训练,得到待测试模型。S40: Update the weight of the ResNet-50 network according to the predicted probability, and stop training until the updated change amount is less than the first preset threshold to obtain the model to be tested.
进一步地,在根据预测概率更新ResNet-50网络的权值的步骤中,具体包括:Further, the step of updating the weight of the ResNet-50 network according to the predicted probability specifically includes:
S41:采用交叉熵损失函数计算训练过程中产生的损失值,其中,交叉熵损失函数表示为:
Figure PCTCN2019115946-appb-000001
Figure PCTCN2019115946-appb-000002
表示用于训练的目标图像样本的标签,y表示预测概率;
S41: Use the cross-entropy loss function to calculate the loss value generated during the training process, where the cross-entropy loss function is expressed as:
Figure PCTCN2019115946-appb-000001
Figure PCTCN2019115946-appb-000002
Represents the label of the target image sample used for training, and y represents the predicted probability;
S42:采用反向传播算法将训练过程中产生的损失值回传到ResNet-50网络中,根据每次训练回传的损失值更新ResNet-50网络的权值。S42: Use a backpropagation algorithm to return the loss value generated during the training process to the ResNet-50 network, and update the weight of the ResNet-50 network according to the loss value returned during each training.
在步骤S41-S42中,提供了一种根据预测概率更新ResNet-50网络的权值的具体实施方式, 可以在有监督学习下,实现网络参数的更新。In steps S41-S42, a specific implementation manner for updating the weights of the ResNet-50 network according to the predicted probability is provided, and the network parameters can be updated under supervised learning.
S50:采用用于模型测试的目标图像样本测试待测试模型,当待测试模型输出的测试结果的准确率大于预设准确率时,将待测试模型作为肺结核分类模型。S50: Use the target image sample for model testing to test the model to be tested, and when the accuracy rate of the test result output by the model to be tested is greater than the preset accuracy rate, the model to be tested is used as a tuberculosis classification model.
进一步地,ResNet-50网络包括卷积层、标准化层和全连接层,肺结核分类模型在更新ResNet-50网络的权值时先在预设遍数内对ResNet-50网络中的卷积层进行更新,预设遍数训练之后,冻结ResNet-50网络中卷积层的权值,采用0.001的学习率训练ResNet-50网络中的标准化层和全连接层1000遍,对ResNet-50网络中的标准化层和全连接层的权值进行更新,其中,冻结是指不对ResNet-50网络中卷积层的权值进行更新。Further, the ResNet-50 network includes a convolutional layer, a standardization layer, and a fully connected layer. The tuberculosis classification model first performs a preset number of passes on the convolutional layer in the ResNet-50 network when updating the weights of the ResNet-50 network. Update, after the preset number of training passes, freeze the weights of the convolutional layer in the ResNet-50 network, and use a learning rate of 0.001 to train the standardized layer and the fully connected layer in the ResNet-50 network for 1000 times. The weights of the standardized layer and the fully connected layer are updated, where freezing means that the weights of the convolutional layer in the ResNet-50 network are not updated.
可以理解地,卷积层的权值包含了用于区分目标图像样本的关键特征,但是预训练权值中体现的特征来自其他项目的样本训练,不能完全用于区分肺结核样本。此处采用迁移学习,先训练卷积层,使其具有体现判定肺结核疾病的特征;然后在冻结卷积层,训练标准化层和全连接层,这样可以进一步提高模型的特征提取能力,进而提高模型的准确率。Understandably, the weights of the convolutional layer contain key features for distinguishing the target image samples, but the features reflected in the pre-training weights come from the sample training of other items and cannot be used to distinguish tuberculosis samples. Here, transfer learning is used to first train the convolutional layer to reflect the characteristics of judging tuberculosis disease; then freeze the convolutional layer, train the standardized layer and the fully connected layer, which can further improve the feature extraction ability of the model, and then improve the model The accuracy rate.
进一步地,肺结核分类模型在更新ResNet-50网络的权值时先在预设遍数内对ResNet-50网络中的卷积层进行更新ResNet-50网络包括卷积层,其中预设遍数具体可以是3000遍。ResNet-50网络在更新卷积层的权值时,训练过程为采用0.0001的学习率训练3000遍ResNet-50网络,其中,每遍训练包括10张用于训练的目标图像样本。Further, when the tuberculosis classification model updates the weights of the ResNet-50 network, it first updates the convolutional layer in the ResNet-50 network within a preset number of passes. The ResNet-50 network includes a convolutional layer, and the preset number of passes is specific It can be 3000 times. When the ResNet-50 network updates the weights of the convolutional layer, the training process is to train the ResNet-50 network 3000 times with a learning rate of 0.0001, where each pass includes 10 target image samples for training.
采用以上模型训练、参数更新过程中提及的具体参数,能够提高肺结核分类模型的特征提取能力,以及肺结核分类模型的准确率。Using the specific parameters mentioned in the above model training and parameter update process can improve the feature extraction ability of the tuberculosis classification model and the accuracy of the tuberculosis classification model.
在本申请实施例中,采用肺结核分类模型实现对待分类胸部X光片图像的肺结核判定。该肺结核分类模型采用ResNet-50网络作为训练的深度神经网络,使得训练得到的肺结核分类模型具有较强的特征提取能力,且分类准确率较高;另外,训练肺结核分类模型还采用了迁移学习的方法,将预训练得到的权值作为ResNet-50网络初始的权值,能够加快模型训练的速度,并且提高模型分类的准确率。本申请实施例通过针对肺结核判定所进行训练得到的肺结核分类模型,在输入由待分类胸部X光片图像转换得到的待分类目标图像后,即可根据肺结核分类模型输出的预测概率实现肺结核的判定,能够在保证准确率较高的前提下,实现对肺结核的快速判定。In the embodiment of the present application, the tuberculosis classification model is used to realize the tuberculosis determination of the chest X-ray image to be classified. The tuberculosis classification model uses the ResNet-50 network as the deep neural network for training, so that the trained tuberculosis classification model has strong feature extraction capabilities and high classification accuracy; in addition, the training tuberculosis classification model also uses migration learning Method, the weights obtained by pre-training are used as the initial weights of the ResNet-50 network, which can speed up model training and improve the accuracy of model classification. The embodiment of the application uses the tuberculosis classification model trained for tuberculosis determination. After inputting the target image to be classified converted from the chest X-ray image to be classified, the tuberculosis determination can be achieved according to the predicted probability output by the tuberculosis classification model. , Under the premise of ensuring high accuracy, the rapid determination of tuberculosis can be realized.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence number of each step in the foregoing embodiment does not mean the order of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
基于实施例中所提供的肺结核判定方法,本申请实施例进一步给出实现上述方法实施例中各步骤及方法的装置实施例。Based on the pulmonary tuberculosis determination method provided in the embodiments, the embodiments of the present application further provide device embodiments that implement the steps and methods in the foregoing method embodiments.
图2示出与实施例中肺结核判定方法一一对应的肺结核判定装置的原理框图。如图2所示,该肺结核判定装置包括第一获取模块10、第二获取模块20、判定模块30、构建模块40、初始化模块50、训练模块60、更新模块70和第三获取模块80。其中,第一获取模块10、第二获取模块20、判定模块30、构建模块40、初始化模块50、训练模块60、更新模块70和第三获取模块80的实现功能与实施例中肺结核判定方法对应的步骤一一对应,为避免赘述,本实施例不一一详述。Fig. 2 shows a principle block diagram of a tuberculosis determination device corresponding to the tuberculosis determination method in the embodiment one-to-one. As shown in FIG. 2, the tuberculosis determination device includes a first acquisition module 10, a second acquisition module 20, a determination module 30, a construction module 40, an initialization module 50, a training module 60, an update module 70 and a third acquisition module 80. Among them, the implementation functions of the first acquisition module 10, the second acquisition module 20, the determination module 30, the construction module 40, the initialization module 50, the training module 60, the update module 70, and the third acquisition module 80 correspond to the tuberculosis determination method in the embodiment The steps of are one-to-one correspondence, in order to avoid repetition, this embodiment will not describe them one by one.
第一获取模块10,用于获取待分类胸部X光片图像。The first acquisition module 10 is used to acquire a chest X-ray image to be classified.
第二获取模块20,用于按照预设的图像处理步骤,将待分类胸部X光片图像转换为待分类目标图像,其中,待分类目标图像的分辨率和维度与训练肺结核分类模型的目标图像样本相同。The second acquisition module 20 is used to convert the chest X-ray image to be classified into a target image to be classified according to the preset image processing steps, wherein the resolution and dimension of the target image to be classified are the same as the target image for training the tuberculosis classification model The samples are the same.
判定模块30,用于将待分类目标图像输入到肺结核分类模型中,得到预测概率,预测概率为预测肺结核为阳性的概率,当预测概率大于预设阈值时,判定与待分类目标图像对应的待分类胸部X光片图像存在肺结核,其中,肺结核分类模型通过构建模块、初始化模块、训练模块、更新模块和第三获取模块得到:The determination module 30 is used to input the target image to be classified into the tuberculosis classification model to obtain the predicted probability. The predicted probability is the probability that the tuberculosis is predicted to be positive. When the predicted probability is greater than a preset threshold, determine the target image to be classified. The classification of chest X-ray images has tuberculosis, and the tuberculosis classification model is obtained through the construction module, the initialization module, the training module, the update module, and the third acquisition module:
构建模块40,用于构建训练样本集,其中,训练样本集包括用于模型训练的目标图像样本和用于模型测试的目标图像样本,用于模型训练的目标图像样本和用于模型测试的目标图像样本之间不存在相同的目标图像样本。The construction module 40 is used to construct a training sample set, where the training sample set includes a target image sample used for model training and a target image sample used for model testing, a target image sample used for model training and a target used for model testing The same target image sample does not exist between the image samples.
初始化模块50,用于采用ResNet-50网络作为训练的深度神经网络,并将预训练得到的权值作为ResNet-50网络初始的权值。The initialization module 50 is used to use the ResNet-50 network as a training deep neural network, and use the weights obtained by pre-training as the initial weights of the ResNet-50 network.
训练模块60,用于将用于模型训练的目标图像样本输入到ResNet-50网络中训练,输出结果为肺结核阳性的预测概率。The training module 60 is used to input the target image samples used for model training into the ResNet-50 network for training, and the output result is the predicted probability of pulmonary tuberculosis positive.
更新模块70,用于根据预测概率更新ResNet-50网络的权值,直到更新的变化量均小于第一预设阈值时停止训练,得到待测试模型。The update module 70 is configured to update the weight of the ResNet-50 network according to the predicted probability, and stop training until the updated change amount is less than the first preset threshold to obtain the model to be tested.
第三获取模块80,用于采用用于模型测试的目标图像样本测试待测试模型,当待测试模型输出的测试结果的准确率大于预设准确率时,将待测试模型作为肺结核分类模型。The third acquisition module 80 is used to test the model to be tested using the target image sample for model testing, and when the accuracy of the test result output by the model to be tested is greater than the preset accuracy, the model to be tested is used as a tuberculosis classification model.
可选地,构建模块40具体用于:Optionally, the building module 40 is specifically used for:
获取胸部X光片的图像样本以及图像样本的标签,其中,图像样本为肺结核阳性时,标签为1,图像样本为肺结核阴性时,标签为0;Obtain the image sample of the chest X-ray film and the label of the image sample. When the image sample is positive for tuberculosis, the label is 1, and when the image sample is negative for tuberculosis, the label is 0;
将图像样本处理为预设分辨率的图像样本,其中,对于分辨率高于预设分辨率的图像样本,采用下采样的方法将图像样本的分辨率下采样至预设分辨率,对于分辨率低于预设分辨率的图 像样本,采用双线性插值法将图像样本的分辨率上采样至预设分辨率;The image samples are processed into image samples with a preset resolution. For image samples with a higher resolution than the preset resolution, the down-sampling method is used to down-sample the resolution of the image samples to the preset resolution. For image samples lower than the preset resolution, use bilinear interpolation to upsample the resolution of the image samples to the preset resolution;
将预设分辨率的图像样本的每个像素点的值归一化到[-1,1]的区间内;Normalize the value of each pixel of the image sample of the preset resolution to the interval of [-1, 1];
将归一化处理后的图像样本进行复制,扩展图像样本的维度,得到目标图像样本;Copy the normalized image sample, expand the dimension of the image sample, and obtain the target image sample;
采用目标图像样本构建训练样本集,其中,训练样本集中用于模型训练的目标图像样本和用于模型测试的目标图像样本的比例为5:1。The target image samples are used to construct a training sample set, where the ratio of the target image samples used for model training and the target image samples used for model testing in the training sample set is 5:1.
可选地,ResNet-50网络包括卷积层,ResNet-50网络在更新卷积层的权值时,训练过程为采用0.0001的学习率训练3000遍ResNet-50网络,其中,每遍训练包括10张用于训练的目标图像样本。Optionally, the ResNet-50 network includes a convolutional layer. When the ResNet-50 network updates the weights of the convolutional layer, the training process is to use a learning rate of 0.0001 to train 3000 times the ResNet-50 network, where each training pass includes 10 A sample of the target image used for training.
可选地,ResNet-50网络包括卷积层、标准化层和全连接层,肺结核分类模型在更新ResNet-50网络的权值时先在预设遍数内对ResNet-50网络中的卷积层进行更新,预设遍数训练之后,冻结ResNet-50网络中卷积层的权值,采用0.001的学习率训练ResNet-50网络中的标准化层和全连接层1000遍,对ResNet-50网络中的标准化层和全连接层的权值进行更新,其中,冻结是指不对ResNet-50网络中卷积层的权值进行更新。Optionally, the ResNet-50 network includes a convolutional layer, a standardization layer, and a fully connected layer. The tuberculosis classification model first performs a preset number of passes to the convolutional layer in the ResNet-50 network when updating the weights of the ResNet-50 network After updating, the preset number of passes is trained, the weights of the convolutional layer in the ResNet-50 network are frozen, and the learning rate of 0.001 is used to train the standardized layer and the fully connected layer in the ResNet-50 network 1000 times. For the ResNet-50 network The weights of the standardized layer and the fully connected layer are updated, where freezing means that the weights of the convolutional layer in the ResNet-50 network are not updated.
可选地,更新模块70具体用于:Optionally, the update module 70 is specifically used for:
采用交叉熵损失函数计算训练过程中产生的损失值,其中,交叉熵损失函数表示为:
Figure PCTCN2019115946-appb-000003
Figure PCTCN2019115946-appb-000004
Figure PCTCN2019115946-appb-000005
表示用于训练的目标图像样本的标签,y表示预测概率;
The cross entropy loss function is used to calculate the loss value generated during the training process, where the cross entropy loss function is expressed as:
Figure PCTCN2019115946-appb-000003
Figure PCTCN2019115946-appb-000004
Figure PCTCN2019115946-appb-000005
Represents the label of the target image sample used for training, and y represents the predicted probability;
采用反向传播算法将训练过程中产生的损失值回传到ResNet-50网络中,根据每次训练回传的损失值更新ResNet-50网络的权值。The backpropagation algorithm is used to return the loss value generated during the training process to the ResNet-50 network, and the weight of the ResNet-50 network is updated according to the loss value returned during each training.
在本申请实施例中,采用肺结核分类模型实现对待分类胸部X光片图像的肺结核判定。该肺结核分类模型采用ResNet-50网络作为训练的深度神经网络,使得训练得到的肺结核分类模型具有较强的特征提取能力,且分类准确率较高;另外,训练肺结核分类模型还采用了迁移学习的方法,将预训练得到的权值作为ResNet-50网络初始的权值,能够加快模型训练的速度,并且提高模型分类的准确率。本申请实施例通过针对肺结核判定所进行训练得到的肺结核分类模型,在输入由待分类胸部X光片图像转换得到的待分类目标图像后,即可根据肺结核分类模型输出的预测概率实现肺结核的判定,能够在保证准确率较高的前提下,实现对肺结核的快速判定。In the embodiment of the present application, the tuberculosis classification model is used to realize the tuberculosis determination of the chest X-ray image to be classified. The tuberculosis classification model uses the ResNet-50 network as the deep neural network for training, so that the trained tuberculosis classification model has strong feature extraction capabilities and high classification accuracy; in addition, the training tuberculosis classification model also uses migration learning Method, the weights obtained by pre-training are used as the initial weights of the ResNet-50 network, which can speed up model training and improve the accuracy of model classification. The embodiment of the application uses the tuberculosis classification model trained for tuberculosis determination. After inputting the target image to be classified converted from the chest X-ray image to be classified, the tuberculosis determination can be achieved according to the predicted probability output by the tuberculosis classification model. , Under the premise of ensuring high accuracy, the rapid determination of tuberculosis can be realized.
本实施例提供一计算机非易失性可读存储介质,该计算机非易失性可读存储介质上存储有计算机可读指令,该计算机可读指令被处理器执行时实现实施例中肺结核判定方法,为避免重复,此处不一一赘述。或者,该计算机可读指令被处理器执行时实现实施例中肺结核判定装置中各模块/单元的功能,为避免重复,此处不一一赘述。This embodiment provides a computer non-volatile readable storage medium, the computer non-volatile readable storage medium stores computer readable instructions, and when the computer readable instructions are executed by a processor, the method for determining tuberculosis in the embodiment is implemented To avoid repetition, I won’t repeat them here. Alternatively, the computer-readable instructions realize the functions of the various modules/units in the tuberculosis determination device in the embodiment when being executed by the processor. In order to avoid repetition, details are not repeated here.
图3是本申请一实施例提供的计算机设备的示意图。如图3所示,该实施例的计算机设备90包括:处理器91、存储器92以及存储在存储器92中并可在处理器91上运行的计算机可读指令93,该计算机可读指令93被处理器91执行时实现实施例中的肺结核判定方法,为避免重复,此处不一一赘述。或者,该计算机可读指令93被处理器91执行时实现实施例中肺结核判定装置中各模型/单元的功能,为避免重复,此处不一一赘述。Fig. 3 is a schematic diagram of a computer device provided by an embodiment of the present application. As shown in FIG. 3, the computer device 90 of this embodiment includes: a processor 91, a memory 92, and computer-readable instructions 93 stored in the memory 92 and running on the processor 91, and the computer-readable instructions 93 are processed. The method for determining tuberculosis in the embodiment is implemented when the device 91 is executed. In order to avoid repetition, it will not be repeated here. Alternatively, when the computer-readable instruction 93 is executed by the processor 91, the function of each model/unit in the tuberculosis determination device in the embodiment is realized. In order to avoid repetition, it will not be repeated here.
计算机设备90可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。计算机设备90可包括,但不仅限于,处理器91、存储器92。本领域技术人员可以理解,图3仅仅是计算机设备90的示例,并不构成对计算机设备90的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如计算机设备还可以包括输入输出设备、网络接入设备、总线等。The computer device 90 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The computer device 90 may include, but is not limited to, a processor 91 and a memory 92. Those skilled in the art can understand that FIG. 3 is only an example of the computer device 90, and does not constitute a limitation on the computer device 90. It may include more or less components than those shown in the figure, or a combination of certain components, or different components. For example, computer equipment may also include input and output devices, network access devices, buses, and so on.
所称处理器91可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 91 may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
存储器92可以是计算机设备90的内部存储单元,例如计算机设备90的硬盘或内存。存储器92也可以是计算机设备90的外部存储设备,例如计算机设备90上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器92还可以既包括计算机设备90的内部存储单元也包括外部存储设备。存储器92用于存储计算机可读指令以及计算机设备所需的其他程序和数据。存储器92还可以用于暂时地存储已经输出或者将要输出的数据。The memory 92 may be an internal storage unit of the computer device 90, such as a hard disk or a memory of the computer device 90. The memory 92 may also be an external storage device of the computer device 90, such as a plug-in hard disk equipped on the computer device 90, a smart media card (SMC), a secure digital (SD) card, and a flash memory card (Flash). Card) and so on. Further, the memory 92 may also include both an internal storage unit of the computer device 90 and an external storage device. The memory 92 is used to store computer readable instructions and other programs and data required by the computer equipment. The memory 92 can also be used to temporarily store data that has been output or will be output.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。Those skilled in the art can clearly understand that for the convenience and conciseness of description, only the division of the above functional units and modules is used as an example. In practical applications, the above functions can be allocated to different functional units and modules as required. Module completion, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still compare the previous embodiments. The recorded technical solutions are modified, or some of the technical features are equivalently replaced; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the application, and shall be included in the application Within the scope of protection.

Claims (20)

  1. 一种肺结核判定方法,其特征在于,所述方法包括:A method for determining tuberculosis, characterized in that the method includes:
    获取待分类胸部X光片图像;Acquire X-ray images of the chest to be classified;
    按照预设的图像处理步骤,将所述待分类胸部X光片图像转换为待分类目标图像,其中,所述待分类目标图像的分辨率和维度与训练肺结核分类模型的目标图像样本相同;According to a preset image processing step, converting the chest X-ray image to be classified into a target image to be classified, wherein the resolution and dimension of the target image to be classified are the same as the target image sample for training the tuberculosis classification model;
    将所述待分类目标图像输入到所述肺结核分类模型中,得到预测概率,所述预测概率为预测肺结核为阳性的概率,当所述预测概率大于预设阈值时,判定与所述待分类目标图像对应的所述待分类胸部X光片图像存在肺结核,其中,所述肺结核分类模型采用的模型训练步骤包括:Input the target image to be classified into the pulmonary tuberculosis classification model to obtain the predicted probability. The predicted probability is the probability that the predicted pulmonary tuberculosis is positive. There is tuberculosis in the chest X-ray image to be classified corresponding to the image, wherein the model training steps adopted by the tuberculosis classification model include:
    构建训练样本集,其中,所述训练样本集包括用于模型训练的目标图像样本和用于模型测试的目标图像样本,所述用于模型训练的目标图像样本和用于模型测试的目标图像样本之间不存在相同的目标图像样本;Construct a training sample set, wherein the training sample set includes a target image sample for model training and a target image sample for model testing, the target image sample for model training and a target image sample for model testing There is no same target image sample between them;
    采用ResNet-50网络作为训练的深度神经网络,并将预训练得到的权值作为所述ResNet-50网络初始的权值;Adopting the ResNet-50 network as the training deep neural network, and using the pre-trained weights as the initial weights of the ResNet-50 network;
    将所述用于模型训练的目标图像样本输入到所述ResNet-50网络中训练,输出结果为肺结核阳性的预测概率;Input the target image sample used for model training into the ResNet-50 network for training, and the output result is the predicted probability of pulmonary tuberculosis positive;
    根据所述预测概率更新所述ResNet-50网络的权值,直到更新的变化量均小于第一预设阈值时停止训练,得到待测试模型;Update the weight of the ResNet-50 network according to the predicted probability, and stop training until the updated change amount is less than the first preset threshold to obtain the model to be tested;
    采用所述用于模型测试的目标图像样本测试所述待测试模型,当所述待测试模型输出的测试结果的准确率大于预设准确率时,将所述待测试模型作为所述肺结核分类模型。Use the target image sample for model testing to test the model to be tested, and when the accuracy rate of the test result output by the model to be tested is greater than the preset accuracy rate, use the model to be tested as the tuberculosis classification model .
  2. 根据权利要求1所述的方法,其特征在于,所述构建训练样本集,包括:The method according to claim 1, wherein said constructing a training sample set comprises:
    获取胸部X光片的图像样本以及所述图像样本的标签,其中,所述图像样本为肺结核阳性时,标签为1,所述图像样本为肺结核阴性时,标签为0;Acquiring an image sample of a chest X-ray film and a label of the image sample, wherein when the image sample is positive for tuberculosis, the label is 1, and when the image sample is negative for tuberculosis, the label is 0;
    将所述图像样本处理为预设分辨率的图像样本,其中,对于分辨率高于预设分辨率的图像样本,采用下采样的方法将所述图像样本的分辨率下采样至所述预设分辨率,对于分辨率低于所述预设分辨率的图像样本,采用双线性插值法将所述图像样本的分辨率上采样至所述预设分辨率;The image sample is processed into an image sample with a preset resolution, where, for an image sample with a resolution higher than the preset resolution, a down-sampling method is used to down-sample the resolution of the image sample to the preset Resolution, for an image sample with a resolution lower than the preset resolution, up-sampling the resolution of the image sample to the preset resolution by using a bilinear interpolation method;
    将所述预设分辨率的图像样本的每个像素点的值归一化到[-1,1]的区间内;Normalize the value of each pixel of the image sample of the preset resolution to the interval [-1, 1];
    将归一化处理后的所述图像样本进行复制,扩展所述图像样本的维度,得到目标图像样本;Copying the normalized image sample to expand the dimension of the image sample to obtain a target image sample;
    采用所述目标图像样本构建所述训练样本集,其中,所述训练样本集中所述用于模型训练的目标图像样本和所述用于模型测试的目标图像样本的比例为5:1。The target image samples are used to construct the training sample set, wherein the ratio of the target image samples used for model training to the target image samples used for model testing in the training sample set is 5:1.
  3. 根据权利要求1所述的方法,其特征在于,所述ResNet-50网络包括卷积层,所述ResNet-50网络在更新所述卷积层的权值时,训练过程为采用0.0001的学习率训练3000遍所述ResNet-50网络,其中,每遍训练包括10张所述用于训练的目标图像样本。The method according to claim 1, wherein the ResNet-50 network includes a convolutional layer, and when the ResNet-50 network updates the weights of the convolutional layer, the training process adopts a learning rate of 0.0001 The ResNet-50 network is trained 3000 times, wherein each training pass includes 10 target image samples for training.
  4. 根据权利要求1所述的方法,其特征在于,所述ResNet-50网络包括卷积层、标准化层和全连接层,所述肺结核分类模型在更新所述ResNet-50网络的权值时先在预设遍数内对所述ResNet-50网络中的卷积层进行更新,预设遍数训练之后,冻结所述ResNet-50网络中卷积层的权值,采用0.001的学习率训练所述ResNet-50网络中的标准化层和全连接层1000遍,对所述ResNet-50网络中的标准化层和全连接层的权值进行更新,其中,所述冻结是指不对所述ResNet-50网络中卷积层的权值进行更新。The method according to claim 1, wherein the ResNet-50 network includes a convolutional layer, a standardization layer, and a fully connected layer, and the tuberculosis classification model first updates the weights of the ResNet-50 network. The convolutional layer in the ResNet-50 network is updated within the preset number of passes. After the preset number of passes is trained, the weight of the convolutional layer in the ResNet-50 network is frozen, and the learning rate of 0.001 is used to train the The standardized layer and the fully connected layer in the ResNet-50 network are updated 1,000 times, and the weights of the standardized layer and the fully connected layer in the ResNet-50 network are updated, where the freezing means that the ResNet-50 network is not updated. The weight of the middle convolutional layer is updated.
  5. 根据权利要求1-4任意一项所述的方法,其特征在于,所述根据所述预测概率更新所述ResNet-50网络的权值,包括:The method according to any one of claims 1 to 4, wherein the updating the weight of the ResNet-50 network according to the predicted probability comprises:
    采用交叉熵损失函数计算训练过程中产生的损失值,其中,所述交叉熵损失函数表示为:
    Figure PCTCN2019115946-appb-100001
    表示所述用于训练的目标图像样本的标签,y表示所述预测概率;
    The cross-entropy loss function is used to calculate the loss value generated during the training process, where the cross-entropy loss function is expressed as:
    Figure PCTCN2019115946-appb-100001
    Represents the label of the target image sample used for training, and y represents the predicted probability;
    采用反向传播算法将训练过程中产生的损失值回传到所述ResNet-50网络中,根据每次训练回传的损失值更新所述ResNet-50网络的权值。A back propagation algorithm is used to return the loss value generated during the training process to the ResNet-50 network, and the weight value of the ResNet-50 network is updated according to the loss value returned during each training.
  6. 一种肺结核判定装置,其特征在于,所述装置包括:A device for determining tuberculosis, characterized in that the device comprises:
    第一获取模块,用于获取待分类胸部X光片图像;The first acquisition module is used to acquire a chest X-ray image to be classified;
    第二获取模块,用于按照预设的图像处理步骤,将所述待分类胸部X光片图像转换为待分类目标图像,其中,所述待分类目标图像的分辨率和维度与训练肺结核分类模型的目标图像样本相同;The second acquisition module is configured to convert the chest X-ray image to be classified into a target image to be classified according to preset image processing steps, wherein the resolution and dimension of the target image to be classified are the same as the training tuberculosis classification model The target image samples are the same;
    判定模块,用于将所述待分类目标图像输入到所述肺结核分类模型中,得到预测概率,所述预测概率为预测肺结核为阳性的概率,当所述预测概率大于预设阈值时,判定与所述待分类目标图像对应的所述待分类胸部X光片图像存在肺结核,其中,所述肺结核分类模型通过构建模块、初始化模块、训练模块、更新模块和第三获取模块得到:The judging module is used to input the target image to be classified into the tuberculosis classification model to obtain the predicted probability. The predicted probability is the probability that the predicted tuberculosis is positive. When the predicted probability is greater than a preset threshold, the Tuberculosis is present in the chest X-ray image to be classified corresponding to the target image to be classified, wherein the tuberculosis classification model is obtained through a construction module, an initialization module, a training module, an update module, and a third acquisition module:
    构建模块,用于构建训练样本集,其中,所述训练样本集包括用于模型训练的目标图像样本和用于模型测试的目标图像样本,所述用于模型训练的目标图像样本和用于模型测试的目标图像样本之间不存在相同的目标图像样本;The construction module is used to construct a training sample set, wherein the training sample set includes a target image sample used for model training and a target image sample used for model testing, and the target image sample used for model training is used for model training. There is no identical target image sample among the tested target image samples;
    初始化模块,用于采用ResNet-50网络作为训练的深度神经网络,并将预训练得到的权值作为所述ResNet-50网络初始的权值;The initialization module is used to use the ResNet-50 network as a deep neural network for training, and use the weights obtained by pre-training as the initial weights of the ResNet-50 network;
    训练模块,用于将所述用于模型训练的目标图像样本输入到所述ResNet-50网络中训练,输出结果为肺结核阳性的预测概率;A training module, configured to input the target image samples used for model training into the ResNet-50 network for training, and the output result is the predicted probability of pulmonary tuberculosis positive;
    更新模块,用于根据所述预测概率更新所述ResNet-50网络的权值,直到更新的变化量均小于第一预设阈值时停止训练,得到待测试模型;An update module, configured to update the weight of the ResNet-50 network according to the predicted probability, and stop training until the updated change amount is less than a first preset threshold to obtain the model to be tested;
    第三获取模块,用于采用所述用于模型测试的目标图像样本测试所述待测试模型,当所述待测试模型输出的测试结果的准确率大于预设准确率时,将所述待测试模型作为所述肺结核分类模型。The third acquisition module is configured to use the target image sample for model testing to test the model to be tested, and when the accuracy of the test result output by the model to be tested is greater than the preset accuracy, the The model is used as the tuberculosis classification model.
  7. 根据权利要求6所述的装置,其特征在于,所述构建模块具体用于:The device according to claim 6, wherein the building module is specifically configured to:
    获取胸部X光片的图像样本以及所述图像样本的标签,其中,所述图像样本为肺结核阳性时,标签为1,所述图像样本为肺结核阴性时,标签为0;Acquiring an image sample of a chest X-ray film and a label of the image sample, wherein when the image sample is positive for tuberculosis, the label is 1, and when the image sample is negative for tuberculosis, the label is 0;
    将所述图像样本处理为预设分辨率的图像样本,其中,对于分辨率高于预设分辨率的图像样本,采用下采样的方法将所述图像样本的分辨率下采样至所述预设分辨率,对于分辨率低于所述预设分辨率的图像样本,采用双线性插值法将所述图像样本的分辨率上采样至所述预设分辨率;The image sample is processed into an image sample with a preset resolution, where, for an image sample with a resolution higher than the preset resolution, a down-sampling method is used to down-sample the resolution of the image sample to the preset Resolution, for an image sample with a resolution lower than the preset resolution, up-sampling the resolution of the image sample to the preset resolution by using a bilinear interpolation method;
    将所述预设分辨率的图像样本的每个像素点的值归一化到[-1,1]的区间内;Normalize the value of each pixel of the image sample of the preset resolution to the interval [-1, 1];
    将归一化处理后的所述图像样本进行复制,扩展所述图像样本的维度,得到目标图像样本;Copying the normalized image sample to expand the dimension of the image sample to obtain a target image sample;
    采用所述目标图像样本构建所述训练样本集,其中,所述训练样本集中所述用于模型训练的目标图像样本和所述用于模型测试的目标图像样本的比例为5:1。The target image samples are used to construct the training sample set, wherein the ratio of the target image samples used for model training to the target image samples used for model testing in the training sample set is 5:1.
  8. 根据权利要求6所述的装置,其特征在于,所述ResNet-50网络包括卷积层,所述ResNet-50网络在更新所述卷积层的权值时,训练过程为采用0.0001的学习率训练3000遍所述ResNet-50网络,其中,每遍训练包括10张所述用于训练的目标图像样本。The device according to claim 6, wherein the ResNet-50 network includes a convolutional layer, and when the ResNet-50 network updates the weights of the convolutional layer, the training process adopts a learning rate of 0.0001 The ResNet-50 network is trained 3000 times, wherein each training pass includes 10 target image samples for training.
  9. 根据权利要求6所述的装置,其特征在于,所述ResNet-50网络包括卷积层、标准化层和全连接层,所述肺结核分类模型在更新所述ResNet-50网络的权值时先在预设遍数内对所述ResNet-50网络中的卷积层进行更新,预设遍数训练之后,冻结所述ResNet-50网络中卷积层的权值,采用0.001的学习率训练所述ResNet-50网络中的标准化层和全连接层1000遍,对所述ResNet-50网络中的标准化层和全连接层的权值进行更新,其中,所述冻结是指不对所述ResNet-50网络中卷积层的权值进行更新。The device according to claim 6, wherein the ResNet-50 network includes a convolutional layer, a standardization layer, and a fully connected layer, and the tuberculosis classification model is first used when updating the weights of the ResNet-50 network. The convolutional layer in the ResNet-50 network is updated within the preset number of passes. After the preset number of passes is trained, the weight of the convolutional layer in the ResNet-50 network is frozen, and the learning rate of 0.001 is used to train the The standardized layer and the fully connected layer in the ResNet-50 network are updated 1,000 times, and the weights of the standardized layer and the fully connected layer in the ResNet-50 network are updated, where the freezing means that the ResNet-50 network is not updated. The weight of the middle convolutional layer is updated.
  10. 根据权利要求6-9任意一项所述的装置,其特征在于,所述更新模块具体用于:The device according to any one of claims 6-9, wherein the update module is specifically configured to:
    采用交叉熵损失函数计算训练过程中产生的损失值,其中,所述交叉熵损失函数表示为:
    Figure PCTCN2019115946-appb-100002
    表示所述用于训练的目标图像样本的标签,y表示所述预测概率;
    The cross-entropy loss function is used to calculate the loss value generated during the training process, where the cross-entropy loss function is expressed as:
    Figure PCTCN2019115946-appb-100002
    Represents the label of the target image sample used for training, and y represents the predicted probability;
    采用反向传播算法将训练过程中产生的损失值回传到所述ResNet-50网络中,根据每次训练回传的损失值更新所述ResNet-50网络的权值。A back propagation algorithm is used to return the loss value generated during the training process to the ResNet-50 network, and the weight value of the ResNet-50 network is updated according to the loss value returned during each training.
  11. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor, wherein the processor executes the computer-readable instructions as follows step:
    获取待分类胸部X光片图像;Acquire X-ray images of the chest to be classified;
    按照预设的图像处理步骤,将所述待分类胸部X光片图像转换为待分类目标图像,其中,所述待分类目标图像的分辨率和维度与训练肺结核分类模型的目标图像样本相同;Converting the chest X-ray image to be classified into a target image to be classified according to a preset image processing step, wherein the resolution and dimension of the target image to be classified are the same as the target image sample for training the tuberculosis classification model;
    将所述待分类目标图像输入到所述肺结核分类模型中,得到预测概率,所述预测概率为预测肺结核为阳性的概率,当所述预测概率大于预设阈值时,判定与所述待分类目标图像对应的所述待分类胸部X光片图像存在肺结核,其中,所述肺结核分类模型采用的模型训练步骤包括:The target image to be classified is input into the tuberculosis classification model to obtain a prediction probability. The prediction probability is the probability that the tuberculosis is predicted to be positive. When the prediction probability is greater than a preset threshold, it is determined to be the same as the target to be classified. There is tuberculosis in the chest X-ray image to be classified corresponding to the image, wherein the model training steps adopted by the tuberculosis classification model include:
    构建训练样本集,其中,所述训练样本集包括用于模型训练的目标图像样本和用于模型测试的目标图像样本,所述用于模型训练的目标图像样本和用于模型测试的目标图像样本之间不存在相同的目标图像样本;Construct a training sample set, wherein the training sample set includes a target image sample for model training and a target image sample for model testing, the target image sample for model training and a target image sample for model testing There is no same target image sample between them;
    采用ResNet-50网络作为训练的深度神经网络,并将预训练得到的权值作为所述ResNet-50网络初始的权值;Adopting the ResNet-50 network as the training deep neural network, and using the pre-trained weights as the initial weights of the ResNet-50 network;
    将所述用于模型训练的目标图像样本输入到所述ResNet-50网络中训练,输出结果为肺结核阳性的预测概率;Input the target image sample used for model training into the ResNet-50 network for training, and the output result is the predicted probability of pulmonary tuberculosis positive;
    根据所述预测概率更新所述ResNet-50网络的权值,直到更新的变化量均小于第一预设阈值时停止训练,得到待测试模型;Update the weight of the ResNet-50 network according to the predicted probability, and stop training until the updated change amount is less than the first preset threshold to obtain the model to be tested;
    采用所述用于模型测试的目标图像样本测试所述待测试模型,当所述待测试模型输出的测试结果的准确率大于预设准确率时,将所述待测试模型作为所述肺结核分类模型。Use the target image sample for model testing to test the model to be tested, and when the accuracy rate of the test result output by the model to be tested is greater than the preset accuracy rate, use the model to be tested as the tuberculosis classification model .
  12. 根据权利要求11所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令实现构建训练样本集时,包括如下步骤:The computer device according to claim 11, wherein when the processor executes the computer-readable instructions to construct a training sample set, it comprises the following steps:
    获取胸部X光片的图像样本以及所述图像样本的标签,其中,所述图像样本为肺结核阳性时,标签为1,所述图像样本为肺结核阴性时,标签为0;Acquiring an image sample of a chest X-ray film and a label of the image sample, wherein when the image sample is positive for tuberculosis, the label is 1, and when the image sample is negative for tuberculosis, the label is 0;
    将所述图像样本处理为预设分辨率的图像样本,其中,对于分辨率高于预设分辨率的图像 样本,采用下采样的方法将所述图像样本的分辨率下采样至所述预设分辨率,对于分辨率低于所述预设分辨率的图像样本,采用双线性插值法将所述图像样本的分辨率上采样至所述预设分辨率;The image sample is processed into an image sample with a preset resolution, where, for an image sample with a resolution higher than the preset resolution, the resolution of the image sample is downsampled to the preset Resolution, for image samples with a resolution lower than the preset resolution, up-sampling the resolution of the image samples to the preset resolution by using a bilinear interpolation method;
    将所述预设分辨率的图像样本的每个像素点的值归一化到[-1,1]的区间内;Normalize the value of each pixel of the image sample of the preset resolution to the interval [-1, 1];
    将归一化处理后的所述图像样本进行复制,扩展所述图像样本的维度,得到目标图像样本;Copying the normalized image sample to expand the dimension of the image sample to obtain a target image sample;
    采用所述目标图像样本构建所述训练样本集,其中,所述训练样本集中所述用于模型训练的目标图像样本和所述用于模型测试的目标图像样本的比例为5:1。The target image samples are used to construct the training sample set, wherein the ratio of the target image samples used for model training to the target image samples used for model testing in the training sample set is 5:1.
  13. 根据权利要求11所述的计算机设备,其特征在于,所述ResNet-50网络包括卷积层,所述ResNet-50网络在更新所述卷积层的权值时,训练过程为采用0.0001的学习率训练3000遍所述ResNet-50网络,其中,每遍训练包括10张所述用于训练的目标图像样本。The computer device according to claim 11, wherein the ResNet-50 network includes a convolutional layer, and when the ResNet-50 network updates the weights of the convolutional layer, the training process is to use 0.0001 learning The ResNet-50 network is trained 3000 times at a rate, wherein each training pass includes 10 target image samples for training.
  14. 根据权利要求11所述的计算机设备,其特征在于,所述ResNet-50网络包括卷积层、标准化层和全连接层,所述肺结核分类模型在更新所述ResNet-50网络的权值时先在预设遍数内对所述ResNet-50网络中的卷积层进行更新,预设遍数训练之后,冻结所述ResNet-50网络中卷积层的权值,采用0.001的学习率训练所述ResNet-50网络中的标准化层和全连接层1000遍,对所述ResNet-50网络中的标准化层和全连接层的权值进行更新,其中,所述冻结是指不对所述ResNet-50网络中卷积层的权值进行更新。The computer device according to claim 11, wherein the ResNet-50 network includes a convolutional layer, a standardization layer, and a fully connected layer, and the tuberculosis classification model first updates the weights of the ResNet-50 network. The convolutional layer in the ResNet-50 network is updated within the preset number of passes. After the preset number of passes is trained, the weights of the convolutional layer in the ResNet-50 network are frozen, and the learning rate of 0.001 is used to train the The standardized layer and the fully connected layer in the ResNet-50 network are 1000 times, and the weights of the standardized layer and the fully connected layer in the ResNet-50 network are updated. The weight of the convolutional layer in the network is updated.
  15. 根据权利要求11-14任意一项所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令实现根据所述预测概率更新所述ResNet-50网络的权值时,包括如下步骤:The computer device according to any one of claims 11-14, wherein when the processor executes the computer-readable instructions to update the weight of the ResNet-50 network according to the predicted probability, it includes the following step:
    采用交叉熵损失函数计算训练过程中产生的损失值,其中,所述交叉熵损失函数表示为:
    Figure PCTCN2019115946-appb-100003
    表示所述用于训练的目标图像样本的标签,y表示所述预测概率;
    The cross-entropy loss function is used to calculate the loss value generated during the training process, where the cross-entropy loss function is expressed as:
    Figure PCTCN2019115946-appb-100003
    Represents the label of the target image sample used for training, and y represents the predicted probability;
    采用反向传播算法将训练过程中产生的损失值回传到所述ResNet-50网络中,根据每次训练回传的损失值更新所述ResNet-50网络的权值。A back propagation algorithm is used to return the loss value generated during the training process to the ResNet-50 network, and the weight value of the ResNet-50 network is updated according to the loss value returned during each training.
  16. 一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:A computer non-volatile readable storage medium, the computer non-volatile readable storage medium storing computer readable instructions, wherein the computer readable instructions are executed by a processor to implement the following steps:
    获取待分类胸部X光片图像;Acquire X-ray images of the chest to be classified;
    按照预设的图像处理步骤,将所述待分类胸部X光片图像转换为待分类目标图像,其中,所述待分类目标图像的分辨率和维度与训练肺结核分类模型的目标图像样本相同;Converting the chest X-ray image to be classified into a target image to be classified according to a preset image processing step, wherein the resolution and dimension of the target image to be classified are the same as the target image sample for training the tuberculosis classification model;
    将所述待分类目标图像输入到所述肺结核分类模型中,得到预测概率,所述预测概率为预测肺结核为阳性的概率,当所述预测概率大于预设阈值时,判定与所述待分类目标图像对应的 所述待分类胸部X光片图像存在肺结核,其中,所述肺结核分类模型采用的模型训练步骤包括:Input the target image to be classified into the pulmonary tuberculosis classification model to obtain the predicted probability. The predicted probability is the probability that the predicted pulmonary tuberculosis is positive. When the predicted probability is greater than a preset threshold, it is determined that the target There is tuberculosis in the chest X-ray image to be classified corresponding to the image, wherein the model training steps adopted by the tuberculosis classification model include:
    构建训练样本集,其中,所述训练样本集包括用于模型训练的目标图像样本和用于模型测试的目标图像样本,所述用于模型训练的目标图像样本和用于模型测试的目标图像样本之间不存在相同的目标图像样本;Construct a training sample set, wherein the training sample set includes a target image sample for model training and a target image sample for model testing, the target image sample for model training and a target image sample for model testing There is no same target image sample between them;
    采用ResNet-50网络作为训练的深度神经网络,并将预训练得到的权值作为所述ResNet-50网络初始的权值;Adopting the ResNet-50 network as the training deep neural network, and using the pre-trained weights as the initial weights of the ResNet-50 network;
    将所述用于模型训练的目标图像样本输入到所述ResNet-50网络中训练,输出结果为肺结核阳性的预测概率;Input the target image sample used for model training into the ResNet-50 network for training, and the output result is the predicted probability of pulmonary tuberculosis positive;
    根据所述预测概率更新所述ResNet-50网络的权值,直到更新的变化量均小于第一预设阈值时停止训练,得到待测试模型;Update the weight of the ResNet-50 network according to the predicted probability, and stop training until the updated change amount is less than the first preset threshold to obtain the model to be tested;
    采用所述用于模型测试的目标图像样本测试所述待测试模型,当所述待测试模型输出的测试结果的准确率大于预设准确率时,将所述待测试模型作为所述肺结核分类模型。Use the target image sample for model testing to test the model to be tested, and when the accuracy rate of the test result output by the model to be tested is greater than the preset accuracy rate, use the model to be tested as the tuberculosis classification model .
  17. 根据权利要求16所述的计算机非易失性可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行实现构建训练样本集时,包括如下步骤:The computer non-volatile readable storage medium according to claim 16, wherein when the computer readable instructions are executed by one or more processors to construct a training sample set, the method comprises the following steps:
    获取胸部X光片的图像样本以及所述图像样本的标签,其中,所述图像样本为肺结核阳性时,标签为1,所述图像样本为肺结核阴性时,标签为0;Acquiring an image sample of a chest X-ray film and a label of the image sample, wherein when the image sample is positive for tuberculosis, the label is 1, and when the image sample is negative for tuberculosis, the label is 0;
    将所述图像样本处理为预设分辨率的图像样本,其中,对于分辨率高于预设分辨率的图像样本,采用下采样的方法将所述图像样本的分辨率下采样至所述预设分辨率,对于分辨率低于所述预设分辨率的图像样本,采用双线性插值法将所述图像样本的分辨率上采样至所述预设分辨率;The image sample is processed into an image sample with a preset resolution, where, for an image sample with a resolution higher than the preset resolution, a down-sampling method is used to down-sample the resolution of the image sample to the preset Resolution, for an image sample with a resolution lower than the preset resolution, up-sampling the resolution of the image sample to the preset resolution by using a bilinear interpolation method;
    将所述预设分辨率的图像样本的每个像素点的值归一化到[-1,1]的区间内;Normalize the value of each pixel of the image sample of the preset resolution to the interval [-1, 1];
    将归一化处理后的所述图像样本进行复制,扩展所述图像样本的维度,得到目标图像样本;Copying the normalized image sample to expand the dimension of the image sample to obtain a target image sample;
    采用所述目标图像样本构建所述训练样本集,其中,所述训练样本集中所述用于模型训练的目标图像样本和所述用于模型测试的目标图像样本的比例为5:1。The target image samples are used to construct the training sample set, wherein the ratio of the target image samples used for model training to the target image samples used for model testing in the training sample set is 5:1.
  18. 根据权利要求16所述的计算机非易失性可读存储介质,其特征在于,所述ResNet-50网络包括卷积层,所述ResNet-50网络在更新所述卷积层的权值时,训练过程为采用0.0001的学习率训练3000遍所述ResNet-50网络,其中,每遍训练包括10张所述用于训练的目标图像样本。The computer non-volatile readable storage medium according to claim 16, wherein the ResNet-50 network comprises a convolutional layer, and when the ResNet-50 network updates the weight of the convolutional layer, The training process is to train the ResNet-50 network 3000 times with a learning rate of 0.0001, wherein each training pass includes 10 target image samples for training.
  19. 根据权利要求16所述的计算机非易失性可读存储介质,其特征在于,所述ResNet-50 网络包括卷积层、标准化层和全连接层,所述肺结核分类模型在更新所述ResNet-50网络的权值时先在预设遍数内对所述ResNet-50网络中的卷积层进行更新,预设遍数训练之后,冻结所述ResNet-50网络中卷积层的权值,采用0.001的学习率训练所述ResNet-50网络中的标准化层和全连接层1000遍,对所述ResNet-50网络中的标准化层和全连接层的权值进行更新,其中,所述冻结是指不对所述ResNet-50网络中卷积层的权值进行更新。The computer non-volatile readable storage medium according to claim 16, wherein the ResNet-50 network includes a convolutional layer, a standardized layer, and a fully connected layer, and the tuberculosis classification model is updating the ResNet-50 network. When the weight of the 50 network is used, the convolutional layer in the ResNet-50 network is first updated within the preset number of passes. After the preset number of passes is trained, the weight of the convolutional layer in the ResNet-50 network is frozen, Use a learning rate of 0.001 to train the standardized layer and the fully connected layer in the ResNet-50 network 1000 times, and update the weights of the standardized layer and the fully connected layer in the ResNet-50 network, wherein the freezing is It means that the weight of the convolutional layer in the ResNet-50 network is not updated.
  20. 根据权利要求16-19任意一项所述的计算机非易失性可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行实现根据所述预测概率更新所述ResNet-50网络的权值时,包括如下步骤:The computer non-volatile readable storage medium according to any one of claims 16-19, wherein the computer readable instructions are executed by one or more processors to update the ResNet according to the predicted probability -50 network weight, including the following steps:
    采用交叉熵损失函数计算训练过程中产生的损失值,其中,所述交叉熵损失函数表示为:
    Figure PCTCN2019115946-appb-100004
    表示所述用于训练的目标图像样本的标签,y表示所述预测概率;
    The cross-entropy loss function is used to calculate the loss value generated during the training process, where the cross-entropy loss function is expressed as:
    Figure PCTCN2019115946-appb-100004
    Represents the label of the target image sample used for training, and y represents the predicted probability;
    采用反向传播算法将训练过程中产生的损失值回传到所述ResNet-50网络中,根据每次训练回传的损失值更新所述ResNet-50网络的权值。A back propagation algorithm is used to return the loss value generated during the training process to the ResNet-50 network, and the weight value of the ResNet-50 network is updated according to the loss value returned during each training.
PCT/CN2019/115946 2019-09-16 2019-11-06 Pulmonary tuberculosis determination method and apparatus, computer device, and storage medium WO2021051497A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910869773.6A CN110738235B (en) 2019-09-16 2019-09-16 Pulmonary tuberculosis judging method, device, computer equipment and storage medium
CN201910869773.6 2019-09-16

Publications (1)

Publication Number Publication Date
WO2021051497A1 true WO2021051497A1 (en) 2021-03-25

Family

ID=69267962

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/115946 WO2021051497A1 (en) 2019-09-16 2019-11-06 Pulmonary tuberculosis determination method and apparatus, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN110738235B (en)
WO (1) WO2021051497A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113378483A (en) * 2021-07-12 2021-09-10 广东电网有限责任公司 Power grid data early warning method, device, equipment and storage medium
CN113657530A (en) * 2021-08-24 2021-11-16 凌云光技术股份有限公司 Method and device for processing multi-target large image by adopting detection and classification model

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114065826A (en) * 2020-07-28 2022-02-18 紫东信息科技(苏州)有限公司 Construction method, classification method and device of image classification model and electronic equipment
CN111932564B (en) * 2020-09-24 2021-03-02 平安科技(深圳)有限公司 Picture identification method and device, electronic equipment and computer readable storage medium
CN113076993B (en) * 2021-03-31 2023-04-18 零氪智慧医疗科技(天津)有限公司 Information processing method and model training method for chest X-ray film recognition
CN113780444B (en) * 2021-09-16 2023-07-25 平安科技(深圳)有限公司 Training method of tongue fur image classification model based on progressive learning
CN117095241B (en) * 2023-10-17 2024-01-12 四川大学 Screening method, system, equipment and medium for drug-resistant phthisis class

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190073568A1 (en) * 2017-09-06 2019-03-07 Kla-Tencor Corporation Unified neural network for defect detection and classification
CN109635842A (en) * 2018-11-14 2019-04-16 平安科技(深圳)有限公司 A kind of image classification method, device and computer readable storage medium
CN109685765A (en) * 2018-11-21 2019-04-26 浙江大学山东工业技术研究院 A kind of X-ray pneumonia prediction of result device based on convolutional neural networks
CN110111313A (en) * 2019-04-22 2019-08-09 腾讯科技(深圳)有限公司 Medical image detection method and relevant device based on deep learning
CN110188795A (en) * 2019-04-24 2019-08-30 华为技术有限公司 Image classification method, data processing method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107492099B (en) * 2017-08-28 2021-08-20 京东方科技集团股份有限公司 Medical image analysis method, medical image analysis system, and storage medium
CN108022647B (en) * 2017-11-30 2022-01-25 东北大学 Lung nodule benign and malignant prediction method based on ResNet-inclusion model
CN109191436A (en) * 2018-08-15 2019-01-11 复旦大学 The low-dose CT Lung neoplasm detection algorithm of view-based access control model conspicuousness spectrum residual error method
CN109345507B (en) * 2018-08-24 2021-07-13 河海大学 Dam image crack detection method based on transfer learning
CN110163260A (en) * 2019-04-26 2019-08-23 平安科技(深圳)有限公司 Image-recognizing method, device, equipment and storage medium based on residual error network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190073568A1 (en) * 2017-09-06 2019-03-07 Kla-Tencor Corporation Unified neural network for defect detection and classification
CN109635842A (en) * 2018-11-14 2019-04-16 平安科技(深圳)有限公司 A kind of image classification method, device and computer readable storage medium
CN109685765A (en) * 2018-11-21 2019-04-26 浙江大学山东工业技术研究院 A kind of X-ray pneumonia prediction of result device based on convolutional neural networks
CN110111313A (en) * 2019-04-22 2019-08-09 腾讯科技(深圳)有限公司 Medical image detection method and relevant device based on deep learning
CN110188795A (en) * 2019-04-24 2019-08-30 华为技术有限公司 Image classification method, data processing method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113378483A (en) * 2021-07-12 2021-09-10 广东电网有限责任公司 Power grid data early warning method, device, equipment and storage medium
CN113657530A (en) * 2021-08-24 2021-11-16 凌云光技术股份有限公司 Method and device for processing multi-target large image by adopting detection and classification model
CN113657530B (en) * 2021-08-24 2024-04-05 凌云光技术股份有限公司 Method and device for processing multi-target large image by adopting detection and classification model

Also Published As

Publication number Publication date
CN110738235B (en) 2023-05-30
CN110738235A (en) 2020-01-31

Similar Documents

Publication Publication Date Title
WO2021051497A1 (en) Pulmonary tuberculosis determination method and apparatus, computer device, and storage medium
CN112037912B (en) Triage model training method, device and equipment based on medical knowledge graph
US11507800B2 (en) Semantic class localization digital environment
WO2020155518A1 (en) Object detection method and device, computer device and storage medium
WO2016124103A1 (en) Picture detection method and device
CN110866471A (en) Face image quality evaluation method and device, computer readable medium and communication terminal
WO2021179498A1 (en) Target detection method, method for training model therefor, apparatus, and electronic device
TWI532014B (en) Image similarity judgment system and method
WO2022213465A1 (en) Neural network-based image recognition method and apparatus, electronic device, and medium
AU2017272288A1 (en) Method, system, electronic device, and medium for classifying license plates based on deep learning
WO2019200702A1 (en) Descreening system training method and apparatus, descreening method and apparatus, device, and medium
US20220092407A1 (en) Transfer learning with machine learning systems
US11568212B2 (en) Techniques for understanding how trained neural networks operate
WO2021217937A1 (en) Posture recognition model training method and device, and posture recognition method and device
US10438088B2 (en) Visual-saliency driven scene description
CN112329762A (en) Image processing method, model training method, device, computer device and medium
WO2024001806A1 (en) Data valuation method based on federated learning and related device therefor
US11188795B1 (en) Domain adaptation using probability distribution distance
WO2021042544A1 (en) Facial verification method and apparatus based on mesh removal model, and computer device and storage medium
US9928408B2 (en) Signal processing
CN114528913A (en) Model migration method, device, equipment and medium based on trust and consistency
TWI803243B (en) Method for expanding images, computer device and storage medium
CN116415020A (en) Image retrieval method, device, electronic equipment and storage medium
TWI742312B (en) Machine learning system, machine learning method and non-transitory computer readable medium for operating the same
CN112651467A (en) Training method and system and prediction method and system of convolutional neural network

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19945840

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19945840

Country of ref document: EP

Kind code of ref document: A1