CN114049491A - Fingerprint segmentation model training method, fingerprint segmentation device, fingerprint segmentation equipment and fingerprint segmentation medium - Google Patents
Fingerprint segmentation model training method, fingerprint segmentation device, fingerprint segmentation equipment and fingerprint segmentation medium Download PDFInfo
- Publication number
- CN114049491A CN114049491A CN202111318551.9A CN202111318551A CN114049491A CN 114049491 A CN114049491 A CN 114049491A CN 202111318551 A CN202111318551 A CN 202111318551A CN 114049491 A CN114049491 A CN 114049491A
- Authority
- CN
- China
- Prior art keywords
- feature map
- fingerprint
- segmentation model
- characteristic diagram
- fingerprint segmentation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000011218 segmentation Effects 0.000 title claims abstract description 186
- 238000012549 training Methods 0.000 title claims abstract description 80
- 238000000034 method Methods 0.000 title claims abstract description 60
- 238000010586 diagram Methods 0.000 claims abstract description 114
- 238000012545 processing Methods 0.000 claims abstract description 76
- 238000000605 extraction Methods 0.000 claims abstract description 44
- 238000011176 pooling Methods 0.000 claims description 34
- 238000004891 communication Methods 0.000 claims description 20
- 238000010606 normalization Methods 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 14
- 230000008569 process Effects 0.000 description 15
- 238000005070 sampling Methods 0.000 description 11
- 230000007246 mechanism Effects 0.000 description 10
- 238000003062 neural network model Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 239000011159 matrix material Substances 0.000 description 4
- 238000013528 artificial neural network Methods 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001149 cognitive effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000001537 neural effect Effects 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/25—Fusion techniques
- G06F18/253—Fusion techniques of extracted features
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Collating Specific Patterns (AREA)
Abstract
The invention discloses a fingerprint segmentation model training method, a fingerprint segmentation device, a fingerprint segmentation equipment and a medium, wherein the method comprises the following steps: inputting sample images in a training set into a fingerprint segmentation model, and performing convolution processing on the sample images to obtain a first characteristic diagram; performing feature extraction on the first feature map based on the channel attention submodule to obtain a second feature map; performing feature extraction on the first feature map based on the space attention submodule to obtain a third feature map; merging the second characteristic diagram and the third characteristic diagram to obtain a fourth characteristic diagram; and determining training fingerprint position information in the sample image according to the fourth characteristic diagram, determining a loss value according to the training fingerprint position information and the real fingerprint position information in the sample image, and training the fingerprint segmentation model based on the loss value. The method combines the mutual influence relationship of the space attention and the channel attention on the semantic segmentation, and can obtain more accurate position information of the fingerprint based on the fingerprint segmentation model. The accuracy of fingerprint segmentation is improved.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to a fingerprint segmentation model training method, a fingerprint segmentation model training device and a fingerprint segmentation model training medium.
Background
Fingerprint identification is increasingly used as an identity authentication technology based on biological characteristics. The accuracy of fingerprint segmentation directly affects the accuracy of fingerprint identification. In the prior art, when fingerprint image segmentation is performed, two rounds of segmentation are generally performed on an image, the first round of segmentation adopts gray statistical characteristics, and a segmentation threshold is determined through a histogram; the second round of segmentation analyzes the distribution of the grain pixels and performs segmentation by counting the sparse grain pixels. And finally, carrying out post-processing on the segmentation result by utilizing an opening operation and a closing operation to obtain the segmented fingerprint image. The prior art has the problems that firstly, if the gray value of a pixel point in an image changes more, the accuracy of determining a segmentation threshold value through a gray histogram is poor, and secondly, the influence of noise on fingerprint segmentation only through the gray value is large, so that the accuracy of fingerprint segmentation in the prior art is poor.
Disclosure of Invention
The embodiment of the invention provides a fingerprint segmentation model training method, a fingerprint segmentation model training device and a fingerprint segmentation model training medium, which are used for solving the problem of poor accuracy of fingerprint segmentation in the prior art.
In a first aspect, an embodiment of the present invention provides a fingerprint segmentation model training method, where the method includes:
inputting sample images in a training set into a fingerprint segmentation model, and performing convolution processing on the sample images based on a convolution submodule of the fingerprint segmentation model to obtain a first feature map;
performing feature extraction on the first feature map based on a channel attention submodule in the fingerprint segmentation model to obtain a second feature map; performing feature extraction on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a third feature map; merging the second characteristic diagram and the third characteristic diagram to obtain a fourth characteristic diagram;
determining training fingerprint position information in the sample image according to the fourth feature map, determining a loss value according to the training fingerprint position information and real fingerprint position information in the sample image, and training the fingerprint segmentation model based on the loss value.
In a second aspect, an embodiment of the present invention provides a fingerprint segmentation method, where the method includes:
acquiring an image to be segmented;
inputting the image to be segmented into a fingerprint segmentation model, and performing convolution processing on the image to be segmented based on a convolution submodule of the fingerprint segmentation model to obtain a seventh characteristic diagram;
performing feature extraction on the seventh feature map based on a channel attention submodule in the fingerprint segmentation model to obtain an eighth feature map; performing feature extraction on the seventh feature map based on a space attention submodule in the fingerprint segmentation model to obtain a ninth feature map; combining the eighth characteristic diagram and the ninth characteristic diagram to obtain a tenth characteristic diagram; and determining fingerprint position information in the image to be segmented according to the tenth feature map.
In a third aspect, an embodiment of the present invention provides a fingerprint segmentation model training apparatus, where the apparatus includes:
the convolution processing module is used for inputting a sample image in a training set into a fingerprint segmentation model and carrying out convolution processing on the sample image based on a convolution submodule of the fingerprint segmentation model to obtain a first characteristic diagram;
the attention processing module is used for carrying out feature extraction on the first feature map based on a channel attention submodule in the fingerprint segmentation model to obtain a second feature map; performing feature extraction on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a third feature map; merging the second characteristic diagram and the third characteristic diagram to obtain a fourth characteristic diagram;
and the training module is used for determining training fingerprint position information in the sample image according to the fourth feature map, determining a loss value according to the training fingerprint position information and real fingerprint position information in the sample image, and training the fingerprint segmentation model based on the loss value.
In a fourth aspect, an embodiment of the present invention provides a fingerprint segmentation apparatus, where the apparatus includes:
the acquisition module is used for acquiring an image to be segmented;
the processing module is used for inputting the image to be segmented into a fingerprint segmentation model, and carrying out convolution processing on the image to be segmented based on a convolution submodule of the fingerprint segmentation model to obtain a seventh characteristic diagram;
the determining module is used for extracting the features of the seventh feature map based on a channel attention submodule in the fingerprint segmentation model to obtain an eighth feature map; performing feature extraction on the seventh feature map based on a space attention submodule in the fingerprint segmentation model to obtain a ninth feature map; combining the eighth characteristic diagram and the ninth characteristic diagram to obtain a tenth characteristic diagram; and determining fingerprint position information in the image to be segmented according to the tenth feature map.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the steps of the fingerprint segmentation model training method or the steps of the fingerprint segmentation method when executing the program stored in the memory.
In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of a fingerprint segmentation model training method, or implements the steps of a fingerprint segmentation method.
The embodiment of the invention provides a method, a device, equipment and a medium for training a fingerprint segmentation model and segmenting a fingerprint, wherein the method comprises the following steps: inputting sample images in a training set into a fingerprint segmentation model, and performing convolution processing on the sample images based on a convolution submodule of the fingerprint segmentation model to obtain a first feature map; performing feature extraction on the first feature map based on a channel attention submodule in the fingerprint segmentation model to obtain a second feature map; performing feature extraction on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a third feature map; merging the second characteristic diagram and the third characteristic diagram to obtain a fourth characteristic diagram; determining training fingerprint position information in the sample image according to the fourth feature map, determining a loss value according to the training fingerprint position information and real fingerprint position information in the sample image, and training the fingerprint segmentation model based on the loss value.
The technical scheme has the following advantages or beneficial effects:
in the embodiment of the invention, when a fingerprint segmentation model is trained, a sample image is subjected to convolution processing to obtain a first feature map, then feature extraction is respectively carried out on the first feature map based on a channel attention submodule to obtain a second feature map, and feature extraction is carried out on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a third feature map. And then combining the second characteristic diagram and the third characteristic diagram to obtain a fourth characteristic diagram. And further determining training fingerprint position information in the sample image and a model training loss value according to the fourth feature map, and finally finishing training of the fingerprint segmentation model. The embodiment of the invention combines the mutual influence relationship of the space attention and the channel attention on the semantic segmentation, processes the characteristic diagram in a parallel mode and more effectively associates different characteristic values of different space positions of the fingerprint image. Therefore, more accurate position information of the fingerprint can be obtained based on the fingerprint segmentation model. The accuracy of fingerprint segmentation is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a fingerprint segmentation model training process according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a UNET neural network model according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a fingerprint segmentation model according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a workflow of an attention mechanism module according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a workflow of a channel attention sub-module according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a workflow of a spatial attention sub-module according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a fingerprint segmentation process according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a fingerprint segmentation model training apparatus according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a fingerprint segmentation apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the attached drawings, and it should be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1:
fig. 1 is a schematic diagram of a fingerprint segmentation model training process provided in an embodiment of the present invention, where the process includes the following steps:
s101: and inputting the sample images in the training set into a fingerprint segmentation model, and performing convolution processing on the sample images based on a convolution submodule of the fingerprint segmentation model to obtain a first characteristic diagram.
S102: performing feature extraction on the first feature map based on a channel attention submodule in the fingerprint segmentation model to obtain a second feature map; performing feature extraction on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a third feature map; and combining the second characteristic diagram and the third characteristic diagram to obtain a fourth characteristic diagram.
S103: determining training fingerprint position information in the sample image according to the fourth feature map, determining a loss value according to the training fingerprint position information and real fingerprint position information in the sample image, and training the fingerprint segmentation model based on the loss value.
The fingerprint segmentation model training method provided by the embodiment of the invention is applied to electronic equipment, and the electronic equipment can be a PC (personal computer), a tablet computer, a server and the like.
When training the fingerprint segmentation model, first, each parameter in a set of fingerprint segmentation models is initialized. After the sample images in the training set are input into the fingerprint segmentation model, the fingerprint segmentation model processes the sample images based on initialized parameters to obtain a first characteristic diagram. The convolution sub-module based on the fingerprint segmentation model performs convolution processing on the sample image to obtain the first feature map.
The fingerprint segmentation model comprises an attention mechanism module, wherein the attention mechanism module comprises a channel attention submodule and a space attention submodule. The channel attention submodule and the spatial attention submodule perform parallel processing on the first feature map. Specifically, a channel attention submodule in a fingerprint segmentation model is used for carrying out feature extraction on a first feature map to obtain a second feature map; and performing feature extraction on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a third feature map. And then combining the second characteristic diagram and the third characteristic diagram to obtain a fourth characteristic diagram. The merging of the second feature map and the third feature map may be to add feature values of corresponding positions of the second feature map and the third feature map to obtain a merged fourth feature map.
And determining training fingerprint position information in the sample image according to the fourth characteristic diagram, wherein the sample image has real fingerprint position information, and determining a loss value according to the training fingerprint position information and the real fingerprint position information in the sample image. And adjusting parameters of the fingerprint segmentation model according to the loss value, and continuing training until convergence.
In the embodiment of the invention, when a fingerprint segmentation model is trained, a sample image is subjected to convolution processing to obtain a first feature map, then feature extraction is respectively carried out on the first feature map based on a channel attention submodule to obtain a second feature map, and feature extraction is carried out on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a third feature map. And then combining the second characteristic diagram and the third characteristic diagram to obtain a fourth characteristic diagram. And further determining training fingerprint position information in the sample image and a model training loss value according to the fourth feature map, and finally finishing training of the fingerprint segmentation model. The embodiment of the invention combines the mutual influence relationship of the space attention and the channel attention on the semantic segmentation, processes the characteristic diagram in a parallel mode and more effectively associates different characteristic values of different space positions of the fingerprint image. Therefore, more accurate position information of the fingerprint can be obtained based on the fingerprint segmentation model. The accuracy of fingerprint segmentation is improved.
The attention mechanism, channel attention and spatial attention in embodiments of the present invention are understood as follows:
an attention mechanism is as follows: derived from studies on human vision. In cognitive science, humans selectively focus on a portion of all information while ignoring other visible information due to bottlenecks in information processing. The neural attention mechanism may enable the neural network to focus on a subset of its inputs (or features): a particular input is selected. Attention may be applied to any type of input regardless of its shape. In situations where computing power is limited, the attention mechanism is a resource allocation scheme that is the primary means to solve the information overload problem, allocating computing resources to more important tasks.
Attention of the channel: it can be understood as what the neural network is looking at. There is a convolution kernel for each layer of the convolutional network. One signature channel for each convolution kernel. Channel attention is aimed at allocating resources between the various convolution channels. In the pictures related to the present invention, each picture is initially represented by three (R, G, B) channels, and then after passing through different convolution kernels, each channel generates a new signal, for example, each channel of a picture feature is convolved with 64 kernels, and a matrix (H, W,64) of 64 new channels is generated, where H and W respectively represent the height and width of the picture feature. Since each signal can be decomposed into components on the kernel function, the contribution of the generated new 64 channels to the key information must be small, and if we add a weight to the signal on each channel to represent the correlation of the channel with the key information, the larger the weight, the higher the correlation.
The characteristics of each channel actually represent the components of the picture on different convolution kernels, similar to time-frequency transformation, and the convolution of the convolution kernels is similar to signal Fourier transformation, so that the information of one channel of the characteristics can be decomposed into signal components on 64 convolution kernels.
Spatial attention is as follows: it can be understood that spatial information of the original picture is preserved for the neural network to see where. In the pictures related to the patent, the spatial attention focuses on the width and height information of the pictures, and the essence is to locate the target and perform some transformation and obtain the weight.
Convolution: is a mathematical operator that generates a third function [ c ] from two functions [ a ] and [ b ], and is formulated as follows. The function [ a ] is usually called input (input), the function [ b ] is called convolution kernel (kernel), and the function [ c ] is called feature map (feature map). The formula is as follows: c (t) ═ a (t) × b (t).
The fingerprint segmentation model provided by the embodiment of the invention comprises a convolution sub-module, a down-sampling layer and an up-sampling layer, wherein a channel attention sub-module and a space attention sub-module are arranged in front of the down-sampling layer and the up-sampling layer. The fingerprint segmentation model may include a UNET neural network model, a channel attention submodule, and a spatial attention submodule, and fig. 2 is a schematic structural diagram of the UNET neural network model. As shown in fig. 2, the UNET neural network model includes 9 convolution submodules, which are respectively a first convolution submodule to a ninth convolution submodule, connected in sequence. The first to fourth convolution sub-modules include downsampling layers, and the fifth to eighth convolution sub-modules include upsampling layers. The output result of the first convolution submodule is downsampled and then transmitted to the second convolution submodule, the output result of the second convolution submodule is downsampled and then transmitted to the third convolution submodule, the output result of the third convolution submodule is downsampled and then transmitted to the fourth convolution submodule, the output result of the fourth convolution submodule is downsampled and then transmitted to the fifth convolution submodule, the output result of the fifth convolution submodule is upsampled and then transmitted to the sixth convolution submodule, the output result of the sixth convolution submodule is upsampled and then transmitted to the seventh convolution submodule, the output result of the seventh convolution submodule is upsampled and then transmitted to the eighth convolution submodule, and the output result of the eighth convolution submodule is upsampled and then transmitted to the ninth convolution submodule. And the output result of the first convolution submodule and the up-sampled output result of the eighth convolution submodule are used as the input of the ninth convolution submodule. And the output result of the second convolution submodule and the output result after up-sampling of the seventh convolution submodule are used as the input of the eighth convolution submodule. And the output result of the third convolution submodule and the output result of the sixth convolution submodule after up-sampling are used as the input of a seventh convolution submodule. And the output result of the fourth convolution submodule and the output result of the fifth convolution submodule after up-sampling are used as the input of the sixth convolution submodule.
The fingerprint segmentation model provided by the embodiment of the invention is improved on the basis of the UNET neural network model. Specifically, as shown in fig. 3, the channel attention submodule and the spatial attention submodule are arranged before a down-sampling layer and an up-sampling layer of the UNET neural network model.
In the embodiment of the present invention, as shown in fig. 4, attention mechanism modules are arranged before a down-sampling layer and an up-sampling layer of a UNET neural network model, each attention mechanism module includes a channel attention sub-module and a space attention sub-module, the attention mechanism modules process the same feature map in a parallel manner through the channel attention sub-module and the space attention sub-module, that is, two different attention modules process source feature maps respectively to obtain two new feature maps, and the two new feature maps are merged and output to a next convolution sub-module.
Specifically, the performing feature extraction on the first feature map based on the channel attention submodule in the fingerprint segmentation model to obtain a second feature map includes:
and performing maximum pooling, convolution and normalization processing on the first feature map based on a channel attention submodule in the fingerprint segmentation model to obtain a fifth feature map, and taking the fifth feature map as a second feature map.
Maximum pooling operation: an input image is divided into a plurality of rectangular areas, and a maximum value is output for each sub-area. Its mathematical definition is as follows:
y represents the maximum pooled output value at the rectangular region R (i, j) associated with the kth feature map, and X represents each element in the rectangular region R (i, j).
In the embodiment of the present invention, the source feature maps input to the channel attention submodule and the spatial attention submodule are collectively referred to as a first feature map. The specific processing process of the channel attention submodule comprises the steps of sequentially carrying out maximum pooling processing, convolution processing and normalization processing on the received first characteristic diagram and outputting a second characteristic diagram.
In order to improve the global information extraction capability of the channel attention submodule on the first feature map, preferably, the step of using the fifth feature map as the second feature map includes: and merging the first characteristic diagram and the fifth characteristic diagram, and taking the merged result as a second characteristic diagram.
In order to further improve the global information extraction capability of the channel attention submodule on the first feature map, preferably, the step of performing maximum pooling, convolution and normalization on the first feature map to obtain a fifth feature map includes: performing maximum pooling and first convolution processing on the first feature map, and compressing channel features of the first feature map; performing second convolution processing on the feature map subjected to the first convolution processing to recover the channel feature of the feature map subjected to the first convolution processing; and carrying out normalization processing on the feature map subjected to the second convolution processing to obtain a fifth feature map.
Fig. 5 is a schematic diagram of a workflow of a channel attention sub-module according to an embodiment of the present invention. As shown in fig. 5, a maximal pooling operation is performed on the source signature based on the spatial dimension to reduce the spatial dimension of the signature to one dimension. And performing first convolution on the feature map, and compressing the channel features of the feature map. And performing a second convolution and normalization operation on the feature map to obtain a corresponding feature map mask, and recovering the channel feature of the feature map. And merging the source feature map and the attention feature map mask, and recalibrating to obtain a new feature map.
Merging the characteristic graphs: and multiplying the attention mask and the feature map coefficient to obtain a new feature map.
Compressing the characteristic diagram: the feature vector latitude is reduced through convolution. When the number of convolution kernels is less than the number of input channels, the matrix latitude is reduced. Example operation: convolution of 1 x 32 with the convolution kernel of 1 x 16 yields a new matrix of 1 x 16 latitudes.
And (3) restoring the characteristic diagram: and restoring the latitude of the feature vector to the original size by a convolution mode. Similar to the principle of compressing eigenvalues, when the number of convolution kernels is greater than the number of input channels, the matrix latitude is raised.
And (3) normalization operation: normalization is to limit the data to be processed (by some algorithm) to a certain range that you need. In this patent, the normalization operation is to generalize specific values to a probability distribution between 0 and 1.
As defined by the following equation:
after processing, the dimensional expression is converted into a dimensionless expression, and the dimensionless expression is converted into a pure quantity, so that the comparability between different data indexes is improved.
The feature extraction of the first feature map based on the spatial attention submodule in the fingerprint segmentation model to obtain a third feature map comprises:
and performing pooling processing, convolution processing and normalization processing on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a sixth feature map, and taking the sixth feature map as a third feature map.
The specific process of the spatial attention submodule for processing the first feature map is as follows: and the space attention submodule sequentially performs pooling processing, convolution processing and normalization processing on the first characteristic diagram to obtain a third characteristic diagram.
In order to improve the ability of the spatial attention submodule to extract point and point information from a spatial upper point of a first feature map, preferably, the pooling of the first feature map based on the spatial attention submodule in the fingerprint segmentation model includes:
and respectively performing maximum pooling and average pooling on the first feature map based on a space attention submodule in the fingerprint segmentation model, and performing channel number splicing on the feature maps after the maximum pooling and the average pooling.
Average pooling operation: the input image is divided into a plurality of rectangular areas, and the average value of all elements is output for each sub-area. As defined by the following equation:
y represents the flattened pooling output value in the rectangular region R (i, j) with respect to the kth feature map, and X represents each element in the rectangular region R (i, j).
The splicing is explained as follows: the two feature maps are superposed based on the number of channels, so that the number of features for describing the image is increased, and the information under the features is not increased. In the splicing operation of the patent, two (H, W,1) feature maps are superposed into a (H, W,2) feature map.
In order to further improve the capability of the spatial attention submodule in extracting the spatial upper point and the point information of the first feature map, it is preferable that the method for extracting the spatial upper point and the point information of the first feature map includes, as the third feature map:
and merging the first characteristic diagram and the sixth characteristic diagram, and taking the merged result as a third characteristic diagram.
Fig. 6 is a schematic diagram of a workflow of a spatial attention sub-module according to an embodiment of the present invention. As shown in fig. 6, two different pooling operations, maximum pooling and average pooling, are performed on the source feature map, and the two feature maps are spliced into a single feature map based on the number of channels. And carrying out convolution operation and normalization operation on the single feature map to obtain a corresponding feature map mask. And merging the source feature map and the attention feature map mask, and recalibrating to obtain a new feature map.
The embodiment of the invention considers the channel attention submodule: the method carries out global processing on information in one channel; also considered are spatial attention sub-modules: the main focus is the correlation of point to point information in space. In addition, the benefit of the parallel stacking of the attention module is that the probability of spatial and channel attention interaction is reduced, correlating different eigenvalues in different positions in the image.
Example 2:
fig. 7 is a schematic diagram of a fingerprint segmentation process provided in an embodiment of the present invention, where the process includes the following steps:
s201: an image to be segmented is acquired.
S202: and inputting the image to be segmented into a fingerprint segmentation model, and performing convolution processing on the image to be segmented based on a convolution submodule of the fingerprint segmentation model to obtain a seventh characteristic diagram.
S203: performing feature extraction on the seventh feature map based on a channel attention submodule in the fingerprint segmentation model to obtain an eighth feature map; performing feature extraction on the seventh feature map based on a space attention submodule in the fingerprint segmentation model to obtain a ninth feature map; combining the eighth characteristic diagram and the ninth characteristic diagram to obtain a tenth characteristic diagram; and determining fingerprint position information in the image to be segmented according to the tenth feature map.
The fingerprint segmentation method provided by the embodiment of the invention is applied to electronic equipment, and the electronic equipment can be equipment such as a PC (personal computer), a tablet computer and the like.
The electronic device used for training the fingerprint segmentation model and the electronic device used for performing fingerprint segmentation on the image to be segmented can be the same electronic device or different electronic devices.
Example 3:
fig. 8 is a schematic structural diagram of a fingerprint segmentation model training apparatus according to an embodiment of the present invention, where the apparatus includes:
the convolution processing module 81 is configured to input a sample image in a training set into a fingerprint segmentation model, and perform convolution processing on the sample image based on a convolution submodule of the fingerprint segmentation model to obtain a first feature map;
the attention processing module 82 is configured to perform feature extraction on the first feature map based on a channel attention submodule in the fingerprint segmentation model to obtain a second feature map; performing feature extraction on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a third feature map; merging the second characteristic diagram and the third characteristic diagram to obtain a fourth characteristic diagram;
and the training module 83 is configured to determine training fingerprint position information in the sample image according to the fourth feature map, determine a loss value according to the training fingerprint position information and the real fingerprint position information in the sample image, and train the fingerprint segmentation model based on the loss value.
The attention processing module 82 is specifically configured to perform maximum pooling, convolution and normalization on the first feature map based on the channel attention submodule in the fingerprint segmentation model to obtain a fifth feature map, and use the fifth feature map as the second feature map.
The attention processing module 82 is specifically configured to merge the first feature map and the fifth feature map, and use the result of the merging as the second feature map.
The attention processing module 82 is specifically configured to perform a maximum pooling process and a first convolution process on the first feature map, and compress the channel features of the first feature map; performing second convolution processing on the feature map subjected to the first convolution processing to recover the channel feature of the feature map subjected to the first convolution processing; and carrying out normalization processing on the feature map subjected to the second convolution processing to obtain a fifth feature map.
The attention processing module 82 is specifically configured to perform pooling processing, convolution processing and normalization processing on the first feature map based on the spatial attention submodule in the fingerprint segmentation model to obtain a sixth feature map, and use the sixth feature map as a third feature map.
The attention processing module 82 is specifically configured to perform maximum pooling and average pooling on the first feature map respectively based on the spatial attention submodule in the fingerprint segmentation model, and perform channel number stitching on the feature maps after the maximum pooling and the average pooling.
The attention processing module 82 is specifically configured to merge the first feature map and the sixth feature map, and use the merged result as a third feature map.
Example 4:
fig. 9 is a schematic structural diagram of a fingerprint segmentation apparatus according to an embodiment of the present invention, including:
an obtaining module 91, configured to obtain an image to be segmented;
the processing module 92 is configured to input the image to be segmented into a fingerprint segmentation model, and perform convolution processing on the image to be segmented based on a convolution submodule of the fingerprint segmentation model to obtain a seventh feature map;
a determining module 93, configured to perform feature extraction on the seventh feature map based on a channel attention submodule in the fingerprint segmentation model to obtain an eighth feature map; performing feature extraction on the seventh feature map based on a space attention submodule in the fingerprint segmentation model to obtain a ninth feature map; combining the eighth characteristic diagram and the ninth characteristic diagram to obtain a tenth characteristic diagram; and determining fingerprint position information in the image to be segmented according to the tenth feature map.
Example 5:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides an electronic device, as shown in fig. 10, including: the system comprises a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302 and the memory 303 complete mutual communication through the communication bus 304;
the memory 303 has stored therein a computer program which, when executed by the processor 301, causes the processor 301 to perform the steps of:
inputting sample images in a training set into a fingerprint segmentation model, and performing convolution processing on the sample images based on a convolution submodule of the fingerprint segmentation model to obtain a first feature map;
performing feature extraction on the first feature map based on a channel attention submodule in the fingerprint segmentation model to obtain a second feature map; performing feature extraction on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a third feature map; merging the second characteristic diagram and the third characteristic diagram to obtain a fourth characteristic diagram;
determining training fingerprint position information in the sample image according to the fourth feature map, determining a loss value according to the training fingerprint position information and real fingerprint position information in the sample image, and training the fingerprint segmentation model based on the loss value.
Based on the same inventive concept, the embodiment of the present invention further provides an electronic device, and because the principle of solving the problem of the electronic device is similar to the fingerprint segmentation model training method, the implementation of the electronic device may refer to the implementation of the method, and repeated details are not repeated.
Example 6:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides a computer storage readable storage medium, in which a computer program executable by an electronic device is stored, and when the program is run on the electronic device, the electronic device is caused to execute the following steps:
inputting sample images in a training set into a fingerprint segmentation model, and performing convolution processing on the sample images based on a convolution submodule of the fingerprint segmentation model to obtain a first feature map;
performing feature extraction on the first feature map based on a channel attention submodule in the fingerprint segmentation model to obtain a second feature map; performing feature extraction on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a third feature map; merging the second characteristic diagram and the third characteristic diagram to obtain a fourth characteristic diagram;
determining training fingerprint position information in the sample image according to the fourth feature map, determining a loss value according to the training fingerprint position information and real fingerprint position information in the sample image, and training the fingerprint segmentation model based on the loss value.
Based on the same inventive concept, embodiments of the present invention further provide a computer-readable storage medium, and since a principle of solving a problem when a processor executes a computer program stored in the computer-readable storage medium is similar to a fingerprint segmentation model training method, implementation of the computer program stored in the computer-readable storage medium by the processor may refer to implementation of the method, and repeated details are not repeated.
Example 7:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides an electronic device, including: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
acquiring an image to be segmented;
inputting the image to be segmented into a fingerprint segmentation model, and performing convolution processing on the image to be segmented based on a convolution submodule of the fingerprint segmentation model to obtain a seventh characteristic diagram;
performing feature extraction on the seventh feature map based on a channel attention submodule in the fingerprint segmentation model to obtain an eighth feature map; performing feature extraction on the seventh feature map based on a space attention submodule in the fingerprint segmentation model to obtain a ninth feature map; combining the eighth characteristic diagram and the ninth characteristic diagram to obtain a tenth characteristic diagram; and determining fingerprint position information in the image to be segmented according to the tenth feature map.
Based on the same inventive concept, the embodiment of the present invention further provides an electronic device, and because the principle of solving the problem of the electronic device is similar to the fingerprint segmentation method, the implementation of the electronic device may refer to the implementation of the method, and repeated details are not repeated. The structure of the electronic device provided in the embodiment of the present invention is similar to the structure of the electronic device performing the fingerprint segmentation model training in the above embodiment, and the structure of the electronic device is not described herein again.
Example 8:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides a computer storage readable storage medium, in which a computer program executable by an electronic device is stored, and when the program is run on the electronic device, the electronic device is caused to execute the following steps:
acquiring an image to be segmented;
inputting the image to be segmented into a fingerprint segmentation model, and performing convolution processing on the image to be segmented based on a convolution submodule of the fingerprint segmentation model to obtain a seventh characteristic diagram;
performing feature extraction on the seventh feature map based on a channel attention submodule in the fingerprint segmentation model to obtain an eighth feature map; performing feature extraction on the seventh feature map based on a space attention submodule in the fingerprint segmentation model to obtain a ninth feature map; combining the eighth characteristic diagram and the ninth characteristic diagram to obtain a tenth characteristic diagram; and determining fingerprint position information in the image to be segmented according to the tenth feature map.
Based on the same inventive concept, embodiments of the present invention further provide a computer-readable storage medium, and since a principle of solving a problem when a processor executes a computer program stored in the computer-readable storage medium is similar to a fingerprint segmentation method, implementation of the computer program stored in the computer-readable storage medium by the processor may refer to implementation of the method, and repeated details are omitted.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such 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 such modifications and variations.
Claims (13)
1. A method for training a fingerprint segmentation model, the method comprising:
inputting sample images in a training set into a fingerprint segmentation model, and performing convolution processing on the sample images based on a convolution submodule of the fingerprint segmentation model to obtain a first feature map;
performing feature extraction on the first feature map based on a channel attention submodule in the fingerprint segmentation model to obtain a second feature map; performing feature extraction on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a third feature map; merging the second characteristic diagram and the third characteristic diagram to obtain a fourth characteristic diagram;
determining training fingerprint position information in the sample image according to the fourth feature map, determining a loss value according to the training fingerprint position information and real fingerprint position information in the sample image, and training the fingerprint segmentation model based on the loss value.
2. The method of claim 1, wherein the feature extracting the first feature map based on a channel attention submodule in the fingerprint segmentation model to obtain a second feature map comprises:
and performing maximum pooling, convolution and normalization processing on the first feature map based on a channel attention submodule in the fingerprint segmentation model to obtain a fifth feature map, and taking the fifth feature map as a second feature map.
3. The method of claim 2, wherein taking the fifth profile as the second profile comprises:
and merging the first characteristic diagram and the fifth characteristic diagram, and taking the merged result as a second characteristic diagram.
4. The method of claim 2, wherein performing max-pooling, convolution and normalization on the first feature map to obtain a fifth feature map comprises:
performing maximum pooling and first convolution processing on the first feature map, and compressing channel features of the first feature map; performing second convolution processing on the feature map subjected to the first convolution processing to recover the channel feature of the feature map subjected to the first convolution processing; and carrying out normalization processing on the feature map subjected to the second convolution processing to obtain a fifth feature map.
5. The method of claim 1, wherein the feature extracting the first feature map based on a spatial attention submodule in the fingerprint segmentation model to obtain a third feature map comprises:
and performing pooling processing, convolution processing and normalization processing on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a sixth feature map, and taking the sixth feature map as a third feature map.
6. The method of claim 5, wherein pooling the first feature map based on a spatial attention submodule in the fingerprint segmentation model comprises:
and respectively performing maximum pooling and average pooling on the first feature map based on a space attention submodule in the fingerprint segmentation model, and performing channel number splicing on the feature maps after the maximum pooling and the average pooling.
7. The method of claim 5, wherein taking the sixth profile as a third profile comprises:
and merging the first characteristic diagram and the sixth characteristic diagram, and taking the merged result as a third characteristic diagram.
8. The method of claim 1, wherein the fingerprint segmentation model includes a convolution sub-module, a downsampling layer, and an upsampling layer, each preceded by a channel attention sub-module and a spatial attention sub-module.
9. A fingerprint segmentation method based on a fingerprint segmentation model trained by the method of any one of claims 1 to 8, the method comprising:
acquiring an image to be segmented;
inputting the image to be segmented into a fingerprint segmentation model, and performing convolution processing on the image to be segmented based on a convolution submodule of the fingerprint segmentation model to obtain a seventh characteristic diagram;
performing feature extraction on the seventh feature map based on a channel attention submodule in the fingerprint segmentation model to obtain an eighth feature map; performing feature extraction on the seventh feature map based on a space attention submodule in the fingerprint segmentation model to obtain a ninth feature map; combining the eighth characteristic diagram and the ninth characteristic diagram to obtain a tenth characteristic diagram; and determining fingerprint position information in the image to be segmented according to the tenth feature map.
10. An apparatus for training a fingerprint segmentation model, the apparatus comprising:
the convolution processing module is used for inputting a sample image in a training set into a fingerprint segmentation model and carrying out convolution processing on the sample image based on a convolution submodule of the fingerprint segmentation model to obtain a first characteristic diagram;
the attention processing module is used for carrying out feature extraction on the first feature map based on a channel attention submodule in the fingerprint segmentation model to obtain a second feature map; performing feature extraction on the first feature map based on a space attention submodule in the fingerprint segmentation model to obtain a third feature map; merging the second characteristic diagram and the third characteristic diagram to obtain a fourth characteristic diagram;
and the training module is used for determining training fingerprint position information in the sample image according to the fourth feature map, determining a loss value according to the training fingerprint position information and real fingerprint position information in the sample image, and training the fingerprint segmentation model based on the loss value.
11. A fingerprint segmentation apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring an image to be segmented;
the processing module is used for inputting the image to be segmented into a fingerprint segmentation model, and carrying out convolution processing on the image to be segmented based on a convolution submodule of the fingerprint segmentation model to obtain a seventh characteristic diagram;
the determining module is used for extracting the features of the seventh feature map based on a channel attention submodule in the fingerprint segmentation model to obtain an eighth feature map; performing feature extraction on the seventh feature map based on a space attention submodule in the fingerprint segmentation model to obtain a ninth feature map; combining the eighth characteristic diagram and the ninth characteristic diagram to obtain a tenth characteristic diagram; and determining fingerprint position information in the image to be segmented according to the tenth feature map.
12. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the steps of the fingerprint segmentation model training method of any one of claims 1 to 8, or for implementing the steps of the fingerprint segmentation method of claim 9, when executing a program stored in a memory.
13. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the fingerprint segmentation model training method of any one of claims 1 to 8, or the steps of the fingerprint segmentation method of claim 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111318551.9A CN114049491A (en) | 2021-11-09 | 2021-11-09 | Fingerprint segmentation model training method, fingerprint segmentation device, fingerprint segmentation equipment and fingerprint segmentation medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111318551.9A CN114049491A (en) | 2021-11-09 | 2021-11-09 | Fingerprint segmentation model training method, fingerprint segmentation device, fingerprint segmentation equipment and fingerprint segmentation medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114049491A true CN114049491A (en) | 2022-02-15 |
Family
ID=80207630
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111318551.9A Pending CN114049491A (en) | 2021-11-09 | 2021-11-09 | Fingerprint segmentation model training method, fingerprint segmentation device, fingerprint segmentation equipment and fingerprint segmentation medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114049491A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115496744A (en) * | 2022-10-17 | 2022-12-20 | 上海生物芯片有限公司 | Lung cancer image segmentation method, device, terminal and medium based on mixed attention |
CN115690592A (en) * | 2023-01-05 | 2023-02-03 | 阿里巴巴(中国)有限公司 | Image processing method and model training method |
-
2021
- 2021-11-09 CN CN202111318551.9A patent/CN114049491A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115496744A (en) * | 2022-10-17 | 2022-12-20 | 上海生物芯片有限公司 | Lung cancer image segmentation method, device, terminal and medium based on mixed attention |
CN115496744B (en) * | 2022-10-17 | 2024-08-02 | 上海生物芯片有限公司 | Lung cancer image segmentation method, device, terminal and medium based on mixed attention |
CN115690592A (en) * | 2023-01-05 | 2023-02-03 | 阿里巴巴(中国)有限公司 | Image processing method and model training method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11734851B2 (en) | Face key point detection method and apparatus, storage medium, and electronic device | |
EP3732619B1 (en) | Convolutional neural network-based image processing method and image processing apparatus | |
US11551333B2 (en) | Image reconstruction method and device | |
CN110188795B (en) | Image classification method, data processing method and device | |
CN112288011B (en) | Image matching method based on self-attention deep neural network | |
EP3923233A1 (en) | Image denoising method and apparatus | |
CN111340077B (en) | Attention mechanism-based disparity map acquisition method and device | |
CN111860398B (en) | Remote sensing image target detection method and system and terminal equipment | |
CN110765860A (en) | Tumble determination method, tumble determination device, computer apparatus, and storage medium | |
CN113191489B (en) | Training method of binary neural network model, image processing method and device | |
Yue et al. | A novel attention fully convolutional network method for synthetic aperture radar image segmentation | |
CN114049491A (en) | Fingerprint segmentation model training method, fingerprint segmentation device, fingerprint segmentation equipment and fingerprint segmentation medium | |
CN110222718A (en) | The method and device of image procossing | |
Ren et al. | Enhanced non-local total variation model and multi-directional feature prediction prior for single image super resolution | |
CN111696038A (en) | Image super-resolution method, device, equipment and computer-readable storage medium | |
CN114612681A (en) | GCN-based multi-label image classification method, model construction method and device | |
CN112149526A (en) | Lane line detection method and system based on long-distance information fusion | |
CN112989919B (en) | Method and system for extracting target object from image | |
CN116071625B (en) | Training method of deep learning model, target detection method and device | |
Ye et al. | Multi-directional feature fusion super-resolution network based on nonlinear spiking neural P systems | |
CN116311290A (en) | Handwriting and printing text detection method and device based on deep learning | |
CN113591838B (en) | Target detection method, device, electronic equipment and storage medium | |
CN117036658A (en) | Image processing method and related equipment | |
CN113610856A (en) | Method and device for training image segmentation model and image segmentation | |
JP2019125128A (en) | Information processing device, control method and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |