Ultrasonic image calcification focus sound shadow simulation algorithm
By processing the ultrasound image with the calcification foci sound shadow simulation algorithm, an augmented training image is generated, which solves the problem that existing technology cannot effectively simulate the sound shadow of calcification foci in ultrasound images, and improves the accuracy and accuracy of artificial intelligence recognition of calcification foci. robustness.
Patent Information
- Application Number
- CN202410746932.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-06
AI Technical Summary
Existing image augmentation technology cannot effectively simulate the sound shadow of calcification lesions in ultrasound images, resulting in a low accuracy of artificial intelligence in identifying images containing calcification lesions in the real world.
Through secondary processing of the original ultrasound image, calcification lesions and their acoustic shadow artifacts are generated, and a specific algorithm is used to add calcification lesions and acoustic shadows to the image to simulate the formation process of calcification lesions and generate augmented training images. The specific steps include reading the picture, generating the acoustic shock sublattice, the calcification foci lattice, the sound shadow, and the calcification foci reflection highlight points, and superimposing the sound shadow and reflection highlight points on the original picture.
It improves the accuracy and robustness of artificial intelligence in identifying calcifications in ultrasound images in the real world, and enhances the quality of the training library.
Smart Images

Figure CN118608643A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image artificial intelligence classification and recognition, and in particular to an image data augmentation algorithm for performing acoustic and shadow simulation of calcification foci on ultrasonic images. Background Art
[0002] Artificial intelligence is developing rapidly. Image classification and recognition is a very important research branch in artificial intelligence. Medical imaging has also been greatly improved in accuracy and diagnostic efficiency with the help of artificial intelligence. The improvement of the accuracy of artificial intelligence classification and recognition of images depends on high-quality image data sets that have been accurately labeled. Image data sets must not only be large in quantity, but also of high quality, and the quantity of each category must be balanced.
[0003] In the real world, ultrasound images of lesions are often affected by many factors, and the acoustic shadow of calcification is an important one. In this case, increasing the number of images is a solution, but the cost is very high. A common method is to augment the existing image data set, which can improve the accuracy and robustness of the artificial intelligence program. [1] The addition of ultrasound training image datasets with the acoustic shadows of calcifications can obviously improve the accuracy and robustness of artificial intelligence programs in identifying images containing calcifications in the real world.
[0004] There is currently no publicly available technology for simulating the acoustic shadow of calcifications in ultrasound images. Existing image augmentation technologies only perform image enhancement on brightness, chromaticity, rotation, patching, etc. [2] , which is no different from the general image augmentation technology used [3] , and no specific image augmentation algorithms have been designed for ultrasound image artifacts, especially the acoustic shadows of calcifications. Therefore, when artificial intelligence trained using these image augmentation methods reads images with acoustic shadows of calcifications in the real world, the classification accuracy will be relatively low. Summary of the invention
[0005] In view of the above-mentioned technical deficiencies, the purpose of the present invention is to provide an algorithm for simulating the acoustic and shadow of calcification foci in ultrasound images, which is a method for performing secondary processing on the original ultrasound images, adding calcification foci and their acoustic and shadow artifacts to the images according to a certain algorithm, and augmenting the training image database.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] The present invention provides an ultrasonic image calcification focus acoustic shadow simulation algorithm, comprising the following steps:
[0008] Step 1. Read the image and do preliminary processing;
[0009] Read in the unprocessed ultrasound image, convert the image size into an image with a height of H pixels and a width of W pixels, and convert the data into a tensor, which is recorded as img_tensor. The shape of img_tensor is [C, H, W]. Here C represents the number of channels, which is 3. The first channel stores the horizontal coordinate of the point, the second channel stores the vertical coordinate of the point, and the third channel stores the grayscale value of the point, with a value range of 0-255.
[0010] Step 2. Generate acoustic vibration sub-lattice;
[0011] Define the position and intensity of the acoustic vibrator in the image according to the type of ultrasound probe, and simulate the acoustic vibrator array of the high-frequency plain scan probe and convex array probe; in the simulation, the acoustic vibrators of the high-frequency probe are all located at the top of the image, arranged by pixels, and described by a tensor of shape [number of acoustic vibrators, number of channels]; the number of channels is 3, the first channel stores the horizontal coordinate of the acoustic vibrator, the second channel stores the vertical coordinate of the acoustic vibrator, and the third channel stores the acoustic force of the acoustic vibrator, with a value range of 0-100; the acoustic force sets the average value and standard deviation;
[0012] Step 3. Generate calcification focus array;
[0013] Generating calcification foci is divided into three steps:
[0014] The first step is to initialize several calcification cores, each core has an intensity value, and obtain the tensor core_tensor. These cores are in a rectangle shadow_rect with a limited length and width;
[0015] The second step is to traverse all points in the shadow_rect rectangle and calculate the distance p_core_dis_tensor between these points and all calcification cores; multiply these distances with the intensity value shadow_intense_tensor of the calcification core to obtain the tensor b_tensor, and take the first n points of the b value and record them in the tensor c_tensor;
[0016] The third step is to convert c_tensor into a normal distribution series tensor shadow_tensor with a mean of shadow_avg and a standard deviation of shadow_std;
[0017] Step 4. Generate sound shadow;
[0018] Generate sound shadow according to the two tensors ilu_tensor and shadow_tensor obtained in step 2 and step 3;
[0019] Step 1: Calculate and enumerate the straight lines between the acoustic vibrators and the image pixels;
[0020] Step 2: Calculate the distance between the calcification point and the straight line;
[0021] Step 3: Calculate the distance between the acoustic vibrator and the pixel in the image, and calculate the attenuation effect of the sound beam based on the distance between the two;
[0022] Step 4: Calculate the impact of each calcification point on the sound intensity of each acoustic sub-pixel line;
[0023] Step 5: Generate a mask and record it in the tensor Mask_shadow;
[0024] Step 5. Generate a highlight point formed by the reflection of the calcification focus;
[0025] Step 6. Overlay the sound shadow and reflection highlights on the original image;
[0026] Step 7. Export the image.
[0027] The beneficial effect of the present invention is that the method is used to expand the ultrasound image training library, which can improve the accuracy and robustness of artificial intelligence recognition in the real world. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 A framework diagram of an algorithm for simulating the acoustic shadow of calcification foci in ultrasound images according to the present invention;
[0030] Figure 2 It is a schematic diagram of the probe acoustic vibrator simulation and data storage format;
[0031] Figure 3 The figure is a schematic diagram of calcification simulation and its data format;
[0032] Figure 4 This is a schematic diagram of the acoustic shadow formed by the calcification focus;
[0033] Figure 5 This is a schematic diagram of the sound intensity calculation at each point without the influence of calcification;
[0034] Figure 6 A flowchart of an algorithm for simulating the acoustic shadow of calcification foci in an ultrasound image according to the present invention;
[0035] Figure 7 Schematic diagram of the algorithm for implementing the intensity attenuation of the acoustic beam for the ray tracing method;
[0036] Figure 8 Schematic diagram of the algorithm for calculating the reflection intensity of calcification foci. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] like Figure 1 As shown, an algorithm for simulating the acoustic shadow of calcification in an ultrasound image comprises the following steps:
[0039] Step 1. Read the image and do preliminary processing;
[0040] Use the CV2 module to read in the unprocessed ultrasound image, convert the image size to 480 pixels high and 640 pixels wide, and convert it into a tensor. The tensor is recorded as img_tensor. The shape of img_tensor is [number of channels, image height, image width]. Here, the number of channels is 3. The first channel stores the horizontal coordinate of the point, the second channel stores the vertical coordinate of the point, and the third channel stores the grayscale value of the point (value range 0-255).
[0041] Step 2. Generate acoustic vibration sub-lattice; (see Figure 2 )
[0042] The sonicator is the smallest unit that generates ultrasound waves on an ultrasound probe. Each probe has dozens or even hundreds of sonicators. Obviously, when simulating the acoustic shadow of a calcification, the location and vibration intensity of the sonicator need to be considered.
[0043] Define the position and intensity of the acoustic vibrator in the image according to the type of ultrasound probe. This simulation algorithm simulates the acoustic vibrator array of a high-frequency plain scan probe. In the simulation algorithm, the acoustic vibrators of the high-frequency probe are located at the top of the image, arranged by pixels, and described by a tensor of shape [number of acoustic vibrators, number of channels], denoted as ilu_tensor. It has 3 channels. The first channel stores the horizontal coordinate of the acoustic vibrator, the second channel stores the vertical coordinate of the acoustic vibrator, and the third channel stores the acoustic force of the acoustic vibrator (value range 0-100). The acoustic force can set the mean value and standard deviation;
[0044] like Figure 3 As shown, step 3. Generate calcification focus lattice. Generating calcification focus lattice is divided into three steps:
[0045] The first step is to initialize several calcification cores, each with an intensity value, and obtain the tensor core_tensor. These cores are in a rectangle shadow_rect with a limited length and width. The position of each calcification core is random, and its intensity value is also random.
[0046] In the second step, according to formula 1, all points in the shadow_rect rectangle are traversed, the distances between these points and all calcification cores are calculated and the data are recorded in the tensor p_core_dis_tensor (formula 1), and these distances are bitwise multiplied with the intensity value tensor shadow_intense_tensor of the calcification core to obtain the tensor b_tensor (formula 2), and the first n points with the largest b value are taken, and the result is recorded in the tensor c_tensor;
[0047] The third step is to convert c_tensor into a normal distribution series tensor shadow_tensor with mean shadow_avg and standard deviation shadow_std according to formula 3.
[0048] Formula 1:
[0049] p_core_dis_tensor=sqrt((p_x-core_x) 2 +(p_y-core_y) 2) ;
[0050] Formula 2:
[0051] b_tensor=sum(p_core_dis_tensor*core_tensor[1], axis=0);
[0052] Note: core_tensor[1] refers to the channel of calcification intensity;
[0053] Formula 3:
[0054] shadow_tensor=(c_tensor-mean(c_tensor)) / std(c_tensor)×shadow_std+shadow_avg;
[0055] Note: mean() is used to calculate the mean, and std() is used to calculate the standard deviation;
[0056] Step 4. Generate sound shadow. Generate the sound shadow according to the two tensors ilu_tensor and shadow_tensor obtained in steps 2 and 3.
[0057] Step 1: Calculate and enumerate the straight lines between the acoustic vibrators and the image pixels;
[0058] Formula 4: Assuming that the straight line is represented by Ax+By+C=0, and two points (x1, y1) and (x2, y2) are known, the coefficients A, B, and C can be expressed as:
[0059] A=y2-y1, B=x1-x2, C=x2*y1-x1*y2;
[0060] x_ilu represents the horizontal coordinate of the acoustic vibrator, y_ilu represents the vertical coordinate of the acoustic vibrator, x_p represents the horizontal coordinate of any coordinate on the image, and x_p represents the vertical coordinate of any coordinate on the image. Now let x1=x_ilu, y1=y_ilu, x2=x_p, y2=y_p, substitute the values into the above formula, then A=y_p-y_ilu; B=x_ilu-x_p; C=x_p*y_ilu-x_ilu*y_p;
[0061] Step 2: Calculate the distance between the calcification point and the straight line;
[0062] Formula 5:
[0063] If the straight line is represented by Ax+By+C=0
[0064] The A, B, and C parameters of the line containing the point p_ilu(x_ilu,y_ilu) and the point p(x_p,y_p) are:
[0065] A=y_p-y_ilu
[0066] B=x_ilu-x_p
[0067] C=(x_p)×(y_ilu)-(x_ilu)×(y_p)
[0068] The distance between P_shadow(p_x,p_y) and the straight line (through point p_ilu and point p) is:
[0069] shadow_line_dis=|A×p_x+B×p_y+C| / sqrt(A^2+B^2);
[0070] The distance formula between a point (x, y) and a line (Ax+By+C=0) is:
[0071] |Ax+By+C| / sqrt(A^2+B^2);
[0072] As the calcification point (x, y) changes, the sqrt(A^2+B^2) part does not include x and y, so it remains unchanged. It can be calculated first.
[0073] The shape of the calculated tensor is still [number of acoustic shock particles, image height, image width];
[0074] Step 3: Calculate the distance between the acoustic vibrator and the pixel in the image, and calculate the attenuation effect of the sound beam based on the distance between the two; Figure 5 shown.
[0075] Assume the distance between the acoustic vibration point and the pixel point is ilu_p_dis,
[0076] Formula 6: Then ilu_p_dis = sqrt((x_ilu-x_p) 2 +(y_ilu-y_p)) 2 ;
[0077] Note: sqrt() is the square root function;
[0078] As the propagation distance increases, the sound intensity will decay. Let the distance attenuation coefficient be dim_rate.
[0079] After the distance ilu_p_dis, set the distance attenuation coefficient to dim_rate,
[0080] The brightness of the pixel when the acoustic vibration point is irradiated is updated as follows:
[0081] Formula 7: Ilu_ilu=ilu_ilu*Power(dim_rate,ilu_p_dis);
[0082] Add the effects of all acoustic vibrators to obtain the sound intensity at each point without the influence of calcification, and put the data into the tensor Ilu_ilu_sum;
[0083] Step 4: Calculate the impact of each calcification point on the sound intensity of each acoustic sub-pixel line; (see Figure 4 )
[0084] When the sound shock propagates to the location of the calcification, the difference in the propagation speed of the two media will cause the sound intensity to attenuate. The closer the sound beam is to the calcification point, the greater the intensity of the effect, and the farther the distance is, the smaller the effect. If the distance attenuation coefficient from the calcification to the straight line is shadow_range_dim;
[0085] Then the sound wave will be attenuated after passing through the calcification.
[0086] Formula 9: dim_rate_from_shadow=shadow_shadow[2]-shadow_range_dim×shadow_line_dis 2
[0087] Substituting the shadow_line_dis obtained from Formula 5 into Formula 9, we get Formula 10:
[0088] Then dim_rate_from_shadow=shadow_shadow[2]-((|(Ax+By+C)|) 2 ) / (A 2 +B 2 );
[0089] Use ilu_sum_point to save the expected sound intensity at each point without the influence of sound shadow.
[0090] Formula 11: ilu_sum_point=sum(ilu_ilu);
[0091] Use ilu_shadow_sum_point to save the sound intensity of each point under the influence of calcification;
[0092] Formula 12: ilu_shadow_sum_point=sum(ilu_ilu×dim_rate_from_shadow);
[0093] Step 5: Generate a mask and record it in the tensor Mask_shadow. When the original image and Mask_shadow_tensor are multiplied point by point, an augmented image containing sound and shadow can be obtained.
[0094] Mask_shadow_tensor=ilu_shadow_sum_point / ilu_sum_point;
[0095] Step 5. Generate a highlight point formed by the reflection of the calcification focus;
[0096] Multiply the reflectivity in the fourth channel of shadow_tensor by the attenuated sound intensity to get reflect_tensor.
[0097] Formula 13 reflect_tensor=shadow_tensor(3)×Ilu_ilu_sum;
[0098] Step 6: Overlay the sound shadow and reflection highlights on the original image.
[0099] Augmented image = img_tensor × Mask_shadow_tensor × reflect_tensor;
[0100] Step 7: Output the image.
[0101] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. An algorithm for simulating the acoustic shadow of calcification foci in ultrasound images. It is characterized in that The steps include: Step 1. Read the image and do preliminary processing; Read in the unprocessed ultrasound image, convert the image size into an image with a height of H pixels and a width of W pixels, and convert the data into a tensor, which is recorded as img_tensor. The shape of img_tensor is [C, H, W]. Here C represents the number of channels, which is 3. The first channel stores the horizontal coordinate of the point, the second channel stores the vertical coordinate of the point, and the third channel stores the grayscale value of the point, with a value range of 0-255. Step 2. Generate acoustic vibration sub-lattice; Define the position and intensity of the acoustic vibrator in the image according to the type of ultrasound probe, and simulate the acoustic vibrator array of the high-frequency plain scan probe and convex array probe; in the simulation, the acoustic vibrators of the high-frequency probe are all located at the top of the image, arranged by pixels, and described by a tensor of shape [number of acoustic vibrators, number of channels]; the number of channels is 3, the first channel stores the horizontal coordinate of the acoustic vibrator, the second channel stores the vertical coordinate of the acoustic vibrator, and the third channel stores the acoustic force of the acoustic vibrator, with a value range of 0-100; the acoustic force sets the average value and standard deviation; Step 3. Generate calcification focus array; Generating calcification foci is divided into three steps: The first step is to initialize several calcification cores, each core has an intensity value, and obtain the tensor core_tensor. These cores are in a rectangle shadow_rect with a limited length and width; The second step is to traverse all points in the shadow_rect rectangle and calculate the distance p_core_dis_tensor between these points and all calcification cores; multiply these distances with the intensity value shadow_intense_tensor of the calcification core to obtain the tensor b_tensor, and take the first n points of the b value and record them in the tensor c_tensor; The third step is to convert c_tensor into a normal distribution series tensor shadow_tensor with a mean of shadow_avg and a standard deviation of shadow_std; Step 4. Generate sound shadow; Generate sound shadow according to the two tensors ilu_tensor and shadow_tensor obtained in step 2 and step 3; Step 1: Calculate and enumerate the straight lines between the acoustic vibrators and the image pixels; Step 2: Calculate the distance between the calcification point and the straight line; Step 3: Calculate the distance between the acoustic vibrator and the pixel in the image, and calculate the attenuation effect of the sound beam based on the distance between the two; Step 4: Calculate the impact of each calcification point on the sound intensity of each acoustic sub-pixel line; Step 5: Generate a mask and record it in the tensor Mask_shadow; Step 5. Generate a highlight point formed by the reflection of the calcification focus; Step 6. Overlay the sound shadow and reflection highlights on the original image; Step 7. Export the image.
