Sensors: Breast Mass Detection in Mammography Based On Image Template Matching and CNN
Sensors: Breast Mass Detection in Mammography Based On Image Template Matching and CNN
Sensors: Breast Mass Detection in Mammography Based On Image Template Matching and CNN
Article
Breast Mass Detection in Mammography Based on Image
Template Matching and CNN
Lilei Sun 1 , Huijie Sun 2 , Junqian Wang 3 , Shuai Wu 3 , Yong Zhao 4 and Yong Xu 3,5, *
1 College of Computer Science and Technology, Guizhou University, Guiyang 550025, China;
[email protected]
2 College of Computer Information and Engineering, Nanchang Institute of Technology,
Nanchang 330044, China; [email protected]
3 College of Computer Science and Technology, Harbin Institute of Technology (Shenzhen),
Shenzhen 518055, China; [email protected] (J.W.); [email protected] (S.W.)
4 School of Electronic and Computer Engineering, Shenzhen Graduate School of Peking University,
Shenzhen 518055, China; [email protected]
5 Shenzhen Key Laboratory of Visual Object Detection and Recognition, Harbin Institute of Technology
(Shenzhen), Shenzhen 518055, China
* Correspondence: [email protected]
Abstract: In recent years, computer vision technology has been widely used in the field of medical
image processing. However, there is still a big gap between the existing breast mass detection
methods and the real-world application due to the limited detection accuracy. It is known that
humans locate the regions of interest quickly and further identify whether these regions are the
targets we found. In breast cancer diagnosis, we locate all the potential regions of breast mass by
glancing at the mammographic image from top to bottom and from left to right, then further identify
whether these regions are a breast mass. Inspired by the process of human detection of breast mass, we
proposed a novel breast mass detection method to detect breast mass on a mammographic image by
Citation: Sun, L.; Sun, H.; Wang, J.; stimulating the process of human detection. The proposed method preprocesses the mammographic
Wu, S.; Zhao, Y.; Xu, Y. Breast Mass image via the mathematical morphology method and locates the suspected regions of breast mass by
Detection in Mammography Based on the image template matching method. Then, it obtains the regions of breast mass by classifying these
Image Template Matching and CNN.
suspected regions into breast mass and background categories using a convolutional neural network
Sensors 2021, 21, 2855. https://
(CNN). The bounding box of breast mass obtained by the mathematical morphology method and
doi.org/10.3390/s21082855
image template matching method are roughly due to the mathematical morphology method, which
transforms all of the brighter regions into approximate circular areas. For regression of a breast
Academic Editor: Dan Istrate
mass bounding box, the optimal solution should be searched in the feasible region and the Particle
Received: 26 March 2021 Swarm Optimization (PSO) is suitable for solving the problem of searching the optimal solution
Accepted: 15 April 2021 within a certain range. Therefore, we refine the bounding box of breast mass by the PSO algorithm.
Published: 18 April 2021 The proposed breast mass detection method and the compared detection methods were evaluated
on the open database Digital Database for Screening Mammography (DDSM). The experimental
Publisher’s Note: MDPI stays neutral results demonstrate that the proposed method is superior to all of the compared detection methods
with regard to jurisdictional claims in in detection performance.
published maps and institutional affil-
iations. Keywords: medical image processing; mammographic image; deep learning; breast mass detection
breast mass characteristics and the fact it is low-cost. With the development of machine
learning technology [3,4], using a computer to automatically diagnose breast cancer can
improve diagnosis accuracy and save valuable medical resources.
The diagnosis of breast cancer on mammography contains two stages: breast mass
detection and classification. The first stage is used to find the locations of all the suspected
regions of breast masses in a mammographic image [5], and the second stage is used
further to classify these suspected regions into breast mass and background categories.
Breast mass detection plays a crucial role in diagnosis, the accuracy of breast mass de-
tection greatly affects the performance of breast cancer diagnosis. Figure 1 shows two
molybdenum target mammograms. The regions in the blue rectangles are breast masses.
However, it is challenging work to detect breast masses in a mammographic image due
to the blurry edge and complex texture of breast mass, etc. Kerhet et al. [6] converted the
breast mass detection problem into a classification problem. They converted microwave
breast sensing into probability mapping which illustrates a posteriori probability of tumor
presence by the support vector machine (SVM) classification method, then located the
breast mass according to the probability mapping. Kom et al. [7] enhanced mammo-
graphic images by a linear transformation filter, then segmented the breast mass in the
enhanced image by a local adaptive threshold method. Xu et al. [8] segmented the breast
mass by the improved method based on dynamic programming. The improved method
generates the optimal weights of the cost components that are optimized by PSO [9].
Kuo et al. [10] enhanced the signal of the suspected regions of breast mass in the mam-
mographic image in the time domain, then identified and located the breast mass by
PSO. To enhance the regions of breast mass, StojiC et al. [11] enhanced the details on the
mammographic image using the mathematical morphology method. Amutha et al. [12]
enhanced the contrast of mammography using mathematical morphology. The region
of breast mass always looks brighter than the neighboring regions due to the density of
the breast mass region being higher than that of the surrounding tissues. Liu et al. [13]
detected the breast mass using the image template matching method with a bright circular
image template. The mathematical morphology method can highlight the region of interest
in the image and guides people to focus on these regions, which are the objects we want
to find with a high probability in the object detection task. Then, matching these regions
using the image template matching method and identifying whether they are breast mass
by a classifier. The process is similar to that of the physicians and radiologists glancing at
the whole mammographic image to find the suspected regions of breast mass.
In recent years, machine learning technology, especially deep learning technology has
been widely used in the field of computer vision [14], such as image object detection and
image classification [15–18]. Compared with the conventional shallow learning methods
or human-based feature extraction methods, CNN-based deep learning can adaptively
extract the most discriminative features from the input images for different tasks and many
reported experimental results have also demonstrated the superiority of deep learning in
object detection and image classification tasks. In the field of object detection, CNN boasts
many achievements. R-CNN [19] generates 2000 proposal regions by Selective Search [20]
and normalizes these regions to a uniform size, then extracts the features from these regions
via a CNN, and classifies these extracted features by an SVM and regresses the bounding
box of the object by a feedforward network. Almasni et al. [21] detected and classified
the breast mass by YOLO [22] on the mammographic image dataset Digital Database for
Screening Mammography (DDSM) [23], the YOLO-based approach can detect and classify
the breast mass simultaneously in one network. Kooi et al. [24] compared the detection
performance of a CNN-based CAD system and the traditional CAD system which using
hand-crafted image features on a large data set of around 45,000 images. The experimental
results demonstrate that the CNN-based CAD system outperforms the traditional CAD
system, and the CNN-based CAD shows a similar performance to that of the radiologists.
To improve the diagnosis performance, Wu et al. [25] proposed a hybrid model which uses
a two-stage architecture to diagnose breast cancer. The proposed method generates two
Sensors 2021, 21, 2855 3 of 16
heatmaps from each image by a sliding window as additional input views to a multi-view
CNN-based classifier to improve the classification performance. The authors compared the
performance of the proposed image-and-heatmaps ensemble method to humans with 12
attending radiologists, a resident and a medical student. The experimental results show
that the proposed method is as accurate as the experienced radiologists on the same dataset.
(a) (b)
Figure 1. Molybdenum target mammograms. The regions of blue rectangles in (a,b) are breast masses.
Although there are many approaches to accomplish the detection task for mammog-
raphy breast mass, the following problems still exist: First, there is no method is used to
detect breast mass by simulating the human’s visual characteristics for object detection.
The detection performance of breast mass can be improved significantly by simulating
the human vision mechanism. Second, it is difficult to detect breast mass due to blurry
borders, complex textures and the overlap of many kinds of human tissues in the mammo-
graphic image.
To solve the above problems, we propose a novel breast mass detection method in a
mammographic image. Compared with the existing breast mass detection methods, the
proposed method has the following advantages:
(1) For the blurry edge and complex texture of the breast mass, we highlight the
suspected regions of breast mass and suppress the background by the eroding and dilating
operations designed specifically for breast mass detection in this paper. We locate the
suspected regions of breast mass in the processed mammographic image using the image
template matching method. These matched regions will be further identified as breast
mass or background by the following works.
(2) The suspected regions of breast mass cropped from the mammographic image are
classified as breast mass or background by BD-CNN. We realized the detection task for
breast mass and obtain a better detection performance in the mammographic image via
the mathematical morphology method, image template matching method and a classifica-
tion network.
(3) For the rough bounding box of the breast mass obtained from the mammographic
image via the mathematical morphology and image template matching methods, we
refined the bounding box of breast mass using PSO.
The processing flow chart of the breast mass detection for a mammographic image
proposed in this paper is shown in Figure 2.
Sensors 2021, 21, 2855 4 of 16
BD-CNN
Figure 2. Flow chart of the breast mass detection method for the mammographic image. Where
(a) is the mammographic image, (b) shows the matched regions on the processed mammographic
image, (c) shows the suspected regions of breast mass generated using the mathematical morphology
and image template matching methods on (a). (d) shows the process of breast mass identified using
BD-CNN. The red rectangles in (e,f) are the regions of breast mass generated by the previous works.
The blue rectangle in (f) is the refined bounding box of a breast mass using PSO.
2. Related Work
Over the past years, various image processing approaches have been proposed to
improve the performance of image detection and classification. In this section, we introduce
several image processing methods related to the method proposed in this paper. These
methods are divided into two types: the mathematical morphology method and image
template matching method.
The mathematical morphology method is used to process the mammographic image,
which is beneficial to easily and effectively highlight the suspected regions of breast
mass. There are several benefits of using the mathematical morphology method in a
mammographic image: the noise can be removed, the suspected regions of breast mass
can be highlighted and normalized to a circle shape, which is beneficial to improve the
performance of the breast mass detection method. Eltonsy et al. [26] found that the regions
of the breast mass are brightest in these concentric layers, they contain more potential
information for the breast mass and the probability that the bright area is a breast mass
is very high. They proposed a detection method based on a morphological model with
concentric circles to detect the breast mass in the mammographic image. Because the
gray-level values of the image pixels in each concentric layer are very similar, they realized
breast mass detection by extracting different concentric regions using a predetermined
threshold. To remove radiopaque artifacts, such as label text in the mammographic image,
Nagi et al. [27] transformed the mammographic image with grayscale into a binary
[0, 1] using a global threshold with a value of T = 18. Then, obtaining the whole area
of the breast by removing the isolated pixels and small objects such as labels text in the
Sensors 2021, 21, 2855 5 of 16
image with the binary format by a morphological operation. Ciecholewski et al. [28]
proposed a segmentation method for the mammographic image. The proposed method
is composed of two parts. In the first part, it reduces the noise and improves the contrast
of the mammographic image via the mathematical morphological method. In the second
part, it extracts microcalcification shapes in the processed mammographic image using
watershed segmentation.
The image template matching method is used to find the most similar regions in the
image to the template image. Tourassi et al. [29] built a databank for mammography
ROI by the ground truth of breast mass from DDSM. The mutual information [30] is used
as the similarity of the image template matching method. The similarities between the
suspected region and all ROIs in the databank are calculated and rank-ordered and the
detection result is obtained based on the best matches. Divyashree et al. [31] divided the
breast mass detection task into several stages. They highlighted all the suspected regions
of breast mass using the mathematical morphological method and enhanced these regions
via the contrast limited adaptive histogram equalization (CLAHE) method [32]. Then, they
detected the breast mass using a maximally stable external regions (MSER) [33] detector.
Lbachir et al. [34] segmented the regions of breast mass using the OST method [35]. Since
these regions of breast mass segmented by OST are rough, they fine-turn the regions by the
K-Means methods.
between the image template and these patches. The Euclidean distance between the image
template and an image patch can be formulated as
M N
D (i, j) = ∑ ∑ [ P(m, n) − T (m, n)]2 , (1)
m =1 n =1
where D (i, j) is the Euclidean distance between the image template and the image patch
whose center of gravity is located at (i, j). M and N are the width and height of the image
template, respectively. The width and height of the image template are 68 pixels and
60 pixels, respectively. P(m, n) and T (m, n) are the pixel values of the image template and
an image patch whose center of gravity is located at (m, n), respectively.
To generate a better breast mass template image, we processed a mammographic
image which contains a typically breast mass by the mathematical morphology method,
then cropped and saved the mass region in the processed mammographic image as the
breast mass template image. As shown in Figure 3, typical pixel values are 117, 116 and 104
in (b) are the pixel value in the breast mass template image. The designed image template
presents a circle, the pixel values in the central region are 117, and the pixels are decreasing
toward the edge and the outermost pixels are 104.
104 104 104 104 104 104 104 104 104 104 104
104 106 106 106 106 106 106 106 106 106 104
… … … … … …
105 106 116 117 117 117 117 117 116 106 105
106 107 116 117 117 117 117 117 116 107 106
106 107 … 117 117 … 117 117 117 … 117 117 … 107 106
106 107 116 117 117 117 117 117 116 107 106
105 106 116 117 117 117 117 117 116 106 105
… … … … … …
104 106 106 106 106 106 106 106 106 106 104
104 104 104 104 104 104 104 104 104 104 104
(a) (b)
Figure 3. The circular image template of breast mass for image template matching method. Where
(a) is the template image used to match the suspected regions of breast mass in the processed image.
The pixel values of the template image of breast mass are shown in (b).
Convolutional Layer
Max Pooling Layer
Batch Normalization
Flatten Layer
Fully connected Layer
Classification Layer
Classification Block
BD-CNN contains an input, output, three convolutional blocks (CB), a flatting layer, a
fully connected layer and a classification layer. Each CB contains a convolutional layer, a
max-pooling layer, a Batch Normalization (BN) [36] and ReLU activation function. There
are 128 convolutional kernels in each CB, and the size of convolutional kernels used in
CB1, CB2 and CB3 are 5 × 5, 3 × 3 and 3 × 3, respectively. BD-CNN receives the image
of the suspected breast mass region, which is resized to 200 × 200 pixels from the input
and generates the feature maps by three CBs. Then, these feature maps are flattened by a
flatting layer and the discriminant features are further extracted by a fully connected layer
containing 1024 nodes. Finally, the output of the fully connected layer is classified into
breast mass and background categories by a classification layer with softmax.
3.4. Regression Model for the Location and Bounding Box of Breast Mass
The suspected regions of breast mass generated by the mathematical morphology and
the image template matching methods means that the bounding box of breast mass are
rough. To solve the problem of the rough bounding box of breast mass in the mammo-
graphic image, the PSO algorithm is used to search a location and bounding box better
to match the ground truth of the breast mass because it can exploit the potential solution
by a global random research mechanism. The flow chart of breast mass bounding box
regression conducted using PSO is shown in Figure 5. The rough bounding box of breast
mass from the mammographic image is used as the initialization of the regression model.
The BD-CNN is used as the fitness function of PSO to predict the probability that the region
is a breast mass, and the region is optimized by the PSO based on the probability. PSO
Encoding encodes the bounding box of breast mass on the mammographic image into a
particle feature, i.e., the center coordinate x and y, width and height. PSO Decoding trans-
forms the particle feature into the bounding box of a breast mass on the mammographic
image. Steps 2 to 5 are the iterative optimization processes for the regression of the breast
mass bounding box in the mammographic image.
5. PSO Decoding
3. PSO Encoding
Figure 5. Flow chart of breast mass bounding box regression using PSO.
The position of the i-th particle is defined as Xi = xip , yip , wip , hip , the velocity of
the i-th particle is defined as Vi = xvi , yiv , wiv , hiv . xip and yip are the center of the i-th
potential breast mass, wi and hi are the width and height of the i-th potential breast mass,
respectively. xvi and yiv are center of the velocity of the i-th particle, wiv and hiv are the
width and height of the velocity of the i-th particle, respectively. Each particle calculates
the fitness by the corresponding object function. In our work, the fitness is generated by
BD-CNN. In addition, every particle knows its best fitness pbest at present. pbesti can
be regarded as the search experience of the i-th particle. Every particle knows the best
global fitness gbest found by all of the particles in the entire population so far. gbest can be
regarded as the best research experience of the peers. The initial value of pbesti is set as
the position of the i-th particle. The initial value of gbest is the maximum pbest of all the
Sensors 2021, 21, 2855 8 of 16
particles. The next motion of a particle is determined by its experience and the experiences
of all of the peers, the motion can be formulated as
xi = xi−1 + Vi , (3)
where rand() is used to generate a random number between (0, 1). c p and c g are the weights
of the search experience of the i-th particle and all the particles, respectively. The values
of c p and c g are set to 0.5 in this paper. The bounding box of the breast mass refinement
algorithm based on PSO as shown Algorithm 1.
4. Experiments
We evaluate the proposed breast mass detection method for the mammographic image
on DDSM. In this section, we first describe the DDSM mammographic image dataset and
experimental setting. Then, we analyze the experimental results of the proposed method
and the state-of-the-art breast mass detection methods for the mammographic image
on DDSM in detail. Finally, the result of the bounding box regression of breast mass is
illustrated using PSO.
in the subset into training and test datasets. The training and test datasets contain 70%
and 30% of the samples, respectively. There are 307 mammographic images in the training
dataset and 132 mammographic images in the test dataset. An unbiased estimate of the
performance of the method proposed in this paper was obtained through the use of 5-
fold cross-validation. The averages of five folds are used to evaluate the performance of
these methods.
All of the mammographic images in the training and test datasets are resized to
1500 × 2000 pixels. All of the training samples of suspected breast mass are resized to
200 × 200 pixels. The weights of BD-CNN are randomly initialized, and the value of the
learning rate is set to 10−4 . The training process of BD-CNN is terminated if the number of
training epochs reaches 200 or the training accuracy equals 100%. All CNN-based breast
mass detection methods mentioned in this paper are optimized by the Stochastic Gradient
Descent method, and these methods are implemented based on Python 3.7.3 and PyTorch
1.1.0, and evaluated in the following environment: Ubuntu 16.04, Intel(R) Xeon(R) CPU
E5-2640 v4, RAM 256G and NVIDIA GeForce GTX 1080 Ti GPU.
After obtaining the image with obvious highlighted circular regions, we match the
suspected regions of a breast mass by the image template matching method. As shown in
Figure 7, the image in (b) illustrates that some circular regions in image (b) are matched,
but most of these matched regions are meaningless. For resolving the problem of the
meaningless regions, we filter out the regions with a high matching degree. Compared
with image (b), image (c) contains fewer suspected regions with a higher matching degree,
which is beneficial to reduce the suspected regions with a lower probability of being a breast
mass. For obtaining more precise suspected regions and reducing meaningless regions, we
combine and eliminate these regions by their Intersection over Union (IoU). In particular,
Sensors 2021, 21, 2855 10 of 16
the two bounding boxes will merge if the IoU of them is greater than 0.3. As shown the
image (d) in Figure 7, we obtain five circular regions from the regions overlapping each
other in image (c) using the merging method.
After obtaining the circular regions in the processed image by the mathematical
morphology and image template matching methods, we crop the suspected regions of
breast mass from the mammographic image. As shown in Figure 8, we match these regions
using the image template matching method with an ellipse dilating kernel with a size
of 50 × 50 pixels. The regions enclosed by the red rectangles in the image (d) are the
suspected regions of breast mass.
of features using the manual design feature extraction method. We cited the experimental
results in the works of literatures for Eltonsy [26], Sampat [37], Wu [38], Junior [39],
Liu [40] and Cao [41] in Table 1. RetinaNet [42], FSAF [43], Foveabox[44] and our method
in Table 1 are evaluated on the subset used in this paper. The benefit from the proposed
method simulates the breast mass detection process of radiologists via the multi-stage
method, meaning it can detect the breast mass in a more intelligent way. The proposed
method achieves the highest True Positive Rate (TPR) and the lowest False positives Per
Image (FPI), performing better than all of the compared breast mass detection methods.
1 2 ,0 0 0 9 8
T ra in
9 6
N u m b e r o f c a n d id a te r e g io n s
T e st
1 0 ,0 0 0
T o ta l
9 4
T P R
8 0 0 0
6
9 2
T P R (% )
9 0
0 0 0
8 8
4 0 0 0
8 6
2 0 0 0 8 4
8 2
0 .4 0 .6 0 .8
T h r e sh
Figure 9. Comparison of the detection performance of the proposed method under different thresh-
olds for matching degree.
1.0
0.8
7 U X H 3 R V L W L Y H 5 D W H
0.6
0.4