Image anomaly recognition method, device, equipment, storage medium and program product

By calculating the similarity between the segmentation result of the image to be identified and the reference image, the problem of insufficient accuracy of image abnormality recognition is solved, and fast and accurate image abnormality recognition is achieved, reducing the difficulty and cost of recognition.

CN119785074APending Publication Date: 2025-04-08MAESTRO SURGICAL ROBOTICS LTD CO
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411781475.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In the prior art, image anomaly recognition is insufficient, and a large number of sample images are required to train the model, which consumes a lot of time and cost.

Method used

By acquiring the segmentation result of the image to be identified and the reference image generated based on the multiple sample images, the similarity between the two is calculated. If the similarity is less than the preset threshold, it is determined that there is an abnormality in the image to be identified.

Benefits of technology

Without training anomaly recognition model, it can quickly identify image abnormalities, providing a simple, efficient and accurate image recognition method, reducing the difficulty and cost of abnormal image recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119785074A_ABST
    Figure CN119785074A_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide an image anomaly recognition method, device, equipment, storage medium and program product. The method includes: obtaining a segmentation result and a reference image obtained by image segmentation of the image to be recognized, calculating the similarity between the segmentation result of the image to be recognized and the reference image, and judging whether the image to be recognized has an abnormality based on the similarity. Among them, the reference image can be obtained based on the mask of multiple normal sample images, which can characterize the pixel-level features of the normal sample. The similarity with the reference image can reflect the abnormal probability of the image to be recognized. The similarity can accurately identify whether the image has an abnormality. In addition, the method does not require manual recognition, nor does it require training of a model for identifying anomalies. It can automatically identify based on an algorithm, thereby reducing the difficulty of abnormal image recognition and improving recognition efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to an image anomaly recognition method, device, equipment, storage medium and program product. Background Art

[0002] Image recognition is widely used in industrial inspection, medical and other fields, especially in identifying image anomalies, and plays an important role in many links. For example, parts in industrial production may have abnormalities such as bulges and burrs. Timely identification of abnormalities helps improve production efficiency. For another example, the medical field often needs to study the areas of interest of some medical images and analyze the differences between normal areas and abnormal areas.

[0003] At present, image recognition can mainly include manual recognition and model recognition based on machine learning. The former is inefficient and its accuracy is difficult to guarantee. The latter requires a large number of sample images to train the model, and the model needs to be iterated repeatedly to enhance its functions. The model recognition accuracy is proportional to the training difficulty. If you want to improve the recognition accuracy, it will take a lot of time and cost. Summary of the invention

[0004] The embodiments of the present application provide an image anomaly recognition method, apparatus, device, storage medium and program product to solve the problem of insufficient accuracy in image anomaly recognition.

[0005] In a first aspect, an embodiment of the present application provides a method for identifying anomalies in an image, comprising:

[0006] Obtaining a segmentation result and a reference image obtained by image segmentation of the image to be identified, wherein the reference image is a grayscale image generated based on masks of multiple sample images;

[0007] The similarity between the segmentation result and the reference image is calculated, and whether the image to be identified has an abnormality is determined according to the similarity.

[0008] In a possible implementation, the segmentation result is a mask of the image to be identified, and calculating the similarity between the segmentation result and the reference image, and determining whether the image to be identified has an abnormality according to the similarity, includes:

[0009] Calculating the generalized sieve coefficients of the mask of the image to be identified and the reference image;

[0010] If the generalized sieve coefficient is less than a preset threshold, it is determined that an abnormality exists in the image to be identified.

[0011] In a possible implementation, it further includes:

[0012] Calculating the generalized sieve coefficients of the mask of the sample image and the reference image;

[0013] The generalized sieve coefficients corresponding to the multiple masks are arranged numerically, and at least one is selected from the arranged generalized sieve coefficients as a preset threshold according to a preset quantile parameter.

[0014] In a possible implementation manner, before calculating the similarity between the image to be identified and the reference image, the method further includes:

[0015] A spatial transformation is performed on at least one of the segmentation result and the reference image, where the spatial transformation is used to convert the segmentation result and the reference image into the same coordinate system.

[0016] In a possible implementation, performing spatial transformation on at least one of the segmentation result and the reference image includes:

[0017] Calculating the similarity between the mask of the sample image and the reference image, and selecting one from a plurality of sample images as a registration image according to the similarity;

[0018] Registering the image to be recognized with the registration image, and recording the registration parameters;

[0019] The segmentation result or the reference image is spatially transformed according to the registration parameter.

[0020] In a possible implementation, it further includes:

[0021] Get masks of multiple sample images;

[0022] Calculate the pixel average value of the plurality of masks at each pixel point, and generate a reference image, wherein the pixel value of the reference image is the calculated pixel average value.

[0023] In a second aspect, an embodiment of the present application provides an image anomaly recognition device, comprising:

[0024] An acquisition module, used to acquire a segmentation result and a reference image obtained by segmenting the image to be identified, wherein the reference image is a grayscale image generated based on masks of multiple sample images;

[0025] The abnormality determination module is used to calculate the similarity between the segmentation result and the reference image, and determine whether the image to be identified has an abnormality according to the similarity.

[0026] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0027] The memory stores computer-executable instructions;

[0028] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0029] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0030] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0031] The image anomaly recognition method, device, equipment, storage medium and program product provided in the embodiments of the present application relate to the field of image processing. The image anomaly recognition method includes: obtaining the segmentation result and reference image obtained by image segmentation of the image to be recognized, calculating the similarity between the segmentation result of the image to be recognized and the reference image, and judging whether the image to be recognized has an abnormality based on the similarity. Among them, the reference image can be obtained based on the mask of multiple normal sample images, which can characterize the pixel-level features of the normal sample. The similarity with the reference image can reflect the abnormal probability of the image to be recognized. The similarity can accurately identify whether the image has an abnormality. In addition, the method does not require manual recognition, nor does it require training of a model for identifying anomalies. It can automatically identify based on an algorithm, thereby reducing the difficulty of abnormal image recognition and improving recognition efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0033] Figure 1 It is a flowchart of an image anomaly recognition method provided by an embodiment of the present application;

[0034] Figure 2 It is a schematic diagram of a flow chart of determining whether an image to be identified is abnormal, provided in an embodiment of the present application;

[0035] Figure 3 is a schematic diagram of a process for obtaining a reference image provided by an embodiment of the present application;

[0036] Figure 4 It is a schematic diagram of a process of performing space transformation provided by an embodiment of the present application;

[0037] Figure 5 It is a structural schematic diagram of an image anomaly recognition device provided in an embodiment of the present application;

[0038] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0039] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0040] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0041] The terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, product or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, product or device. In the absence of further restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. For example, if the words first, second, etc. are used to indicate names, they do not indicate any particular order.

[0042] Image anomaly recognition has a wide range of applications in the medical field. Many organs and tissues have this requirement in order to observe and analyze abnormal parts. For example, bones such as the spine or other organ tissues often have abnormal parts such as bone hyperplasia and bone spurs. Analyzing these abnormalities can help understand information such as bone growth patterns. However, how to accurately identify abnormal images from a large number of images is a major problem.

[0043] At present, image recognition can mainly include manual recognition and model recognition based on machine learning. Manual recognition requires industry staff to make judgments based on experience, which is inefficient and overly dependent on the staff's own level, and accuracy is difficult to guarantee. Model-based recognition methods not only require a large number of sample images as data sets for the model, but also require repeated iterations. Each iteration involves a large number of model parameters, and abnormal samples need to be manually labeled. A high-performance model often requires a lot of manpower and time costs.

[0044] In response to the above problems, the inventors proposed a technical concept, which collects several normal sample images, obtains the mask of the sample image according to the recognition requirements, uses the pixel values ​​of the mask to characterize the shape and grayscale and other features of the region of interest, and generates a reference image based on the pixel values ​​of the masks of multiple normal samples, and uses the reference image to characterize the shape and grayscale and other features of the normal region of interest. In this way, the abnormal recognition problem of the image to be recognized can be transformed into the similarity calculation problem between the region of interest after the segmentation of the image to be recognized and the reference image. The higher the similarity, the higher the probability that the image to be recognized is normal. Conversely, the lower the similarity, the higher the probability that the image to be recognized is abnormal.

[0045] Based on this technical concept, the embodiments of the present application provide an image anomaly recognition method, device, equipment, storage medium and program product. The method determines whether it is abnormal by calculating the similarity between the segmentation result of the image to be recognized and the reference image. There is no need to train an abnormality recognition model. The complex model processing process can be converted into a similarity calculation process, so that image anomalies can be quickly identified, providing a simple, efficient and accurate image recognition method.

[0046] The application scenarios involved above are only partial examples. Those skilled in the art can expand the application according to the specific scenarios, and the embodiments of the present application do not impose specific restrictions on this. In other scenarios, image anomaly recognition can also be used in the industrial field. For example, some industrial processes may cause some parts of the equipment to have abnormal parts that are deformed and protruding due to process defects and other reasons. It is necessary to use image anomaly recognition equipment to identify these abnormal parts. The image anomaly recognition method provided by this application can also be applied. It should be noted that the above application scenarios are only shown to facilitate the understanding of the spirit and principles of this application, and the implementation methods of this application are not subject to any restrictions in this regard. On the contrary, the implementation methods of this application can be applied to any applicable scenarios.

[0047] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0048] Figure 1 FIG. 1 is a flow chart of an image anomaly recognition method provided in an embodiment of the present application. Figure 1 As shown, the method includes:

[0049] Step S101, obtaining a segmentation result and a reference image obtained by segmenting the image to be identified.

[0050] The reference image is a grayscale image generated based on masks of multiple sample images.

[0051] It should be noted that the image to be identified may be a grayscale image (such as a CT image, etc.).

[0052] Taking the CT image of the spinal bones as an example, the CT image as the image to be identified may contain multiple bones (such as vertebra A, vertebra B, vertebra C, etc.). If the part to be identified is one of the vertebrae (such as whether vertebra A has abnormalities such as bone spurs), the pixel value of the CT image can be changed by image processing methods such as image segmentation, so that the pixel point corresponding to vertebra A in the CT image is distinguished from the pixel values ​​of the remaining pixel points in the image. For example, the CT image can be segmented to obtain its mask as the segmentation result, in which the pixel value of the pixel point where the vertebra A to be identified is located is 1, and the pixel values ​​of the remaining pixel points in the mask are 0.

[0053] Accordingly, the sample image can be a CT image of a normal spinal skeleton (the image contains vertebra A and vertebra A does not have abnormalities such as bone spurs), and the mask of the sample image is obtained by image segmentation (the pixel value of the pixel where vertebra A is located in the mask is 1, and the pixel values ​​of the other pixels are 0). Based on the masks of multiple sample images, the numerical distribution law of the pixels in these masks can be analyzed, and then a reference image can be formed.

[0054] Step S102, calculating the similarity between the segmentation result and the reference image, and determining whether there is an abnormality in the image to be identified according to the similarity.

[0055] The reference image is a grayscale image generated based on masks of multiple sample images.

[0056] Specifically, the similarity between the segmentation result of the image to be identified and the reference image can be obtained by calculating the mean square error between the segmentation result of the image to be identified and the corresponding pixel values ​​of the reference image, and whether the image to be identified is abnormal can be judged based on a preset similarity threshold. If the calculated similarity is greater than or equal to the similarity threshold, there is no abnormality in the image to be identified; if it is less than the similarity threshold, there is an abnormality.

[0057] In the above embodiment, by obtaining the segmentation result and the reference image obtained by image segmentation of the image to be identified, the similarity between the segmentation result of the image to be identified and the reference image can be calculated, and whether the image to be identified is abnormal can be judged based on the similarity. Among them, the reference image can be obtained based on the mask of multiple normal sample images, which can characterize the pixel-level features of normal samples. The similarity with the reference image can reflect the abnormal probability of the image to be identified. Whether the image is abnormal can be accurately identified by the similarity. In addition, this method does not require training of a model for identifying abnormalities, nor does it require manual identification. It can be automatically identified based on an algorithm, thereby reducing the difficulty of abnormal image identification and improving identification efficiency.

[0058] In one embodiment, the segmentation result is a mask of the image to be identified, such as Figure 2 As shown, the similarity between the segmentation result and the reference image is calculated, and whether the image to be identified has an abnormality is determined based on the similarity, including:

[0059] Step S201, calculating the generalized sieve coefficients of the mask of the image to be identified and the reference image.

[0060] Among them, the generalized Dice Coefficient (GDice) is an indicator that can characterize the similarity between two grayscale images. It is an extended form of the Dice Coefficient.

[0061] Exemplarily, the generalized sieve coefficient GDice may be calculated by the following formula.

[0062]

[0063] Among them, A i and B i Represents the pixel value of each pixel in image A and image B respectively. These pixel values ​​can be decimals in the interval [0,1] or binary values ​​0 or 1. The value range of GDice is also [0,1]. The closer the value of GDice is to 1, the higher the similarity between image A and image B.

[0064] Step S202: If the generalized sieve coefficient is less than a preset threshold, it is determined that an abnormality exists in the image to be identified.

[0065] The preset threshold can be customized. For example, some normal samples and abnormal samples can be selected, the GDice of each sample and the reference image can be calculated respectively, and the threshold can be set according to the calculation results.

[0066] In some possible implementations, the method also includes the following process for obtaining a preset threshold: calculating the generalized sieve coefficients of the mask of the sample image and the reference image; arranging the generalized sieve coefficients corresponding to multiple masks numerically, and selecting at least one from the arranged generalized sieve coefficients as the preset threshold according to a preset quantile parameter.

[0067] Among them, the quantile is also called percentile, which means that after a set of data is arranged by numerical size (such as from large to small), given a new data point, the quantile represents the relative position of the data in the sorted data set. For example, if the new data is at 75%, it means that its value is less than 75% of the values ​​of the entire data set, that is, it is at the 75th percentile.

[0068] Exemplarily, based on multiple sample images, a mask of each sample image can be obtained, the GDice of each mask and the reference image can be calculated, and all calculated GDice values ​​are arranged from large to small; after the arrangement is completed, the GDice value at a certain position is taken as the threshold.

[0069] Exemplarily, there may be multiple preset thresholds. For example, the GDice value at the 90th percentile in the arranged GDice values ​​may be taken as the first threshold, and the GDice value at the last percentile may be taken as the second threshold. If the GDice value of the mask of the image to be identified and the reference image is greater than the first threshold, it is considered that the image to be identified has no abnormality; if the GDice value of the mask of the image to be identified and the reference image is less than the second threshold, it is considered that the image to be identified has an abnormality; if the GDice value of the mask of the image to be identified and the reference image is greater than the second threshold and less than the first threshold, it can be considered that the image to be identified is handed over to manual re-identification.

[0070] The reference images in the embodiments of the present application are further described below.

[0071] In one embodiment, Figure 3 As shown, the image anomaly recognition method may also include the following process of obtaining a reference image:

[0072] Step S301, obtaining masks of multiple sample images.

[0073] The pixel value of the normal region of interest in the sample image in the mask may be 1, and the pixel value of the remaining region in the mask may be 0.

[0074] Exemplarily, several CT images can be obtained as sample images, and masks corresponding to these CT images can be obtained. The mask can be a binary image (the pixel value of the normal part used for identification is 1, and the pixel value of the rest of the part is 0). For example, if the sample image is a spinal CT image containing multiple vertebrae, and the region of interest to be identified is the second vertebra in the image, then in the mask corresponding to the sample image, the pixel value of the pixel point where the second vertebra is located is 1, and the pixel points of the rest of the mask image are 0.

[0075] Step S302, calculating the average pixel value of the multiple masks at each pixel point, and generating a reference image, the pixel value of the reference image is the calculated average pixel value.

[0076] Specifically, these masks can be averaged according to pixel positions, the pixel average of multiple masks at the same position (the same pixel point) can be calculated, and the pixel average of each pixel point can be mapped to a new grayscale image, that is, the reference image can be obtained.

[0077] In some possible implementations, the pixel averages of multiple masks at the same pixel point may be calculated by weighted average calculation. 10 There are 10 sample images in total. The resolutions of these 10 sample images are aligned (i.e., the pixels correspond one to one). For a certain pixel, the pixel values ​​of CT1~CT9 at this pixel are all 1, and the weight is 2. 10 When the pixel value of the pixel point is 0 and the weight is 1, the weighted average calculation result of the pixel value of the pixel point can be expressed as: (9×2×1 + 1×1×0) / (9×2+1×1) ≈0.947.

[0078] In some other possible implementations, after obtaining the masks of multiple sample images, a reference image can also be formed according to the pixel value distribution rules of different masks. Exemplarily, the value of the pixel point can be determined according to the number of masks with a value of 1 at the same pixel point, and the reference image is generated based on the final determined values ​​of all the pixels. For example, there are 10 sample images, CT1, CT2, ..., CT10, and the resolutions of these 10 sample images are aligned (i.e., the pixels correspond one to one), the pixel values ​​of CT1~CT9 at the pixel point are all 1, and the pixel value of CT10 at the pixel point is 0. The distribution of these sample images at the pixel point meets certain conditions (such as the number of masks with a pixel value of 1 is greater than or equal to 9, or the number of masks with a pixel value of 1 accounts for 90% or more of the total number of masks), then the pixel value of the pixel point in the finally generated reference image is 1. The reference image generated in this way can be a binary image, and the sieve coefficient can be calculated as the similarity between the segmentation result of the image to be identified and the reference image in the form of a binary image, and whether the image to be identified is abnormal can be determined according to a certain similarity threshold.

[0079] In one embodiment, before calculating the pixel averages of the multiple masks at each pixel point, the masks may be spatially transformed, and the spatial transformation may be used to convert different masks into the same coordinate system.

[0080] Exemplarily, spatially transforming the mask may include: selecting a sample image from multiple sample images as a first registration image; for sample images other than the first registration image among the multiple sample images, sequentially registering the sample images with the first registration image to convert the sample images to a coordinate system corresponding to the first registration image; and spatially transforming the mask corresponding to the sample image based on the registration parameters of the sample image and the first registration image.

[0081] For example, N sample images (such as CT1, CT2, ..., CT N) selects a first registration image, which is easy to be registered with other images and can be recorded as CT(Ref0), and registers other sample images with Ref0 in turn, and records the registration parameters of each registration. For example, the registration parameters after image CT1 is registered with CT(Ref0) are Regp1:(r x ,r y ,r z ,t x ,t y ,t z ), which represents the rotation angle around its X-axis, Y-axis, and Z-axis and the translation distance along its X-axis, Y-axis, and Z-axis; if it is a two-dimensional image, the registration parameters can be expressed as (r, t x ,t y ), r can represent the angle of rotation of the image around the X axis. After obtaining the registration parameters, the registration parameters of the mask mask1 corresponding to CT1 can also be expressed as Regp1, and Regp1 is used to transform mask1 to obtain the transformed mask 1m , mask 1m The mask corresponding to Ref0 is in the same coordinate system. Accordingly, by transforming other masks, we can get mask 2m 、mask 3m 、…。

[0082] For example, after the masks are aligned to the same coordinate system by image registration, the masks can be 1m 、mask 2m 、mask 3m etc.) average by pixel position and calculate the average mask mean . Mask mean The value of is mapped to the new image space to obtain the reference image.

[0083]

[0084] If the mask is a binary image, then in mask mean In the mask, the value of each pixel is in the interval [0,1]. im The pixel value is 0 or 1, mask mean The value of is a floating point number (decimal) in the interval [0,1], with a maximum of 1 and a minimum of 0.

[0085] In one embodiment, before calculating the similarity between the image to be identified and the reference image, the method further includes:

[0086] A spatial transformation is performed on at least one of the segmentation result and the reference image.

[0087] The spatial transformation is used to convert the segmentation result of the image to be identified and the reference image into the same coordinate system.

[0088] In some possible implementations, such as Figure 4 As shown, performing spatial transformation on at least one of the segmentation result and the reference image may include:

[0089] Step S401 : calculating the similarity between the mask of the sample image and the reference image, and selecting one from a plurality of sample images as a registration image according to the similarity.

[0090] Step S402: align the image to be recognized with the registration image, and record the registration parameters.

[0091] Step S403: performing spatial transformation on the segmentation result or the reference image according to the registration parameters.

[0092] The segmentation result is obtained by performing image segmentation on the image to be identified, and may be a mask of the image to be identified.

[0093] For example, for the registered mask (such as mask 1m 、mask 2m 、mask 3m etc.), each mask can be calculated im With the average mask mean The similarity between them is calculated, and the sample image corresponding to the mask with the largest similarity is taken as the registration reference image, which can be recorded as CT(Ref1). Then the image to be identified can be registered with Ref1, and the registration parameters of the image to be identified and Ref1 are recorded. Then, the segmentation result of the image to be identified (such as the mask) or the reference image is spatially transformed according to the registration parameters, so as to achieve the purpose of aligning the segmentation result of the image to be identified with the reference image and improve the accuracy of abnormality recognition.

[0094] Figure 5 This is a schematic diagram of the structure of an image anomaly recognition device provided in an embodiment of the present application. Figure 5 As shown, the image anomaly recognition device 500 may include:

[0095] The acquisition module 501 is used to acquire the segmentation result and the reference image obtained by image segmentation of the image to be identified. The reference image is a grayscale image generated based on the mask of multiple sample images.

[0096] The abnormality determination module 502 is used to calculate the similarity between the segmentation result and the reference image, and determine whether the image to be identified has an abnormality according to the similarity.

[0097] In one embodiment, the segmentation result is a mask of the image to be identified, and the abnormality determination module 502 is further used to: calculate the generalized sieve coefficient of the mask of the image to be identified and the reference image; if the generalized sieve coefficient is less than a preset threshold, it is determined that the image to be identified has an abnormality.

[0098] In one embodiment, the anomaly determination module 502 is also used to: calculate the generalized sieve coefficients of the mask of the sample image and the reference image; arrange the generalized sieve coefficients corresponding to multiple masks numerically, and select at least one from the arranged generalized sieve coefficients as a preset threshold according to a preset quantile parameter.

[0099] In one embodiment, the abnormality determination module 502 is further used to: perform spatial transformation on at least one of the segmentation result and the reference image, wherein the spatial transformation is used to convert the segmentation result and the reference image into the same coordinate system.

[0100] In one embodiment, the anomaly determination module 502 is also used to: calculate the similarity between the mask of the sample image and the reference image, and select one from multiple sample images as a registration image based on the similarity; align the image to be identified with the registration image, and record the registration parameters; and perform spatial transformation on the segmentation result or reference image based on the registration parameters.

[0101] In one embodiment, the acquisition module 501 is further used to: acquire masks of multiple sample images; calculate pixel averages of the multiple masks at each pixel point, and generate a reference image, wherein the pixel value of the reference image is the calculated pixel average.

[0102] The image anomaly recognition device provided in this embodiment can be used to execute the technical solution in any of the aforementioned method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.

[0103] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0104] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0105] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device 60 may include:

[0106] Processor 61, memory 62, and communication interface 63;

[0107] The memory 62 is used to store executable instructions of the processor 61; the executable instructions may be computer-executable instructions;

[0108] The processor 61 is configured to execute the technical solution in any of the aforementioned method embodiments by executing the executable instructions.

[0109] Optionally, the memory 62 may be independent or integrated with the processor 61 .

[0110] Optionally, when the memory 62 is a device independent of the processor 61, the electronic device 60 may further include:

[0111] The bus 64 , the memory 62 and the communication interface 63 are connected to the processor 61 via the bus 64 and communicate with each other. The communication interface 63 is used to communicate with other devices.

[0112] Optionally, the communication interface 63 may be implemented by a transceiver. The communication interface is used to implement communication between the database access device and other devices (such as a client, a read-write library, and a read-only library). The memory may include a random access memory (RAM) and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage.

[0113] The bus 64 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0114] The above-mentioned processor can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0115] The electronic device is used to execute the technical solution in any of the aforementioned method embodiments, and its implementation principle and technical effect are similar and will not be repeated here.

[0116] An embodiment of the present application also provides a readable storage medium, which may be a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the technical solution provided by any of the aforementioned method embodiments is implemented.

[0117] An embodiment of the present application also provides a computer program product, including a computer program, which is used to implement the technical solution provided by any of the aforementioned method embodiments when executed by a processor.

[0118] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0119] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0120] If the function 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 technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0121] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0122] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for identifying anomalies in an image, characterized in that: include: Obtaining a segmentation result and a reference image obtained by image segmentation of the image to be identified, wherein the reference image is a grayscale image generated based on masks of multiple sample images; The similarity between the segmentation result and the reference image is calculated, and whether the image to be identified has an abnormality is determined according to the similarity.

2. The image anomaly recognition method according to claim 1, characterized in that: The segmentation result is a mask of the image to be identified, and the calculating of the similarity between the segmentation result and the reference image, and determining whether the image to be identified has an abnormality according to the similarity, includes: Calculating the generalized sieve coefficients of the mask of the image to be identified and the reference image; If the generalized sieve coefficient is less than a preset threshold, it is determined that an abnormality exists in the image to be identified.

3. The image anomaly recognition method according to claim 2, characterized in that: Also includes: Calculating the generalized sieve coefficients of the mask of the sample image and the reference image; The generalized sieve coefficients corresponding to the multiple masks are arranged numerically, and at least one is selected from the arranged generalized sieve coefficients as a preset threshold according to a preset quantile parameter.

4. The image anomaly recognition method according to any one of claims 1 to 3, characterized in that: Before calculating the similarity between the image to be identified and the reference image, the method further includes: A spatial transformation is performed on at least one of the segmentation result and the reference image, where the spatial transformation is used to convert the segmentation result and the reference image into the same coordinate system.

5. The image anomaly recognition method according to claim 4, characterized in that: The performing spatial transformation on at least one of the segmentation result and the reference image comprises: Calculating the similarity between the mask of the sample image and the reference image, and selecting one from a plurality of sample images as a registration image according to the similarity; Registering the image to be recognized with the registration image, and recording the registration parameters; The segmentation result or the reference image is spatially transformed according to the registration parameter.

6. The image anomaly recognition method according to any one of claims 1 to 3, characterized in that: Also includes: Get masks of multiple sample images; Calculate the pixel average value of the plurality of masks at each pixel point, and generate a reference image, wherein the pixel value of the reference image is the calculated pixel average value.

7. An image anomaly recognition device, characterized in that: include: An acquisition module, used to acquire a segmentation result and a reference image obtained by segmenting the image to be identified, wherein the reference image is a grayscale image generated based on masks of multiple sample images; The abnormality determination module is used to calculate the similarity between the segmentation result and the reference image, and determine whether the image to be identified has an abnormality according to the similarity.

8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.

Citation Information

Cited By

  • Image segmentation anomaly detection method and device

    CN120411511A