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.
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.