Virus detection method and device based on target image analysis, equipment and medium
By chunking the images of the detection kit, performing histogram calculations and pixel allocation, and combining with the target virus detection model, the problems of inefficient virus detection results and abnormal photo brightness are solved, and efficient and accurate acquisition of virus detection results is achieved.
Patent Information
- Application Number
- CN202311352645.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-18
- Publication Date
- 2025-04-18
AI Technical Summary
When large-scale virus testing of the person being tested, the efficiency of manually checking the virus test results is inefficient, and misjudgments caused by abnormal brightness of the photo need to be re-shooted, affecting efficiency.
Virus detection method based on target image analysis is adopted, by chunking the images of the detection kit, histogram calculation and pixel allocation, merge them into the target image, and input them into the target virus detection model to obtain the virus category detection results.
Through this method, the problem of excessive brightness or darkness of images can be effectively avoided, the accuracy and efficiency of virus detection results can be improved, and the need for manual verification can be reduced.
Smart Images

Figure CN119850508A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of biological detection, and in particular to a virus detection method, device, equipment and medium based on target image analysis. Background Art
[0002] With the rapid development of virus detection technology, detection kits are widely used in various virus detection scenarios. Taking the detection kit for the new coronavirus as an example, the detection kit includes two detection areas. When red bands appear in both detection areas, the virus test result is determined to be positive. For highly contagious viruses, the person being tested can use the detection kit to test independently, but the person being tested also needs to upload a photo of the detection kit to the detection platform. The staff of the detection platform verifies the virus test results of the person being tested based on the photo of the detection kit, so as to count the number of people with positive virus test results and the number of people with negative virus test results in different areas.
[0003] However, when there are a large number of people being tested in an area, manual verification takes a lot of time, resulting in low efficiency in determining virus test results. In addition, there are abnormal situations such as the brightness of the test kit photos taken by the tested people is too high, which makes it impossible for the staff to clearly see the color band changes of the test kit, and it is necessary to notify the tested people to retake photos of the test kit, resulting in low efficiency in determining virus test results. Summary of the invention
[0004] The purpose of the embodiment of the present invention is to provide a device for solving the problem of low efficiency of virus detection results.
[0005] In order to achieve the above objectives, in a first aspect, the present application provides a virus detection method based on target image analysis, and the virus detection method based on target image analysis includes:
[0006] Dividing the acquired image of the detection kit into a plurality of divided sub-images;
[0007] Performing histogram calculation on each sub-block image respectively to obtain a histogram of each sub-block image;
[0008] Allocate pixels of the first target area of each histogram to the second target area, and obtain pixel-updated block sub-images respectively, wherein the first target area is an area where the pixel value of the histogram is greater than a preset pixel value, and the second target area is an area where the pixel value of the histogram is less than or equal to the preset pixel value;
[0009] Merging all the pixel-updated sub-images to obtain a target image of the detection kit;
[0010] The target image is input into the target virus detection model to obtain the virus category detection result corresponding to the detection kit.
[0011] In combination with the first aspect, in a first possible implementation manner, the acquired image of the detection kit is divided into a plurality of divided sub-images, including:
[0012] Performing tensor processing on the acquired image of the detection kit to obtain a tensorized image of the detection kit;
[0013] The tensorized image is divided into multiple sub-images.
[0014] In combination with the first aspect, in a second possible implementation, all the sub-block images are merged to obtain a target image of the detection kit, including:
[0015] Based on the edges of the adjacent pixel-updated sub-images after each pixel-updated sub-image, smoothing each pixel-updated sub-image respectively to obtain smoothed sub-images after each pixel-updated sub-image;
[0016] All smoothed sub-images are merged to obtain the target image for the detection card box.
[0017] In combination with the first aspect, in a third possible implementation, all the divided sub-images are merged to obtain a target image of the detection kit, including:
[0018] Obtain the cumulative distribution function of each pixel after updating the sub-block image;
[0019] The pixel values of the sub-block images after pixel update are mapped using the cumulative distribution function to obtain the sub-block images after image enhancement;
[0020] All enhanced sub-images are merged to obtain the target image of the detection kit.
[0021] In combination with the first aspect, in a fourth possible implementation, the target image is input into a target virus detection model to obtain a virus category detection result corresponding to the detection kit, including:
[0022] Input the target image into the target virus detection model to obtain the category prediction result and the confidence of the category prediction result output by the target virus detection model;
[0023] When the confidence level is less than or equal to the preset confidence level, the virus category detection result corresponding to the detection kit is determined as an invalid category.
[0024] When the confidence level is greater than a preset confidence level, the category prediction result is determined as the virus category detection result corresponding to the detection kit.
[0025] In combination with the first aspect, in a fifth possible implementation manner, the target virus detection model is obtained by the following steps:
[0026] The sample images for virus detection are input into the preset model, the preset model is trained, and the target virus detection model is obtained.
[0027] In a second aspect, the present application provides a virus detection device based on target image analysis, and the virus detection device based on target image analysis includes:
[0028] An image segmentation module, used to segment the acquired image of the detection kit into a plurality of segmented sub-images;
[0029] The pixel value obtaining module is used to calculate the histogram of each sub-image block to obtain the pixel value of each image area;
[0030] A pixel allocation module is used to allocate pixels of a first target area of each histogram to a second target area, and obtain pixel-updated block sub-images, respectively, wherein the first target area is an area where the pixel value of the histogram is greater than a preset pixel value, and the second target area is an area where the pixel value of the histogram is less than or equal to the preset pixel value;
[0031] An image merging module is used to merge all the sub-images after pixel updates to obtain a target image of the detection kit;
[0032] The detection result acquisition module is used to input the target image into the target virus detection model to obtain the virus category detection result corresponding to the detection kit.
[0033] In combination with the first aspect, in a first possible implementation manner, the image segmentation module includes:
[0034] A tensorization submodule, used for performing tensorization processing on the acquired image of the detection kit to obtain a tensorized image of the detection kit;
[0035] The block submodule is used to block the tensorized image into multiple block sub-images.
[0036] In a third aspect, the present application provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and when the computer program is executed by the processor, implementing the virus detection method based on target image analysis as in the first aspect.
[0037] In a fourth aspect, the present application provides a machine-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the virus detection method based on target image analysis as in the first aspect is implemented.
[0038] The present application provides a virus detection method based on target image analysis, including: dividing the acquired image of the detection kit into multiple block sub-images; performing histogram calculation on each block sub-image respectively to obtain the histogram of each block sub-image; allocating the pixels of the first target area of each histogram to the second target area; merging all the block sub-images to obtain the target image of the detection kit; inputting the target image into a target virus detection model to obtain the virus category detection result corresponding to the detection kit. Since there will be no overly bright or overly dark areas in the target image of the detection kit after pixel allocation, the target image of the detection kit is input into the target virus detection model, and the virus category detection result corresponding to the accurate detection kit can be obtained, without the need to manually determine the virus detection result, thereby improving the efficiency of determining the virus detection result.
[0039] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0041] Figure 1 A flow chart of a virus detection method based on target image analysis provided in an embodiment of the present application is shown;
[0042] Figure 2 An example diagram showing an image of a detection kit provided in an embodiment of the present application is shown;
[0043] Figure 3 An example diagram of a block sub-image provided by an embodiment of the present application is shown;
[0044] Figure 4 A schematic structural diagram of a virus detection device based on target image analysis provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0045] The specific implementation of the embodiment of the present invention will be described in detail below in conjunction with the accompanying drawings in the embodiment of the present invention. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0046] The components of the embodiments of the present invention generally described and shown in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0047] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present invention, are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.
[0048] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0049] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present invention belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present invention.
[0050] Example 1
[0051] See also Figure 1 , Figure 1 A flow chart of a virus detection method based on target image analysis provided in an embodiment of the present application is shown. Figure 1 The virus detection methods based on target image analysis include:
[0052] S110, dividing the acquired image of the detection kit into a plurality of divided sub-images.
[0053] See also Figure 2 , Figure 2 An example diagram of an image of a detection kit provided in an embodiment of the present application is shown.
[0054] After the virus detection is completed using the detection kit, the target image of the detection kit is obtained as shown in the figure. Specifically, the detection kit can be imaged using an image acquisition device such as a camera to obtain the target image of the detection kit. As shown in the figure, the detection kit of the new coronavirus includes a C-line area and a T-line area. The shaded areas in the figure are the red ribbons that appear in the C-line area and the T-line area. In the case where red ribbons appear in both the C-line area and the T-line area, the virus detection result is determined to be a positive result. In the case where a red ribbon appears only in the C-line area, the virus detection result is determined to be a negative result. In the case where no red ribbon appears in the C-line area, the virus detection result is determined to be an invalid category.
[0055] See also Figure 3 , Figure 3 An example diagram of a block sub-image provided by an embodiment of the present application is shown.
[0056] Due to the different position information and texture information when actually collecting the image of the detection kit, and the differences between different models of image acquisition devices, it is impossible to accurately obtain the virus detection result based on the image of the detection kit. The image of the detection kit obtained is divided into multiple block sub-images to process each block sub-image separately. It should be understood that the number of block sub-images is set according to actual needs and is not limited here. For ease of understanding, the image of the detection kit is divided into four block sub-images in the embodiment of the present application. Figure 3 One of the block sub-images is shown, and the other three block sub-images are no longer shown.
[0057] In an embodiment of the present application, the acquired image of the detection kit is divided into a plurality of divided sub-images, including:
[0058] Performing tensor processing on the acquired image of the detection kit to obtain a tensorized image of the detection kit;
[0059] The tensorized image is divided into multiple sub-images.
[0060] Before inputting the image into the model, the image needs to be tensorized to obtain an image that meets the model tensor requirements. Specifically, the image of the acquired detection kit is tensorized to obtain a tensorized image of the detection kit. After the image is tensorized, the tensorized image is divided into multiple sub-images to process the brightness and contrast of the image, and then the image that meets the tensor, contrast and brightness requirements of the target virus detection model is input into the model.
[0061] S120, performing histogram calculation on each sub-block image to obtain a histogram of each sub-block image.
[0062] When performing virus detection, it is common that some areas of the image of the test kit are too bright or too dark when obtaining the image, resulting in the model being unable to output accurate results. The image of the test kit is divided into multiple sub-images, and each sub-image is processed independently to perform regional brightness and contrast processing on the image of the test kit.
[0063] The histogram of each sub-block image is calculated and the sub-block image is converted to a histogram to obtain a histogram of each sub-block image. A histogram is also called a quality distribution diagram, which is a series of longitudinal stripes or line segments of varying heights to represent the data distribution. In the example of the present application, the histogram of the sub-block image is used to accurately represent the image pixels.
[0064] S130, assigning pixels of the first target area of each histogram to the second target area, and obtaining pixel-updated block sub-images respectively, wherein the first target area is an area where the pixel value of the histogram is greater than a preset pixel value, and the second target area is an area where the pixel value of the histogram is less than or equal to the preset pixel value.
[0065] According to the histogram of the block sub-image, the pixels of the block sub-image are determined to determine the block sub-image as an image composed of a first target area and a second target area, wherein the first target area is an area where the pixel value of the histogram is greater than a preset pixel value, and the second target area is an area where the pixel value of the histogram is less than or equal to the preset pixel value.
[0066] Since the first target area is an area with high brightness and contrast, and the second target area is an area with low brightness and contrast, the pixel values of the first area can be clipped, and then the pixels of the first target area of each histogram are allocated to the second target area, and the sub-block sub-images after pixel update are obtained respectively. The image of the detection kit is subjected to contrast and brightness restriction processing through pixel allocation, and the pixels of the area with high brightness and contrast are allocated to the area with low brightness and contrast, so as to avoid the image having too bright or too dark areas and affecting the output results of the model.
[0067] S140, merging all the sub-images after pixel update to obtain a target image of the detection kit.
[0068] Each pixel-updated sub-image is an independent image. After pixel allocation is performed on the sub-images, all the pixel-updated sub-images are merged to obtain a target image of the detection kit after contrast and brightness processing is limited.
[0069] In the embodiment of the present application, all the sub-block images are merged to obtain the target image of the detection kit, including:
[0070] Based on the edges of the adjacent pixel-updated sub-images after each pixel-updated sub-image, smoothing each pixel-updated sub-image respectively to obtain smoothed sub-images after each pixel-updated sub-image;
[0071] All smoothed sub-images are merged to obtain the target image for the detection card box.
[0072] Allocating the pixels of the first target area of each histogram to the second target area can avoid the image from having too bright or too dark areas. However, since each pixel-updated block sub-image is processed independently from other pixel-updated block sub-images, after all pixel-updated block sub-images are merged, there is discontinuity between the pixel-updated block sub-images. Based on the edges of the adjacent block sub-images of each pixel-updated block sub-image, each pixel-updated block sub-image is smoothed respectively to avoid visual discontinuity in the target image of the detection card box and reduce the noise of the image. For ease of understanding, in the embodiment of the present application, bilinear interpolation is used to smooth each pixel-updated block sub-image, which is not described in detail here. The smoothed block sub-images after all pixel updates are merged to obtain the target image of the detection card box, avoiding excessive noise in the target image of the detection card box and affecting the output of the target virus detection model.
[0073] In the embodiment of the present application, all the sub-block images are merged to obtain the target image of the detection kit, including:
[0074] Obtain the cumulative distribution function of each pixel after updating the sub-block image;
[0075] The pixel values of the sub-block images after pixel update are mapped using the cumulative distribution function to obtain the sub-block images after image enhancement;
[0076] All enhanced sub-images are merged to obtain the target image of the detection kit.
[0077] After pixel allocation is performed on the image of the detection kit, a pixel-updated block sub-image is obtained. In order to further improve the recognition of the target virus detection model for the image, the image of the detection kit needs to be enhanced. The cumulative distribution function of each pixel-updated block sub-image is obtained by calculating the cumulative histogram (Cumulative Distribution Function, CDF) of each pixel-updated block sub-image. The pixel values of the pixel-updated block sub-image are mapped using the cumulative distribution function to reconstruct the pixel-updated block sub-image to reduce image noise, and then the pixel-updated block sub-image is contrast-enhanced to obtain the image-enhanced block sub-image. All the image-enhanced block sub-images are merged to obtain the contrast-enhanced target image of the detection kit.
[0078] S150, inputting the target image into the target virus detection model to obtain the virus category detection result corresponding to the detection kit.
[0079] The target image is input into the target virus detection model, and the target virus detection model outputs the category prediction result of the virus corresponding to the detection kit. According to the category prediction result, the virus category detection result corresponding to the detection kit is obtained. The type of the detection kit is set according to actual needs and is not limited here. For ease of understanding, the detection kit in the embodiment of the present application is a detection kit for the new coronavirus. In the case where red ribbons appear in both detection areas of the detection kit, it is determined that the virus detection result is positive. After the pixels of the first target area of each histogram are assigned to the second target area, the target virus detection model will not be unable to accurately identify the red ribbons appearing in both detection areas due to the images of the two detection areas of the detection kit being too dark or bright, thereby enabling the target virus detection model to output accurate results.
[0080] Since there will be no overly bright or dark areas in the target image of the test kit after pixel allocation, the target image of the test kit can be input into the target virus detection model to obtain accurate virus category detection results corresponding to the test kit. There is no need to manually determine the virus detection results, thereby improving the efficiency of determining the virus detection results.
[0081] In the embodiment of the present application, the target image is input into the target virus detection model to obtain the virus category detection result corresponding to the detection kit, including:
[0082] Input the target image into the target virus detection model to obtain the category prediction result and the confidence of the category prediction result output by the target virus detection model;
[0083] When the confidence level is less than or equal to the preset confidence level, the virus category detection result corresponding to the detection kit is determined as an invalid category.
[0084] When the confidence level is greater than a preset confidence level, the category prediction result is determined as the virus category detection result corresponding to the detection kit.
[0085] The target image is input into the target virus detection model to obtain the category prediction result and the confidence of the category prediction result output by the target virus detection model. Since the sample images in the process of training the target virus detection model cannot include all the images of the actual detection kit, if the input target image is very different from the sample image, the model will make an unconfident judgment. According to the confidence of the category prediction result, the reliability of the category prediction result is judged.
[0086] When the confidence is less than or equal to the preset confidence, the category prediction result is determined to be unreliable, and the virus category detection result corresponding to the detection kit is determined to be an invalid category. The value of the preset confidence is set according to actual needs and can be any value between 0 and 1, and is not limited here. When the confidence is greater than the preset confidence, the category prediction result is determined to be reliable, and the category prediction result is determined to be the virus category detection result corresponding to the detection kit.
[0087] The virus category test results include positive results, negative results and invalid categories. When it is an invalid type, it is determined that it is impossible to determine whether it is a positive result due to unclear collected images or no images of the test kit, etc., and a prompt message can be generated to prompt the user to re-acquire the image of the test kit.
[0088] In the embodiment of the present application, the target virus detection model is obtained by the following steps:
[0089] The sample images for virus detection are input into the preset model, the preset model is trained, and the target virus detection model is obtained.
[0090] It should be understood that the network structure of the preset model is set according to actual needs, and can be CNN (Convolutional Neural Networks), ResNeXt (Event Sequential), ResNeXt-50, any visual task network structure, etc., without limitation here.
[0091] The sample image of virus detection is input into the preset model, and the preset model is trained to obtain the target virus detection model, wherein the sample image is an image including the actual virus detection result, which will not be described in detail here. In the visual task of virus detection, the target image of the detection kit is input into the model. Since there will be no overly bright or dark areas in the target image of the detection kit after pixel allocation, the accuracy of the model's output results can be improved. At the same time, the amount of calculation and the amount of parameters are reduced, so that the model can output results more quickly.
[0092] In an embodiment of the present application, the sample images include sample images with positive detection result labels, sample images with negative detection result labels, and sample images with invalid detection result labels.
[0093] The virus detection results include positive results, negative results and invalid results, wherein an invalid result is a result that cannot determine whether the virus detection is negative or positive. For ease of understanding, in the embodiments of the present application, the detection of new coronavirus is taken as an example, and the detection kit of the new coronavirus includes a C-line area and a T-line area. In the case where red ribbons appear in both the C-line area and the T-line area, the virus detection result is determined to be a positive result. In the case where only a red ribbon appears in the C-line area, the virus detection result is determined to be a negative result. In the case where no red ribbon appears in the C-line area, the virus detection result is determined to be an invalid category.
[0094] The preset model is trained by testing sample images with positive test result labels, sample images with negative test structure labels, and sample images with invalid test result labels, so that the target virus detection model obtained can identify the color band display results of the test kits with different virus titers. The present application performs pixel allocation processing on the input image, and the model can better identify the C-line area and T-line area of the test kit, so that the target virus detection model has higher performance and can output more accurate virus detection results.
[0095] The present application provides a virus detection method based on target image analysis, including: dividing the acquired image of the detection kit into multiple block sub-images; performing histogram calculation on each block sub-image respectively to obtain the histogram of each block sub-image; allocating the pixels of the first target area of each histogram to the second target area; merging all the block sub-images to obtain the target image of the detection kit; inputting the target image into a target virus detection model to obtain the virus category detection result corresponding to the detection kit. Since there will be no overly bright or overly dark areas in the target image of the detection kit after pixel allocation, the target image of the detection kit is input into the target virus detection model, and the virus category detection result corresponding to the accurate detection kit can be obtained, without the need to manually determine the virus detection result, thereby improving the efficiency of determining the virus detection result.
[0096] Example 2
[0097] See also Figure 4 , Figure 4 A schematic structural diagram of a virus detection device based on target image analysis provided in an embodiment of the present application is shown. Figure 4 The virus detection device 200 in the embodiment includes:
[0098] An image segmentation module 210 is used to segment the acquired image of the detection kit into a plurality of segmented sub-images;
[0099] The pixel value obtaining module 220 is used to perform histogram calculation on each sub-block image to obtain the pixel value of each image area;
[0100] The pixel allocation module 230 is used to allocate pixels of the first target area of each histogram to the second target area, and obtain pixel-updated block sub-images, respectively, wherein the first target area is an area where the pixel value of the histogram is greater than a preset pixel value, and the second target area is an area where the pixel value of the histogram is less than or equal to the preset pixel value;
[0101] An image merging module 240 is used to merge all the sub-images after pixel updates to obtain a target image of the detection kit;
[0102] The detection result obtaining module 250 is used to input the target image into the target virus detection model to obtain the virus category detection result corresponding to the detection kit.
[0103] In the embodiment of the present application, the image segmentation module 210 includes:
[0104] A tensorization submodule, used for performing tensorization processing on the acquired image of the detection kit to obtain a tensorized image of the detection kit;
[0105] The block submodule is used to block the tensorized image into multiple block sub-images.
[0106] In an embodiment of the present application, the image merging module 240 includes:
[0107] A smoothing submodule, used for smoothing each pixel-updated sub-image based on the edge of the pixel-updated sub-image adjacent to each pixel-updated sub-image, to obtain smoothed sub-images;
[0108] The merging submodule is used to merge all the smoothed block sub-images to obtain the target image of the detection card box.
[0109] In an embodiment of the present application, the image merging module 240 includes:
[0110] The function acquisition submodule is used to obtain the cumulative distribution function of each pixel after the updated sub-block image;
[0111] The image enhancement submodule is used to map the pixel values of the sub-block images after pixel update using a cumulative distribution function to obtain the sub-block images after image enhancement;
[0112] The enhanced image merging submodule is used to merge all the enhanced sub-images to obtain the target image of the detection kit.
[0113] In the embodiment of the present application, the detection result obtaining module 250 includes:
[0114] The model output submodule is used to input the target image into the target virus detection model to obtain the category prediction result and the confidence of the category prediction result output by the target virus detection model;
[0115] The invalid determination submodule is used to determine the virus category detection result corresponding to the detection kit as an invalid category when the confidence level is less than or equal to a preset confidence level.
[0116] The result determination submodule is used to determine the category prediction result as the virus category detection result corresponding to the detection kit when the confidence level is greater than a preset confidence level.
[0117] In the embodiment of the present application, the target virus detection model is obtained by the following steps:
[0118] The sample images for virus detection are input into the preset model, the preset model is trained, and the target virus detection model is obtained.
[0119] The virus detection device 200 is used to execute the corresponding steps in the above-mentioned virus detection method based on target image analysis, and the specific implementation of each function is not described one by one here. In addition, the optional examples in embodiment 1 are also applicable to the virus detection device 200 of embodiment 2.
[0120] An embodiment of the present application also provides a computer device, which includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, it implements the virus detection method based on target image analysis as described in Example 1.
[0121] In this embodiment, the image segmentation module 210, the pixel value obtaining module 220, the pixel allocation module 230, the image merging module 240 and the detection result obtaining module 250 are all stored in the memory as program units, and the processor executes the above program units stored in the memory to realize the corresponding functions.
[0122] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set to solve the problem of low efficiency of virus detection results by adjusting kernel parameters.
[0123] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0124] The embodiment of the present application also provides a machine-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the virus detection method based on target image analysis as described in Example 1 is implemented.
[0125] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0126] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0127] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0129] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0130] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0131] Machine-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0132] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0133] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A virus detection method based on target image analysis, characterized in that: The virus detection method based on target image analysis includes: Dividing the acquired image of the detection kit into a plurality of divided sub-images; Performing histogram calculation on each of the sub-block images to obtain a histogram of each sub-block image; Allocate pixels of the first target area of each histogram to the second target area, and obtain pixel-updated block sub-images respectively, wherein the first target area is an area where the pixel value of the histogram is greater than a preset pixel value, and the second target area is an area where the pixel value of the histogram is less than or equal to the preset pixel value; Merging all the pixel-updated sub-images to obtain a target image of the detection kit; The target image is input into a target virus detection model to obtain a virus category detection result corresponding to the detection kit.
2. The virus detection method based on target image analysis according to claim 1, characterized in that: The step of dividing the acquired image of the detection kit into a plurality of divided sub-images includes: Performing tensorization processing on the acquired image of the detection kit to obtain a tensorized image of the detection kit; The tensorized image is divided into a plurality of divided sub-images.
3. The virus detection method based on target image analysis according to claim 1, characterized in that: The step of merging all the pixel-updated sub-images to obtain a target image of the detection kit comprises: Based on the edges of the pixel-updated sub-images adjacent to the pixel-updated sub-images, smoothing each of the pixel-updated sub-images to obtain smoothed sub-images; All the smoothed block sub-images are merged to obtain the target image of the detection card box.
4. The virus detection method based on target image analysis according to claim 1, characterized in that: The step of merging all the sub-block images to obtain a target image of the detection kit includes: Obtaining the cumulative distribution function of each updated pixel block sub-image; Mapping the pixel values of the pixel-updated block sub-images using the cumulative distribution function to obtain image-enhanced block sub-images; All the image-enhanced sub-images are merged to obtain the target image of the detection kit.
5. The virus detection method based on target image analysis according to claim 1, characterized in that: The step of inputting the target image into a target virus detection model to obtain a virus category detection result corresponding to the detection kit includes: Inputting the target image into a target virus detection model to obtain a category prediction result output by the target virus detection model and a confidence level of the category prediction result; When the confidence level is less than or equal to a preset confidence level, the virus category detection result corresponding to the detection kit is determined as an invalid category. When the confidence level is greater than a preset confidence level, the category prediction result is determined as the virus category detection result corresponding to the detection kit.
6. The virus detection method based on target image analysis according to claim 1, characterized in that: The target virus detection model is obtained by the following steps: The sample images for virus detection are input into a preset model, and the preset model is trained to obtain a target virus detection model.
7. A virus detection device based on target image analysis, characterized in that: The virus detection device based on target image analysis comprises: An image segmentation module, used to segment the acquired image of the detection kit into a plurality of segmented sub-images; A pixel value obtaining module is used to perform histogram calculation on each of the sub-block images to obtain the pixel value of each image area; A pixel allocation module, used to allocate pixels of the first target area of each of the histograms to the second target area, and obtain pixel-updated block sub-images respectively, wherein the first target area is an area where the pixel value of the histogram is greater than a preset pixel value, and the second target area is an area where the pixel value of the histogram is less than or equal to the preset pixel value; An image merging module, used to merge all the pixel-updated sub-images to obtain a target image of the detection kit; The detection result obtaining module is used to input the target image into the target virus detection model to obtain the virus category detection result corresponding to the detection kit.
8. The virus detection device based on target image analysis according to claim 7, characterized in that: The image segmentation module comprises: A tensorization submodule, used for performing tensorization processing on the acquired image of the detection kit to obtain a tensorized image of the detection kit; The block submodule is used to block the tensorized image into multiple block sub-images.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the virus detection method based on target image analysis according to any one of claims 1 to 6 is implemented.
10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores a computer program, and when the computer program is executed by a processor, the virus detection method based on target image analysis according to any one of claims 1 to 6 is implemented.