A scale recognition method for ultrasonic images
The convolutional neural network automatically detects and identifies rulers and scales in ultrasound images, solving the problem of time-consuming and inaccurate ruler estimation in ultrasound diagnosis, achieving fast and accurate diagnosis, and is suitable for real-time ultrasound scanning and has wide applicability.
Patent Information
- Application Number
- CN202210293137.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-03-24
AI Technical Summary
In ultrasound clinical diagnosis, doctors estimate the ruler and lesion size in ultrasound images with the naked eye, which is time-consuming and has large errors, and there is a lack of efficient automated identification methods.
The convolutional neural network XDNetV2-D-Ruler and XDNetV2-D-Marker are used, combined with the feature pyramid network and classification and regression networks, to automatically detect and identify the ruler and unit scale in ultrasound images, and optimize feature extraction and recognition through relative position encoding.
It achieves fast and accurate ruler and scale detection, avoids manual operations, improves diagnostic efficiency, is suitable for real-time ultrasound scanning, and is not limited by the brand and model of the ultrasound machine, making it more versatile.
Smart Images

Figure CN114782319B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image processing, and in particular to a method for identifying a scale of an ultrasonic image. Background Art
[0002] When ultrasound clinicians read ultrasound images, the size of body tissues (such as organs, glands, etc.), the size of abnormal areas (such as nodules, masses, etc.), and the size of some lesions (such as calcification) are all the basis for doctors to make clinical diagnoses; however, doctors make judgments on these sizes by referring to the scale on the side of the ultrasound image and estimating them with the naked eye (or by gesturing with fingers on the screen). This method is time-consuming and laborious, and has large errors. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a method for identifying the scale of an ultrasonic image, which can effectively detect the scale of an ultrasonic image.
[0004] The technical solution adopted by the present invention to solve the technical problem is: to provide a method for identifying a scale of an ultrasonic image, comprising:
[0005] Obtain an ultrasound image with a ruler;
[0006] The ruler in the ultrasound image is detected by a first detection network; the first detection network includes a convolutional neural network XDNetV2-D-Ruler, a feature pyramid network, and two parallel classification networks and a regression network connected in sequence; the convolutional neural network XDNetV2-D-Ruler is used to extract features of the ultrasound image, the feature pyramid network is used to enhance and fuse the extracted features, the classification network is used to identify the ruler of the ultrasound image based on the enhanced and fused features, and the regression network is used to identify the ruler area of the ultrasound image.
[0007] The convolutional neural network XDNetV2-D-Ruler includes a first feature unit, a second feature unit, a third feature unit, a fourth feature unit, two fifth feature units and a sixth feature unit connected in sequence, wherein the first feature unit includes a seventh feature unit, two ninth feature units, an eighth feature unit, a ninth feature unit and an eighth feature unit connected in sequence; the second feature unit includes a fifth feature unit, a ninth feature unit, an eighth feature unit, a ninth feature unit and an eighth feature unit connected in sequence; the third feature unit includes a fifth feature unit, a ninth feature unit, an eighth feature unit and a ninth feature unit connected in sequence; the fourth feature unit includes a fifth feature unit, a ninth feature unit and an eighth feature unit connected in sequence.
[0008] The seventh feature unit includes a depth-separable convolutional layer, a batch normalization layer, an activation layer, a convolutional layer and an activation layer connected in sequence;
[0009] The ninth feature unit includes a layer normalization layer, an attention module, and an addition layer connected in sequence, and an input of the layer normalization layer in the ninth feature unit is connected to the addition layer in the ninth feature unit;
[0010] The eighth feature unit includes an activation layer, a batch normalization layer, a depth-wise separable convolution layer, an activation layer, a batch normalization layer, a depth-wise separable convolution layer, and an addition layer connected in sequence, and the input of the activation layer in the eighth feature unit is connected to the addition layer in the eighth feature unit.
[0011] The fifth feature unit includes a convolutional layer, an activation layer, a layer normalization layer, an attention module and an addition layer connected in sequence, and an input of the layer normalization layer in the fifth feature unit is connected to the addition layer in the fifth feature unit;
[0012] The sixth feature unit includes a convolutional layer, a batch normalization layer and an activation layer connected in sequence.
[0013] The attention module includes a relative position encoding layer and three depth-wise separable convolutional layers, wherein the second depth-wise separable convolutional layer is dot-multiplied with the third depth-wise separable convolutional layer to obtain a first dot-multiplication result, the third depth-wise separable convolutional layer is dot-multiplied with the relative position encoding layer to obtain a second dot-multiplication result, the first dot-multiplication result and the second dot-multiplication result are added and connected to the attention activation layer, and the output of the activation layer is dot-multiplied with the first depth-wise separable convolutional layer and connected to the reshaping layer.
[0014] It also includes: detecting the unit scale on the ruler through a second detection network; the second detection network includes a convolutional neural network XDNetV2-D-Marker, a feature pyramid network, and two parallel classification networks and a regression network connected in sequence; the convolutional neural network XDNetV2-D-Marker is used to extract features of ultrasound images, the feature pyramid network is used to enhance and fuse the extracted features, the classification network is used to identify the unit scale on the ruler according to the enhanced and fused features, and the regression network is used to identify the unit scale.
[0015] The convolutional neural network XDNetV2-D-Marker includes a tenth feature unit, a third feature unit, a second feature unit, a third feature unit and three fifth feature units connected in sequence.
[0016] The method further includes: calculating the number of pixels between the unit scales to obtain a corresponding relationship between the unit scales and the number of pixels, and determining the size of each tissue in the ultrasound image according to the corresponding relationship between the unit scales and the number of pixels.
[0017] Beneficial Effects
[0018] Due to the adoption of the above technical solution, the present invention has the following advantages and positive effects compared with the prior art: the development of the convolutional neural network XDNetV2-D-Ruler network and XDNetV2-D-Marker network constructed by the present invention belongs to small sample training, and the lightweight network can effectively avoid the overfitting problem of small sample training and improve the generalization ability; the size of the ruler is usually very small relative to the entire ultrasound image, and it is a slender structure with a very extreme aspect ratio. The XDNetV2-D-Ruler network optimizes the extraction of low-dimensional features and strengthens the detection of small targets. At the same time, the features of the ruler are composed of a The scale is composed of a series of scales, and the relative position encoding in the attention module can grasp this obvious continuous position relationship and help identify the ruler; the size of the scale is medium to small compared to the ruler, but the millimeter-level scale is the biggest interference, so the XDNetV2-D-Marker network optimizes the extraction of medium to low-dimensional features and strengthens the detection of small and medium-sized targets; the present invention can automatically detect the ruler and identify the scale through the target detection network, without the need for additional manual operation, saving time and effort, and is fast and convenient to use, and ensures accurate results; the present invention can meet the needs of real-time ultrasonic scanning, is not limited by the brand and model of the ultrasound machine, and is more versatile. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a method flow chart of an embodiment of the present invention;
[0020] Figure 2 It is a schematic diagram of the structure of the convolutional neural network XDNetV2-D-Ruler according to an embodiment of the present invention;
[0021] Figure 3 It is a schematic diagram of the structure of the convolutional neural network XDNetV2-D-Marker according to an embodiment of the present invention;
[0022] Figure 4 is a schematic diagram of the attention module structure of an embodiment of the present invention;
[0023] Figure 5 is a target detection network processing flow chart of an embodiment of the present invention;
[0024] Figure 6 It is a schematic diagram of actual detection results of an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the appended claims of the application equally.
[0026] An embodiment of the present invention relates to a method for identifying a scale of an ultrasound image, comprising:
[0027] Acquiring ultrasound images;
[0028] The ruler in the ultrasound image is detected by a first detection network; the first detection network includes a convolutional neural network XDNetV2-D-Ruler, a feature pyramid network, and two parallel classification networks and regression networks connected in sequence, see Figure 5 The convolutional neural network XDNetV2-D-Ruler is used to extract features of ultrasound images, the feature pyramid network is used to enhance and fuse the extracted features, the classification network is used to identify the scale of the ultrasound image based on the enhanced and fused features, and the regression network is used to identify the scale area of the ultrasound image;
[0029] The unit scale on the ruler is detected by a second detection network; the second detection network includes a convolutional neural network XDNetV2-D-Marker, a feature pyramid network, and two parallel classification networks and regression networks connected in sequence, see Figure 5 The convolutional neural network XDNetV2-D-Marker is used to extract the features of ultrasound images, the feature pyramid network is used to enhance and fuse the extracted features, the classification network is used to identify the unit scale on the ruler according to the enhanced and fused features, and the regression network is used to identify the unit scale.
[0030] The number of pixels between the unit scales is calculated to obtain a corresponding relationship between the unit scales and the number of pixels, and the size of each tissue in the ultrasound image is determined according to the corresponding relationship between the unit scales and the number of pixels.
[0031] The following is a detailed introduction to this implementation method:
[0032] This implementation is mainly composed of two target detection networks connected in series.
[0033] 1. Training data composition
[0034] 1.1. First detection network training data
[0035] Tens of thousands of ultrasound images were manually annotated with the ruler area in the image in the early stage, including the coordinates of the vertices of the circumscribed rectangle and the corresponding classification. In this embodiment, there is only one classification, namely "ruler".
[0036] The training data of the first detection network consists of two parts: ultrasound image data and scale annotation data.
[0037] 1.2. Second detection network training data
[0038] According to the ruler area coordinates in 1.1, the ruler image is extracted, and the centimeter-level scale in the image is manually annotated, including the coordinates of the vertices of the circumscribed rectangle and the corresponding classification. In this embodiment, there is only one classification, namely "scale".
[0039] The training data of the second detection level network consists of two parts: ruler image data and scale annotation data.
[0040] 2. Data Preprocessing
[0041] All images are resized to (512, 512, 3) when input, where 3 represents the number of channels, i.e. the data is a color image; they are then normalized.
[0042] 3. Data Augmentation
[0043] Enhance the data to improve the robustness of the algorithm.
[0044] The data augmentation used includes: random width shift, random height shift, random brightness shift, random channel shift, random width flip, and random height flip.
[0045] 4. Backbone network structure (Network Architecture)
[0046] The backbone network of the target detection model in this embodiment is the convolutional neural network XDNetV2-D-Ruler and XDNetV2-D-Marker, which are respectively used for detecting rulers and identifying scales. Both networks are a kind of semi-self-attention convolutional neural network (CNN), see Figure 2 and Figure 3 .
[0047] Furthermore, the local structures used by the convolutional neural networks XDNetV2-D-Ruler and XDNetV2-D-Marker include:
[0048] A) Convolution layer;
[0049] B) Depth-wise separable convolution layer;
[0050] C) Batch normalization layer: normalizes individual neurons between a batch of training data;
[0051] D) Layer normalization layer: normalizes all neurons in a layer using a single training data.
[0052] E) Activation layer (swish and softmax);
[0053] Swish function formula:
[0054]
[0055] Softmax function formula:
[0056]
[0057] Among them, e is a natural constant; x i Represents the i-th element of the input.
[0058] F) Relative Position Embedding: The ordinary convolution layer extracts the image features of pixel intensity (i.e. color) and edge contours; the attention module uses relative position encoding to obtain the relative position relationship between pixels, thereby extracting features such as shape structure;
[0059] G) add;
[0060] H) dot product;
[0061] I) Reshape layer.
[0062] Furthermore, by splicing the above-mentioned local structures, a convolutional neural network XDNetV2-D-Ruler can be obtained, which specifically includes a first feature unit, a second feature unit, a third feature unit, a fourth feature unit, two fifth feature units and a sixth feature unit connected in sequence, wherein the first feature unit includes a seventh feature unit, two ninth feature units, an eighth feature unit, a ninth feature unit and an eighth feature unit connected in sequence; the second feature unit includes a fifth feature unit, a ninth feature unit, an eighth feature unit, a ninth feature unit and an eighth feature unit connected in sequence; the third feature unit includes a fifth feature unit, a ninth feature unit, an eighth feature unit and a ninth feature unit connected in sequence; the fourth feature unit includes a fifth feature unit, a ninth feature unit and an eighth feature unit connected in sequence. The "convolution layer (step size is 2)" in the first, second, third, fourth, fifth, and sixth feature units is a sign of downsampling. There is only one per column, and each downsampling represents a significant increase in the data dimension. Therefore, from the XDNetV2-D-Ruler network structure, we can see that the more we go to the left and up, that is, the closer to the input end, the lower the data dimension; the more we go to the right and down, that is, the closer to the output end, the higher the data dimension. Therefore, the longer the columns corresponding to the first, second, third, fourth, fifth, and sixth feature units are, the more attention modules and convolution operations there are, the stronger the ability to extract features, and the more features are extracted for this dimension.
[0063] The seventh feature unit includes a depth-separable convolutional layer, a batch normalization layer, an activation layer (swish), a convolutional layer and an activation layer (swish) connected in sequence;
[0064] The ninth feature unit includes a layer normalization layer, an attention module, and an addition layer connected in sequence, and an input of the layer normalization layer in the ninth feature unit is connected to the addition layer in the ninth feature unit;
[0065] The eighth feature unit includes an activation layer (swish), a batch normalization layer, a depth-wise separable convolution layer, an activation layer (swish), a batch normalization layer, a depth-wise separable convolution layer and an addition layer connected in sequence, and the input of the activation layer (swish) in the eighth feature unit is connected to the addition layer in the eighth feature unit.
[0066] The fifth feature unit includes a convolutional layer, an activation layer (swish), a layer normalization layer, an attention module and an addition layer connected in sequence, and an input of the layer normalization layer in the fifth feature unit is connected to the addition layer in the fifth feature unit;
[0067] The sixth feature unit includes a convolutional layer, a batch normalization layer and an activation layer (swish) connected in sequence.
[0068] The attention module includes a relative position encoding layer and three depth-wise separable convolutional layers, wherein the second depth-wise separable convolutional layer is dot-multiplied with the third depth-wise separable convolutional layer to obtain a first dot-multiplication result, the third depth-wise separable convolutional layer is dot-multiplied with the relative position encoding layer to obtain a second dot-multiplication result, the first dot-multiplication result and the second dot-multiplication result are added and connected to the attention activation layer (softmax), and the output of the activation layer is dot-multiplied with the first depth-wise separable convolutional layer and then connected to the reshaping layer.
[0069] Furthermore, the convolutional neural network XDNetV2-D-Marker includes a tenth feature unit, a third feature unit, a second feature unit, a third feature unit and three fifth feature units connected in sequence.
[0070] This embodiment uses the self-attention mechanism in the transformer to construct an attention module suitable for ultrasound images. Figure 4 ; Combined with the full pre-activation skip connection in ResNet, feature enhancement is achieved and the network is given random depth; and depthwise separable convolution is applied to significantly reduce the number of parameters and computational complexity.
[0071] 5. Object detection model structure
[0072] The target detection model of the present invention is a one-stage type, see Figure 5 :The input is processed by the backbone network and then input into the Feature Pyramid Network (FPN). The function of FPN is feature enhancement and fusion. Then, it undergoes classification analysis and regression analysis to obtain the classification output and the corresponding bounding box output.
[0073] 6. Loss Function
[0074] Corresponding to regression analysis and classification analysis, the loss functions are Smooth-L1 and Focal Loss respectively.
[0075] Smooth-L1 formula:
[0076]
[0077] Among them, L1Smooth represents the prediction loss, r represents the actual value, Represents the predicted value.
[0078] Focal Loss formula:
[0079] FL(p t )=-(1-p t ) γ log(p t )
[0080] in:
[0081]
[0082] Among them, FL is the prediction loss, p t Represents the probability of the model predicting the class, y t represents the actual value (i.e., whether it is actually class t, 1 represents "yes" and 0 represents "no"), Represents the predicted value, γ is a constant, which is 2 here.
[0083] 7. Development and application process
[0084] The labeled data (including box selection coordinates and classification) is preprocessed and enhanced, and then input into and trained into the neural network model to learn image features. When applied, the software will preprocess the image imported by the user, and then calculate it through the neural network model to obtain the predicted border and corresponding classification results, and obtain the final result after non-maximum suppression (NMS).
[0085] If the results are visualized, Figure 6 As shown, Figure 6 The long bar on the right side is the "ruler". The distance between the small rectangular areas in the "ruler" is the unit scale. The calculation result (that is, how many pixels on the ultrasound image correspond to one centimeter) will be used to help clinicians quickly and accurately measure the size of objects in the ultrasound image.
[0086] It is not difficult to find that the network of the present invention (XDNetV2-D-Ruler and XDNetV2-D-Marker) mainly uses attention modules and jump connections for adaptive network depth, and uses a large number of depth-separable convolutions to reduce the amount of calculation parameters, which is a very lightweight network structure. The lightweight network has two major advantages in the present invention: 1: Because the amount of calculation is small, the network runs fast; 2: The ultrasonic image of the cervical lymph nodes is medical data, which is not only difficult to collect, but also has ethical and privacy issues. Therefore, the development of the XDNetV2-D-Ruler and XDNetV2-D-Marker networks belongs to small sample training. The lightweight network can effectively avoid the overfitting problem of small sample training and improve the generalization ability. Usually, the size of the ruler is very small relative to the entire ultrasound image, and it is a slender structure with a very extreme aspect ratio. The XDNetV2-D-Ruler network optimizes the extraction of low-dimensional features and strengthens the detection of small targets. At the same time, the features of the ruler are composed of a series of scales. The relative position encoding in the attention module can grasp this obvious continuous position relationship and help identify the ruler; the size of the scale is medium to small relative to the ruler, but the millimeter-level scale is the biggest interference, so the XDNetV2-D-Marker network optimizes the extraction of medium to low-dimensional features and strengthens the detection of small and medium-sized targets. Therefore, compared with other network structures, it has the advantages of fast speed and high accuracy.
[0087] The foregoing description of specific exemplary embodiments of the present invention is for the purpose of illustration and demonstration. These descriptions are not intended to limit the present invention to the precise form disclosed, and it is clear that many changes and variations can be made based on the above teachings. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the present invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the present invention and various different selections and changes. The scope of the present invention is intended to be limited by the claims and their equivalents.
Claims
1. A method for identifying a scale of an ultrasound image, It is characterized in that include: Acquiring ultrasound images; Detecting the ruler in the ultrasound image through a first detection network; the first detection network includes a convolutional neural network XDNetV2-D-Ruler, a feature pyramid network, and two parallel classification networks and regression networks connected in sequence; The unit scale on the ruler is detected by a second detection network; the second detection network includes a convolutional neural network XDNetV2-D-Marker, a feature pyramid network, and two parallel classification networks and regression networks connected in sequence; wherein, The convolutional neural network XDNetV2-D-Ruler is used to extract features of ultrasound images, the feature pyramid network is used to enhance and fuse the extracted features, the classification network is used to identify the scale of the ultrasound image based on the enhanced and fused features, and the regression network is used to identify the scale area of the ultrasound image; The convolutional neural network XDNetV2-D-Ruler includes a first feature unit, a second feature unit, a third feature unit, a fourth feature unit, two fifth feature units and a sixth feature unit connected in sequence, wherein the first feature unit includes a seventh feature unit, two ninth feature units, an eighth feature unit, a ninth feature unit and an eighth feature unit connected in sequence; the second feature unit includes a fifth feature unit, a ninth feature unit, an eighth feature unit, a ninth feature unit and an eighth feature unit connected in sequence; the third feature unit includes a fifth feature unit, a ninth feature unit, an eighth feature unit and a ninth feature unit connected in sequence; the fourth feature unit includes a fifth feature unit, a ninth feature unit and an eighth feature unit connected in sequence; The seventh feature unit includes a depth-separable convolutional layer, a batch normalization layer, an activation layer, a convolutional layer and an activation layer connected in sequence; The ninth feature unit includes a layer normalization layer, an attention module, and an addition layer connected in sequence, and an input of the layer normalization layer in the ninth feature unit is connected to the addition layer in the ninth feature unit; The eighth feature unit includes an activation layer, a batch normalization layer, a depthwise separable convolution layer, an activation layer, a batch normalization layer, a depthwise separable convolution layer, and an addition layer connected in sequence, and an input of the activation layer in the eighth feature unit is connected to the addition layer in the eighth feature unit; The fifth feature unit includes a convolutional layer, an activation layer, a layer normalization layer, an attention module and an addition layer connected in sequence, and an input of the layer normalization layer in the fifth feature unit is connected to the addition layer in the fifth feature unit; The sixth feature unit includes a convolutional layer, a batch normalization layer and an activation layer connected in sequence; The convolutional neural network XDNetV2-D-Marker is used to extract features of ultrasound images, the feature pyramid network is used to enhance and fuse the extracted features, the classification network is used to identify the unit scale on the ruler according to the enhanced and fused features, and the regression network is used to identify the unit scale; The convolutional neural network XDNetV2-D-Marker includes a tenth feature unit, a third feature unit, a second feature unit, a third feature unit and three fifth feature units connected in sequence; The tenth characteristic unit includes the seventh characteristic unit, two ninth characteristic units and the eighth characteristic unit connected in sequence.
2. The method for identifying a scale for an ultrasound image according to claim 1, It is characterized in that The attention module includes a relative position encoding layer and three depth-wise separable convolutional layers, wherein the second depth-wise separable convolutional layer is dot-multiplied with the third depth-wise separable convolutional layer to obtain a first dot-multiplication result, the third depth-wise separable convolutional layer is dot-multiplied with the relative position encoding layer to obtain a second dot-multiplication result, the first dot-multiplication result and the second dot-multiplication result are added and connected to the attention activation layer, and the output of the activation layer is dot-multiplied with the first depth-wise separable convolutional layer and connected to the reshaping layer.
3. The method for identifying a scale for an ultrasound image according to claim 1, It is characterized in that Also includes: The number of pixels between the unit scales is calculated to obtain a corresponding relationship between the unit scales and the number of pixels, and the size of each tissue in the ultrasound image is determined according to the corresponding relationship between the unit scales and the number of pixels.
Citation Information
Patent Citations
A method for recognizing and estimating water level of hydrological ruler based on image analysis
CN109522889A
Marker identification method based on visual detection of tower drum shaking
CN113033522A
Target detection device and method combining global and local features, and storage medium
CN113554125A
Target detection method and moving target tracking method using same
CN114092820A
Small target detection method based on attention mechanism
CN114202672A
