Fundus lesion detection method, detection device and terminal equipment
By adjusting the brightness of the fundus area and using training model detection, the problem of low fundus lesions detection accuracy in the prior art is solved, and more efficient and accurate lesions detection is achieved.
Patent Information
- Application Number
- CN202011575989.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-28
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2040-12-28
AI Technical Summary
The existing eye disease detection methods have low accuracy when extracting characteristic information of fundus lesion areas, and cannot effectively detect complex fundus retinopathy and other lesions, resulting in low detection accuracy.
By adjusting the brightness of the fundus area in the image to be detected, the candidate lesions are highlighted, and the trained detection model is used to detect the lesions to improve detection accuracy and efficiency. Specific steps include cutting the fundus area, performing grayscale conversion, removing background pixel points, smoothing processing and difference image enhancement, and generating adjustment images for detection.
It improves the accuracy and efficiency of fundus lesions detection, provides a reliable basis for detection data, and enhances the accuracy of lesions detection.
Smart Images

Figure CN112734701B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology, and in particular relates to a fundus lesion detection method, a detection device and a terminal device. Background Art
[0002] With the change of eating habits and lifestyle, more and more people are suffering from eye diseases. For eye diseases, early diagnosis and early treatment are needed to prevent the disease from getting worse and leading to blindness. Usually, the lesions of eye diseases are not easy to observe. For example, fundus retinal lesions cannot be diagnosed by doctors. Therefore, the detection of eye lesions is the key to diagnosing eye diseases.
[0003] In the existing methods for detecting eye diseases, medical images of the eye can be obtained through medical instruments, and the location and type of eye lesions can be determined by performing image detection on the medical images of the eye. However, most of the existing methods perform lesion detection based on features such as grayscale and gradient of the image and simple threshold filtering. Due to the complex physiological structures of the optic disc, macula, and blood vessels in the fundus retina, the existing methods cannot guarantee the validity of the feature information of the extracted fundus lesion area, resulting in low detection accuracy. Summary of the invention
[0004] The embodiments of the present application provide a method, a detection device and a terminal device for detecting fundus lesions, which can improve the detection accuracy and efficiency of fundus lesions.
[0005] In a first aspect, an embodiment of the present application provides a method for detecting fundus lesions, comprising:
[0006] Acquire an image to be detected including a fundus area;
[0007] Adjusting the brightness of the fundus area in the image to be detected to obtain an adjusted image;
[0008] The lesion in the adjusted image is detected according to the trained detection model.
[0009] In the embodiment of the present application, by adjusting the brightness of the fundus region in the image to be detected, the candidate lesions in the fundus region of the image to be detected can be highlighted, providing a reliable data basis for the detection of lesions, thereby helping to improve the detection accuracy. In addition, using the trained detection model to detect lesions can effectively improve the detection efficiency and the detection accuracy.
[0010] In a possible implementation manner of the first aspect, adjusting the brightness of the fundus area in the image to be detected to obtain an adjusted image includes:
[0011] intercepting the fundus area from the image to be detected to obtain a fundus image;
[0012] The brightness of the fundus image is adjusted to obtain the adjusted image.
[0013] In a possible implementation manner of the first aspect, intercepting the fundus area from the image to be detected to obtain the fundus image includes:
[0014] Converting the image to be detected into a grayscale image;
[0015] The fundus area is intercepted from the grayscale image according to the pixel values of the pixels in the grayscale image to obtain the fundus image.
[0016] In a possible implementation manner of the first aspect, intercepting the fundus area from the grayscale image according to pixel values of pixel points in the grayscale image to obtain the fundus image includes:
[0017] Removing pixel points corresponding to pixel values that meet a preset condition in the grayscale image, and determining the grayscale image after the removal as the fundus image;
[0018] The preset condition includes: the pixel value of the pixel point is within a first preset value range.
[0019] In a possible implementation manner of the first aspect, adjusting the brightness of the fundus image to obtain the adjusted image includes:
[0020] Performing smoothing on the fundus image to obtain a smoothed image;
[0021] Acquire a difference image between the fundus image and the smoothed image;
[0022] Performing enhancement processing on the pixel values of the pixel points in the difference image to obtain an enhanced difference image;
[0023] The enhanced difference image is determined as the adjusted image.
[0024] In a possible implementation manner of the first aspect, the method further includes:
[0025] Obtain training image sets and test image sets;
[0026] Training the detection model according to the training image set to obtain an intermediate model;
[0027] Testing the intermediate model according to the test image set to obtain a test result;
[0028] Update the training image set according to the test result to obtain the updated training image set;
[0029] The intermediate model is retrained according to the updated training image set to obtain the trained detection model.
[0030] In a possible implementation manner of the first aspect, the test result includes a test label corresponding to each test image in the test image set, and the test label includes a first probability value and a second probability value;
[0031] The updating of the training image set according to the test result to obtain the updated training image set includes:
[0032] For any one of the test images in the test image set, when the first probability value in the test label corresponding to the test image is within a second preset value range, marking the test image as a positive sample;
[0033] When the second probability value in the test label corresponding to the test image is within a third preset value range, the test image is marked as a negative sample.
[0034] In a second aspect, an embodiment of the present application provides a fundus lesion detection device, comprising:
[0035] An image acquisition unit, used for acquiring an image to be detected, wherein the image to be detected includes a fundus area and a background area;
[0036] A brightness adjustment unit, used for adjusting the brightness of the fundus area to obtain an adjusted image;
[0037] The lesion detection unit is used to detect the lesion in the adjusted image according to the trained detection model.
[0038] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a fundus lesion detection method as described in any one of the first aspects above when executing the computer program.
[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium. An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and wherein when the computer program is executed by a processor, the method for detecting fundus lesions as described in any one of the above-mentioned first aspects is implemented.
[0040] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the fundus lesion detection method described in any one of the first aspects above.
[0041] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0043] Figure 1 It is a flowchart of a method for training a detection model provided in an embodiment of the present application;
[0044] Figure 2 It is a schematic diagram of the structure of the detection model provided in the embodiment of the present application;
[0045] Figure 3 It is a schematic diagram of the training process of the detection model provided in the embodiment of the present application;
[0046] Figure 4 is a flow chart of a method for detecting fundus lesions provided in an embodiment of the present application;
[0047] Figure 5 is a schematic diagram of the interception process of the fundus image provided in the embodiment of the present application;
[0048] Figure 6 is a schematic diagram of adjusting an image provided by an embodiment of the present application;
[0049] Figure 7 is a structural block diagram of a fundus lesion detection device provided in an embodiment of the present application;
[0050] Figure 8 It is a structural diagram of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0052] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0053] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0054] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
[0055] The embodiment of the present application includes two aspects: the training process of the detection model and the detection process of fundus lesions. First, the detection model is trained using sample images, and then the trained detection model is used to detect the image to be detected.
[0056] The following first introduces the training process of the detection model. Figure 1 , is a flow chart of the training method of the detection model provided in an embodiment of the present application.
[0057] S101, obtaining a training image set and a test image set.
[0058] The training image set includes multiple training images, and the test image set includes multiple test images.
[0059] The training image carries label information. For example, if a training image includes fundus lesions, that is, fundus images with diseases, the label information of the training image can be 1. If a training image includes a normal fundus image, the label information of the training image can be 0. It should be noted that the above is only an example of label information and does not specifically limit the specific form of label information. Label information can be numbers, text, or symbols, etc.
[0060] The label information of the training images is usually manually annotated. The label information can be used to indicate the category of detection. For example, when it is necessary to detect whether a person is sick, the label information may include two numerical values, one indicating that the person has the disease, and the other indicating that the person does not have the disease. When it is necessary to detect the location of the lesion, the label information may include the location information of the detection box corresponding to the lesion. Label the label information according to actual needs, and accordingly, the detection model trained with the training images carrying the label information can also be used to detect the category corresponding to the label information.
[0061] The training image and the test image may be RGB images including the fundus area. In order to enable the detection model to obtain clearer and more accurate feature information, the training image and the test image may be preprocessed. The preprocessing process is the same as the preprocessing process of the image to be detected during the detection process. For details, please refer to the description in S402, which will not be repeated here.
[0062] S102, training the detection model according to the training image set to obtain an intermediate model.
[0063] The intermediate model here refers to the detection model that has not yet been trained.
[0064] In order to reduce the amount of calculation, the detection model can use a lightweight classification neural network, such as a resnet18 network, etc. The lightweight network can be embedded in portable devices such as mobile devices, thereby improving the practicality and convenience of the fundus lesion detection method in the present application.
[0065] For example, see Figure 2 , is a schematic diagram of the structure of the detection model provided in the embodiment of the present application. Figure 2 As shown, the detection model can include 4 residual modules (such as Figure 2 C1-C4 shown) and an average pooling layer (as shown Figure 2 The residual network can avoid the gradient vanishing problem. The average pooling layer can be used to fuse the feature information of adjacent pixels. The scale of the residual module can be adjusted according to the size of the input image. Figure 2 The detection model shown can output probability values corresponding to various categories (such as the probability of being sick and the probability of being healthy).
[0066] S103, testing the intermediate model according to the test image set to obtain a test result.
[0067] The test result includes test labels corresponding to the test images in the test image set, and the test labels include a first probability value and a second probability value.
[0068] S104: Update the training image set according to the test result to obtain an updated training image set.
[0069] S105, retraining the intermediate model according to the updated training image set to obtain a trained detection model.
[0070] Usually, during the training process, the detection model is not trained only once, but is repeatedly trained K times using the training image set, or the detection model is repeatedly trained until the detection model reaches a preset accuracy. The above steps describe a training process. For an exemplary process of repeated training, see Figure 3 , is a schematic diagram of the training process of the detection model provided in an embodiment of the present application.
[0071] like Figure 3 As shown, after obtaining the training image set, each training image in the training image set is preprocessed; then the preprocessed training image is input into the detection model to train the detection model and obtain an intermediate model; it is determined whether the preset training times K is reached; if the preset training times K is reached, the current intermediate model is determined as the trained detection model; if the preset training times K is not reached, the test image in the test image set is input into the intermediate model, and the test label of the test image is output; then the test image carrying the test label is added to the training image set; thereafter, the intermediate model is retrained using the updated training image set until the training times K is reached.
[0072] In one embodiment, an implementation of S104 includes:
[0073] For any test image in the test image set, when the first probability value in the test label corresponding to the test image is within the second preset numerical range, the test image is marked as a positive sample; when the second probability value in the test label corresponding to the test image is within the third preset numerical range, the test image is marked as a negative sample.
[0074] Positive samples and negative samples are used to represent different categories of training images. For example, when the image of the diseased fundus is a positive sample, the image of the non-diseased fundus is a negative sample; when the image of the diseased fundus is a negative sample, the image of the non-diseased fundus is a positive sample.
[0075] Exemplarily, it is assumed that the test result of the test image includes a first probability value P1 and a second probability value P2, wherein P1 represents the probability value that the test image is a healthy fundus, and P2 represents the probability value that the test image is a diseased fundus. When P1 is within the second preset value range, the test image is marked as a positive sample (i.e., representing a healthy fundus image); when P2 is within the third preset value range, the test image is marked as a negative sample (i.e., representing a diseased fundus image).
[0076] Optionally, the second preset numerical range and the third preset numerical range may be a fixed numerical range. However, since the detection accuracy of the detection model is low when it is first trained, and the detection accuracy of the detection model gradually improves as the number of training times increases, if a fixed numerical range is used to determine the detection label of the test image, the training effect is poor.
[0077] In order to solve the above problem, optionally, the second preset numerical range and the third preset numerical range can be dynamically adjusted according to the number of training times.
[0078] Exemplarily, the second preset numerical range and the third preset numerical range can both be greater than 1-0.001k. Wherein, k is the number of times currently trained. As the number of training times increases, that is, the k value increases, the value corresponding to 1-0.001k decreases. This is equivalent to lowering the threshold as the number of training times increases, so that more training samples can be added.
[0079] The above embodiment of the present application can generate a pseudo label for the test image based on the test result, and add the test image carrying the pseudo label as a new training image to the training image set. In this way, the training image set can be dynamically updated without manual annotation, thus reducing labor costs. When there are fewer training images, the above method can effectively ensure the training accuracy of the detection model.
[0080] After the detection model is trained, the trained detection model is used for detection. The following describes the detection process of fundus lesions. Figure 4 , is a flow chart of a method for detecting fundus lesions provided in an embodiment of the present application. As an example but not a limitation, the method may include the following steps:
[0081] S401, obtaining an image to be detected including a fundus area.
[0082] Since the fundus region includes physiological structures such as the optic disc, macula, and blood vessels, the structure is relatively complex. If the image to be detected is directly detected, the detection accuracy will be affected. In order to solve the above problem, in the embodiment of the present application, the image to be detected is preprocessed. The specific preprocessing process is described in S402 below.
[0083] S402, adjusting the brightness of the fundus area in the image to be detected to obtain an adjusted image.
[0084] Usually, the image to be detected, that is, the medical image containing the fundus area, also contains the background image. When the brightness of the image to be detected is adjusted, the background image part of the image to be detected will also be adjusted accordingly, which may cause the boundary between the fundus area and the background image in the adjusted image to be unclear, and the two parts will be confused, thereby affecting the detection accuracy.
[0085] To solve the above problem, in one embodiment, an implementation of S402 includes:
[0086] I. Cut out the fundus area from the image to be detected to obtain a fundus image.
[0087] Through the method in step I, the background image in the image to be detected can be cut out, thereby avoiding the interference of the background image on the fundus area. At the same time, it can also reduce the redundant information in the image to be detected that is useless to the detection method, reduce the amount of calculation, and improve the detection efficiency.
[0088] Optionally, I may include:
[0089] The image to be detected is converted into a grayscale image; the fundus area is intercepted from the grayscale image according to the pixel values of the pixels in the grayscale image to obtain the fundus image.
[0090] Usually the image to be detected is an RGB image, that is, each pixel in the image has three channel values of R, G, and B. The amount of data is large, which affects the detection efficiency. However, the lesion area and the normal area usually do not show obvious differences in color, but most of them have obvious differences in morphology. Therefore, in order to reduce the amount of calculation and improve the detection efficiency, the RGB image can be converted into a grayscale image. Each pixel in the grayscale image corresponds to only one pixel value, which greatly reduces the amount of calculation data.
[0091] Optionally, you can convert the RGB image to a grayscale image using the following methods:
[0092] 1. Floating point algorithm: Gray = R*0.3+G*0.59+B*0.11;
[0093] 2. Integer method: Gray = (R*30+G*59+B*11) / 100;
[0094] 3. Shift method: Gray = (R*76+G*151+B*28)>>8;
[0095] 4. Average value method: Gray = (R + G + B) / 3;
[0096] Among them, Gray is the pixel value of the pixel in the grayscale image, R is the R channel value of the pixel in the RGB image, G is the G channel value of the pixel in the RGB image, and B is the B channel value of the pixel in the RGB image.
[0097] Specifically, extracting a fundus area from a grayscale image based on pixel values of pixel points in the grayscale image to obtain a fundus image may include: removing pixel points corresponding to pixel values that meet preset conditions in the grayscale image, and determining the grayscale image after removal as the fundus image; wherein the preset conditions include: the pixel value of the pixel point is within a first preset value range.
[0098] For example, assuming that the pixel value of a pixel point in a grayscale image ranges from 0 to 1, the first preset value range can be set to be less than 0.2 or greater than 0.98. That is, when the pixel value of a pixel point in a grayscale image is between 0.2 and 0.98, the pixel point is retained; when the pixel value of a pixel point in a grayscale image is less than 0.2 or greater than 0.98, the pixel point is removed.
[0099] See also Figure 5 , is a schematic diagram of the interception process of the fundus image provided in the embodiment of the present application. Figure 5 As shown, the background image can be removed by the method in I.
[0100] In practical applications, there may also be a situation where the pixel values of some pixels in the fundus region in the grayscale image are also within the first preset value range, in which case some feature information in the fundus region will be removed.
[0101] In order to avoid the above situation, before removing the pixels, the boundary between the fundus area and the background image in the grayscale image can be fitted, and then the background image can be removed according to the pixel value. That is, only the pixels in the background image are removed, and the pixels in the fundus area are not removed.
[0102] II. Adjust the brightness of the fundus image to obtain an adjusted image.
[0103] The purpose of adjusting the brightness of the fundus image is to highlight the lesion in the fundus image.
[0104] Optionally, an implementation of II includes:
[0105] The fundus image is smoothed to obtain a smoothed image; a difference image between the fundus image and the smoothed image is obtained; pixel values of pixels in the difference image are enhanced to obtain an enhanced difference image; and the enhanced difference image is determined as an adjusted image.
[0106] Optionally, the fundus image may be smoothed using a Gaussian blur kernel.
[0107] Since the pixel values of the pixels in the grayscale image are relatively small, the pixel values of the pixels in the calculated difference image are also small, and the difference is not obvious. For example: In order to improve the difference between the two, the formula img sub =4*img-4*img_blur calculates the pixel value of each pixel in the difference image. subrepresents the pixel value of the pixel in the difference image, img represents the pixel value of the pixel in the fundus image, and img_blur represents the pixel value of the pixel in the smoothed image. Through the above formula, the pixel value of each pixel in the difference image is enlarged by 4 times. It should be noted that when the pixel value of the pixel in the difference image is calculated using the above formula, the corresponding pixels in the fundus image and the smoothed image are processed.
[0108] Furthermore, the pixel values of the pixels in the difference image may be enhanced. For example, by using the formula img final =img sub +128 enhances the pixel value of each pixel in the difference image. final To adjust the image.
[0109] See also Figure 6 , is a schematic diagram of adjusting an image provided in an embodiment of the present application. Figure 6 (a) in the figure shows a normal fundus image. Figure 6 (b) in the figure is the image of the diseased fundus. Figure 6 As shown, after brightness adjustment, the lesions in the diseased fundus image become more obvious.
[0110] S403, detecting and adjusting lesions in the image according to the trained detection model.
[0111] In the embodiment of the present application, by adjusting the brightness of the fundus region in the image to be detected, the candidate lesions in the fundus region of the image to be detected can be highlighted, providing a reliable data basis for the detection of lesions, thereby helping to improve the detection accuracy. In addition, using the trained detection model to detect lesions can effectively improve the detection efficiency and the detection accuracy.
[0112] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0113] Corresponding to the fundus lesion detection method described in the above embodiment, Figure 7 This is a structural block diagram of the fundus lesion detection device provided in an embodiment of the present application. For the sake of ease of explanation, only the parts related to the embodiment of the present application are shown.
[0114] Reference Figure 7 , the device comprises:
[0115] The image acquisition unit 71 is used to acquire an image to be detected, wherein the image to be detected includes a fundus area and a background area.
[0116] The brightness adjustment unit 72 is used to adjust the brightness of the fundus area to obtain an adjusted image.
[0117] The lesion detection unit 73 is used to detect the lesion in the adjusted image according to the trained detection model.
[0118] Optionally, the brightness adjustment unit 72 includes:
[0119] The interception module is used to intercept the fundus area from the image to be detected to obtain a fundus image.
[0120] The adjustment module is used to adjust the brightness of the fundus image to obtain the adjusted image.
[0121] Optionally, the interception module is also used to:
[0122] The image to be detected is converted into a grayscale image; the fundus area is intercepted from the grayscale image according to the pixel values of the pixels in the grayscale image to obtain the fundus image.
[0123] Optionally, the interception module is also used to:
[0124] Pixel points corresponding to pixel values satisfying preset conditions in the grayscale image are removed, and the grayscale image after removal is determined as the fundus image; wherein the preset conditions include: the pixel values of the pixel points are within a first preset value range.
[0125] Optionally, the adjustment module is also used to:
[0126] The fundus image is smoothed to obtain a smoothed image; a difference image between the fundus image and the smoothed image is obtained; pixel values of pixels in the difference image are enhanced to obtain an enhanced difference image; and the enhanced difference image is determined as the adjusted image.
[0127] Optionally, the device 7 further comprises:
[0128] The training unit 74 is used to obtain a training image set and a test image set; train the detection model according to the training image set to obtain an intermediate model; test the intermediate model according to the test image set to obtain a test result; update the training image set according to the test result to obtain the updated training image set; re-train the intermediate model according to the updated training image set to obtain the trained detection model.
[0129] Optionally, the test result includes a test label corresponding to each test image in the test image set, and the test label includes a first probability value and a second probability value.
[0130] Optionally, the training unit 74 is further configured to:
[0131] For any test image in the test image set, when the first probability value in the test label corresponding to the test image is within a second preset numerical range, the test image is marked as a positive sample; when the second probability value in the test label corresponding to the test image is within a third preset numerical range, the test image is marked as a negative sample.
[0132] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0133] in addition, Figure 7 The fundus lesion detection device shown can be a software unit, a hardware unit, or a combination of software and hardware units built into an existing terminal device, or can be integrated into the terminal device as an independent pendant, or can exist as an independent terminal device.
[0134] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0135] Figure 8 Schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Figure 8 As shown, the terminal device 8 of this embodiment includes: at least one processor 80 ( Figure 8 Only one is shown in the figure) a processor, a memory 81, and a computer program 82 stored in the memory 81 and executable on the at least one processor 80, and when the processor 80 executes the computer program 82, the steps in any of the above-mentioned fundus lesion detection method embodiments are implemented.
[0136] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that Figure 8 It is only an example of the terminal device 8 and does not constitute a limitation on the terminal device 8. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0137] The processor 80 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0138] In some embodiments, the memory 81 may be an internal storage unit of the terminal device 8, such as a hard disk or memory of the terminal device 8. In other embodiments, the memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device 8. Further, the memory 81 may also include both an internal storage unit of the terminal device 8 and an external storage device. The memory 81 is used to store an operating system, an application program, a boot loader (Boot Loader), data, and other programs, such as the program code of the computer program, etc. The memory 81 may also be used to temporarily store data that has been output or is to be output.
[0139] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0140] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0141] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0142] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0143] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0144] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0145] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0146] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for detecting fundus lesions, characterized in that: include: Acquire an image to be detected including a fundus area; Adjusting the brightness of the fundus area in the image to be detected to obtain an adjusted image; The step of adjusting the brightness of the fundus area in the image to be detected to obtain an adjusted image includes: intercepting the fundus area from the image to be detected to obtain a fundus image; Adjusting the brightness of the fundus image to obtain the adjusted image; Detecting lesions in the adjusted image according to the trained detection model; The method further comprises: Obtain training image sets and test image sets; Training the detection model according to the training image set to obtain an intermediate model; Testing the intermediate model according to the test image set to obtain a test result, wherein the test result includes a test label corresponding to each test image in the test image set, and the test label includes a first probability value and a second probability value; For any one of the test images in the test image set, when the first probability value in the test label corresponding to the test image is within a second preset value range, marking the test image as a positive sample; When the second probability value in the test label corresponding to the test image is within a third preset numerical range, the test image is marked as a negative sample; the second preset numerical range and the third preset numerical range are dynamically adjusted according to the number of training times, specifically, as the number of training times increases, the second preset numerical range and the third preset numerical range are reduced; The intermediate model is retrained according to the updated training image set to obtain the trained detection model.
2. The method for detecting fundus lesions according to claim 1, wherein: The method of intercepting the fundus area from the image to be detected to obtain a fundus image includes: Converting the image to be detected into a grayscale image; The fundus area is intercepted from the grayscale image according to the pixel values of the pixels in the grayscale image to obtain the fundus image.
3. The method for detecting fundus lesions according to claim 2, wherein: The method of intercepting the fundus region from the grayscale image according to the pixel values of the pixel points in the grayscale image to obtain the fundus image includes: Removing pixel points corresponding to pixel values that meet a preset condition in the grayscale image, and determining the grayscale image after the removal as the fundus image; The preset condition includes: the pixel value of the pixel point is within a first preset value range.
4. The method for detecting fundus lesions according to claim 1, wherein: The step of adjusting the brightness of the fundus image to obtain the adjusted image includes: Performing smoothing on the fundus image to obtain a smoothed image; Acquire a difference image between the fundus image and the smoothed image; Performing enhancement processing on the pixel values of the pixel points in the difference image to obtain an enhanced difference image; The enhanced difference image is determined as the adjusted image.
5. A fundus lesion detection device, characterized in that: include: An image acquisition unit, used for acquiring an image to be detected including a fundus area; A brightness adjustment unit, used for adjusting the brightness of the fundus area to obtain an adjusted image; The step of adjusting the brightness of the fundus area in the image to be detected to obtain an adjusted image includes: intercepting the fundus area from the image to be detected to obtain a fundus image; Adjusting the brightness of the fundus image to obtain the adjusted image; A lesion detection unit, used for detecting lesions in the adjusted image according to a trained detection model; The device also includes: A training unit is used to obtain a training image set and a test image set; train the detection model according to the training image set to obtain an intermediate model; test the intermediate model according to the test image set to obtain a test result, wherein the test result includes a test label corresponding to each test image in the test image set, and the test label includes a first probability value and a second probability value; for any test image in the test image set, when the first probability value in the test label corresponding to the test image is within a second preset numerical range, the test image is marked as a positive sample; when the second probability value in the test label corresponding to the test image is within a third preset numerical range, the test image is marked as a negative sample; the second preset numerical range and the third preset numerical range are dynamically adjusted according to the number of training times, specifically, as the number of training times increases, the second preset numerical range and the third preset numerical range are reduced; the intermediate model is re-trained according to the updated training image set to obtain the trained detection model.
6. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Neural network training method and device thereof
CN107491790A
Abnormality recognition method and device based on eye fundus image, equipment and storage medium
CN110210286A
Fundus image processing method and device
CN110503639A
Method and device for enhancing fundus image
CN110675325A