Deep learning-based chest radiograph image processing method and system, and program product
Through the chest radiographic image processing method based on deep learning, the problem of lack of resources of radiologists is solved, intelligent processing of chest radiographic images and lesion detection are realized, and diagnostic efficiency and efficiency are improved.
Patent Information
- Application Number
- CN202410958359.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-08
AI Technical Summary
In the prior art, medical imaging data is growing rapidly, while the insufficient number of radiologists has caused physicians to work overload, and a computer-assisted diagnostic technology is needed to improve work efficiency and reduce labor intensity.
The chest image processing method based on deep learning includes grayscale transformation, image enhancement, filtering, threshold determination, deep learning model for binary processing and morphological filtering, and segment the lung field area and perform Edge detection, marking out the lesion area.
Intelligent processing of chest radiograph images is realized, and the lung field area and suspected lesions are accurately segmented to assist radiologists to improve diagnosis efficiency and reduce labor intensity.
Smart Images

Figure CN118918073A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of medical image processing, and specifically relates to a chest X-ray image processing method, system and program product based on deep learning. Background Art
[0002] The use of medical images for disease screening and diagnosis has become an indispensable means in clinical practice, and chest X-ray is a medical imaging technology widely used in clinical practice. It has important clinical significance for the analysis and diagnosis of lung diseases. Most lung disease diagnoses are completed with the assistance of chest X-ray. The annual growth rate of medical imaging data in my country is about 30%, while the annual growth rate of the number of radiologists is only about 4.1%. In addition, medical imaging diagnosis has high requirements for physician experience. In areas with low development levels, experienced radiologists are relatively scarce. These current situations mean that a large number of radiologists will be overloaded. Therefore, how to effectively apply computer-aided diagnosis technology to the processing and analysis of chest X-rays to assist in improving the work efficiency of radiologists and reducing their workload is an urgent problem that needs to be solved. Summary of the invention
[0003] The purpose of the present invention is to provide a chest X-ray image processing method, system and program product based on deep learning to solve the above-mentioned problems existing in the prior art.
[0004] In order to achieve the above object, the present invention adopts the following technical solutions:
[0005] In a first aspect, a chest X-ray image processing method based on deep learning is provided, comprising:
[0006] Acquire an X-ray chest image of a target object;
[0007] Performing grayscale transformation processing on the X-ray chest film image to obtain an initial chest film grayscale image, and performing image enhancement and image filtering processing on the initial chest film grayscale image to obtain a target chest film grayscale image;
[0008] The grayscale average value of all pixels in the target chest X-ray grayscale image is taken as the upper grayscale value, the pixel whose grayscale value in the target chest X-ray grayscale image is less than the upper grayscale value is taken as the depth pixel, and the grayscale average value of all depth pixels is taken as the lower grayscale value;
[0009] The grayscale threshold interval is constructed using the lower grayscale value and the upper grayscale value, and the target grayscale threshold is determined within the grayscale threshold interval using the maximum inter-class variance method.
[0010] The target chest X-ray grayscale image is binarized using the target grayscale threshold, and the target classification neural network model after deep learning is used to classify and confirm the binarization result to obtain the initial chest X-ray binary image, and the initial chest X-ray binary image is subjected to morphological filtering to obtain a smooth chest X-ray binary image;
[0011] The two largest connected regions with gray values of the first set gray values in the smooth chest radiograph binary image are taken as lung field regions, and image coordinate information of the lung field regions is determined;
[0012] Segmenting a lung field region image from a target chest X-ray grayscale image according to image coordinate information of the lung field region;
[0013] Performing edge detection processing on the lung field region image, determining a number of edge closed regions in the lung field region image, and extracting image coordinate information of each edge closed region in the lung field region image;
[0014] Each edge closed area is marked in the lung field area image according to the image coordinate information of each edge closed area, a final lung field image is obtained, and the final lung field image is output.
[0015] In a possible design, the grayscale transformation processing is performed on the X-ray chest film image to obtain an initial chest film grayscale image, and the initial chest film grayscale image is subjected to image enhancement and image filtering processing to obtain a target chest film grayscale image, including:
[0016] Determine the grayscale value of each pixel in the X-ray chest image, and determine the continuous grayscale value interval [H1, H2] of the X-ray chest image according to the grayscale value of each pixel, so that the number of pixels in the X-ray chest image whose grayscale values are within the continuous grayscale value interval [H1, H2] accounts for a set ratio;
[0017] Extract the lower limit value H1 and the upper limit value H2 from the continuous gray value interval [H1, H2], and obtain the minimum target gray value D1 and the maximum target gray value D2, and 0≤D1<D2≤255;
[0018] Substitute the interval lower limit value H1, the interval upper limit value H2, the minimum target grayscale value D1, the maximum target grayscale value D2 and the grayscale value of each pixel in the X-ray chest image into the preset grayscale transformation formula for calculation to obtain the grayscale value of each pixel after conversion. The grayscale transformation formula is:
[0019]
[0020] Where (x, y) is the image coordinate of the corresponding pixel, F(x, y) is the gray value of the corresponding pixel, and G(x, y) is the converted gray value of the corresponding pixel;
[0021] Constructing an initial chest X-ray grayscale image based on the converted grayscale value of each pixel;
[0022] The initial chest X-ray grayscale image is processed by histogram equalization to obtain an enhanced chest X-ray grayscale image, and the enhanced chest X-ray grayscale image is processed by bilateral filtering to obtain a target chest X-ray grayscale image.
[0023] In a possible design, the method of using the maximum inter-class variance method to determine the target grayscale threshold within the grayscale threshold interval includes:
[0024] Traverse each grayscale threshold in the grayscale threshold interval, and use each grayscale threshold to classify each pixel in the target chest X-ray grayscale image, and classify the pixel in the target chest X-ray grayscale image whose grayscale value exceeds the corresponding grayscale threshold as the first category of pixel points, and classify the pixel in the target chest X-ray grayscale image whose grayscale value does not exceed the corresponding grayscale threshold as the second category of pixel points;
[0025] Determine the number S1 of first-category pixels, the number S2 of second-category pixels, the grayscale mean Q1 of all first-category pixels, and the grayscale mean Q2 of all second-category pixels under the corresponding grayscale threshold condition;
[0026] Substitute the number of first-class pixels S1, the number of second-class pixels S2, the grayscale mean Q1 of all first-class pixels, and the grayscale mean Q2 of all second-class pixels under the corresponding grayscale threshold into the inter-class variance formula for calculation to obtain the inter-class variance corresponding to the grayscale threshold. The inter-class variance formula is: Among them, V represents the variance between classes;
[0027] The grayscale threshold with the largest inter-class variance is taken as the target grayscale threshold.
[0028] In a possible design, the target chest X-ray grayscale image is binarized using the target grayscale threshold, and the binarization result is classified and confirmed using the target classification neural network model after deep learning to obtain an initial chest X-ray binary image, including:
[0029] a. Change the grayscale value of the pixel points whose grayscale value in the target chest X-ray grayscale image is higher than the target grayscale threshold to 255, and change the grayscale value of the pixel points whose grayscale value in the target chest X-ray grayscale image is lower than the target grayscale threshold to 0, so as to obtain a binary image of the chest X-ray to be tested;
[0030] b. Inputting the chest X-ray binary image to be tested into a preset target classification neural network model for classification, and obtaining a corresponding classification result, wherein the classification result includes a background area classification label or a background area classification label not included, wherein the target classification neural network model is obtained by training a VGG neural network model through a training set, wherein the training set includes a number of chest X-ray binary image samples marked with a background area classification label, and a number of chest X-ray binary image samples marked with a background area classification label not included;
[0031] c. When the classification result contains a background area classification label, the target grayscale threshold is subtracted from the set grayscale adjustment value to obtain an updated target grayscale threshold;
[0032] d. Repeat steps a to c above using the updated target grayscale threshold until the classification result does not contain the background area classification label, and use the chest X-ray binary image to be tested at this time as the initial chest X-ray binary image.
[0033] In a possible design, performing morphological filtering on the initial chest X-ray binary image to obtain a smooth chest X-ray binary image includes:
[0034] The initial chest X-ray binary image is processed by image opening and image closing operations to obtain a smooth chest X-ray binary image.
[0035] In a possible design, the edge detection process is performed on the lung field region image to determine a number of edge closed regions in the lung field region image, including:
[0036] Based on the gray value of each pixel in the lung field area image, it is determined whether each pixel in the lung field area image is an edge pixel. When the pixel value of the corresponding pixel satisfies the condition X(i, j) = |max Q [X(i, j)]-min Q [X(i, j)]|, the corresponding pixel is determined to be an edge pixel, where (i, j) is the image coordinate of the corresponding pixel in the lung field image, X(i, j) is the pixel value of the corresponding pixel, and max Q [X(i, j)] represents the maximum grayscale value within a 3×3 pixel window centered at pixel point (i, j), min Q [X(i, j)] represents the minimum grayscale value within a 3×3 pixel window centered at pixel point (i, j);
[0037] A plurality of edge closed regions in the lung field region image are determined according to the image coordinates of each edge pixel point in the lung field region image.
[0038] In a possible design, marking each edge closed area in the lung field area image according to the image coordinate information of each edge closed area to obtain the final lung field image includes:
[0039] The contours of each edge closed area are marked in the lung field area image according to the image coordinate information of each edge closed area, and the grayscale values of all pixels in the contours of each edge closed area are transformed into a second set grayscale value to obtain a final lung field image.
[0040] In a second aspect, a chest X-ray image processing system based on deep learning is provided, comprising an image acquisition unit, an image transformation unit, an interval determination unit, a threshold determination unit, a binary processing unit, a region determination unit, a lung field segmentation unit, an edge detection unit and an image output unit, wherein:
[0041] An image acquisition unit, used to acquire an X-ray chest image of a target object;
[0042] An image conversion unit is used to perform grayscale conversion processing on the X-ray chest film image to obtain an initial chest film grayscale image, and perform image enhancement and image filtering processing on the initial chest film grayscale image to obtain a target chest film grayscale image;
[0043] An interval determination unit is used to take the grayscale average value of all pixels in the target chest X-ray grayscale image as the upper grayscale value, take the pixel whose grayscale value in the target chest X-ray grayscale image is less than the upper grayscale value as the depth pixel, and take the grayscale average value of all depth pixel as the lower grayscale value;
[0044] A threshold determination unit, used to construct a grayscale threshold interval using a lower grayscale value and an upper grayscale value, and determine a target grayscale threshold within the grayscale threshold interval using a maximum inter-class variance method;
[0045] A binary processing unit is used to perform binary processing on the target chest X-ray grayscale image using a target grayscale threshold, classify and confirm the binary processing result using a target classification neural network model after deep learning to obtain an initial chest X-ray binary image, and perform morphological filtering on the initial chest X-ray binary image to obtain a smooth chest X-ray binary image;
[0046] A region determination unit, used for taking two largest connected regions with grayscale values of a first set grayscale value in the smooth chest X-ray binary image as lung field regions, and determining image coordinate information of the lung field regions;
[0047] A lung field segmentation unit, used for segmenting a lung field region image from a target chest X-ray grayscale image according to image coordinate information of the lung field region;
[0048] An edge detection unit is used to perform edge detection processing on the lung field region image, determine a number of edge closed regions in the lung field region image, and extract image coordinate information of each edge closed region in the lung field region image;
[0049] The image output unit is used to mark each edge closed area in the lung field area image according to the image coordinate information of each edge closed area, obtain the final lung field image, and output the final lung field image.
[0050] Thirdly, a chest X-ray image processing system based on deep learning is provided, including:
[0051] A memory for storing instructions;
[0052] A processor is used to read the instructions stored in the memory and execute any one of the methods described in the first aspect according to the instructions.
[0053] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored on the computer-readable storage medium, and when the instructions are executed on a computer, the computer executes any one of the methods described in the first aspect. In addition, a computer program product is provided, and when the computer program product is executed on a computer, the computer executes any one of the methods described in the first aspect.
[0054] Beneficial effects: The present invention obtains the target object's X-ray chest image by grayscale transformation and enhancement processing to obtain the target chest grayscale image, then determines the target grayscale threshold based on the target chest grayscale image, uses the target grayscale threshold to perform binarization processing and morphological filtering on the target chest grayscale image, and then performs lung field segmentation, segments the lung field region image from the target chest grayscale image for edge detection, determines each edge closed region in the lung field region image, and finally marks each edge closed region in the lung field region image to obtain the final lung field image for output, which can realize intelligent processing of chest images before diagnosis. The present invention can accurately and reliably segment the lung field region image from the patient's chest X-ray image, and can effectively detect the suspected lesion area in the lung field region image to assist radiologists in lesion diagnosis, improve the radiologist's reading speed and diagnostic efficiency, and reduce the labor intensity of radiologists. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0056] Figure 1 This is a schematic diagram of the steps of the method in Example 1 of the present invention;
[0057] Figure 2 This is a schematic diagram of the structure of the system in Example 2 of the present invention;
[0058] Figure 3 Schematic diagram of the system structure in Example 3 of the present invention. DETAILED DESCRIPTION
[0059] It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention. The specific structures and functional details disclosed herein are only used to describe the exemplary embodiments of the present invention. However, the present invention can be embodied in many alternative forms, and it should not be understood that the present invention is limited to the embodiments set forth herein.
[0060] It should be understood that, unless otherwise clearly specified and limited, the term "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments can be understood according to specific circumstances.
[0061] In the following description, certain details are provided to facilitate a complete understanding of the example embodiments. However, it will be appreciated by those of ordinary skill in the art that the example embodiments may be implemented without these certain details. For example, devices may be shown in block diagrams to avoid obscuring the examples with unnecessary details. In other embodiments, well-known processes, structures, and techniques may not be shown in unnecessary detail to avoid obscuring the embodiments.
[0062] Embodiment 1:
[0063] This embodiment provides a chest X-ray image processing method based on deep learning, which can be applied to corresponding medical image processing terminals, such as Figure 1 As shown, the method comprises the following steps:
[0064] S1. Obtain an X-ray chest image of a target object.
[0065] In specific implementation, the target object is firstly scanned by a corresponding X-ray scanning device to acquire an X-ray chest image of the target object, and then the X-ray chest image is transmitted to a processing terminal for subsequent X-ray chest image processing.
[0066] S2. Perform grayscale transformation processing on the X-ray chest film image to obtain an initial chest film grayscale image, and perform image enhancement and image filtering processing on the initial chest film grayscale image to obtain a target chest film grayscale image.
[0067] In specific implementation, after receiving the X-ray chest image of the target object, the processing terminal performs the following steps S201-S205:
[0068] S201. Determine the grayscale value of each pixel in the X-ray chest image, and determine the continuous grayscale value interval [H1, H2] of the X-ray chest image according to the grayscale value of each pixel, so that the number of pixels in the X-ray chest image whose grayscale values are within the continuous grayscale value interval [H1, H2] accounts for a set ratio;
[0069] S202. Extract the interval lower limit value H1 and the interval upper limit value H2 from the continuous gray value interval [H1, H2], and obtain the minimum target gray value D1 and the maximum target gray value D2, and 0≤D1<D2≤255;
[0070] S203. Substitute the interval lower limit value H1, the interval upper limit value H2, the minimum target grayscale value D1, the maximum target grayscale value D2 and the grayscale value of each pixel in the X-ray chest image into the preset grayscale transformation formula for calculation to obtain the grayscale value of each pixel after conversion. The grayscale transformation formula is:
[0071]
[0072] Where (x, y) is the image coordinate of the corresponding pixel, F(x, y) is the gray value of the corresponding pixel, and G(x, y) is the converted gray value of the corresponding pixel;
[0073] S204. Constructing an initial chest X-ray grayscale image based on the converted grayscale value of each pixel;
[0074] S205. Perform histogram equalization processing on the initial chest X-ray grayscale image to obtain an enhanced chest X-ray grayscale image, and perform bilateral filtering processing on the enhanced chest X-ray grayscale image to obtain a target chest X-ray grayscale image.
[0075] S3. The grayscale average value of all pixels in the target chest X-ray grayscale image is used as the upper grayscale value, the pixel points in the target chest X-ray grayscale image whose grayscale value is less than the upper grayscale value are used as depth pixels, and the grayscale average value of all depth pixels is used as the lower grayscale value.
[0076] During specific implementation, the processing terminal first determines the grayscale average value of all pixels in the target chest X-ray grayscale image, and takes the grayscale average value of all pixels in the target chest X-ray grayscale image as the upper limit grayscale value; then, the pixels in the target chest X-ray grayscale image whose grayscale values are less than the upper limit grayscale value are taken as depth pixels, and the grayscale average value of all depth pixels is determined; and then, the grayscale average value of all depth pixels is taken as the lower limit grayscale value.
[0077] S4. Use the lower gray value and the upper gray value to construct a gray threshold interval, and use the maximum inter-class variance method to determine the target gray threshold within the gray threshold interval.
[0078] In specific implementation, the processing terminal constructs a grayscale threshold interval using the lower grayscale value and the upper grayscale value, and then executes the following steps S401-S404:
[0079] S401. Traverse each grayscale threshold in the grayscale threshold interval, and use each grayscale threshold to classify each pixel in the target chest X-ray grayscale image, and classify the pixel in the target chest X-ray grayscale image whose grayscale value exceeds the corresponding grayscale threshold as the first category of pixel, and classify the pixel in the target chest X-ray grayscale image whose grayscale value does not exceed the corresponding grayscale threshold as the second category of pixel;
[0080] S402. Determine the number S1 of first-category pixels, the number S2 of second-category pixels, the grayscale mean Q1 of all first-category pixels, and the grayscale mean Q2 of all second-category pixels under the corresponding grayscale threshold condition;
[0081] S403. Substitute the number of first-class pixels S1, the number of second-class pixels S2, the grayscale mean Q1 of all first-class pixels, and the grayscale mean Q2 of all second-class pixels under the corresponding grayscale threshold into the inter-class variance formula for calculation to obtain the inter-class variance corresponding to the grayscale threshold. The inter-class variance formula is: Among them, V represents the variance between classes;
[0082] S404. Use the grayscale threshold corresponding to the maximum inter-class variance as the target grayscale threshold.
[0083] S5. Use the target grayscale threshold to binarize the target chest X-ray grayscale image, use the target classification neural network model after deep learning to classify and confirm the binarization result to obtain the initial chest X-ray binary image, and perform morphological filtering on the initial chest X-ray binary image to obtain a smooth chest X-ray binary image.
[0084] In specific implementation, after the processing terminal determines the target grayscale threshold, the following steps S501-S505 are executed:
[0085] S501. Change the grayscale values of the pixels in the target chest X-ray grayscale image whose grayscale values are higher than the target grayscale threshold to 255, and change the grayscale values of the pixels in the target chest X-ray grayscale image whose grayscale values are lower than the target grayscale threshold to 0, to obtain a binary image of the chest X-ray to be tested;
[0086] S502. Input the chest X-ray binary image to be tested into a preset target classification neural network model for classification, and obtain a corresponding classification result, wherein the classification result includes a background area classification label or a background area classification label not included, and the target classification neural network model is obtained by training a VGG neural network model through a training set, and the training set includes a number of chest X-ray binary image samples marked with a background area classification label, and a number of chest X-ray binary image samples marked with a background area classification label not included;
[0087] S503. When the classification result contains a background area classification label, the target grayscale threshold is subtracted from the set grayscale adjustment value to obtain an updated target grayscale threshold;
[0088] S504. Repeat the above steps S501 to S503 using the updated target grayscale threshold until the classification result does not contain the background area classification label, and use the chest X-ray binary image to be tested at this time as the initial chest X-ray binary image;
[0089] S505. Perform image opening and image closing operations on the initial chest X-ray binary image to obtain a smooth chest X-ray binary image.
[0090] S6. The two largest connected regions with grayscale values of the first set grayscale value in the smooth chest X-ray binary image are taken as lung field regions, and image coordinate information of the lung field regions is determined.
[0091] In a specific implementation, in the smooth chest X-ray binary image obtained through the image processing in the previous steps, there are several image areas with a grayscale value of 0 including the lung field areas, and several image areas with a grayscale value of 255 including the non-lung field areas. Since the lung field areas in the chest X-ray image are the two largest connected areas, the two largest connected areas with a grayscale value of 0 in the smooth chest X-ray binary image can be used as the lung field areas, and the image coordinate information of the two lung field areas can be determined.
[0092] S7. Segment a lung field region image from the target chest X-ray grayscale image according to the image coordinate information of the lung field region.
[0093] During specific implementation, the processing terminal remaps the image coordinate information of the lung field area to the target chest X-ray grayscale image, determines the image area corresponding to the image coordinate information of the lung field area in the target chest X-ray grayscale image, and segments the image area from the target chest X-ray grayscale image as a lung field area image.
[0094] S8. Perform edge detection processing on the lung field region image, determine a number of edge closed regions in the lung field region image, and extract image coordinate information of each edge closed region in the lung field region image.
[0095] In specific implementation, the processing terminal determines whether each pixel in the lung field area image is an edge pixel based on the gray value of each pixel in the lung field area image. When the pixel value of the corresponding pixel satisfies the condition X(i, j) = |max Q [X(i, j)]-min Q [X(i, j)]|, the corresponding pixel is determined to be an edge pixel, where (i, j) is the image coordinate of the corresponding pixel in the lung field image, X(i, j) is the pixel value of the corresponding pixel, and max Q [X(i, j)] represents the maximum grayscale value within a 3×3 pixel window centered at pixel point (i, j), min Q [X(i, j)] represents the minimum grayscale value in a 3×3 pixel window centered at pixel point (i, j). Then, several edge closed regions in the lung field region image are determined based on the image coordinates of each edge pixel point in the lung field region image, and the image coordinate information of each edge closed region in the lung field region image is extracted.
[0096] S9. Mark each edge closed area in the lung field area image according to the image coordinate information of each edge closed area, obtain a final lung field image, and output the final lung field image.
[0097] During specific implementation, the processing terminal marks the outline of each closed edge area in the lung field area image according to the image coordinate information of each closed edge area, and obtains the final lung field image for output display. Some small closed edge areas in the lung field area may be lesion areas. By marking the outline of the closed edge area on the lung field image in advance, radiologists can intuitively see the suspected lesion areas in the lung field, thereby conducting rapid lesion analysis and diagnosis.
[0098] The method of this embodiment can realize intelligent processing of chest X-ray images before diagnosis, accurately and reliably segment lung field area images from patient chest X-ray images, and effectively detect suspected lesion areas in lung field area images to assist radiologists in lesion diagnosis, improve radiologists' film reading speed and diagnostic efficiency, and reduce radiologists' labor intensity.
[0099] Embodiment 2:
[0100] This embodiment provides a chest X-ray image processing system based on deep learning, such as Figure 2 As shown, it includes an image acquisition unit, an image transformation unit, an interval determination unit, a threshold determination unit, a binary processing unit, a region determination unit, a lung field segmentation unit, an edge detection unit and an image output unit, wherein:
[0101] An image acquisition unit, used to acquire an X-ray chest image of a target object;
[0102] An image conversion unit is used to perform grayscale conversion processing on the X-ray chest film image to obtain an initial chest film grayscale image, and perform image enhancement and image filtering processing on the initial chest film grayscale image to obtain a target chest film grayscale image;
[0103] An interval determination unit is used to take the grayscale average value of all pixels in the target chest X-ray grayscale image as the upper grayscale value, take the pixel whose grayscale value in the target chest X-ray grayscale image is less than the upper grayscale value as the depth pixel, and take the grayscale average value of all depth pixel as the lower grayscale value;
[0104] A threshold determination unit, used to construct a grayscale threshold interval using a lower grayscale value and an upper grayscale value, and determine a target grayscale threshold within the grayscale threshold interval using a maximum inter-class variance method;
[0105] A binary processing unit is used to perform binary processing on the target chest X-ray grayscale image using a target grayscale threshold, classify and confirm the binary processing result using a target classification neural network model after deep learning to obtain an initial chest X-ray binary image, and perform morphological filtering on the initial chest X-ray binary image to obtain a smooth chest X-ray binary image;
[0106] A region determination unit, used for taking two largest connected regions with grayscale values of a first set grayscale value in the smooth chest X-ray binary image as lung field regions, and determining image coordinate information of the lung field regions;
[0107] A lung field segmentation unit, used to segment a lung field region image from a target chest X-ray grayscale image according to image coordinate information of the lung field region;
[0108] An edge detection unit is used to perform edge detection processing on the lung field region image, determine a number of edge closed regions in the lung field region image, and extract image coordinate information of each edge closed region in the lung field region image;
[0109] The image output unit is used to mark each edge closed area in the lung field area image according to the image coordinate information of each edge closed area, obtain the final lung field image, and output the final lung field image.
[0110] Embodiment 3:
[0111] This embodiment provides a chest X-ray image processing system based on deep learning, such as Figure 3 As shown, at the hardware level, it includes:
[0112] Data interface, used to establish data connection between the processor and the X-ray scanning device;
[0113] A memory for storing instructions;
[0114] A processor is used to read the instructions stored in the memory and execute the chest X-ray image processing method based on deep learning in Example 1 according to the instructions.
[0115] Optionally, the system further includes an internal bus, through which the processor, the memory and the data interface can be interconnected, and the internal bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0116] The memory may include, but is not limited to, random access memory (RAM), read only memory (ROM), flash memory, first input first output (FIFO) and / or first in last out (FILO) memory, etc. The processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0117] Embodiment 4:
[0118] This embodiment provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed on a computer, the computer executes the chest X-ray image processing method based on deep learning in Embodiment 1. The computer-readable storage medium refers to a carrier for storing data, which may include but is not limited to a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash drive, and / or a memory stick, etc. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0119] This embodiment further provides a computer program product, which, when executed on a computer, executes the chest X-ray image processing method based on deep learning in Embodiment 1. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0120] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A chest X-ray image processing method based on deep learning, characterized in that: include: Acquire an X-ray chest image of a target object; Performing grayscale transformation processing on the X-ray chest film image to obtain an initial chest film grayscale image, and performing image enhancement and image filtering processing on the initial chest film grayscale image to obtain a target chest film grayscale image; The grayscale average value of all pixels in the target chest X-ray grayscale image is taken as the upper grayscale value, the pixel whose grayscale value in the target chest X-ray grayscale image is less than the upper grayscale value is taken as the depth pixel, and the grayscale average value of all depth pixels is taken as the lower grayscale value; The grayscale threshold interval is constructed using the lower grayscale value and the upper grayscale value, and the target grayscale threshold is determined within the grayscale threshold interval using the maximum inter-class variance method. The target chest X-ray grayscale image is binarized using the target grayscale threshold, and the target classification neural network model after deep learning is used to classify and confirm the binarization result to obtain the initial chest X-ray binary image, and the initial chest X-ray binary image is subjected to morphological filtering to obtain a smooth chest X-ray binary image; The two largest connected regions with gray values of the first set gray values in the smooth chest radiograph binary image are taken as lung field regions, and image coordinate information of the lung field regions is determined; Segmenting a lung field region image from a target chest X-ray grayscale image according to image coordinate information of the lung field region; Performing edge detection processing on the lung field region image, determining a number of edge closed regions in the lung field region image, and extracting image coordinate information of each edge closed region in the lung field region image; Each edge closed area is marked in the lung field area image according to the image coordinate information of each edge closed area, a final lung field image is obtained, and the final lung field image is output.
2. The chest X-ray image processing method based on deep learning according to claim 1, characterized in that: The grayscale transformation process is performed on the X-ray chest film image to obtain an initial chest film grayscale image, and the initial chest film grayscale image is enhanced and filtered to obtain a target chest film grayscale image, including: Determine the grayscale value of each pixel in the X-ray chest image, and determine the continuous grayscale value interval [H1, H2] of the X-ray chest image according to the grayscale value of each pixel, so that the number of pixels in the X-ray chest image whose grayscale values are within the continuous grayscale value interval [H1, H2] accounts for a set ratio; Extract the lower limit value H1 and the upper limit value H2 from the continuous gray value interval [H1, H2], and obtain the minimum target gray value D1 and the maximum target gray value D2, and 0≤D1<D2≤255; Substitute the interval lower limit value H1, the interval upper limit value H2, the minimum target grayscale value D1, the maximum target grayscale value D2 and the grayscale value of each pixel in the X-ray chest image into the preset grayscale transformation formula for calculation to obtain the grayscale value of each pixel after conversion. The grayscale transformation formula is: Where (x, y) is the image coordinate of the corresponding pixel, F(x, y) is the gray value of the corresponding pixel, and G(x, y) is the converted gray value of the corresponding pixel; Constructing an initial chest X-ray grayscale image based on the converted grayscale value of each pixel; The initial chest X-ray grayscale image is processed by histogram equalization to obtain an enhanced chest X-ray grayscale image, and the enhanced chest X-ray grayscale image is processed by bilateral filtering to obtain a target chest X-ray grayscale image.
3. The chest X-ray image processing method based on deep learning according to claim 1, characterized in that: The method of using the maximum inter-class variance method to determine the target grayscale threshold within the grayscale threshold interval includes: Traverse each grayscale threshold in the grayscale threshold interval, and use each grayscale threshold to classify each pixel in the target chest X-ray grayscale image, and classify the pixel in the target chest X-ray grayscale image whose grayscale value exceeds the corresponding grayscale threshold as the first category of pixel points, and classify the pixel in the target chest X-ray grayscale image whose grayscale value does not exceed the corresponding grayscale threshold as the second category of pixel points; Determine the number S1 of first-category pixels, the number S2 of second-category pixels, the grayscale mean Q1 of all first-category pixels, and the grayscale mean Q2 of all second-category pixels under the corresponding grayscale threshold condition; Substitute the number of first-class pixels S1, the number of second-class pixels S2, the grayscale mean Q1 of all first-class pixels, and the grayscale mean Q2 of all second-class pixels under the corresponding grayscale threshold into the inter-class variance formula for calculation to obtain the inter-class variance corresponding to the grayscale threshold. The inter-class variance formula is: Among them, V represents the variance between classes; The grayscale threshold with the largest inter-class variance is taken as the target grayscale threshold.
4. The chest X-ray image processing method based on deep learning according to claim 1, characterized in that: The target chest X-ray grayscale image is binarized using the target grayscale threshold, and the target classification neural network model after deep learning is used to classify and confirm the binarization result to obtain an initial chest X-ray binary image, including: a. Change the grayscale value of the pixel points whose grayscale value in the target chest X-ray grayscale image is higher than the target grayscale threshold to 255, and change the grayscale value of the pixel points whose grayscale value in the target chest X-ray grayscale image is lower than the target grayscale threshold to 0, so as to obtain a binary image of the chest X-ray to be tested; b. Inputting the chest X-ray binary image to be tested into a preset target classification neural network model for classification, and obtaining a corresponding classification result, wherein the classification result includes a background area classification label or a background area classification label not included, wherein the target classification neural network model is obtained by training a VGG neural network model through a training set, wherein the training set includes a number of chest X-ray binary image samples marked with a background area classification label, and a number of chest X-ray binary image samples marked with a background area classification label not included; c. When the classification result contains a background area classification label, the target grayscale threshold is subtracted from the set grayscale adjustment value to obtain an updated target grayscale threshold; d. Repeat steps a to c above using the updated target grayscale threshold until the classification result does not contain the background area classification label, and use the chest X-ray binary image to be tested at this time as the initial chest X-ray binary image.
5. The chest X-ray image processing method based on deep learning according to claim 1, characterized in that: The step of performing morphological filtering on the initial chest X-ray binary image to obtain a smooth chest X-ray binary image includes: The initial chest X-ray binary image is processed by image opening and image closing operations to obtain a smooth chest X-ray binary image.
6. The chest X-ray image processing method based on deep learning according to claim 1, characterized in that: The performing edge detection processing on the lung field region image to determine a plurality of edge closed regions in the lung field region image includes: Based on the gray value of each pixel in the lung field area image, it is determined whether each pixel in the lung field area image is an edge pixel. When the pixel value of the corresponding pixel satisfies the condition X(i, j) = |max Q [X(i, j)]-min Q [X(i, j)]|, the corresponding pixel is determined to be an edge pixel, where (i, j) is the image coordinate of the corresponding pixel in the lung field image, X(i, j) is the pixel value of the corresponding pixel, and max Q [X(i, j)] represents the maximum grayscale value within a 3×3 pixel window centered at pixel point (i, j), min Q [X(i, j)] represents the minimum grayscale value within a 3×3 pixel window centered at pixel point (i, j); A plurality of edge closed regions in the lung field region image are determined according to the image coordinates of each edge pixel point in the lung field region image.
7. The chest X-ray image processing method based on deep learning according to claim 1, characterized in that: The method of marking each edge closed area in the lung field area image according to the image coordinate information of each edge closed area to obtain a final lung field image includes: The contours of each edge closed region are marked in the lung field region image according to the image coordinate information of each edge closed region to obtain the final lung field image.
8. A chest X-ray image processing system based on deep learning, characterized in that: It includes an image acquisition unit, an image transformation unit, an interval determination unit, a threshold determination unit, a binary processing unit, a region determination unit, a lung field segmentation unit, an edge detection unit and an image output unit, wherein: An image acquisition unit, used to acquire an X-ray chest image of a target object; An image conversion unit is used to perform grayscale conversion processing on the X-ray chest film image to obtain an initial chest film grayscale image, and perform image enhancement and image filtering processing on the initial chest film grayscale image to obtain a target chest film grayscale image; An interval determination unit is used to take the grayscale average value of all pixels in the target chest X-ray grayscale image as the upper grayscale value, take the pixel whose grayscale value in the target chest X-ray grayscale image is less than the upper grayscale value as the depth pixel, and take the grayscale average value of all depth pixel as the lower grayscale value; A threshold determination unit, used to construct a grayscale threshold interval using a lower grayscale value and an upper grayscale value, and determine a target grayscale threshold within the grayscale threshold interval using a maximum inter-class variance method; A binary processing unit is used to perform binary processing on the target chest X-ray grayscale image using a target grayscale threshold, classify and confirm the binary processing result using a target classification neural network model after deep learning to obtain an initial chest X-ray binary image, and perform morphological filtering on the initial chest X-ray binary image to obtain a smooth chest X-ray binary image; A region determination unit, used for taking two largest connected regions with grayscale values of a first set grayscale value in the smooth chest X-ray binary image as lung field regions, and determining image coordinate information of the lung field regions; A lung field segmentation unit, used to segment a lung field region image from a target chest X-ray grayscale image according to image coordinate information of the lung field region; An edge detection unit is used to perform edge detection processing on the lung field region image, determine a number of edge closed regions in the lung field region image, and extract image coordinate information of each edge closed region in the lung field region image; The image output unit is used to mark each edge closed area in the lung field area image according to the image coordinate information of each edge closed area, obtain the final lung field image, and output the final lung field image.
9. A chest X-ray image processing system based on deep learning, characterized in that: include: A memory for storing instructions; A processor is used to read the instructions stored in the memory and execute the chest X-ray image processing method based on deep learning according to any one of claims 1 to 7.
10. A computer program product, characterized in that When the computer program product runs on a computer, the chest X-ray image processing method based on deep learning described in any one of claims 1 to 7 is executed.
