An image recognition method, device, apparatus and storage medium

CN115908985BActive Publication Date: 2026-09-18ZKTECO CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211717014.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2026-09-18
Estimated Expiration
2042-12-29

AI Technical Summary

Technical Problem

[0004]有鉴于此,本申请提供了一种图像识别方法、装置、设备和存储介质,用于解决现有方法是对图像进行全局光照扩增,但是这种方法只适用于所有部位光线相同的图像,若对于存在不同明暗效果的图像,反而会降低该图像的精度,因此不能识别到准确的特征的问题

Benefits of technology

[0055]As can be seen from the above technical solution, this application obtains a first initial image and establishes an all-zero image; draws the all-zero image to obtain a first drawn image; performs mean sampling on the first drawn image using a preset random number to obtain a second drawn image; adds the second drawn image to the first initial image to obtain a second initial image; performs comprehensive amplification on the second initial image to obtain a third initial image; inputs the first initial image and the third initial image into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and target features; the recognition model is trained using multiple initial image samples as training samples, and using the intermediate feature map and target features corresponding to each initial image sample as sample labels. This solution establishes an all-zero image and uses this all-zero image to amplify the initial image with local illumination to obtain a first drawn image, as well as a first initial image and a third initial image. Then, the model is trained, and the trained recognition model can obtain more accurate image features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115908985B_ABST
    Figure CN115908985B_ABST
Patent Text Reader

Abstract

The application discloses an image recognition method, device and equipment and a storage medium. The method comprises the following steps: obtaining a first initial image and establishing a full-zero image; drawing the full-zero image to obtain a first drawing image; collecting mean values in the first drawing image by using a preset random number to obtain a second drawing image; adding the second drawing image and the first initial image to obtain a second initial image; comprehensively amplifying the second initial image to obtain a third initial image; inputting the first initial image and the third initial image into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image and a target feature; and the recognition model is trained by taking a plurality of initial image samples as training samples and taking the intermediate feature map corresponding to each initial image sample and the target feature as sample labels. The scheme can improve the recognition accuracy of the picture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image recognition technology, specifically to an image recognition method, apparatus, device, and storage medium. Background Technology

[0002] As we all know, the same image will appear differently in different scenes. For example, different lighting conditions or light sources have a significant impact on the appearance of an image. In the field of image recognition, images acquired during the image acquisition process are also captured under low-light or no-light conditions. However, such images often suffer from low recognition accuracy and cannot yield the corresponding precise features.

[0003] The existing solution is to perform global illumination augmentation on the image. However, this method is only applicable to images where all parts are illuminated in the same way. For images with different brightness levels, it will reduce the accuracy of the image and therefore cannot identify accurate features. Summary of the Invention

[0004] In view of this, this application provides an image recognition method, apparatus, device, and storage medium to solve the problem that existing methods perform global illumination amplification on images, but this method is only applicable to images where all parts are illuminated at the same level. For images with different brightness and darkness effects, it will reduce the accuracy of the image and thus fail to recognize accurate features.

[0005] To achieve the above objectives, the following solution is proposed:

[0006] Firstly, an image recognition method includes:

[0007] Obtain the first initial image and create an all-zero image;

[0008] The all-zero image is drawn to obtain the first drawn image;

[0009] The second image is obtained by averaging the first drawn image using a preset random number.

[0010] Add the second drawn image to the first initial image to obtain the second initial image;

[0011] The second initial image is amplified to obtain the third initial image;

[0012] The first initial image and the third initial image are input into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and a target feature. The recognition model is trained using multiple initial image samples as training samples and the intermediate feature map and target feature corresponding to each initial image sample as sample labels.

[0013] Preferably, the step of drawing the all-zero image to obtain the first drawn image includes:

[0014] Obtain the height, width, and number of channels of the first initial image;

[0015] Based on the height, width, and number of channels of the first initial image, establish the brightness range, radius range, and center coordinate range corresponding to the first initial image;

[0016] Multiple solid circles are established based on the brightness range, radius range, and center coordinate range;

[0017] Each of the solid circles is drawn on the all-zero image to obtain the first drawn image.

[0018] Preferably, the step of comprehensively amplifying the second initial image to obtain the third initial image includes:

[0019] The second initial image is randomly color-amplified to obtain the first amplified image;

[0020] The first amplified image is locally amplified by illumination to obtain a second amplified image;

[0021] The second amplified image is amplified by perspective transformation to obtain the third amplified image;

[0022] The third amplified image is randomly cropped to obtain the third initial image.

[0023] Preferably, the step of inputting the first initial image and the third initial image into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and target features includes:

[0024] The first initial image and the third initial image are concatenated to obtain the input image;

[0025] The input image is downsampled using the downsampling module in the recognition model to obtain an intermediate feature map;

[0026] The intermediate feature map is convolved using the convolution module in the recognition model to obtain a feature image;

[0027] The feature image is batch normalized using the normalization module in the recognition model to obtain a normalized image;

[0028] The normalized image is flattened using the flattening module in the recognition model to obtain the target vector corresponding to the normalized image;

[0029] The target vector is reduced in dimensionality using the fully connected layer in the recognition model to obtain the target features.

[0030] Preferably, the step of downsampling the input image using the downsampling module in the recognition model to obtain an intermediate feature map includes:

[0031] The input image is sequentially passed through N downsampling convolution sub-modules in the downsampling module to obtain N output images;

[0032] The last N-1 output images are combined to obtain the intermediate feature map.

[0033] Preferably, the training process of the recognition model includes:

[0034] For each initial image sample, obtain the sequence number label of that initial image sample;

[0035] Identify the amplified sample corresponding to the initial image sample;

[0036] Determine the intermediate feature map corresponding to the initial image sample, the intermediate feature map corresponding to the amplified sample, and the target features;

[0037] Based on the sequence label of the initial image sample, the intermediate feature map corresponding to the initial image sample, the intermediate feature map corresponding to the amplified sample, and the target features, the total loss result corresponding to the initial image sample is obtained;

[0038] Obtain the initial parameters corresponding to the recognition model;

[0039] With the preset optimal parameters as the target, the initial parameters are optimized based on the total loss function to obtain the trained recognition model.

[0040] Preferably, the step of obtaining the total loss result corresponding to the initial image sample based on the sequence label of the initial image sample, the intermediate feature map corresponding to the initial image sample, the intermediate feature map corresponding to the amplified sample, and the target features includes:

[0041] The target features and sequence labels are input into a preset first loss function, and the first loss result is output.

[0042] The intermediate feature map corresponding to the initial image and the intermediate feature map corresponding to the amplified sample are input into the preset second loss function, and the second loss result is output.

[0043] The total loss result is obtained based on the first loss result and the second loss result.

[0044] In a second aspect, an image recognition device includes:

[0045] The acquisition module is used to acquire the first initial image and create an all-zero image;

[0046] A drawing module is used to draw the all-zero image to obtain a first drawn image;

[0047] The mean acquisition module is used to acquire the mean value from the first drawn image using a preset random number to obtain the second drawn image;

[0048] The addition module is used to add the second drawn image to the first initial image to obtain the second initial image;

[0049] The comprehensive amplification module is used to comprehensively amplify the second initial image to obtain a third initial image;

[0050] The feature acquisition module is used to input the first initial image and the third initial image into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and a target feature; the recognition model is trained using multiple initial image samples as training samples and the intermediate feature map and target feature corresponding to each initial image sample as sample labels.

[0051] Thirdly, an image recognition device includes a memory and a processor;

[0052] The memory is used to store programs;

[0053] The processor is configured to execute the program to implement the various steps of the image recognition method as described in the first aspect.

[0054] Fourthly, a storage medium having a computer program stored thereon, which, when executed by a processor, implements the various steps of the image recognition method as described in the first aspect.

[0055] As can be seen from the above technical solution, this application obtains a first initial image and establishes an all-zero image; draws the all-zero image to obtain a first drawn image; performs mean sampling on the first drawn image using a preset random number to obtain a second drawn image; adds the second drawn image to the first initial image to obtain a second initial image; performs comprehensive amplification on the second initial image to obtain a third initial image; inputs the first initial image and the third initial image into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and target features; the recognition model is trained using multiple initial image samples as training samples, and using the intermediate feature map and target features corresponding to each initial image sample as sample labels. This solution establishes an all-zero image and uses this all-zero image to amplify the initial image with local illumination to obtain a first drawn image, as well as a first initial image and a third initial image. Then, the model is trained, and the trained recognition model can obtain more accurate image features. Attached Figure Description

[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0057] Figure 1 An optional flowchart of an image recognition method provided in an embodiment of this application;

[0058] Figure 2 A model training process provided in this application embodiment;

[0059] Figure 3 This is a schematic diagram of the structure of an image recognition device provided in an embodiment of this application;

[0060] Figure 4 This is a schematic diagram of the structure of an image recognition device provided in an embodiment of this application. Detailed Implementation

[0061] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0062] As is well known, the same image will appear differently in different scenes. For example, different lighting conditions or light sources have a significant impact on the appearance of an image. In the field of image recognition, images acquired during image acquisition are often taken under low-light or no-light conditions. Such images often suffer from low recognition accuracy and fail to yield accurate feature maps. Taking palm recognition as an example, most existing palm recognition methods use global illumination augmentation to increase the variation in palm illumination. However, after supplementing the illumination, local illumination variations appear in the palm image, thus affecting the accuracy of palm feature extraction.

[0063] The existing solution is to perform global illumination augmentation on the image. However, this method is only applicable to images where all parts are illuminated in the same way. For images with different brightness levels, it will reduce the accuracy of the image and therefore cannot identify accurate features.

[0064] This invention provides an image recognition method that can be applied to various computer terminals or smart terminals. The executing entity can be the processor or server of the computer terminal or smart terminal. The method flowchart is shown below. Figure 1 As shown, it specifically includes:

[0065] S1: Obtain the first initial image and create an all-zero image.

[0066] In this application, the first initial image can be any type of image, and its height, width, and number of channels can be set; this embodiment does not impose any limitations on this. A zero-valued image refers to an image where every pixel value is 0. It should be noted that this zero-valued image has the same shape as the first initial image; "same shape" means that the height, width, and number of channels are all the same.

[0067] S2: Draw the all-zero image to obtain the first drawn image.

[0068] Specifically, the process of drawing an all-zero image can include drawing solid circles in the all-zero image.

[0069] S3: Use a preset random number to collect the mean value in the first drawn image to obtain the second drawn image.

[0070] S4: Add the second drawn image to the first initial image to obtain the second initial image.

[0071] Because the second drawn image has the same shape as the image with all zeros, the second drawn image can be added pixel by pixel to the first initial image to obtain the second initial image. It can be understood that the second initial image still has the same shape as the first initial image.

[0072] S5: Perform comprehensive amplification on the second initial image to obtain a third initial image.

[0073] The process of comprehensively amplifying the second initial image can be localized, and the local lighting effects of the second initial image are gradually changed.

[0074] S6: Input the first initial image and the third initial image into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and a target feature; the recognition model is trained using multiple initial image samples as training samples and the intermediate feature map and target feature corresponding to each initial image sample as sample labels.

[0075] In this application, a recognition model can be pre-trained to process the first initial image and the third initial image to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and target features. The target features are features that correspond to both the first initial image and the third initial image.

[0076] As can be seen from the above technical solution, this application obtains a first initial image and establishes an all-zero image; draws the all-zero image to obtain a first drawn image; performs mean sampling on the first drawn image using a preset random number to obtain a second drawn image; adds the second drawn image to the first initial image to obtain a second initial image; performs comprehensive amplification on the second initial image to obtain a third initial image; inputs the first initial image and the third initial image into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and target features; the recognition model is trained using multiple initial image samples as training samples, and using the intermediate feature map and target features corresponding to each initial image sample as sample labels. This solution establishes an all-zero image and uses this all-zero image to amplify the initial image with local illumination to obtain a first drawn image, as well as a first initial image and a third initial image. Then, the model is trained, and the trained recognition model can obtain more accurate image features.

[0077] The method provided in this embodiment of the invention involves drawing the all-zero image to obtain a first drawn image, the process of which is described in detail below:

[0078] Obtain the height, width, and number of channels of the first initial image; based on the height, width, and number of channels of the first initial image, establish a brightness range, radius range, and center coordinate range corresponding to the first initial image; establish multiple solid circles based on the brightness range, radius range, and center coordinate range; draw each of the solid circles in the all-zero image to obtain the first drawn image.

[0079] Specifically, in one example, we first obtain an initial image input with shape [H,W,3], where H represents the height of the image, W represents the width of the image, and 3 represents the number of channels in the image. We then create a zero-valued image bright with shape [H,W,3]. In this example, the brightness range and radius range can be set to [-64,64] and [20,200] respectively. The x-coordinate range of the center coordinates is [0,W], and the y-coordinate range is [0,H]. Then, we draw 10 solid circles on this zero-valued image, each with brightness within the brightness range, radius within the radius range, and center within the center coordinate range, to obtain the first drawn image.

[0080] The above scheme describes the process of drawing the all-zero image to obtain the first drawn image in this application. The process of comprehensively amplifying the second initial image to obtain the third initial image in this application will be described in detail below.

[0081] The second initial image is randomly color-amplified to obtain a first amplified image; the first amplified image is locally illuminated to obtain a second amplified image; the second amplified image is perspective-transformed to obtain a third amplified image; and the third amplified image is randomly cropped to obtain a third initial image.

[0082] Specifically, for the second initial image, random Gamma nonlinear brightness adjustment, i.e., random color augmentation, can be applied to adjust the contrast, brightness, hue, and saturation of the second initial image, and the channels are randomly rearranged to obtain the first augmented image. Then, local illumination augmentation is applied to the first augmented image to obtain the second augmented image. Next, perspective transformation augmentation on a plane is applied, including rotation, scaling, translation, shearing, and perspective distortion. This includes hand rotation augmentation with uniform sampling within the range of [-5, 5] degrees to obtain the third augmented image. The third augmented image is then described below. The region at the center, with height H and width W, is randomly cropped. The random cropping ratio can be set to [0.9, 1]. The random cropping process can include: uniformly and randomly sampling two ratios, denoted as sh and sw, from the interval [0.9, 1]. Then, a position is randomly selected in the upper left corner region of the third augmented image [0:H-int(H*sh), 0:W-int(W*sw)]. This position is used as the upper left corner of the third initial image, and the image region with height nt(H*sh) and width int(W*sw) of the third augmented image is cropped to obtain the third initial image. No channel cropping is performed on the third augmented image during this process. Additionally, pixels outside the effective range of the image are filled with 0 pixels. Finally, the pixel values ​​are normalized to the range [0, 1]. Since the pixel value range of the third augmented image is between [0, 255], the normalization here refers to dividing each pixel value of the input image by 255 to obtain the output floating-point image, whose value range is between [0, 1]. Simultaneously, during each data augmentation operation, the position (x, y coordinates) of each location in the augmented image relative to the initial input image space is recorded, along with the pointmap of the position recorded during the last augmentation operation, and its shape is [H, W, 2]. In the above process, if local illumination augmentation is not performed, it can be denoted as P(w / o A).

[0083] The process of inputting the first initial image and the third initial image into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and target features will be described below.

[0084] The first initial image and the third initial image are concatenated to obtain the input image;

[0085] The input image is downsampled using the downsampling module in the recognition model to obtain an intermediate feature map;

[0086] The intermediate feature map is convolved using the convolution module in the recognition model to obtain a feature image;

[0087] The feature image is batch normalized using the normalization module in the recognition model to obtain a normalized image;

[0088] The normalized image is flattened using the flattening module in the recognition model to obtain the target vector corresponding to the normalized image;

[0089] The target vector is reduced in dimensionality using the fully connected layer in the recognition model to obtain the target features.

[0090] Specifically, the model is based on the original MobileNetV2 model structure, but with improvements: the activation function in the model is replaced with the commonly used activation function FReLU, which has better performance.

[0091] In the process of downsampling the input image using the downsampling module in the recognition model to obtain an intermediate feature map, the input image is sequentially passed through N downsampling convolutional sub-modules in the downsampling module to obtain N output images; the last N-1 output images are then combined to obtain the intermediate feature map. Optionally, N can be set to 5, and the 5 downsampling convolutional sub-modules can be set to stride=2. The stride parameter is the span parameter used by the convolutional layer. When stride=1, the convolution operation applies a convolutional kernel to each unit on the feature map; when stride=2, the convolution operation applies a convolutional kernel to every 2 units on the feature map. This reduces the height and width of the output feature map by about half.

[0092] In one embodiment provided in this application, the training process of the recognition model may include:

[0093] For each initial image sample, obtain its sequence number label; determine the amplified sample corresponding to the initial image sample; determine the intermediate feature map corresponding to the initial image sample, the intermediate feature map corresponding to the amplified sample, and the target feature; based on the sequence number label of the initial image sample, the intermediate feature map corresponding to the initial image sample, the intermediate feature map corresponding to the amplified sample, and the target feature, obtain the total loss result corresponding to the initial image sample; obtain each initial parameter corresponding to the recognition model; with the preset optimal parameters as the target, optimize each initial parameter based on the total loss function to obtain the trained recognition model.

[0094] Specifically, the initial image sample is analogous to the first initial image, and the amplified image is analogous to the third initial image.

[0095] In one example, the initial image sample has a shape of [B,3,224,192], where B represents the batch size used by the model for computation. The model outputs recognition features of shape [B,256], and a list of intermediate feature maps (louts) of shapes [B,64,56,48], [B,128,28,24], [B,256,14,12], and [B,512,7,6] (used to learn the invariance of intermediate feature maps to data augmentation in the palm recognition model). The feature map obtained from the last downsampling has a shape of [B,512,7,6], and then this feature map is subjected to two convolutions with 512 input / output channels, a kernel size of 3, padding of 0, and 8 groups. Batch normalization was then performed to obtain a feature map with the shape [B, 512, 3, 2]. This was then flattened into a vector, and a fully connected layer with an input dimension of 512*3*2 and an output dimension of 256 was applied to obtain the recognition features or feature map corresponding to the initial training sample. Simultaneously, based on a self-supervised learning loss based on image location, the same model was used to extract intermediate feature maps for two views of the same image. The features at corresponding points in the two intermediate feature maps needed to be similar, thus optimizing the invariance of the intermediate feature maps of the palm recognition model to data augmentation. This loss was used in conjunction with the palm recognition task loss to train the palm recognition model.

[0096] Before training the model, we first need to clarify the model's input: the model input consists of a batch of normalized original images before amplification and a batch of amplified images (note that the amplified batch of images comes first, followed by the batch of normalized original images before amplification). This can be understood as the original images being analogous to the first initial image, and the amplified images being analogous to the third initial image. The corresponding batch of pointmaps forms pointmaps with a shape of [batch, height, width, 2]. The model input data is the data composed of the original and amplified images concatenated along the batch dimension, with a layout of [2*batch, channels, height, width]. Here, the first batch of images is the amplified image, and the second batch is the normalized original image before amplification. `channels` represents the number of channels per image (3), `height` is the image height (224), and `width` is the image width (192). Specifically, the first loss function can be the ArcFace loss function, specifically expressed as:

[0097]

[0098] Understandably, this formula uses features corresponding to the original image and features corresponding to the augmented image during calculation, concatenating them to form the target features. Here, m is the interval between different categories of features to be optimized. The optimization objective is to make the cosine angle between features of different categories greater than m, and to minimize the cosine angle between features of the same category, preferably s = 30° and m = 0.5. The input to this loss function is the recognition features corresponding to the palm image and the cosine angle between the center vectors of each category, and the output is the classification loss based on metric learning. To identify features and the yth i The angle between the class center vectors, where i is the i-th index in the batch during batch stochastic gradient descent, θ j Let θ be the angle between the feature vector and the center of the j-th class, and n be the total number of classes. (Calculate the angle θ between the feature vector and the class center, then calculate...) The loss is composed of the ArcFace loss module.

[0099] The second loss function can be The loss function is expressed as follows:

[0100] fmap aligned [l]:=align_fmap(louts[l][N:],pointmaps)

[0101]

[0102] Where, louts is the list of intermediate feature maps output by step 1 of module 2, N is the number of original images before amplification in step 2 of module 3, and pointmaps is the corresponding batch of pointmaps; cossim calculates the cosine similarity between the two feature maps in the first dimension (the dimension number starts from 0).

[0103] Total loss used in the model The sum of the two losses mentioned above is expressed as follows:

[0104]

[0105] The following is an explanation of the align_fmap function:

[0106] enter:

[0107] The first input is the feature map to be aligned, denoted as fmaps, with its shape [B,C,H,W], where B is the batch size, C is the number of channels, H is the height, and W is the width.

[0108] The second input is the pointmaps generated after augmenting the original image, with a shape of [B,224,192,2], where B is the batch size, 224 is the height, 192 is the width, and 2 is the number of channels;

[0109] Output: Aligned feature map, with shape [B,C,H,W];

[0110] The calculation process includes:

[0111] The pointmaps are scaled to a size of [B,H,W,2] using bilinear interpolation, while pointmaps[...,0]*=W / 192; pointmaps[...,1]*=H / 224;

[0112] By using the x, y coordinates recorded at each position on the pointmaps, the feature values ​​at the corresponding positions on the fmaps are extracted through bilinear interpolation (feature values ​​outside the valid range of the fmaps space are set to 0), and the output feature map is obtained.

[0113] During model training, initialization is performed first: the minimum error rate of the model on the validation set is initialized to positive infinity. Then, the model training process iterates 21.4 million times. Each iteration involves the following calculations: N random hand images and their corresponding labels are read. Following step 2, the model input is fed into the hand recognition model M to extract target features and intermediate feature maps (louts). The target features and their corresponding labels are then fed into the ArcFace loss module to calculate the loss. The loss is calculated based on the intermediate feature maps (louts) output by the model using pointmaps. Finally, the gradient of the overall loss with respect to the ArcFace loss module and the hand recognition model parameters is calculated, and these parameters are learned using gradient descent. If the current iteration count is a multiple of 5000, the model is validated on the hand recognition validation set. After validation, the model's error rate at FRR@FAR = 1e-5 is obtained. If this error rate is less than the previous minimum error rate on the validation set, the current minimum error rate on the validation set is updated, and the optimal model parameters are saved to a file.

[0114] After the model training is complete, the model can be validated. The validation process includes:

[0115] The acquired palm image to be verified is input into the palm recognition model for palm recognition feature extraction. The extracted palm features are compared pairwise to calculate the cosine similarity score. Based on the cosine similarity score, the error rate of the palm recognition model at FRR@FAR=1e-5 is evaluated using the ROC algorithm.

[0116] In this embodiment, the ROC performance of the palm recognition model trained based on the above-mentioned data augmentation pipeline P and P(w / o A) is compared. Please refer to Tables 1 and 2. The results show that the ROC performance of the palm recognition model trained based on the data augmentation pipeline P is better than that of P(w / o A) at FAR = 1e-5, with an FRR of 1.52% compared to 1.65% for P(w / o A), representing an improvement of 0.13%.

[0117] Comparison between different models:

[0118] Table 1

[0119]

[0120]

[0121] Table 1 shows the ROC performance of the hand recognition model M trained based on the data augmentation pipeline P.

[0122] Table 2

[0123]

[0124] Table 2 shows the ROC performance of the hand recognition model M trained based on the data augmentation pipeline P (w / o A).

[0125] The hand recognition verification set includes 128 IDs and 6052 hand images. The above process can be described as follows: Figure 2 As shown.

[0126] and Figure 1 Corresponding to the method described above, embodiments of the present invention also provide an image recognition device for [recognizing / recognizing]. Figure 1 In the specific implementation of the method, the image recognition device provided in this embodiment of the invention can be used in computer terminals or various mobile devices, combined with Figure 3 The image recognition device is introduced, such as... Figure 3 As shown, the device may include:

[0127] The acquisition module 10 is used to acquire the first initial image and create an all-zero image;

[0128] The drawing module 20 is used to draw the all-zero image to obtain a first drawn image;

[0129] The mean acquisition module 30 is used to acquire the mean value in the first drawn image using a preset random number to obtain the second drawn image;

[0130] Addition module 40 is used to add the second drawn image to the first initial image to obtain the second initial image;

[0131] The comprehensive amplification module 50 is used to comprehensively amplify the second initial image to obtain a third initial image;

[0132] The feature acquisition module 60 is used to input the first initial image and the third initial image into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and a target feature; the recognition model is trained using multiple initial image samples as training samples and the intermediate feature map and target feature corresponding to each initial image sample as sample labels.

[0133] As can be seen from the above technical solution, this application obtains a first initial image and establishes an all-zero image; draws the all-zero image to obtain a first drawn image; performs mean sampling on the first drawn image using a preset random number to obtain a second drawn image; adds the second drawn image to the first initial image to obtain a second initial image; performs comprehensive amplification on the second initial image to obtain a third initial image; inputs the first initial image and the third initial image into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and target features; the recognition model is trained using multiple initial image samples as training samples, and using the intermediate feature map and target features corresponding to each initial image sample as sample labels. This solution establishes an all-zero image and uses this all-zero image to amplify the initial image with local illumination to obtain a first drawn image, as well as a first initial image and a third initial image. Then, the model is trained, and the trained recognition model can obtain more accurate image features.

[0134] In one example, the drawing module 20 may include:

[0135] The first acquisition module is used to acquire the height, width, and number of channels of the first initial image;

[0136] The module is used to establish a brightness range, radius range, and center coordinate range corresponding to the first initial image based on the height, width, and number of channels of the first initial image.

[0137] A solid circle creation module is used to create multiple solid circles based on the brightness range, radius range, and center coordinate range.

[0138] The first drawing image obtaining module is used to draw each of the solid circles in the all-zero image to obtain the first drawing image.

[0139] In one example, the comprehensive amplification module 50 may include:

[0140] The random color amplification module is used to randomly amplify the second initial image to obtain the first amplified image;

[0141] A local illumination amplification module is used to perform local illumination amplification on the first amplified image to obtain a second amplified image;

[0142] The perspective transformation amplification module is used to perform perspective transformation amplification on the second amplified image to obtain a third amplified image;

[0143] The random cropping module is used to randomly crop the third amplified image to obtain the third initial image.

[0144] In one example, the feature-obtaining module 60 may include:

[0145] A connection module is used to connect the first initial image and the third initial image to obtain an input image;

[0146] The downsampling module is used to downsample the input image using the downsampling module in the recognition model to obtain an intermediate feature map;

[0147] The convolution module is used to convolve the intermediate feature map using the convolution module in the recognition model to obtain a feature image;

[0148] The batch normalization module is used to perform batch normalization on the feature image using the normalization module in the recognition model to obtain a normalized image;

[0149] A flattening module is used to flatten the normalized image using the flattening module in the recognition model to obtain a target vector corresponding to the normalized image.

[0150] The dimensionality reduction module is used to reduce the dimensionality of the target vector using the fully connected layer in the recognition model to obtain the target features.

[0151] In one example, the downsampling module may include:

[0152] The output image acquisition module is used to sequentially pass the input image through N downsampling convolution sub-modules in the downsampling module to obtain N output images;

[0153] The combination module is used to combine the last N-1 output images to obtain an intermediate feature map.

[0154] In one example, the device may include:

[0155] The sequence number and label acquisition module is used to acquire the sequence number and label of each initial image sample.

[0156] The amplified sample determination module is used to determine the amplified sample corresponding to the initial image sample;

[0157] The feature determination module is used to determine the intermediate feature map corresponding to the initial image sample, the intermediate feature map corresponding to the amplified sample, and the target features;

[0158] The total loss result acquisition module is used to obtain the total loss result corresponding to the initial image sample based on the sequence label of the initial image sample, the intermediate feature map corresponding to the initial image sample, the intermediate feature map corresponding to the amplified sample, and the target features;

[0159] The parameter acquisition module is used to acquire the initial parameters corresponding to the recognition model;

[0160] The optimization module is used to optimize each of the initial parameters based on the total loss function with the preset optimal parameters as the target, so as to obtain a trained recognition model.

[0161] In one example, the module that obtains the total loss result may include:

[0162] The first loss result acquisition module is used to input the target features and sequence labels into a preset first loss function and output the first loss result;

[0163] The second loss result acquisition module is used to input the intermediate feature map corresponding to the initial image and the intermediate feature map corresponding to the amplified sample into the preset second loss function and output the second loss result;

[0164] The module for obtaining the total loss result is used to obtain the total loss result based on the first loss result and the second loss result.

[0165] Furthermore, embodiments of this application provide an image recognition device. Optionally, Figure 4 A hardware block diagram of an image recognition device is shown, with reference to... Figure 4 The hardware structure of an image recognition device may include: at least one processor 01, at least one communication interface 02, at least one memory 03, and at least one communication bus 04.

[0166] In this embodiment, the number of processor 01, communication interface 02, memory 03 and communication bus 04 is at least one, and processor 01, communication interface 02 and memory 03 communicate with each other through communication bus 04.

[0167] Processor 01 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.

[0168] Memory 03 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device.

[0169] The memory stores a program, which the processor can call to execute. The program is used to perform the following image recognition method, including:

[0170] Obtain the first initial image and create an all-zero image;

[0171] The all-zero image is drawn to obtain the first drawn image;

[0172] The second image is obtained by averaging the first drawn image using a preset random number.

[0173] Add the second drawn image to the first initial image to obtain the second initial image;

[0174] The second initial image is amplified to obtain the third initial image;

[0175] The first initial image and the third initial image are input into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and a target feature. The recognition model is trained using multiple initial image samples as training samples and the intermediate feature map and target feature corresponding to each initial image sample as sample labels.

[0176] Optionally, the refined and extended functions of the program can be found in the description of the image recognition method in the method embodiments.

[0177] This application embodiment also provides a storage medium that can store a program suitable for execution by a processor. When the program runs, it controls the device where the storage medium is located to execute the following image recognition method, including:

[0178] Obtain the first initial image and create an all-zero image;

[0179] The all-zero image is drawn to obtain the first drawn image;

[0180] The second image is obtained by averaging the first drawn image using a preset random number.

[0181] Add the second drawn image to the first initial image to obtain the second initial image;

[0182] The second initial image is amplified to obtain the third initial image;

[0183] The first initial image and the third initial image are input into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and a target feature. The recognition model is trained using multiple initial image samples as training samples and the intermediate feature map and target feature corresponding to each initial image sample as sample labels.

[0184] Specifically, the storage medium can be a computer-readable storage medium, which can be an electronic storage device such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM.

[0185] Optionally, the refined and extended functions of the program can be found in the description of the image recognition method in the method embodiments.

[0186] Furthermore, the functional modules in the various embodiments of this disclosure can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. If the function is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a live streaming device, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this disclosure.

[0187] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0188] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0189] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An image recognition method, characterized in that, include: Obtain the first initial image and create an all-zero image; The process of drawing the all-zero image to obtain a first drawn image includes: obtaining the height, width, and number of channels of the first initial image; establishing a brightness range, radius range, and center coordinate range corresponding to the first initial image based on the height, width, and number of channels of the first initial image; establishing multiple solid circles based on the brightness range, radius range, and center coordinate range; and drawing each of the solid circles in the all-zero image to obtain the first drawn image. The mean value of the first drawn image is collected using a preset random number to obtain the second drawn image; Add the second drawn image to the first initial image to obtain the second initial image; The second initial image is amplified to obtain the third initial image; The first initial image and the third initial image are input into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and a target feature. The recognition model is trained using multiple initial image samples as training samples and the intermediate feature map and target feature corresponding to each initial image sample as sample labels. The initial image samples are sample images used to train the recognition model, including the original image corresponding to the first initial image and the amplified image corresponding to the third initial image.

2. The method according to claim 1, characterized in that, The process of comprehensively amplifying the second initial image to obtain the third initial image includes: The second initial image is randomly color-amplified to obtain the first amplified image; The first amplified image is locally amplified by illumination to obtain a second amplified image; The second amplified image is amplified by perspective transformation to obtain the third amplified image; The third amplified image is randomly cropped to obtain the third initial image.

3. The method according to claim 1, characterized in that, The step of inputting the first initial image and the third initial image into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and target features includes: The first initial image and the third initial image are concatenated to obtain the input image; The input image is downsampled using the downsampling module in the recognition model to obtain an intermediate feature map; The intermediate feature map is convolved using the convolution module in the recognition model to obtain a feature image; The feature image is batch normalized using the normalization module in the recognition model to obtain a normalized image; The normalized image is flattened using the flattening module in the recognition model to obtain the target vector corresponding to the normalized image; The target vector is reduced in dimensionality using the fully connected layer in the recognition model to obtain the target features.

4. The method according to claim 3, characterized in that, The step of downsampling the input image using the downsampling module in the recognition model to obtain an intermediate feature map includes: The input image is sequentially processed through the downsampling module. Each downsampled convolutional submodule yields... One output image; After The output images are combined to obtain an intermediate feature map.

5. The method according to claim 1, characterized in that, The training process of the recognition model includes: For each initial image, obtain the sequence number label of that initial image; Determine the amplified sample corresponding to the first initial image; Determine the intermediate feature map corresponding to the first initial image, the intermediate feature map corresponding to the amplified sample, and the target features; Based on the sequence label of the first initial image, the intermediate feature map corresponding to the first initial image, the intermediate feature map corresponding to the amplified sample, and the target features, the total loss result corresponding to the first initial image is obtained; Obtain the initial parameters corresponding to the recognition model; With the preset optimal parameters as the target, the initial parameters are optimized based on the total loss result to obtain a trained recognition model.

6. The method according to claim 5, characterized in that, The process of obtaining the total loss result corresponding to the first initial image based on the sequence label of the first initial image, the intermediate feature map corresponding to the first initial image, the intermediate feature map corresponding to the amplified sample, and the target features includes: The target features and sequence labels are input into a preset first loss function, and the first loss result is output. The intermediate feature map corresponding to the first initial image and the intermediate feature map corresponding to the amplified sample are input into the preset second loss function, and the second loss result is output. The total loss result is obtained based on the first loss result and the second loss result.

7. An image recognition device, characterized in that, include: The acquisition module is used to acquire the first initial image and create an all-zero image; A drawing module is used to draw the all-zero image to obtain a first drawn image; including: obtaining the height, width, and number of channels of the first initial image; establishing a brightness range, radius range, and center coordinate range corresponding to the first initial image based on the height, width, and number of channels of the first initial image; establishing multiple solid circles based on the brightness range, radius range, and center coordinate range; and drawing each of the solid circles in the all-zero image to obtain the first drawn image; The mean acquisition module is used to acquire the mean value from the first drawn image using a preset random number to obtain the second drawn image; The addition module is used to add the second drawn image to the first initial image to obtain the second initial image; The comprehensive amplification module is used to comprehensively amplify the second initial image to obtain a third initial image; The feature acquisition module is used to input the first initial image and the third initial image into a pre-set recognition model to obtain an intermediate feature map corresponding to the first initial image, an intermediate feature map corresponding to the third initial image, and a target feature. The recognition model is trained using multiple initial image samples as training samples and the intermediate feature map and target feature corresponding to each initial image sample as sample labels. The initial image samples are sample images used to train the recognition model, including the original image corresponding to the first initial image and the amplified image corresponding to the third initial image.

8. An image recognition device, characterized in that, Including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the various steps of the image recognition method as claimed in any one of claims 1-6.

9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the various steps of the image recognition method as claimed in any one of claims 1-6.

Citation Information

Patent Citations

  • Human visual perception simulation-based self-adaptive low-illumination image enhancement method

    CN105046663A

  • Multi-modal pre-training model training method and device, equipment and storage medium

    CN114005012A