CN-117173764-B - Image recognition method, electronic device and storage medium
Abstract
The application discloses an image recognition method, electronic equipment and a storage medium, wherein the image recognition method comprises the steps of dividing an image to be recognized into a plurality of image blocks, obtaining space information of each image block in the image to be recognized, and obtaining recognition influence factors contained in the image to be recognized; the method comprises the steps of extracting the space information of each image block and the association information between the identification influence factors to obtain the influence space association characteristics corresponding to each image block, adjusting the weight parameters of each image block based on the influence space association characteristics to obtain the image block weight information corresponding to the image to be identified, and identifying the image to be identified based on the image block weight information to obtain an image identification result. The application refines the adjustment granularity of the weight parameters, improves the accuracy of the adjustment of the weight parameters, and can lead the image recognition to pay more attention to the information of the useful area and obtain a more accurate image recognition result.
Inventors
- WANG LI
- ZHU SHULEI
- YIN JUN
Assignees
- 浙江大华技术股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20230828
Claims (8)
- 1. An image recognition method, the method comprising: Dividing an image to be identified into a plurality of image blocks, and acquiring spatial information of each image block in the image to be identified, wherein the spatial information comprises reference point coordinates and size parameters corresponding to each image block; Calculating the position difference between the image blocks based on the reference point coordinates corresponding to the image blocks, calculating the size difference between the image blocks based on the size parameters corresponding to the image blocks, obtaining the space connection characteristics between the image blocks based on the position difference and the size difference between the image blocks, and performing full connection processing on the space connection characteristics between the image blocks and the identification influence factors to obtain influence space association characteristics; Carrying out full connection processing on the image block sequence after serialization of each image block to obtain image block full connection characteristics, and inputting the influence space association characteristics and the image block full connection characteristics into a coding layer to obtain image block weight information corresponding to the image to be identified, which is output by the coding layer; and identifying the image to be identified based on the image block weight information to obtain an image identification result.
- 2. The method according to claim 1, wherein the acquiring spatial information of each image block in the image to be identified comprises: Acquiring reference point coordinates of each image block for the image to be identified, and acquiring size parameters of each image block; and taking the reference point coordinates and the size parameters corresponding to the image blocks as the spatial information of the image blocks.
- 3. The method according to claim 1, wherein the performing full connection processing on the spatial connection features between the image blocks and the identification influence factors to obtain influence spatial correlation features includes: Inputting the space connection characteristics among the image blocks and the identification influence factors into a pre-trained full-connection layer to obtain initial association characteristics corresponding to the image blocks output by the full-connection layer; and activating the initial association features by adopting a pre-trained activation function to obtain the influence space association features corresponding to the images to be identified.
- 4. The method according to claim 1, wherein the identifying the image to be identified based on the image block weight information, to obtain an image identification result, includes: extracting image features of the image to be identified to obtain initial image features; weighting the initial image features based on the image block weight information to obtain weighted image features; And identifying the image to be identified based on the weighted image characteristics to obtain an image identification result.
- 5. The method according to any one of claims 1 to 4, wherein the step of acquiring the image to be identified comprises: acquiring a portrait image, wherein the portrait image contains a portrait to be identified; Carrying out face image buckling and human body image buckling on the human images to be identified in the human image images to obtain face images and human body images corresponding to the human images to be identified; and taking the face image and the human body image corresponding to the human image to be identified as the image to be identified.
- 6. The method according to claim 5, wherein the identifying the image to be identified based on the image block weight information, to obtain an image identification result, includes: Extracting facial features of the facial image based on the image block weight information corresponding to the facial image to obtain weighted facial features, and extracting human features of the human image based on the image block weight information corresponding to the human image to obtain weighted human features; fusing the weighted face features and the weighted human body features to obtain human image features corresponding to the human images to be identified; and identifying the to-be-identified portrait based on the portrait features to obtain an image identification result.
- 7. An electronic device comprising a memory and a processor for executing program instructions stored in the memory to implement the steps of the method according to any of claims 1-6.
- 8. A computer readable storage medium storing program instructions executable by a processor to perform the steps of the method according to any one of claims 1-6.
Description
Image recognition method, electronic device and storage medium Technical Field The present application relates to the field of computer technologies, and in particular, to an image recognition method, an electronic device, and a storage medium. Background With the development of computer technology and artificial intelligence technology, image recognition technology provides great convenience for people's life. Such as face recognition techniques, behavior recognition techniques, etc. Taking the face recognition technology as an example, the face recognition has application requirements in the fields of security monitoring, smart retail, attendance checking, card punching and the like. At present, when a user is subjected to face recognition by using a face recognition technology, the original complete face image is usually subjected to face recognition, but in actual life, the quality of an image to be recognized is poor due to the reasons of image acquisition angle, environmental care during image acquisition and the like, and the image to be recognized cannot be effectively recognized. Disclosure of Invention The application provides at least an image recognition method, electronic equipment and a storage medium. The first aspect of the application provides an image recognition method, which comprises the steps of dividing an image to be recognized into a plurality of image blocks, obtaining space information of each image block in the image to be recognized, obtaining recognition influence factors contained in the image to be recognized, extracting association information between the space information of each image block and the recognition influence factors to obtain influence space association characteristics corresponding to each image block, adjusting weight parameters of each image block based on the influence space association characteristics to obtain image block weight information corresponding to the image to be recognized, and recognizing the image to be recognized based on the image block weight information to obtain an image recognition result. In one embodiment, the method for acquiring the spatial information of each image block in the image to be identified comprises the steps of acquiring reference point coordinates of each image block for the image to be identified, acquiring size parameters of each image block, and taking the reference point coordinates and the size parameters corresponding to each image block as the spatial information of each image block. In one embodiment, extracting the association information between the spatial information of each image block and the identification influence factors to obtain the influence spatial association characteristics corresponding to each image block comprises extracting the spatial connection characteristics between each image block based on the spatial information of each image block, and performing full connection processing on the spatial connection characteristics between each image block and the identification influence factors to obtain the influence spatial association characteristics. In an embodiment, the spatial information of each image block comprises reference point coordinates and size parameters corresponding to each image block, the spatial connection features among the image blocks are extracted based on the spatial information of each image block, the spatial connection features among the image blocks are obtained based on the reference point coordinates corresponding to each image block, the position differences among the image blocks are calculated based on the size parameters corresponding to each image block, the size differences among the image blocks are calculated based on the position differences among the image blocks and the size differences among the image blocks, and the spatial connection features among the image blocks are obtained based on the position differences among the image blocks and the size differences among the image blocks. In an embodiment, the full connection processing is carried out on the space connection characteristics and the identification influence factors among the image blocks to obtain influence space association characteristics, the method comprises the steps of inputting the space connection characteristics and the identification influence factors among the image blocks into a full connection layer trained in advance to obtain initial association characteristics corresponding to the image blocks output by the full connection layer, and carrying out the activation processing on the initial association characteristics by adopting an activation function trained in advance to obtain the influence space association characteristics corresponding to the image to be identified. In one embodiment, the image to be identified is identified based on the image block weight information to obtain an image identification result, and the image identification result comprises the steps of extracti