Image recognition method, device, electronic device and readable storage medium

Through the face feature analysis model, the face image is decomposed into multiple age feature maps and mixed these feature information, which solves the problem of singleness of character age recognition in photo album management in the prior art, and realizes accurate age recognition and refined management of character images in the photo album.

CN115116116BActive Publication Date: 2025-04-25VIVO MOBILE COMM HANGZHOU CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210836939.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-15
Publication Date
2025-04-25
Estimated Expiration
2042-07-15

AI Technical Summary

Technical Problem

In the prior art, when managing albums through facial recognition, album groups are too single and cannot effectively identify and manage the age changes of characters.

Method used

An image recognition method is adopted to obtain feature information of the face image and input it into the face feature analysis model to output multiple sub-face feature maps, each sub-face feature map corresponds to an age group. Then, the information of these feature maps is mixed to generate feature information with age characteristics for determining the age of the character.

Benefits of technology

It realizes accurate age recognition of the characters' images in the album, supports refined management of characters, and improves the management accuracy of the album.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115116116B_ABST
    Figure CN115116116B_ABST
Patent Text Reader

Abstract

The present application discloses an image recognition method, device, electronic device and readable storage medium, which belongs to the field of artificial intelligence. The method includes: obtaining first facial feature information of a first facial image; inputting the first facial feature information into a facial feature analysis model, and outputting N facial feature maps; the facial feature analysis model includes N sub-facial feature analysis models, and each sub-facial feature analysis model outputs a facial feature map; each sub-facial feature analysis model corresponds to an age group; the feature information in the N facial feature maps is mixed to obtain second facial feature information with age characteristics; based on the second facial feature information, the age of the person corresponding to the first facial image is determined; wherein the model parameters in any of the N sub-facial feature analysis models are used to characterize: the age characteristics of the age group corresponding to the any sub-facial feature analysis model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence, and specifically relates to an image recognition method, an electronic device and a readable storage medium. Background Art

[0002] Nowadays, with the development of electronic technology, users can use electronic devices to take photos and store the photos in albums according to the people they take. Therefore, how to organize and manage these images is as important as the photo itself.

[0003] In the related art, when a user wants to manage an album by age recognition, the ages of the characters in the character images in the album are usually manually marked. Then, the album can recognize the age of the characters in the character images, so that the user can obtain an album sorted by the ages of the characters in the character images.

[0004] This makes the sorting process based on the ages of people in the photo album too complicated. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide an image recognition method, an electronic device and a readable storage medium, which can solve the problem of too single album grouping when managing albums through face recognition.

[0006] In a first aspect, an embodiment of the present application provides an image recognition method, which includes: obtaining first facial feature information of a first facial image; inputting the first facial feature information into a facial feature analysis model, and outputting N facial feature graphs; the facial feature analysis model includes N sub-facial feature analysis models, and each sub-facial feature analysis model corresponds to outputting a facial feature graph; each sub-facial feature analysis model corresponds to an age group; mixing the feature information in the N facial feature graphs to obtain second facial feature information with age characteristics; based on the second facial feature information, determining the age of a person corresponding to the first facial image; wherein the model parameters in any one of the N sub-facial feature analysis models are used to characterize: the age characteristics of the age group corresponding to the any one sub-facial feature analysis model; N is an integer greater than 1.

[0007] In a second aspect, an embodiment of the present application provides an image recognition device, which includes: an acquisition module and a processing module; the acquisition module is used to acquire first facial feature information of a first facial image; the processing module is used to input the above-mentioned first facial feature information into a facial feature analysis model, and output N facial feature maps; the facial feature analysis model includes N sub-facial feature analysis models, one sub-facial feature analysis model corresponds to one facial feature map; one sub-facial feature analysis model corresponds to one age group; the above-mentioned processing module is also used to mix the feature information in the above-mentioned N facial feature maps to obtain second facial feature information with age characteristics; the above-mentioned processing module is also used to determine the age of the person corresponding to the first facial image based on the above-mentioned second facial feature information; wherein N is an integer greater than 1.

[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0010] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0011] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0012] In an embodiment of the present application, first facial feature information of a first facial image is obtained; the first facial feature information is input into a facial feature analysis model to output N facial feature graphs; the facial feature analysis model includes N sub-facial feature analysis models, and each sub-facial feature analysis model outputs a facial feature graph; each sub-facial feature analysis model corresponds to an age group; the feature information in the N facial feature graphs is mixed to obtain second facial feature information with age characteristics; based on the second facial feature information, the age of the person corresponding to the first facial image is determined; wherein the model parameters in any one of the N sub-facial feature analysis models are used to characterize: the age characteristics of the age group corresponding to the any one sub-facial feature analysis model; and N is an integer greater than 1. In this way, by utilizing a facial feature analysis model that can reflect the development and changes of facial shapes of people at different age groups, the age of the person in the first facial image is analyzed. Thus, based on the analysis result of the person's age, the accurate age of the person can be obtained, thereby realizing accurate age recognition of the person images of the same person in the album, realizing refined management of the person, and realizing precise management of the album. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 This is one of the flowcharts of an image recognition method provided in an embodiment of the present application;

[0014] Figure 2 This is a second flow chart of an image recognition method provided in an embodiment of the present application;

[0015] Figure 3 This is a third flow chart of an image recognition method provided in an embodiment of the present application;

[0016] Figure 4 This is a fourth flow chart of an image recognition method provided in an embodiment of the present application;

[0017] Figure 5 is a structural schematic diagram of an image recognition device provided in an embodiment of the present application;

[0018] Figure 6 This is one of the hardware structure diagrams of an electronic device provided in an embodiment of the present application;

[0019] Figure 7 This is the second schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0021] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0022] The image recognition method, electronic device, and readable storage medium provided in the embodiments of the present application are described in detail below with reference to specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0023] The image recognition method provided in the embodiment of the present application can be applied to album management scenarios.

[0024] Nowadays, with the development of electronic technology, users can use electronic devices to take pictures, and classify and store the characters in the album according to the characters taken. Therefore, how to organize and manage these images is no less important than the shooting itself. In the related art, in the process of managing the album, the user can generate a character album of a certain character after performing face recognition on the character images in the album. At this time, the user can further manage the images in the character album according to the shooting time of each image in the character album, and then generate the growth album of the character. For example, taking the scenario where the user wants to manage all the images of his child "Xiao Ming" as an example, when the user wants to sort the images of "Xiao Ming" by age, and specifies the child name corresponding to the image as "Xiao Ming", the images of the face of "Xiao Ming" facing the lens or not too big in the album are imported into the same album, and stored in the order of the shooting time of all images, thereby generating the growth album of "Xiao Ming".

[0025] However, when the images in the character album are sorted and stored according to the shooting time, if an image in the character album is not taken by this terminal (such as an image shared by other terminals), the time information carried by the image will be inaccurate or confusing, which will cause the growth path in the final generated growth album to be confusing, and thus fail to reflect the child's growth path from childhood to adulthood.

[0026] In summary, how to solve the problem of overly single album grouping when managing albums through face recognition is a technical problem that needs to be solved urgently in this application.

[0027] In the image recognition method, electronic device and readable storage medium provided in the embodiment of the present application, the first facial feature information of the first facial image is obtained; the first facial feature information obtained is input into the facial feature analysis model, thereby outputting N facial feature graphs; the facial feature analysis model includes N sub-facial feature analysis models, one sub-facial feature analysis model corresponds to one facial feature graph; one sub-facial feature analysis model corresponds to one age group; the feature information in the N facial feature graphs is then mixed to obtain second facial feature information with age characteristics; based on the second facial feature information, the age of the person corresponding to the first facial image is determined; wherein N is an integer greater than 1. In this way, by using the facial feature analysis model that can reflect the development and changes of the face shape of the person in each age group, the age of the person in the first facial image is analyzed, so that based on the age of the person, the person images of the same person in the album can be further refined and managed, thereby realizing diversified management of the album.

[0028] The image recognition method provided in the embodiment of the present application may be executed by an image recognition device, which may be an electronic device or a functional module in the electronic device. The technical solution provided in the embodiment of the present application will be described below using an electronic device as an example.

[0029] The present application embodiment provides an image recognition method. Figure 1 FIG. 1 is a flow chart of an image recognition method provided by an embodiment of the present application. Figure 1 As shown, the image recognition method provided in the embodiment of the present application may include the following steps 201 to 204.

[0030] Step 201: The electronic device obtains first facial feature information of a first facial image.

[0031] In the embodiment of the present application, the first face image may be a face image in an image to be identified, or may be a face image to be identified. For example, the image to be identified may be any image in a person's photo album.

[0032] In the embodiment of the present application, the first facial feature information is feature information of the basic facial features (BaseFeature) in the first facial image. Exemplarily, the basic facial features are usually facial features, contours and other facial structure features in the face.

[0033] In an embodiment of the present application, the electronic device can extract features by inputting the first face image into the basic face feature model, thereby outputting the first face feature information. Exemplarily, the basic face feature model can use the backbone network of a common image classification model, such as MobileNetV3. This part of the network structure is not specific to age. In other words, the model parameters of the basic face feature model are independent of age characteristics.

[0034] Example 1: Taking the input face image A with an image size of 256x256 as an example, the face image A can be input into the basic face feature model for processing, thereby obtaining the basic feature BaseFeature corresponding to the face image A. For example, the number of feature points corresponding to the obtained BaseFeature can be 32x32.

[0035] Step 202: The electronic device inputs the first facial feature information into a facial feature analysis model and outputs N facial feature images.

[0036] In an embodiment of the present application, the above-mentioned facial feature analysis model (also referred to as a multi-feature branch model) includes: N sub-facial feature analysis models, one sub-facial feature analysis model corresponds to the output of a facial feature map; one sub-facial feature analysis model corresponds to an age group, where N is an integer greater than 1.

[0037] In an embodiment of the present application, each of the N age groups corresponding to the above-mentioned N sub-facial feature analysis models may include only one age (that is, each age corresponds to a sub-facial feature analysis model) or may include multiple ages, which is not limited in this embodiment of the present application.

[0038] In the embodiment of the present application, the model parameters in any of the N sub-face feature analysis models are used to characterize the age characteristics of the age group corresponding to any sub-face feature analysis model. That is, the age characteristics corresponding to the sub-face feature analysis models of different age groups are different.

[0039] In the embodiment of the present application, the facial features contained in each facial feature map are related to the age characteristics corresponding to the sub-facial feature analysis model corresponding to the facial feature map.

[0040] Example 2: Combined with the above example 1, Figure 2As shown, taking the facial feature analysis model with 6 branch structures as an example, the 6 branch models (i.e., sub-facial feature analysis models) in the facial feature analysis model correspond to 6 different age groups, for example, newborn to 1 year old, 2 to 3 years old, 4 to 5 years old, 6 to 7 years old, 8 to 14 years old, 15 years old and above. Next, the feature information of the BaseFeature of the facial image A is input into the 6 branch models (i.e., AgeModel_1 to AgeModel_6) in the facial feature analysis model, thereby obtaining 6 facial feature maps corresponding to the 6 branch models.

[0041] Exemplarily, the input of each AgeModel_i is the feature information of the BaseFeature of the above-mentioned face image A. AgeModel_i is actually the backbone network after ResNet18 replaces the convolution kernel, so its processing method only includes convolution operations, that is, AgeFeature_i=AgeModel_i(BaseFeature), where the AgeFeature_i obtained above is a face feature map.

[0042] For example, AgeModel_1 to AgeModel_3 can use 5x5 and 3x3 convolution kernels, while AgeModel_4 to AgeModel_6 can use 5x3 convolution kernels. In this way, in AgeModel_1 to AgeModel_3, the 7x7 convolution kernel in the ResNet18 network structure is replaced by the 5x5 convolution kernel, and the 3x3 convolution kernel is retained. In AgeModel_4 to AgeModel_6, the 7x7 convolution kernel and the 3x3 convolution kernel in the ResNet18 network structure are replaced by the 5x3 convolution kernel to adapt to the actual shape of the input face.

[0043] Step 203: The electronic device mixes the feature information in the N facial feature images to obtain second facial feature information with age characteristics.

[0044] It should be noted that the "age characteristics" in this application refer to facial features that can reflect the age of a person. For example, the age characteristics of a child may be "baby fat", and the age characteristics of an elderly person may be "white hair, age spots, etc."

[0045] In an embodiment of the present application, the electronic device may input feature information in the above-mentioned N facial feature images into a feature blending model (Blender) for linear combination, and output second facial feature information with age characteristics.

[0046] In an embodiment of the present application, the second facial feature information may include feature information of facial features (SelectiveFeature) with age characteristics.

[0047] In the embodiment of the present application, when the electronic device mixes the feature information in the above-mentioned N face feature maps, it mainly obtains the feature information of the SelectiveFeature by linearly combining the feature information in the above-mentioned N face feature maps. Specifically, the above-mentioned linear combination refers to the weighted summation of convex set elements in linear algebra theory (the sum of each weight is equal to 1).

[0048] Step 204: The electronic device determines the age of the person corresponding to the first facial image based on the second facial feature information having age characteristics.

[0049] In an embodiment of the present application, after acquiring the second facial feature information, the electronic device can determine the age group to which the person corresponding to the first facial image belongs based on the age characteristics reflected in the second facial feature information and from the age characteristics reflected in the above N age groups, and determine the age of the person corresponding to the first facial image from the age group.

[0050] In the image recognition method provided in the embodiment of the present application, first facial feature information of a first facial image is obtained; the first facial feature information is input into a facial feature analysis model to output N facial feature graphs; the facial feature analysis model includes N sub-facial feature analysis models, and one sub-facial feature analysis model corresponds to the output of one facial feature graph; one sub-facial feature analysis model corresponds to an age group; the feature information in the N facial feature graphs is mixed to obtain second facial feature information with age characteristics; based on the second facial feature information, the age of the person corresponding to the above-mentioned first facial image is determined; wherein the model parameters in any of the above-mentioned N sub-facial feature analysis models are used to characterize: the age characteristics of the age group corresponding to any of the sub-facial feature analysis models; N is an integer greater than 1. In this way, by utilizing a facial feature analysis model that can reflect the development and changes of facial shapes of people at different age groups, the age of the person in the first facial image is analyzed. Thus, based on the analysis result of the person's age, the accurate age of the person can be obtained, thereby realizing accurate age recognition of the person images of the same person in the album, realizing refined management of the person, and realizing precise management of the album.

[0051] Optionally, in the embodiment of the present application, before the above step 203, the image recognition method provided in the embodiment of the present application further includes steps 301 to 303:

[0052] Step 301: The electronic device splices N facial feature maps according to color channels to obtain a target facial feature map.

[0053] Step 302: The electronic device calculates a correlation value between the feature information of the target facial feature map and the first facial feature information.

[0054] Further optionally, in the embodiment of the present application, in combination with the above step 301 and step 302, the process of the above step 203 "mixing the feature information in the N face feature images to obtain the second face feature information with age characteristics" includes the following step 303:

[0055] Step 303: The electronic device uses the correlation value obtained by the above calculation to mix the feature information in the N facial feature images to obtain second facial feature information with age characteristics.

[0056] In an embodiment of the present application, the correlation value between the feature information of the target facial feature map and the first facial feature information is used to characterize: the degree of correlation between the feature information of the target facial feature map and the first facial feature information.

[0057] In an embodiment of the present application, the electronic device may use the feature information of the target facial feature map and the first facial feature information as two inputs of a correlation evaluation model, respectively, to perform correlation evaluation, thereby obtaining a correlation value (Rvalues) between the two.

[0058] Exemplarily, the above-mentioned correlation evaluation model can be a small convolutional sub-network.

[0059] Exemplarily, the above-mentioned small convolution subnetwork may specifically include: a 3x3 convolution layer, a 1x1 convolution layer, a global average pooling layer, a fully connected layer, and a Sigmoid layer.

[0060] Exemplarily, the parameters of the above-mentioned small convolutional subnetwork are trainable.

[0061] Exemplarily, the Sigmoid layer has N output nodes, each of which outputs a correlation value, that is, the correlation value between the feature information of the target facial feature map and the first facial feature information may include N values.

[0062] In an embodiment of the present application, the electronic device can superimpose image information corresponding to the same color channel in N facial feature images according to the color channel to obtain the second facial feature information.

[0063] It should be noted that when images are stitched according to color channels, the height and width of the images remain unchanged.

[0064] Optionally, in the embodiment of the present application, the process of "the electronic device uses the correlation value calculated above to mix the feature information in the N facial feature images to obtain the second facial feature information with age characteristics" in the above step 303 specifically includes the following steps A and B:

[0065] Step A: The electronic device multiplies the correlation value corresponding to the ith facial feature map by the feature information in the ith facial feature map to obtain the second facial feature information corresponding to the ith facial feature map.

[0066] Among them, i=1,2…,N.

[0067] Step B: The electronic device accumulates the second facial feature information corresponding to each facial feature image in the N facial feature images to obtain the second facial feature information with age characteristics.

[0068] Further optionally, in the embodiment of the present application, the process of "using the correlation value calculated above to mix the feature information in the N face feature images to obtain the second face feature information with age characteristics" in the above step 303 specifically includes the following step 303a:

[0069] Step 303a: The electronic device uses the correlation value obtained by the above calculation to mix the feature information in the N facial feature images based on the first formula to obtain second facial feature information with age characteristics.

[0070] Exemplarily, the first formula is:

[0071] Among them, SelectiveFeature is the second facial feature information with age characteristics;

[0072] AgeFeature i Feature information of the i-th face feature map;

[0073] r i is the above correlation value.

[0074] It should be noted that the processes of step A and step B above can be implemented by the first formula.

[0075] Example 3: Combined with the above example 2, Figure 2 As shown, after the electronic device obtains the 6 facial feature maps corresponding to the above 6 branch models, it can splice the 6 facial feature maps according to the color channel, that is, superimpose the number of channels of the 6 facial feature maps output by AgeModel_1 to AgeModel_6. For example, assuming that the facial feature map corresponding to AgeModel_i is recorded as AgeFeature_i, its size is 32x32x256, that is, the height and width are both 32, and the number of color channels is 256, then splicing by color channel means that the height and width remain unchanged, and the size of the target facial feature map ConcatFeature obtained by splicing after superimposing the number of color channels is 32x32x1536, that is, 32x32x(256x6).

[0076] Next, the electronic device can also splice the feature maps output by AgeModel_1 to AgeModel_6 by channel as an input of the correlation evaluator (REvaluator), and use the feature information of the BaseFeature of the face image A as another input of the correlation evaluator. In this way, the correlation evaluator REvaluator receives the above two inputs, splices the two inputs by channel, and obtains the correlation value through a small convolution subnetwork calculation. Since the above small convolution subnetwork is composed of a 3x3 convolution layer, a 1x1 convolution layer, a global average pooling layer, a fully connected layer, and a Sigmoid layer. Among them, the Sigmoid layer has 6 output nodes, so the correlation value output by the above REvaluator is r i , i=1,…,6.

[0077] In this way, by performing correlation calculation between the target facial feature map (i.e., a spliced ​​map of different facial feature maps) and the above-mentioned first facial feature map (i.e., the basic feature map), the second facial feature information with age characteristics can be further more accurately determined based on the calculated correlation value.

[0078] Optionally, in the embodiment of the present application, the process of "the electronic device determines the age of the person corresponding to the first face image based on the second face feature information having age characteristics" in the above step 204 includes the following steps 401 and 402:

[0079] Step 401: The electronic device inputs the second facial feature information into an age classification model and outputs N probability values.

[0080] Step 402: The electronic device determines the age of the person in the first facial image from the age group corresponding to the maximum probability value among the N first probability values.

[0081] Exemplarily, the N probability values ​​correspond to N age groups, which are age groups corresponding to the sub-face feature analysis models.

[0082] Exemplarily, any probability value among the above-mentioned N probability values ​​is used to represent: the probability that the age of the person corresponding to the first facial image belongs to the age group corresponding to any probability value.

[0083] Exemplarily, the age classification model may include: a global average pooling layer, a fully connected layer, an N-branch output layer, and a Softmax layer.

[0084] For example, the classification formula corresponding to the above age classification model is the following second formula:

[0085] The second formula is: *= argmax i Softmax_i.

[0086] Among them, Softmax_i is the output value of the i-th node in the Softmax layer, i=1,…,N, there are N nodes in the Softmax layer, and one node corresponds to one of the above age groups.

[0087] i* is the node corresponding to the maximum probability value among the N first probability values.

[0088] For example, combined with the above example, if the calculation result is i*=1, it means that the probability value of the first node is the largest, that is, the probability that the first face image input belongs to the corresponding age group is the largest, that is, it is judged that the first face image corresponds to the first age group, that is, the age of the person corresponding to the face image is newborn to 1 year old.

[0089] In this way, by inputting the second facial feature information with age characteristics into the age classification model, the probability of the age group to which the person in the first facial image belongs can be obtained, so that the age of the person in the first facial image can be determined and a unique age label (Classifier) ​​can be obtained.

[0090] In the embodiments of the present application, Figure 2 The training process of all models in the age recognition flowchart shown includes: Since the collected training images have real age labels, the correlation evaluator can be trained using the hot start training method. At the same time, the REvaluator, RValues, Blender and other modules can be ignored during the initial training, and only the training images are used to train the AgeModel_i of the branches corresponding to the age labels of these training images, so that the network can learn age-specific feature information and network weights. In this way, after the branch module (ie, AgeModel_i) is trained and converged, the REvaluator, RValues, Blender and other modules are added for training together. This training method can avoid the problem that complex network structures are difficult to converge from scratch.

[0091] Optionally, in the embodiment of the present application, the image recognition method provided in the embodiment of the present application may further include the following steps A1 and A2:

[0092] Step A1: The electronic device identifies the age of a person corresponding to each image in the first image set.

[0093] Step A2: The electronic device screens out images in the first image set whose ages do not meet a predetermined age condition based on the age of the person corresponding to each image.

[0094] For example, assuming that an album contains adults and children, or some images in the album contain group photos of adults and children, in this case, the images containing adults in the album can be excluded based on the age recognition results of the images to avoid generating a pseudo children's growth video album using photos of adults.

[0095] Optionally, in the embodiment of the present application, the image recognition method provided in the embodiment of the present application may further include the following steps B1 and B2:

[0096] Step B1: The electronic device identifies the age of the person corresponding to each image in the first image set.

[0097] Step B2: The electronic device sorts the images in the first image set in order of age based on the age of the person corresponding to each image, and generates a target image set or a target video.

[0098] For example, based on the child’s age recognition results, the child’s photos can be sorted from young to old to generate a video album that conforms to the child’s growth timeline, truly recording the child’s growth process.

[0099] In the related art, in the process of managing photo albums, after the user performs face recognition on the person images in the album, if the recognized child's face deviates from the lens at a large angle (>70 degrees) or the child's back is photographed, the effectiveness of the face recognition scheme will be greatly reduced, resulting in misclassification or failure to automatically upload to the album.

[0100] In order to solve this problem, the embodiments of the present application can adapt to different shooting situations (for example, frontal or nearly frontal shooting, the face deviating from the camera at a large angle, the face being obscured, the face facing away from the camera, etc.) and provide different image management solutions for different shooting situations.

[0101] Optionally, in the embodiment of the present application, before the above step 201, the image recognition method provided in the embodiment of the present application further includes step 501:

[0102] Step 501: Obtain an image to be recognized.

[0103] Exemplarily, the above-mentioned image to be identified can be any image in the terminal photo album. Specifically, it can be determined according to actual usage, and this application does not limit it.

[0104] Further optionally, in the embodiment of the present application, the “obtaining first facial feature information of the first facial image” in the above step 201 may include the following step 502:

[0105] Step 502: If a face image exists in the image to be recognized and the reliability of the face image meets a first condition, the electronic device acquires feature information of the face image to obtain first face feature information of the first face image.

[0106] Exemplarily, the first condition includes: the confidence of the key points in the face image in the image to be identified is greater than or equal to a predetermined threshold. Further, the confidence of the key points in the face image may be the average of the confidences of each key point in the face image.

[0107] For example, if there is a facial image in the image to be identified and the reliability meets the first condition, it means that the face in the image to be identified is not blocked by a large area, and the face does not deviate from the lens direction by a large angle (>70 degrees). The facial features are reliable and the facial image can be relied upon for age recognition.

[0108] Optionally, in the embodiment of the present application, before the above step 201, the image recognition method provided in the embodiment of the present application further includes steps 503 and 504:

[0109] Step 503: If there is no face image in the image to be identified, or if there is a face image in the image to be identified and the reliability of the face image does not meet the first condition, the electronic device calculates the similarity value between the body feature information of the person in the image to be identified and the body feature information of the person in the image in the target image set.

[0110] Step 504: If the similarity value corresponding to any image in the target image set is greater than a first threshold, the electronic device adds the image to be identified to the target image set.

[0111] Exemplarily, the target image set includes at least one image.

[0112] Exemplarily, the images in the target image set and the image to be identified meet the second condition, wherein the second condition includes: the difference between the timestamp (e.g., shooting time) corresponding to the images in the target image set and the timestamp corresponding to the image to be identified is less than a second threshold, and / or the scene features in the images in the target image set match the scene features in the image to be identified.

[0113] Exemplarily, if there is no facial image in the image to be identified, or if there is a facial image in the image to be identified and the reliability of the facial image does not meet the first condition, it indicates that the face in the image to be identified is blocked by a large area, the face deviates from the lens direction at a large angle (>70 degrees), the facial features are unreliable, and the image cannot be relied upon for age recognition.

[0114] Exemplarily, the shooting time and location of the person's physical feature information in the images in the target image set are consistent with, or close to, the shooting time and location of the person's physical feature information in the image to be identified.

[0115] Exemplarily, when there is no facial image in the image to be identified, or when there is a facial image in the image to be identified and the reliability of the facial image does not meet the first condition, the body feature information of the identified image is obtained, and then the cosine similarity between the body feature information and the body feature information of the person in the image in the target image set is calculated; if the similarity value is greater than a first threshold, the image to be identified corresponding to the body feature information is added to the target image set.

[0116] In this way, when the face image in the image to be identified is reliable, the age of the person in the image to be identified can be recognized and grouped; when the face image in the image to be identified is unreliable, or there is no face image, the cosine similarity between the body feature information in the image to be identified and the body feature information of an image in a certain image collection is calculated, so as to group the images to be identified, and further, when the face image is unreliable or there is no face image, the images can also be grouped.

[0117] The image recognition method provided in this application will be exemplified by two embodiments below.

[0118] In a first possible embodiment:

[0119] This embodiment provides a method for generating a video album that can adapt to different shooting situations (for example, frontal or nearly frontal shooting, the face deviating from the camera at a large angle, the face being blocked, the face facing away from the camera, etc.), and groups each character image according to the character's identity and sorts them by the character's age.

[0120] For example, taking children's images as an example, Figure 3 As shown, it includes the following steps S11 to S17:

[0121] Step S11, obtaining the photo album read and write permissions of the electronic device.

[0122] For example, in order to protect user privacy and respect the user's right to informed consent, the "User Agreement" is displayed to the user before the video album generation function takes effect. After the user agrees to the agreement, the user obtains the read and write permissions of the electronic device album to read the image and generate the album video after processing.

[0123] Step S12: Obtain a user image list.

[0124] Exemplarily, each folder of the photo album in the user's electronic device is traversed to obtain a list of all images.

[0125] Step S13: AI child recognition.

[0126] For example, there are various images in the photo album of the user's electronic device. For each image in the list of all images, it is determined whether it is a child image, thereby screening out all child images and excluding non-child images. Child image recognition can be achieved using mature deep learning-based image classification technology, which will not be described in detail here.

[0127] Exemplarily, the definition of child images is as follows: ① Children under the legal age of 14 are used as the ideal definition, with priority given to children from newborns to 6 years old; ② The image is mainly composed of children, with no restrictions on the number of children, clothing, or the environment they are in. In other words, if there are children in the image, it can be identified as a child image.

[0128] Step S14: screening children's images.

[0129] For example, due to the influence of factors such as the shooting environment, the child's condition, and the photographer's photography skills, not all child images in the user's photo album are high-quality images. It is inevitable that there will be images with poor clarity, images with poor expressions, and repeated images. This step further screens the child images, which can be achieved by using technical means such as image deduplication, image clarity evaluation, and expression aesthetics evaluation, which will not be elaborated here.

[0130] Step S15: clustering the children's images.

[0131] For example, after the preprocessing of the above steps, high-quality images of all children in the user's electronic device album are obtained. In order to generate a growth video album of each child, these images need to be grouped according to the child's identity. Here, there is no need to pre-store images as reference images for grouping, but an unsupervised clustering method is used to automatically group images according to the child's identity.

[0132] Specifically, face recognition technology can be used to identify the identity of children, which is effective for images of children taken from the front and at non-extreme angles. However, images actually taken often contain children from various angles, children wearing decorations that cover their faces, children from behind, etc. In these cases, facial features will become unreliable. Grouping children's images based solely on face recognition technology will result in problems of misgrouping or non-grouping, which will cause images of other unrelated people to be mixed into a group, seriously affecting the user experience.

[0133] For example, based on the face and body detection results, children's facial and body features are adaptively used to group children's images, which can solve the image grouping problem when the face in the image deviates from the camera at a large angle or the face is not visible (for example, the face is blocked, facing away from the camera, etc.).

[0134] Exemplarily, an image is input, face and body detection is first performed, and the face frame and body frame are matched to correspond to the same individual person, where the face frame is the area where the face is located, and the body frame is the area where the body is located. It can be rectangular or circular, and can be determined according to actual usage, and this application does not impose any restrictions.

[0135] In one example, the matching method of the above face frame and body frame is as follows: because the face frame is usually located within the body frame of the same person, for each detected face frame, its area is recorded as A. The area of ​​the intersection area with all body frames in the image is calculated, and this area is recorded as Ai, and the corresponding body frame area is Bi, where i is the index of the body frame in the image. The area ratio Ai / A is calculated, and the body frame corresponding to the maximum ratio is the body frame matched by the current face frame, that is, the face and the body belong to the same person. If there are tied maximum values, the body frame corresponding to the smallest Bi value is taken as the body frame matching the current face frame.

[0136] Exemplarily, after a facial image is collected, it can be determined whether the facial features in the facial image are reliable. If they are reliable, the facial feature information is used for subsequent clustering. If they are unreliable, the EXIF ​​information of the image is used to determine whether the shooting time and location of the two images are close (for example, the same day, the same location). If they are close, the body feature information is used for subsequent clustering. Otherwise, it can be determined that both the facial and body features are unreliable, and the current individual person is not clustered.

[0137] Exemplarily, for each person in the image, if the facial features are reliable, the facial image block and the entire body image block are respectively sent to the facial feature extractor and the body feature extractor to extract the facial features (Feature_face) and body features (Feature_body). If the facial features are unreliable, only the body image block is sent to the body feature extractor to extract the body features. The facial feature extractor can be obtained by using a mature face recognition model (e.g., ArcFace algorithm), and the body feature extractor can be obtained by using a mature image classification model (e.g., MobileNetV3).

[0138] Exemplarily, a hierarchical agglomerative clustering algorithm is used to cluster the children's images.

[0139] For example, take 2-layer clustering as an example. When doing the first layer of clustering, first use facial features to perform clustering, and highly similar individuals are clustered into the same category. After the face clustering is completed, for the body feature (Feature_body) without a corresponding face frame, if the time and location of the picture where it is located are close to the image in a certain cluster, the cosine similarity between the body features is calculated, and the clustering label corresponding to the maximum similarity that exceeds the predetermined threshold (for example, 0.8) is taken as the clustering label of the current body Feature_body, that is, the current image is assigned the corresponding clustering label, thereby solving the image grouping problem in which the face in the image deviates from the lens at a large angle or the face is invisible (for example, the face is blocked, facing away from the lens, etc.). When doing the second layer of clustering, only facial features are used. By analogy, the hierarchical clustering algorithm recursively merges pairs of clusters to minimize the increase in the intra-class link distance. Until the increment of the intra-class link distance is greater than the predetermined threshold (for example, 0.2), the character clustering is completed, that is, the image grouping is completed.

[0140] Step S16: Identify the age of the child in the image.

[0141] For example, the above clustering step does not include a child recognition function, and it cannot be guaranteed that all categories are based on children. For example, there may be a scene where adults and children take photos together. At this time, the above clustering step may generate a category corresponding to the adult. Therefore, the category corresponding to the adult can be excluded based on the age recognition result to avoid generating a pseudo child growth video album with all images belonging to adults. In addition, the electronic device can automatically sort the child images from small to large according to the recognized age based on the child age recognition result, generate a video album that conforms to the child's growth timeline, and truly record the child's growth process.

[0142] For example, drawing on the principles of children's facial sketching and considering the development and change process of children's facial shape, the image recognition method of the embodiment of the present application proposes a deep network structure with multiple feature branches and a correlation evaluation mechanism to accurately identify the age of children.

[0143] Step S17, generating a children's growth album.

[0144] For example, generating a children's growth album by matching images and music sorted by the children's age is more expressive than simply putting the images into a folder. It can also be combined with the terminal album client to match more personalized children's album templates, which has greater emotional value.

[0145] In this way, through the above method, duplicate images, images with poor clarity or poor facial expressions can be removed, and then children's images can be grouped using children's facial and body features adaptively, which can solve the image grouping problem when the face in the image deviates from the camera at a large angle or the face is invisible (for example, the face is blocked, facing away from the camera, etc.), and the system does not need to pre-store any images of any children. Furthermore, sorting children's images and videos based on age to generate a true children's growth album can arouse emotional resonance between parents and children.

[0146] In a second possible embodiment:

[0147] Since the related art usually needs to pre-store at least one image of each person when performing face recognition, it cannot automatically handle the situation where another person is added.

[0148] In view of this scenario, this embodiment provides a method for concisely and efficiently processing newly added character images in the photo album of the user's electronic device after the character growth album is generated for the first time.

[0149] For example, taking children's images as an example, Figure 4 As shown, it includes the following steps S21 to S27:

[0150] Step S21: Read existing clustering information of electronic devices.

[0151] Exemplarily, when the electronic device detects that a new image has been added to the user's photo album, it reads the existing grouping information to obtain a series of category labels, such as image file name-facial feature information-body feature information-age.

[0152] Step S22: Obtain a list of images newly added by the user.

[0153] Exemplarily, the images newly added after the last clustering are traversed in the album to obtain a list of newly added image file names.

[0154] Step S23: AI child recognition.

[0155] Exemplarily, the method is the same as the above step S13, but step S13 only processes the newly added image list obtained in step S22.

[0156] Step S24: Screening children's images.

[0157] Exemplarily, it is the same as the above step S14.

[0158] Step S25: perform incremental clustering on the newly added children's images.

[0159] Exemplarily, for the newly added images screened through the above steps, these newly added images are inserted into the existing clusters using an incremental clustering method, or it is determined that the newly added images correspond to newly added persons, and new categories are generated.

[0160] Specifically, all newly added images are processed in the manner of step S15 to obtain temporary clustering results. "Temporary" means that the category labels of these newly added images may belong to the previously existing clustering results, so the clustering results of this step are not the final results of this clustering. Next, the second-layer aggregation clustering method of the hierarchical aggregation clustering described in step S15 is used to process the temporary clustering results and the previously existing clustering results. By analogy, the hierarchical clustering algorithm recursively merges pairs of clusters to minimize the increase in the intra-class link distance. Until the increment of the intra-class link distance is greater than a predetermined threshold (for example, 0.2), the incremental clustering of the characters is completed, that is, the image grouping update is completed.

[0161] Step S26: Identify the age of the child in the image.

[0162] Exemplarily, it is the same as the above step S16.

[0163] Step S27: Update or generate a children's growth video album.

[0164] For example, each newly added image with age information of a child is inserted into the existing image list of the child using a binary search method, and the growth album is updated, or for the newly added child, the corresponding growth album is generated according to the method of step S17. In addition, the existing clustering database table is updated.

[0165] In this way, the method provided in the second embodiment can handle the situation where new images or videos are added to the photo album of the user's electronic device after the first clustering is completed, avoiding repeated processing of a large number of previously existing pictures, and can update existing children's growth albums or generate growth albums for new children with higher timeliness and lower energy consumption.

[0166] It should be noted that the image recognition method provided in the embodiment of the present application can be executed by an image recognition device or an electronic device, or a functional module or entity in an electronic device. In the embodiment of the present application, an image recognition device executing the image recognition method is taken as an example to illustrate the image recognition device provided in the embodiment of the present application.

[0167] Figure 5 A possible structural diagram of an image recognition device involved in an embodiment of the present application is shown. Figure 5As shown, the image recognition device 700 may include: an acquisition module 701 and a processing module 702; the acquisition module 701 is used to acquire first facial feature information of a first facial image; the processing module 702 is used to input the above-mentioned first facial feature information into a facial feature analysis model and output N facial feature graphs; the facial feature analysis model includes N sub-facial feature analysis models, and one sub-facial feature analysis model corresponds to outputting one facial feature graph; one sub-facial feature analysis model corresponds to one age group; the above-mentioned processing module 702 is also used to mix the feature information in the above-mentioned N facial feature graphs to obtain second facial feature information with age characteristics; the above-mentioned processing module 702 is also used to determine the age of the person corresponding to the first facial image based on the above-mentioned second facial feature information; wherein, the model parameters in any sub-facial feature analysis model of the N sub-facial feature analysis models are used to characterize: the age characteristics of the age group corresponding to any sub-facial feature analysis model, and N is an integer greater than 1.

[0168] Optionally, in an embodiment of the present application, the above-mentioned processing module 702 is specifically used to splice the above-mentioned N facial feature maps according to color channels to obtain a target facial feature map; the above-mentioned processing module 702 is specifically used to calculate the correlation value between the feature information of the above-mentioned target facial feature map and the above-mentioned first facial feature information; the above-mentioned processing module 702 is specifically used to use the above-mentioned correlation value to mix the feature information in the above-mentioned N facial feature maps to obtain second facial feature information with age characteristics.

[0169] Optionally, in an embodiment of the present application, the above-mentioned processing module 702 is specifically used to multiply the correlation value corresponding to the i-th facial feature map by the feature information in the above-mentioned i-th facial feature map to obtain the second facial feature information corresponding to the above-mentioned i-th facial feature map; i=1,2...,N; the above-mentioned processing module 702 is specifically used to accumulate the second facial feature information corresponding to each facial feature map in the above-mentioned N facial feature maps to obtain the above-mentioned second facial feature information with age characteristics.

[0170] Optionally, in an embodiment of the present application, the above-mentioned processing module 702 is specifically used to input the above-mentioned second facial feature information into an age classification model, and output N probability values; the N probability values ​​correspond to N age groups; any probability value among the N probability values ​​is used to represent: the probability that the age of the person corresponding to the above-mentioned first facial image belongs to the age group corresponding to any probability value; the above-mentioned processing module 702 is also used to determine the age of the person in the above-mentioned first facial image from the age group corresponding to the maximum probability value among the above-mentioned N probability values.

[0171] Optionally, in an embodiment of the present application, the above-mentioned acquisition module 701 is also used to acquire the image to be identified; the above-mentioned acquisition module 701 is specifically used to acquire feature information of the face image if there is a face image in the image to be identified and the reliability of the face image meets the first condition, so as to obtain the first face feature information of the first face image.

[0172] Optionally, in an embodiment of the present application, the above-mentioned processing module 702 is also used to calculate the similarity value between the body feature information of the person in the image to be identified and the body feature information of the person in the image in the target image set if there is no face image in the image to be identified, or if there is a face image in the image to be identified and the reliability of the face image does not meet the first condition; the above-mentioned processing module 702 is also used to add the image to be identified to the target image set if the similarity value corresponding to any image in the target image set is greater than the first threshold.

[0173] In the image recognition device provided in the embodiment of the present application, the device obtains first facial feature information of a first facial image; inputs the first facial feature information into a facial feature analysis model, and outputs N facial feature graphs; the facial feature analysis model includes N sub-facial feature analysis models, and each sub-facial feature analysis model outputs a facial feature graph; each sub-facial feature analysis model corresponds to an age group; the feature information in the N facial feature graphs is mixed to obtain second facial feature information with age characteristics; based on the second facial feature information, the age of the person corresponding to the above-mentioned first facial image is determined; wherein, the model parameters in any of the above-mentioned N sub-facial feature analysis models are used to characterize: the age characteristics of the age group corresponding to any of the sub-facial feature analysis models; N is an integer greater than 1. In this way, by utilizing a facial feature analysis model that can reflect the development and changes of facial shapes of people at different age groups, the age of the person in the first facial image is analyzed. Thus, based on the analysis result of the person's age, the accurate age of the person can be obtained, thereby realizing accurate age recognition of the person images of the same person in the album, realizing refined management of the person, and realizing precise management of the album.

[0174] The image recognition device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than the terminal. Exemplarily, the electronic device can be a terminal, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.

[0175] The image recognition device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0176] The image recognition device provided in the embodiment of the present application can realize Figures 1 to 4 To avoid repetition, the various processes implemented in the method embodiment will not be described again here.

[0177] Alternatively, if Figure 6 As shown, an embodiment of the present application further provides an electronic device 800, including a processor 801 and a memory 802, wherein the memory 802 stores programs or instructions that can be executed on the processor 801, and when the program or instructions are executed by the processor 801, the various steps of the above-mentioned image recognition method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0178] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0179] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0180] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.

[0181] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0182] Among them, the processor 110 is used to obtain first facial feature information of the first facial image; the processor 110 is used to input the above-mentioned first facial feature information into a facial feature analysis model and output N facial feature maps; the facial feature analysis model includes N sub-facial feature analysis models, and each sub-facial feature analysis model corresponds to the output of a facial feature map; each sub-facial feature analysis model corresponds to an age group; the processor 110 is also used to mix the feature information in the above-mentioned N facial feature maps to obtain second facial feature information with age characteristics; the processor 110 is also used to determine the age of the person corresponding to the first facial image based on the above-mentioned second facial feature information; wherein, the model parameters in any sub-facial feature analysis model of the N sub-facial feature analysis models are used to characterize: the age characteristics of the age group corresponding to any sub-facial feature analysis model, and N is an integer greater than 1.

[0183] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is specifically used to splice the above-mentioned N facial feature maps according to color channels to obtain a target facial feature map; the above-mentioned processor 110 is specifically used to calculate the correlation value between the feature information of the above-mentioned target facial feature map and the above-mentioned first facial feature information; the above-mentioned processor 110 is specifically used to use the above-mentioned correlation value to mix the feature information in the above-mentioned N facial feature maps to obtain second facial feature information with age characteristics.

[0184] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is specifically used to multiply the correlation value corresponding to the i-th facial feature map by the feature information in the above-mentioned i-th facial feature map to obtain the second facial feature information corresponding to the above-mentioned i-th facial feature map; i=1,2...,N; the above-mentioned processor 110 is specifically used to accumulate the second facial feature information corresponding to each facial feature map in the above-mentioned N facial feature maps to obtain the above-mentioned second facial feature information with age characteristics.

[0185] Optionally, in an embodiment of the present application, the processor 110 is further used to input the second facial feature information into an age classification model, and output N probability values; the N probability values ​​correspond to N age groups; any one of the N probability values ​​is used to represent: the probability that the age of the person corresponding to the first facial image belongs to the age group corresponding to any probability value; the processor 110 is further used to determine the age of the person in the first facial image from the age group corresponding to the maximum probability value among the N probability values.

[0186] Optionally, in an embodiment of the present application, the processor 110 is also used to obtain an image to be identified; the processor 110 is specifically used to obtain feature information of the face image if there is a face image in the image to be identified and the reliability of the face image satisfies a first condition, thereby obtaining first face feature information of the first face image.

[0187] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is also used to calculate the similarity value between the body feature information of the person in the image to be identified and the body feature information of the person in the image in the target image set if there is no face image in the image to be identified, or if there is a face image in the image to be identified and the reliability of the face image does not meet the first condition; the above-mentioned processor 110 is also used to add the image to be identified to the target image set if the similarity value corresponding to any image in the target image set is greater than the first threshold.

[0188] In the electronic device provided in the embodiment of the present application, the electronic device obtains first facial feature information of a first facial image; inputs the first facial feature information into a facial feature analysis model, and outputs N facial feature graphs; the facial feature analysis model includes N sub-facial feature analysis models, and each sub-facial feature analysis model outputs a facial feature graph; each sub-facial feature analysis model corresponds to an age group; the feature information in the N facial feature graphs is mixed to obtain second facial feature information with age characteristics; based on the second facial feature information, the age of the person corresponding to the above-mentioned first facial image is determined; wherein the model parameters in any of the above-mentioned N sub-facial feature analysis models are used to characterize: the age characteristics of the age group corresponding to the any sub-facial feature analysis model; N is an integer greater than 1. In this way, by utilizing a facial feature analysis model that can reflect the development and changes of facial shapes of people at different age groups, the age of the person in the first facial image is analyzed. Thus, based on the analysis result of the person's age, the accurate age of the person can be obtained, thereby realizing accurate age recognition of the person images of the same person in the album, realizing refined management of the person, and realizing precise management of the album.

[0189] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0190] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0191] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 110.

[0192] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned image recognition method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0193] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0194] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image recognition method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0195] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0196] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned image recognition method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0197] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0198] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a terminal, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0199] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. An image recognition method, characterized in that: The method comprises: Acquire first facial feature information of a first facial image; Input the first facial feature information into a facial feature analysis model, and output N facial feature images; the facial feature analysis model includes N sub-facial feature analysis models, and each sub-facial feature analysis model outputs one facial feature image; and each sub-facial feature analysis model corresponds to one age group; Mixing the feature information in the N facial feature images to obtain second facial feature information with age characteristics; Determining the age of the person corresponding to the first facial image based on the second facial feature information; The model parameters in any one of the N sub-face feature analysis models are used to characterize: the age characteristics of the age group corresponding to the any one of the sub-face feature analysis models; N is an integer greater than 1; The step of mixing the feature information in the N face feature images to obtain second face feature information with age characteristics includes: splicing the N facial feature maps according to color channels to obtain a target facial feature map; Calculating a correlation value between the feature information of the target face feature map and the first face feature information; The correlation value is used to mix the feature information in the N face feature images to obtain second face feature information with age characteristics.

2. The method according to claim 1, characterized in that The step of using the correlation value to mix the feature information in the N face feature images to obtain second face feature information with age characteristics includes: Multiplying the correlation value corresponding to the i-th face feature map by the feature information in the i-th face feature map to obtain second face feature information corresponding to the i-th face feature map; i=1, 2..., N; The second facial feature information corresponding to each facial feature image in the N facial feature images is accumulated to obtain the second facial feature information with age characteristics.

3. The method according to claim 1, characterized in that Before obtaining the first facial feature information of the first facial image, the method further includes: Obtain an image to be recognized; The step of obtaining first facial feature information of the first facial image includes: If a face image exists in the image to be identified and the reliability of the face image meets the first condition, feature information of the face image is acquired to obtain first face feature information.

4. The method according to claim 3, characterized in that After acquiring the image to be identified, the method further includes: If there is no face image in the image to be identified, or if there is a face image in the image to be identified and the reliability of the face image does not meet the first condition, then calculating the similarity value between the body feature information of the person in the image to be identified and the body feature information of the person in the image in the target image set; If the similarity value corresponding to any image in the target image set is greater than a first threshold, the image to be identified is added to the target image set.

5. An image recognition device, characterized in that: The image recognition device comprises: an acquisition module and a processing module; The acquisition module is used to acquire first facial feature information of the first facial image; The processing module is used to input the first facial feature information obtained by the obtaining module into a facial feature analysis model, and output N facial feature images; the facial feature analysis model includes N sub-facial feature analysis models, and each sub-facial feature analysis model outputs a facial feature image; and each sub-facial feature analysis model corresponds to an age group; The processing module is further used to mix the feature information in the N face feature images to obtain second face feature information with age characteristics; The processing module is further used to determine the age of the person corresponding to the first facial image based on the second facial feature information; The model parameters in any one of the N sub-facial feature analysis models are used to characterize: the age characteristics of the age group corresponding to the any one of the sub-facial feature analysis models, and N is an integer greater than 1; The processing module is specifically used to splice the N facial feature maps according to the color channel to obtain a target facial feature map; The processing module is specifically used to calculate the correlation value between the feature information of the target face feature map obtained by the processing module and the first face feature information; The processing module is specifically used to use the correlation value to mix the feature information in the N face feature images to obtain second face feature information with age characteristics.

6. The device according to claim 5, characterized in that The processing module is specifically used to multiply the correlation value corresponding to the i-th face feature map by the feature information in the i-th face feature map to obtain the second face feature information corresponding to the i-th face feature map; i=1, 2..., N; The processing module is specifically used to accumulate the second facial feature information corresponding to each facial feature image in the N facial feature images to obtain the second facial feature information with age characteristics.

7. The device according to claim 5, characterized in that The acquisition module is also used to acquire the image to be identified; The acquisition module is specifically used to acquire feature information of the face image if there is a face image in the image to be recognized and the reliability of the face image meets the first condition, thereby obtaining first face feature information.

8. The device according to claim 7, characterized in that The processing module is further configured to calculate a similarity value between the body feature information of the person in the image to be identified and the body feature information of the person in the image in the target image set if there is no face image in the image to be identified, or if there is a face image in the image to be identified and the reliability of the face image does not meet the first condition; The processing module is further configured to add the image to be identified to the target image set if the similarity value corresponding to any image in the target image set is greater than a first threshold.

9. An electronic device, characterized in that: The invention comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the image recognition method as claimed in any one of claims 1 to 4.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the image recognition method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Age recognition model training method, face age recognition method and related device

    CN113076833A