Method for generating artifact image, electronic equipment, storage medium and product
By generating artifact superimposed images and superimposed processing, the problems of high manual labeling cost and unreal artifacts in the prior art are solved, efficient and real target artifact image generation is achieved, and data sample quality is improved.
Patent Information
- Application Number
- CN202411736618.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-07
AI Technical Summary
In the prior art, artificial artifact labeling on real ultrasound images has problems such as high cost, high manual requirements and insufficiently realistic artifacts, resulting in low data samples.
By generating a to-process image corresponding to the original ultrasound image, randomly adding a mask area, determining the target pixel value of the pixel points in the mask area, obtaining an artifact superimposed image, and obtaining a target artifact image by superimposing the original ultrasound image and the artifact superimposed image.
It realizes the efficiency, authenticity and convenience of generating target artifact images, solves the high cost and inefficiency problems of manual annotation, and improves the quality of data samples.
Smart Images

Figure CN119579726A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of medical image processing, and in particular to a method for generating an artifact image, an electronic device, a storage medium, and a product. Background Art
[0002] In the medical field, ultrasound images are widely used due to their safety and real-time performance. Artifact information is often seen in ultrasound images. The artifact information may include noise, shadows, reflections, etc. The presence of artifact information will affect the accuracy of diagnosis.
[0003] In order to achieve the effect of processing artifact information, a deep model can be used to achieve it. However, before obtaining the deep model for processing artifact information, a large number of data samples including artifact information need to be obtained first.
[0004] Currently, the method of determining data samples for artifact information mainly relies on the annotation of a large number of real ultrasound images, which has the problems of high data acquisition cost and difficulty. Summary of the invention
[0005] The embodiments of the present invention provide a method, device, server, storage medium and product for generating an artifact image, so as to improve the technical effect of obtaining a target artifact image with high efficiency and convenience.
[0006] In a first aspect, an embodiment of the present invention provides a method for generating an artifact image, the method comprising:
[0007] generating an image to be processed corresponding to the original ultrasound image;
[0008] Randomly adding a mask area to the image to be processed to obtain a mask image, and determining a target pixel value corresponding to a pixel point in the mask area in the mask image to obtain an image to be used;
[0009] Determine an artifact superposition image according to a pixel value corresponding to each pixel point in the image to be used;
[0010] A target artifact image of the original ultrasound image is determined according to the original ultrasound image and the artifact superimposed image.
[0011] Furthermore, the step of randomly adding a mask area to the image to be processed to obtain a mask image, and determining pixel values corresponding to pixel points of the mask area in the mask image to obtain the image to be used includes:
[0012] Randomly adding a mask area to the image to be processed, assigning a first pixel value to the mask area, and assigning a second pixel value to a non-mask area, to obtain the mask image;
[0013] For at least one pixel point in the mask area, determining a minimum distance from the pixel point to an edge of the mask area, and determining a target pixel value of the pixel point according to the minimum distance;
[0014] The mask image for determining the target pixel value is used as the image to be used.
[0015] Furthermore, the mask area is an area with smooth edges, and the area with smooth edges includes an elliptical area or a circular area.
[0016] Furthermore, determining the artifact overlay image according to the pixel value corresponding to each pixel point in the image to be used includes:
[0017] Obtaining the maximum pixel value and the minimum pixel value in the image to be used;
[0018] Normalizing the pixel value of each pixel in the image to be used according to the maximum pixel value and the minimum pixel value in the image to be used to obtain a normalized pixel value of each pixel;
[0019] The artifact superposition image is determined according to the normalized pixel value of each pixel in the image to be used.
[0020] Furthermore, determining the artifact overlay image according to the normalized pixel value of each pixel in the image to be used includes:
[0021] Processing the normalized pixel values in the image to be used according to the objective function to obtain the image to be applied;
[0022] Performing grayscale flipping and square root processing on the pixel value of each pixel point in the image to be applied, so as to update the pixel value of each pixel point;
[0023] The image after the pixel value is updated is used as the artifact overlay image.
[0024] Furthermore, determining a target artifact image of the original ultrasound image based on the original ultrasound image and the artifact superimposed image includes:
[0025] Obtaining a first pixel value of the original image and a second pixel value of the artifact superimposed image at the same pixel coordinate;
[0026] Based on the first pixel value and the second pixel value, updating the first pixel value;
[0027] After the first pixel value of each pixel in the original image is updated, the target artifact image is obtained.
[0028] Furthermore, the method further comprises:
[0029] Training the model to be trained based on the original ultrasound image and the corresponding target artifact image to obtain an artifact removal model;
[0030] The artifact removal model is used to remove artifact information in the ultrasound image to be processed to obtain an artifact-free image.
[0031] In a second aspect, an embodiment of the present invention further provides a device for generating an artifact image, the device comprising:
[0032] A to-be-processed image generation module, used to generate an to-be-processed image corresponding to the original ultrasound image;
[0033] The image to be used generating module is used to randomly add a mask area to the image to be used to obtain a mask image, and determine the target pixel value corresponding to the pixel point of the mask area in the mask image to obtain the image to be used;
[0034] An artifact superposition image generation module is used to determine an artifact superposition image according to a pixel value corresponding to each pixel point in the image to be used;
[0035] The target artifact image generating module is used to determine the target artifact image of the original ultrasound image according to the original ultrasound image and the artifact superposition image.
[0036] In a third aspect, an embodiment of the present invention provides a server, which includes:
[0037] one or more processors;
[0038] A memory for storing one or more programs;
[0039] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating an artifact image provided by any embodiment of the present invention.
[0040] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for generating an artifact image as provided in any embodiment of the present invention.
[0041] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program, characterized in that when the computer program is executed by a processor, the computer program implements the method for generating an artifact image as described in any one of the embodiments of the present invention.
[0042] The technical solution provided by the embodiment of the present invention can generate a to-be-processed image corresponding to the original ultrasound image when a target artifact image is needed, and then randomly add a mask area to the to-be-processed image to obtain a mask image. Determine the target pixel value of the pixel points in the mask area in the mask image to obtain the to-be-used image, and further process the pixel value of each pixel point in the to-be-used image to obtain an artifact superposition image. By superimposing the original ultrasound image and the artifact superposition image to obtain the target artifact image corresponding to the original ultrasound image, the problem of high labor requirements and high cost when manually annotating artifacts on real ultrasound images in the prior art is solved. Furthermore, the generated artifacts are often not realistic enough and cannot effectively simulate the complex situations in the clinical environment, resulting in the problem of low data sample quality. The target artifact image corresponding to the original ultrasound image is generated based on simulation, achieving the technical effect of generating target artifact images with high efficiency, authenticity and convenience. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required to describe the embodiments. Obviously, the drawings introduced are only drawings of a part of the embodiments to be described in the present invention, rather than all the drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 A flowchart of a method for generating an artifact image provided by an embodiment of the present invention;
[0045] Figure 2 A schematic diagram of a mask image provided by an embodiment of the present invention;
[0046] Figure 3 A schematic diagram of an image to be used provided by an embodiment of the present invention;
[0047] Figure 4 A schematic diagram of an artifact superimposed image provided by an embodiment of the present invention;
[0048] Figure 5 A schematic diagram of a target artifact image provided by an embodiment of the present invention.
[0049] Figure 6 A flowchart of a method for generating an artifact image provided by an embodiment of the present invention;
[0050] Figure 7 A structural diagram of a device for generating an artifact image provided by an embodiment of the present invention;
[0051] Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0053] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0054] Before introducing the technical solution provided by the embodiment of the present invention, an application scenario may be exemplified first.
[0055] Artifacts may exist in the acquired ultrasound image, and the presence of artifacts will affect the diagnostic conclusion of the ultrasound image. Based on this, the ultrasound image artifacts can be simulated to obtain a target artifact image that adds artifacts to the original ultrasound image. The corresponding neural network can be trained based on the target artifact image, so that after the original ultrasound image is acquired, the original ultrasound image can be analyzed and processed based on the neural network to obtain an ultrasound image without artifacts, thereby improving the accuracy of the diagnostic result.
[0056] In this embodiment, it is possible to show in detail how to determine the target artifact image corresponding to the original ultrasound image. In other words, as long as the method of adding artifacts to the original ultrasound image is the same as the solution provided in this embodiment, it is within the protection scope of this technical solution. Figure 1 A flowchart of a method for generating an artifact image provided in an embodiment of the present invention. This embodiment can be applied to any scenario where it is necessary to add artifact information to an ultrasound image to obtain a target artifact image. The method for generating an artifact image provided in this embodiment can be executed by a client, or by a server, or by a client and a server in cooperation.
[0057] like Figure 1 As shown, the method specifically comprises the following steps:
[0058] S110: Generate an image to be processed corresponding to the original ultrasound image.
[0059] Existing ultrasonic image acquisition equipment may be used to acquire ultrasonic images corresponding to different lesion sites, and the acquired images may be used as original ultrasonic images.
[0060] For different original ultrasound images, the corresponding image sizes and resolutions may be the same or different, and for each original ultrasound image, the method provided by the embodiment of the present invention may be used to determine the target artifact image corresponding thereto. Here, one of the original ultrasound images is taken as an example to illustrate how to generate the target artifact image.
[0061] For the original ultrasound image, a corresponding image to be processed may be generated according to the resolution and size of the original ultrasound image. The image to be processed may be a grayscale image with a preset grayscale value, and optionally, the preset grayscale value may be 0.
[0062] For example, after obtaining the original ultrasound image, a to-be-processed image having the same resolution and size as the original ultrasound image may be generated. The grayscale value of the to-be-processed image may be a preset grayscale value of 0.
[0063] S120 , randomly adding a mask area to the image to be used to obtain a mask image, and determining a target pixel value corresponding to a pixel point in the mask area in the mask image to obtain an image to be used.
[0064] The mask region is a region set in the image to be processed, and the image obtained after adding the mask region to the image to be processed is used as the mask image.
[0065] It should be noted that, for the mask image, there is a certain difference between the pixel values of the pixels in the mask area and the pixel values of the pixels in the non-mask area. Of course, the pixel values of the pixels in the mask area are the same pixel value, and the pixel values of the pixels in the non-mask area are also the same pixel value. The content corresponding to the mask area in the image to be processed can be processed to obtain the image to be used. At this time, the pixel values of the pixels in the mask area in the image to be used can be the same or different, and the specific target pixel value is set according to the actual situation.
[0066] Specifically, an existing image annotation tool can be used to randomly add a mask area to the image to be processed to obtain a mask image. Next, each pixel in the mask image is processed to obtain the target pixel value corresponding to each pixel in the mask area. After the pixel values of all pixels in the mask area are updated to the target pixel values, the image obtained is used as the image to be used.
[0067] In this embodiment, a mask area is randomly added to the image to be processed to obtain a mask image, and the pixel values corresponding to the pixels in the mask area in the mask image are determined to obtain the image to be used, including: randomly adding a mask area to the image to be processed, and assigning a first pixel value to the mask area, and assigning a second pixel value to the non-mask area to obtain the mask image; for at least one pixel in the mask area, determining the minimum distance from the pixel to the edge of the mask area, and determining the target pixel value of the pixel based on the minimum distance; using the mask image with the determined target pixel value as the image to be used.
[0068] Among them, the first pixel value can be a first preset pixel value, and optionally, the first preset pixel value is 0. The second pixel value is a second preset pixel value, and optionally, the second preset pixel value is 1. At this time, the first preset pixel value is the pixel value corresponding to white, and the second preset pixel value is the pixel value corresponding to black. For the mask area, it has a certain shape. The shape of the mask area has a certain edge, and this edge is used as the edge of the mask area. For each pixel point in the mask area, the minimum distance from each pixel point to the edge of the mask area can be determined respectively. Based on the minimum distance corresponding to each pixel point, the target pixel value corresponding to each pixel point is determined. After obtaining the target pixel value of each pixel point in the mask area, the image to be used is determined.
[0069] It can be understood that: a mask area can be randomly added to the image to be processed. The pixel values of the pixels in the mask area can be assigned to the first pixel value. At the same time, the pixel values of the pixels in the non-mask area are assigned to the second pixel value. For the pixels in the mask area, the minimum distance from each pixel to the edge of the mask area can be determined respectively. After the minimum distance is obtained, the target pixel value of the corresponding pixel can be determined based on the minimum distance.
[0070] In this embodiment, the mask area is an area with smooth edges. Optionally, the area with smooth edges is an elliptical area or a circular area.
[0071] For example, see Figure 2 , a mask area can be randomly added to the image to be processed, and the mask area is an ellipse area. That is, the center point of an ellipse is randomly set in the image to be processed, and the lengths of the major and minor axes of the ellipse are randomly set. The pixel values of the pixels in the ellipse area are set as the first pixel value, and the pixel values of the pixels in the non-ellipse area in the mask image are set as the second pixel value, and the following is obtained: Figure 2The mask image shown. For any pixel point in the mask area in the mask image, the shortest distance / minimum distance from the pixel point to the edge of the mask area can be calculated. According to the shortest distance / minimum distance of each pixel point, the target pixel value of the corresponding pixel point is determined. For example, if the mask area is an ellipse, the shortest distance from the center point of the ellipse to the edge of the ellipse can be calculated. The shortest distance can be the short diameter of the ellipse, and the value of the short diameter of the ellipse is used as the target pixel value of the pixel point at the center point of the ellipse.
[0072] On the basis that the mask area is an ellipse area, the exemplary description is continued. A distance transformation can be performed on the ellipse area to calculate the shortest distance from each pixel point in the ellipse area to the ellipse boundary. The shortest distance of each pixel point is used as the target pixel value of the corresponding pixel point, and the following is obtained: Figure 3 Schematic diagram shown.
[0073] S130 , determining an artifact superimposed image according to a pixel value corresponding to each pixel point in the image to be used.
[0074] The artifact superposition image is an artifact image to be superimposed on the original ultrasound image. The pixel value of each pixel point in the image to be used can be processed to obtain the artifact superposition image.
[0075] In this embodiment, the method for determining the artifact overlay image may be: obtaining the maximum pixel value and the minimum pixel value in the image to be used; normalizing the pixel value of each pixel point in the image to be used according to the maximum pixel value and the minimum pixel value in the image to be used to obtain the normalized pixel value of each pixel point; and determining the artifact overlay image according to the normalized pixel value of each pixel point in the image to be used.
[0076] The image to be used has a maximum pixel value and a minimum pixel value. The normalized pixel value is the pixel value obtained after processing the pixel value of each pixel point. The image obtained after the pixel value of each pixel point is normalized is used as the artifact overlay image.
[0077] It can be understood as: obtaining the maximum pixel value and the minimum pixel value in the image to be used. Next, for each pixel point, the normalized pixel value of each pixel point can be determined according to the pixel value, the maximum pixel value and the minimum pixel value of each pixel point. After determining the normalized pixel value of each pixel point, an artifact superposition image can be obtained.
[0078] Exemplarily, after the image to be used is obtained, the maximum pixel value (maximum grayscale value xmax) and the minimum pixel value (minimum grayscale value xmin) of the image to be used may be counted.
[0079] The normalized pixel value of each pixel is determined according to the following formula:
[0080]
[0081] Among them, Y represents the normalized pixel value after the pixel point is normalized, and x represents the pixel value of the pixel point in the image to be used.
[0082] In this embodiment, the artifact overlay image is determined based on the normalized pixel value of each pixel in the image to be used, including: processing the normalized pixel value in the image to be used according to the objective function to obtain the image to be applied; grayscale flipping and square root processing of the pixel value of each pixel in the image to be applied to update the pixel value of each pixel; and using the image after the pixel value is updated as the artifact overlay image.
[0083] The objective function is a function for processing normalized pixel values. The image obtained after processing the normalized pixel values based on the objective function is used as the image to be applied. The artifact overlay image is an image obtained after processing the pixel values of the pixel points in the image to be applied again.
[0084] Specifically, for the pixel value of each pixel in the image to be used, the pixel value at this time is a normalized pixel value. Based on the objective function, the normalized pixel value is processed to obtain the updated pixel value of each pixel, thereby obtaining the image to be applied. Further, the pixel value of each pixel in the image to be applied is grayscale flipped and squared to update the pixel value of each pixel in the image to be applied. After the pixel value processing of all pixels in the image to be applied is completed, the obtained image to be applied can be used as an artifact overlay image.
[0085] Exemplarily, pixel values in the image to be applied after pixel value normalization are subjected to pixel truncation processing to prevent the original information of the central area of the mask area in the original ultrasound image from being lost.
[0086] The objective function is:
[0087]
[0088] Among them, c represents the pixel value after the pixel value of a certain pixel point is truncated, and Y represents the pixel value in the image to be used.
[0089] It can be understood that if the normalized pixel value of a pixel in the image to be used is less than the preset pixel threshold, the normalized pixel value of the pixel remains unchanged; if the normalized pixel value of a pixel in the image to be used is greater than the preset pixel threshold, the normalized pixel value of the pixel is set to the preset pixel threshold.
[0090] By processing the normalized pixel values in the image to be used in the above manner, an image to be applied can be obtained.
[0091] Next, the grayscale of the pixel value of each pixel point in the image to be applied is flipped and square rooted to update the pixel value of each pixel point in the image to be applied.
[0092] Exemplarily, the grayscale flipping process can be to subtract the pixel value of each pixel in the image to be applied from the preset value to obtain the pixel value to be squared. Next, the pixel value to be squared is squared to update the pixel value of each pixel in the image to be applied. After processing each pixel in the image to be applied, an artifact superposition image is obtained, see Figure 4 .
[0093] S140: Determine a target artifact image of the original ultrasound image according to the original ultrasound image and the artifact superimposed image.
[0094] The target artifact image is an ultrasound image obtained by superimposing artifacts on the original ultrasound image.
[0095] Specifically, the original ultrasonic image and the artifact superposition image may be superimposed to obtain a target artifact image corresponding to the original ultrasonic image.
[0096] In this embodiment, a target artifact image of the original ultrasound image is determined based on the original ultrasound image and the artifact overlay image, including: obtaining a first pixel value of the same pixel coordinate in the original image and a second pixel value in the artifact overlay image; updating the first pixel value based on the first pixel value and the second pixel value; and obtaining the target artifact image after updating the first pixel value of each pixel point in the original image.
[0097] It should be noted that the image size and resolution of the artifact superimposed image and the original ultrasound image are the same, so the original ultrasound image and the artifact superimposed image at the same pixel coordinates can be analyzed and processed to obtain a target artifact image.
[0098] Specifically, for the same pixel coordinate, the first pixel value of the pixel coordinate in the original ultrasound image and the second pixel value of the pixel coordinate in the artifact overlay image can be obtained. The third pixel value is obtained by calculating the product of the first pixel value and the second pixel value. The first pixel value corresponding to the pixel coordinate is updated by the third pixel value. After all pixel coordinates in the original ultrasound image are processed, the target artifact image can be obtained.
[0099] For example, after obtaining the superimposed artifact image, the artifact superimposed image and the original ultrasound image may be multiplied to obtain a final target artifact image, see Figure 5 .
[0100] It should be noted that the product processing is also a multiplication processing of the pixel value of the same pixel coordinate in the original ultrasound image and the pixel value of the artifact superimposed image.
[0101] The technical solution provided by the embodiment of the present invention can generate a to-be-processed image corresponding to the original ultrasound image when a target artifact image is needed, and then randomly add a mask area to the to-be-processed image to obtain a mask image. Determine the target pixel value of the pixel points in the mask area in the mask image to obtain the to-be-used image, and further process the pixel value of each pixel point in the to-be-used image to obtain an artifact superposition image. By superimposing the original ultrasound image and the artifact superposition image to obtain the target artifact image corresponding to the original ultrasound image, the problem of high labor requirements and high cost when manually annotating artifacts on real ultrasound images in the prior art is solved. Furthermore, the generated artifacts are often not realistic enough and cannot effectively simulate the complex situations in the clinical environment, resulting in the problem of low data sample quality. The target artifact image corresponding to the original ultrasound image is generated based on simulation, achieving the technical effect of generating target artifact images with high efficiency, authenticity and convenience.
[0102] Figure 6 A flow chart of a method for generating an artifact image provided in an embodiment of the present invention is provided. Based on the aforementioned embodiment, a corresponding artifact removal model can be trained based on the original ultrasound image and the target artifact image. The specific implementation method thereof can be referred to the detailed description of this embodiment, wherein the technical terms that are the same as or corresponding to the aforementioned embodiment are not repeated in this embodiment.
[0103] As shown in Figure 6, the method includes:
[0104] S210: Generate an image to be processed corresponding to the original ultrasound image.
[0105] S220 , randomly adding a mask area to the image to be used to obtain a mask image, and determining a target pixel value corresponding to a pixel point in the mask area in the mask image to obtain an image to be used.
[0106] S230: Determine an artifact superposition image according to a pixel value corresponding to each pixel point in the image to be used.
[0107] S240: Determine a target artifact image of the original ultrasound image according to the original ultrasound image and the artifact superposition image.
[0108] S250 , training the model to be trained based on the original ultrasound image and the corresponding target artifact image to obtain a de-artifacting model.
[0109] It can be understood that the target artifact image corresponding to each original ultrasound image can be obtained by adopting the above-mentioned S210-S240 method.
[0110] It should be noted that in order to improve the generalization effect of the model, original ultrasound images corresponding to different lesion sites can be collected, and target artifact images corresponding to different original ultrasound images can be obtained. The corresponding artifact removal model can be trained based on the original ultrasound images and the corresponding target artifact images to achieve that the artifact removal model can remove artifacts from ultrasound images of different lesion sites.
[0111] Optionally, the original ultrasound image and the corresponding target artifact image can be used as a training sample, and multiple training samples can be constructed in the same way to train a de-artifacting model based on the training samples.
[0112] Specifically, the artifact removal model can be trained in a supervised or unsupervised manner. If a supervised method is used, the artifact removal model can be obtained by taking the target artifact image as the input of the model to be trained for each training sample, and taking the original ultrasound image corresponding to the target artifact image as the corresponding output result. If an unsupervised method is used, the target artifact image can be input into the model to be trained, and the model to be trained can predict a predicted ultrasound image after artifact removal. According to the predicted ultrasound image and the original ultrasound image corresponding to the target artifact image, the artifact loss value is determined. Based on the artifact loss value, the model parameters in the model to be trained are corrected. The convergence of the loss function in the model to be trained is used as the training goal to obtain the artifact removal model.
[0113] It can be understood that the artifact removal model is used to remove artifact information in the ultrasound image to be processed to obtain an artifact-free ultrasound image.
[0114] In practical applications, after an ultrasound image is acquired by an ultrasound device, the ultrasound image can be input into a de-artifacting model, and the model can output an ultrasound image with artifacts removed. Based on the ultrasound image, the lesion information can be clearly determined, thereby improving the accuracy of the lesion information determination.
[0115] The technical solution provided by the embodiment of the present invention can, after obtaining the target artifact image corresponding to the original ultrasonic image, train a removal of artifact model based on the original ultrasonic image and the target artifact image, and then analyze and process the collected ultrasonic image to be processed based on the removal of artifact model, so as to obtain an ultrasonic image with artifact information removed, and then, when performing lesion analysis based on the ultrasonic image with artifacts removed, the analysis accuracy and efficiency can be improved.
[0116] The following is an embodiment of a device for generating an artifact image provided by an embodiment of the present invention. The device and the method for generating an artifact image in the above embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the device for generating an artifact image, reference may be made to the embodiment of the method for generating an artifact image.
[0117] Figure 7 A schematic diagram of the structure of a device for generating an artifact image provided by an embodiment of the present invention, the device specifically includes: a to-be-processed image generation module 310, a to-be-used image generation module 320, an artifact overlay image generation module 330 and an artifact overlay image generation module 340.
[0118] Among them, the image to be processed generation module 310 is used to generate an image to be processed corresponding to the original ultrasound image; the image to be used generation module 320 is used to randomly add a mask area to the image to be processed to obtain a mask image, and determine the target pixel value corresponding to the pixel point of the mask area in the mask image to obtain the image to be used; the artifact overlay image generation module 330 is used to determine the artifact overlay image according to the pixel value corresponding to each pixel point in the image to be used; the target artifact image generation module 340 is used to determine the target artifact image of the original ultrasound image according to the original ultrasound image and the artifact overlay image.
[0119] On the basis of the above technical solution, the image generation module to be used includes:
[0120] A mask image determination unit, configured to randomly add a mask area to the image to be processed, assign a first pixel value to the mask area, and assign a second pixel value to a non-mask area, so as to obtain the mask image;
[0121] a target pixel value determining unit, configured to determine, for at least one pixel point in the mask area, a minimum distance from the pixel point to an edge of the mask area, and determine a target pixel value of the pixel point according to the minimum distance;
[0122] The to-be-used image determining unit is used to use the mask image for determining the target pixel value as the to-be-used image.
[0123] On the basis of the above technical solutions, the mask area is an area with smooth edges, and the area with smooth edges includes an elliptical area or a circular area.
[0124] On the basis of the above technical solutions, the artifact superposition image generation module includes:
[0125] A pixel value acquisition unit, used to acquire a maximum pixel value and a minimum pixel value in the image to be used;
[0126] A pixel value normalization processing unit, used for normalizing the pixel value of each pixel point in the image to be used according to the maximum pixel value and the minimum pixel value in the image to be used, so as to obtain a normalized pixel value of each pixel point;
[0127] The artifact superimposed image determining unit is used to determine the artifact superimposed image according to the normalized pixel value of each pixel point in the image to be used.
[0128] On the basis of the above technical solutions, the artifact superposition image determination unit includes:
[0129] The to-be-applied image determination subunit is used to process the normalized pixel values in the to-be-applied image according to the objective function to obtain the to-be-applied image;
[0130] A pixel value determination subunit, used for grayscale flipping and square root processing of the pixel value of each pixel point in the image to be applied, so as to update the pixel value of each pixel point;
[0131] The artifact superimposed image determination subunit is used to use the image after the pixel values are updated as the artifact superimposed image.
[0132] On the basis of the above technical solutions, the target artifact image generation module includes:
[0133] A pixel value acquisition unit, used to acquire a first pixel value of a same pixel coordinate in the original image and a second pixel value in the artifact superimposed image;
[0134] a pixel value updating unit, configured to update the first pixel value based on the first pixel value and the second pixel value;
[0135] The target artifact image determining unit is used to obtain the target artifact image after updating the first pixel value of each pixel point in the original image.
[0136] On the basis of the above technical solutions, the device further includes:
[0137] An artifact removal model generation module is used to train a to-be-trained model based on the original ultrasound image and the corresponding target artifact image to obtain an artifact removal model;
[0138] The artifact removal model is used to remove artifact information in the ultrasound image to be processed to obtain an artifact-free image.
[0139] The technical solution provided by the embodiment of the present invention can generate a to-be-processed image corresponding to the original ultrasound image when a target artifact image is needed, and then randomly add a mask area to the to-be-processed image to obtain a mask image. Determine the target pixel value of the pixel points in the mask area in the mask image to obtain the to-be-used image, and further process the pixel value of each pixel point in the to-be-used image to obtain an artifact superposition image. By superimposing the original ultrasound image and the artifact superposition image to obtain the target artifact image corresponding to the original ultrasound image, the problem of high labor requirements and high cost when manually annotating artifacts on real ultrasound images in the prior art is solved. Furthermore, the generated artifacts are often not realistic enough and cannot effectively simulate the complex situations in the clinical environment, resulting in the problem of low data sample quality. The target artifact image corresponding to the original ultrasound image is generated based on simulation, achieving the technical effect of generating target artifact images with high efficiency, authenticity and convenience.
[0140] The device for generating an artifact image provided by the embodiment of the present invention can execute the method for generating an artifact image provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method for generating an artifact image.
[0141] It is worth noting that in the embodiment of the above-mentioned device for generating artifact images, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0142] Figure 8 A schematic diagram of the structure of a server provided in an embodiment of the present invention. Figure 8 A block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 8 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0143] like Figure 8 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0144] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0145] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0146] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 8 not shown, usually called a "hard drive"). Although Figure 8 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0147] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0148] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0149] The processing unit 16 executes various functional applications and generates artifact images by running the program stored in the system memory 28, for example, implementing the method steps for generating artifact images provided in the first embodiment of the present invention, the method comprising:
[0150] generating an image to be processed corresponding to the original ultrasound image;
[0151] Randomly adding a mask area to the image to be processed to obtain a mask image, and determining a target pixel value corresponding to a pixel point in the mask area in the mask image to obtain an image to be used;
[0152] Determine an artifact superposition image according to a pixel value corresponding to each pixel point in the image to be used;
[0153] A target artifact image of the original ultrasound image is determined according to the original ultrasound image and the artifact superimposed image.
[0154] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the method for generating an artifact image provided by any embodiment of the present invention.
[0155] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method steps for generating an artifact image provided by the above-mentioned embodiment of the present invention are implemented. The method includes:
[0156] generating an image to be processed corresponding to the original ultrasound image;
[0157] Randomly adding a mask area to the image to be processed to obtain a mask image, and determining a target pixel value corresponding to a pixel point in the mask area in the mask image to obtain an image to be used;
[0158] Determine an artifact superposition image according to a pixel value corresponding to each pixel point in the image to be used;
[0159] A target artifact image of the original ultrasound image is determined according to the original ultrasound image and the artifact superimposed image.
[0160] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0161] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0162] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0163] Computer program code for performing the operation of embodiments of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0164] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for generating an artifact image, characterized in that: include: generating an image to be processed corresponding to the original ultrasound image; Randomly adding a mask area to the image to be processed to obtain a mask image, and determining a target pixel value corresponding to a pixel point in the mask area in the mask image to obtain an image to be used; Determine an artifact superposition image according to a pixel value corresponding to each pixel point in the image to be used; A target artifact image of the original ultrasound image is determined according to the original ultrasound image and the artifact superposition image.
2. The method according to claim 1, characterized in that The step of randomly adding a mask area to the image to be processed to obtain a mask image, and determining pixel values corresponding to pixel points of the mask area in the mask image to obtain the image to be used includes: Randomly adding a mask area to the image to be processed, assigning a first pixel value to the mask area, and assigning a second pixel value to a non-mask area, to obtain the mask image; For at least one pixel point in the mask area, determining a minimum distance from the pixel point to an edge of the mask area, and determining a target pixel value of the pixel point according to the minimum distance; The mask image for determining the target pixel value is used as the image to be used.
3. The method according to claim 1 or 2, characterized in that: The mask area is an area with smooth edges, and the area with smooth edges includes an elliptical area or a circular area.
4. The method according to claim 1, characterized in that: The step of determining the artifact overlay image according to the pixel value corresponding to each pixel point in the image to be used includes: Obtaining the maximum pixel value and the minimum pixel value in the image to be used; Normalizing the pixel value of each pixel in the image to be used according to the maximum pixel value and the minimum pixel value in the image to be used to obtain a normalized pixel value of each pixel; The artifact superposition image is determined according to the normalized pixel value of each pixel in the image to be used.
5. The method according to claim 4, characterized in that The step of determining the artifact overlay image according to the normalized pixel value of each pixel in the image to be used includes: Processing the normalized pixel values in the image to be used according to the objective function to obtain the image to be applied; Performing grayscale flipping and square root processing on the pixel value of each pixel point in the image to be applied, so as to update the pixel value of each pixel point in the image to be applied; The image to be applied after the pixel values are updated is used as the artifact overlay image.
6. The method according to claim 1, characterized in that The step of determining a target artifact image of the original ultrasound image based on the original ultrasound image and the artifact superimposed image includes: Obtaining a first pixel value of the original image and a second pixel value of the artifact superimposed image at the same pixel coordinate; Based on the first pixel value and the second pixel value, updating the first pixel value; After the first pixel value of each pixel in the original image is updated, the target artifact image is obtained.
7. The method according to claim 1, characterized in that The method further comprises: Training the model to be trained based on the original ultrasound image and the corresponding target artifact image to obtain an artifact removal model; The artifact removal model is used to remove artifact information in the ultrasound image to be processed to obtain an artifact-free ultrasound image.
8. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating an artifact image as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for generating an artifact image as described in any one of claims 1 to 7 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the method for generating an artifact image according to any one of claims 1 to 7.
Citation Information
Cited By
Method and device for eliminating artifacts of CT image
CN120747267A