CN118570865A - Face recognition analysis method and system based on artificial intelligence - Google Patents
Face recognition analysis method and system based on artificial intelligence Download PDFInfo
- Publication number
- CN118570865A CN118570865A CN202411039605.1A CN202411039605A CN118570865A CN 118570865 A CN118570865 A CN 118570865A CN 202411039605 A CN202411039605 A CN 202411039605A CN 118570865 A CN118570865 A CN 118570865A
- Authority
- CN
- China
- Prior art keywords
- face
- image
- recognition
- feature
- identified
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000004458 analytical method Methods 0.000 title claims abstract description 110
- 238000013473 artificial intelligence Methods 0.000 title claims abstract description 40
- 239000013598 vector Substances 0.000 claims abstract description 255
- 230000008921 facial expression Effects 0.000 claims abstract description 176
- 238000012545 processing Methods 0.000 claims abstract description 97
- 230000014509 gene expression Effects 0.000 claims abstract description 81
- 238000005259 measurement Methods 0.000 claims abstract description 58
- 238000000034 method Methods 0.000 claims abstract description 51
- 238000006243 chemical reaction Methods 0.000 claims abstract description 42
- 238000004364 calculation method Methods 0.000 claims abstract description 36
- 238000005516 engineering process Methods 0.000 claims abstract description 19
- 238000012512 characterization method Methods 0.000 claims abstract description 17
- 230000001815 facial effect Effects 0.000 claims description 80
- 238000011176 pooling Methods 0.000 claims description 45
- 238000013527 convolutional neural network Methods 0.000 claims description 28
- 230000007246 mechanism Effects 0.000 claims description 19
- 230000009467 reduction Effects 0.000 claims description 16
- 230000004927 fusion Effects 0.000 claims description 13
- 238000003379 elimination reaction Methods 0.000 claims description 11
- 230000008030 elimination Effects 0.000 claims description 10
- 238000007906 compression Methods 0.000 claims description 9
- 230000006835 compression Effects 0.000 claims description 8
- 238000010586 diagram Methods 0.000 claims description 6
- 238000012216 screening Methods 0.000 claims description 4
- 238000007499 fusion processing Methods 0.000 claims description 3
- 238000007405 data analysis Methods 0.000 abstract description 3
- 230000008569 process Effects 0.000 description 28
- 210000000887 face Anatomy 0.000 description 12
- 238000004422 calculation algorithm Methods 0.000 description 7
- 238000000605 extraction Methods 0.000 description 7
- 210000001331 nose Anatomy 0.000 description 7
- 230000002708 enhancing effect Effects 0.000 description 6
- 230000036544 posture Effects 0.000 description 6
- 238000002372 labelling Methods 0.000 description 5
- 238000000513 principal component analysis Methods 0.000 description 5
- 230000008909 emotion recognition Effects 0.000 description 4
- 238000001914 filtration Methods 0.000 description 4
- 238000000691 measurement method Methods 0.000 description 4
- 230000000007 visual effect Effects 0.000 description 4
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 3
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 3
- 238000013136 deep learning model Methods 0.000 description 3
- 238000001514 detection method Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000007613 environmental effect Effects 0.000 description 3
- 238000010195 expression analysis Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000000877 morphologic effect Effects 0.000 description 3
- 238000005457 optimization Methods 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 238000012795 verification Methods 0.000 description 3
- 238000012935 Averaging Methods 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000013135 deep learning Methods 0.000 description 2
- 230000008451 emotion Effects 0.000 description 2
- 230000004660 morphological change Effects 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 238000010921 in-depth analysis Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000003909 pattern recognition Methods 0.000 description 1
- 238000012847 principal component analysis method Methods 0.000 description 1
- 238000011158 quantitative evaluation Methods 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000012549 training Methods 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/172—Classification, e.g. identification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/75—Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/80—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
- G06V10/806—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of extracted features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/168—Feature extraction; Face representation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/174—Facial expression recognition
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Artificial Intelligence (AREA)
- Databases & Information Systems (AREA)
- Medical Informatics (AREA)
- Human Computer Interaction (AREA)
- Biophysics (AREA)
- Mathematical Physics (AREA)
- General Engineering & Computer Science (AREA)
- Biomedical Technology (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Molecular Biology (AREA)
- Image Analysis (AREA)
Abstract
本发明涉及人脸数据分析技术领域,尤其涉及一种基于人工智能的人脸识别分析方法及系统。所述方法包括以下步骤:获取待识别人脸图像数据集并进行人脸灰度化处理和人脸边界背景裁切,得到待识别人脸背景裁切图像数据集;对待识别人脸背景裁切图像数据集进行人脸识别特征表征分析和识别特征增强处理,得到人脸图像第一识别表征特征数据;对人脸图像第一识别表征特征数据进行三维特征虚拟空间转换和特征点云空间向量分析,得到人脸图像识别特征点云空间向量集;对人脸图像识别特征点云空间向量集进行特征向量距离度量计算和人脸数据表情识别,以得到人脸数据表情识别匹配结果。本发明能够实现对人脸表情数据的高效准确识别和分析。
The present invention relates to the field of face data analysis technology, and in particular to a face recognition analysis method and system based on artificial intelligence. The method comprises the following steps: obtaining a face image data set to be identified and performing face grayscale processing and face boundary background cropping to obtain a face background cropped image data set to be identified; performing face recognition feature characterization analysis and recognition feature enhancement processing on the face background cropped image data set to be identified to obtain first recognition characterization feature data of the face image; performing three-dimensional feature virtual space conversion and feature point cloud space vector analysis on the first recognition characterization feature data of the face image to obtain a face image recognition feature point cloud space vector set; performing feature vector distance measurement calculation and face data expression recognition on the face image recognition feature point cloud space vector set to obtain face data expression recognition matching results. The present invention can realize efficient and accurate recognition and analysis of face expression data.
Description
技术领域Technical Field
本发明涉及人脸数据分析技术领域,尤其涉及一种基于人工智能的人脸识别分析方法及系统。The present invention relates to the technical field of face data analysis, and in particular to a face recognition analysis method and system based on artificial intelligence.
背景技术Background Art
人脸识别技术作为一种基于人工智能的应用,正在广泛应用于安全监控、身份验证、社交媒体和商业服务等多个领域。随着深度学习技术的兴起,特别是卷积神经网络(CNN)的应用,基于新技术的人脸识别分析方法成为行业的创新方向,为提高识别精度、增强鲁棒性和提升应用效果提供了全新的解决方案,通过采用了深度卷积神经网络(CNN)进行人脸特征学习和表示,能够自动学习和提取人脸图像中的高级抽象特征,如面部轮廓、眼睛、鼻子等关键特征点,CNN模型通过大量的训练数据进行优化,能够有效地处理不同光照、姿态和表情变化下的人脸图像,显著提升了识别的准确性和鲁棒性。还通过结合了深度度量学习和度量学习算法,该方法能够实现对人脸特征空间的优化和建模,深度度量学习技术通过学习人脸特征之间的距离度量,将同一人的不同表情和姿态下的人脸图像映射到紧凑的特征空间中,提高了同一人脸的可区分度;同时,通过学习不同个体之间的差异,进一步增强了对不同个体的识别能力。然而,传统的人脸识别方法主要基于特征提取和模式匹配,存在着面部表情识别准确性差的问题。As an application based on artificial intelligence, face recognition technology is being widely used in many fields such as security monitoring, identity authentication, social media and commercial services. With the rise of deep learning technology, especially the application of convolutional neural network (CNN), face recognition analysis methods based on new technologies have become an innovative direction in the industry, providing a new solution for improving recognition accuracy, enhancing robustness and improving application effects. By using deep convolutional neural network (CNN) for face feature learning and representation, it can automatically learn and extract high-level abstract features in face images, such as key feature points such as facial contours, eyes, and noses. The CNN model is optimized through a large amount of training data and can effectively process face images under different lighting, postures and expression changes, significantly improving the accuracy and robustness of recognition. By combining deep metric learning and metric learning algorithms, this method can optimize and model the face feature space. Deep metric learning technology maps face images of the same person with different expressions and postures into a compact feature space by learning the distance metric between face features, thereby improving the distinguishability of the same face; at the same time, by learning the differences between different individuals, the recognition ability of different individuals is further enhanced. However, traditional face recognition methods are mainly based on feature extraction and pattern matching, and suffer from the problem of poor accuracy in facial expression recognition.
发明内容Summary of the invention
基于此,本发明提供一种基于人工智能的人脸识别分析方法及系统,以解决传统的人脸识别方法主要基于特征提取和模式匹配,存在着面部表情识别准确性差的技术问题。Based on this, the present invention provides a face recognition analysis method and system based on artificial intelligence to solve the technical problem that traditional face recognition methods are mainly based on feature extraction and pattern matching, and have poor accuracy in facial expression recognition.
为实现上述目的,本发明公开一种基于人工智能的人脸识别分析方法,包括以下步骤:To achieve the above object, the present invention discloses a face recognition analysis method based on artificial intelligence, comprising the following steps:
步骤S1:获取待识别人脸图像数据集,并对待识别人脸图像数据集进行人脸灰度化处理,以得到待识别人脸灰度图数据集;对待识别人脸灰度图数据集进行人脸边界背景裁切,得到待识别人脸背景裁切图像数据集;Step S1: obtaining a dataset of face images to be identified, and performing face grayscale processing on the dataset of face images to be identified to obtain a dataset of grayscale images of faces to be identified; performing face boundary background cropping on the dataset of grayscale images of faces to be identified to obtain a dataset of background cropped images of faces to be identified;
步骤S2:利用卷积神经网络对待识别人脸背景裁切图像数据集进行人脸识别特征表征分析,并引入空间金字塔池化以及注意力机制进行识别特征增强处理,得到人脸图像第一识别表征特征数据;Step S2: using a convolutional neural network to perform face recognition feature characterization analysis on the face background cropped image dataset to be recognized, and introducing spatial pyramid pooling and attention mechanism to perform recognition feature enhancement processing to obtain first recognition characterization feature data of the face image;
步骤S3:对人脸图像第一识别表征特征数据进行三维特征虚拟空间转换,得到人脸图像识别特征三维虚拟空间;对人脸图像识别特征三维虚拟空间进行特征点云空间向量分析,得到人脸图像识别特征点云空间向量集;Step S3: performing a three-dimensional feature virtual space conversion on the first recognition representation feature data of the face image to obtain a three-dimensional virtual space of face image recognition features; performing a feature point cloud space vector analysis on the three-dimensional virtual space of face image recognition features to obtain a face image recognition feature point cloud space vector set;
步骤S4:根据预设的人脸表情匹配数据库对人脸图像识别特征点云空间向量集进行特征向量距离度量计算,以得到各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值;基于各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值对人脸图像识别特征点云空间向量集相对应的待识别人脸数据进行人脸数据表情识别,以得到人脸数据表情识别匹配结果。Step S4: performing feature vector distance measurement calculation on the face image recognition feature point cloud space vector set according to the preset face expression matching database to obtain the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each face expression image; performing face data expression recognition on the face data to be recognized corresponding to the face image recognition feature point cloud space vector set based on the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each face expression image to obtain the face data expression recognition matching result.
本发明首先通过获取待识别人脸图像数据集,是人脸识别系统中的基础步骤,这一步骤确保能够获得足够的数据样本,以便后续进行有效的处理和分析,数据集的多样性和充分性直接影响到后续人脸表情识别过程中在不同场景下的准确性和鲁棒性,因此,获取高质量的人脸图像数据是保证后续处理过程稳定性和性能优化的重要前提。The present invention first obtains the face image data set to be identified, which is a basic step in the face recognition system. This step ensures that sufficient data samples can be obtained for subsequent effective processing and analysis. The diversity and adequacy of the data set directly affect the accuracy and robustness of the subsequent facial expression recognition process in different scenarios. Therefore, obtaining high-quality face image data is an important prerequisite for ensuring the stability of the subsequent processing process and performance optimization.
通过对待识别人脸图像数据集进行人脸灰度化处理,是为了简化图像的复杂性并提高后续处理的效率。人脸灰度化处理将彩色图像数据转换为灰度图像数据,这样做不仅能够减少数据处理的复杂度,还能够保留重要的人脸特征和结构信息,灰度化后的图像更易于进行特征提取和模式匹配,有助于提高人脸识别在不同光照条件和角度变化下的鲁棒性和稳定性。The purpose of graying the face image dataset to be recognized is to simplify the complexity of the image and improve the efficiency of subsequent processing. Graying converts color image data into grayscale image data, which not only reduces the complexity of data processing, but also retains important facial features and structural information. The grayed image is easier to extract features and pattern matching, which helps to improve the robustness and stability of face recognition under different lighting conditions and angle changes.
同时,通过对经过灰度化处理的人脸图像进行人脸边界背景裁切,能够进一步优化人脸区域的准确性和清晰度,背景裁切技术可以帮助去除图像中不必要的背景信息,集中关注人脸部分的特征和细节,这种精确的裁切操作能够有效地消除环境因素对识别精度的负面影响,确保后续人脸表情识别分析在实际应用中能够准确识别人脸表情并进行有效的认证或辨识。At the same time, by cropping the face boundary background of the grayscaled face image, the accuracy and clarity of the face area can be further optimized. The background cropping technology can help remove unnecessary background information in the image and focus on the features and details of the face. This precise cropping operation can effectively eliminate the negative impact of environmental factors on recognition accuracy, ensuring that subsequent facial expression recognition analysis can accurately identify facial expressions and perform effective authentication or identification in practical applications.
其次,通过使用卷积神经网络对待识别人脸背景裁切图像数据集中的待识别人脸灰度实例图进行识别特征捕捉处理,这一步骤的关键在于利用卷积操作捕捉人脸图像中的特征信息,例如边缘、纹理等,卷积神经网络能够提取出不同层次和复杂度的特征表示,为后续的特征数据学习处理奠定基础,并且,通过引入空间金字塔池化技术以及注意力机制对先前分析得到的识别特征数据进行识别特征增强处理,其中空间金字塔池化技术能够进一步提升卷积神经网络在多尺度特征分析上的能力,确保人脸灰度图的多尺度识别特征数据能够覆盖不同层次和范围的信息,而注意力机制能够动态地调整和加权特征图中不同位置的特征响应,使得网络更加关注人脸图像中的关键部位和重要特征,从而进一步提升人脸图像的识别表征特征数据质量和表达能力。Secondly, the convolutional neural network is used to capture the recognition features of the grayscale instance images of the faces to be recognized in the background cropped image dataset. The key to this step is to use the convolution operation to capture the feature information in the face image, such as edges, textures, etc. The convolutional neural network can extract feature representations of different levels and complexities, laying the foundation for subsequent feature data learning and processing. In addition, the recognition feature data obtained by the previous analysis is enhanced by introducing the spatial pyramid pooling technology and the attention mechanism. The spatial pyramid pooling technology can further enhance the ability of the convolutional neural network in multi-scale feature analysis, ensuring that the multi-scale recognition feature data of the face grayscale image can cover information of different levels and ranges, and the attention mechanism can dynamically adjust and weight the feature responses at different positions in the feature map, so that the network pays more attention to the key parts and important features in the face image, thereby further improving the quality and expression ability of the recognition representation feature data of the face image.
然后,通过对人脸图像第一识别表征特征数据进行三维特征虚拟空间转换,能够实现了从二维图像数据到三维虚拟空间的转换过程,这一步骤的关键在于利用深度学习模型或者几何学方法,将人脸图像的平面特征转换为更加丰富和具体的三维特征表示,从而更好地捕捉人脸的几何形状、深度信息以及空间分布特性,通过这种转换,不仅能够增强人脸表情识别对于复杂姿态和光照条件下的鲁棒性,还能提高识别的准确性和稳定性。Then, by performing a three-dimensional feature virtual space conversion on the first recognition representation feature data of the face image, the conversion process from two-dimensional image data to three-dimensional virtual space can be realized. The key to this step is to use a deep learning model or geometric method to convert the planar features of the face image into a richer and more specific three-dimensional feature representation, so as to better capture the geometric shape, depth information and spatial distribution characteristics of the face. Through this conversion, not only can the robustness of facial expression recognition under complex postures and lighting conditions be enhanced, but also the accuracy and stability of recognition can be improved.
通过对人脸图像识别特征三维虚拟空间进行特征点云空间向量转换,这一步骤的核心在于将每个关键部位特征点云的三维信息转换为高维度的特征空间向量集合,该特征空间向量集合不仅包含了关键部位的空间位置信息,还包括颜色、纹理等特征,这些信息对于人脸识别的精准性和全面性至关重要。通过这种向量转换,能够将复杂的三维特征数据转化为更便于处理和分析的形式,为人脸数据的最终表情识别和验证提供更加有效和可靠的特征描述,从而能够提高了面部表情识别的准确性和效率。The core of this step is to convert the three-dimensional information of the feature point cloud of each key part into a high-dimensional feature space vector set by converting the feature point cloud of the three-dimensional virtual space of the face image recognition feature. This feature space vector set not only contains the spatial position information of the key parts, but also includes features such as color and texture. This information is crucial for the accuracy and comprehensiveness of face recognition. Through this vector conversion, complex three-dimensional feature data can be converted into a form that is easier to process and analyze, providing a more effective and reliable feature description for the final expression recognition and verification of face data, thereby improving the accuracy and efficiency of facial expression recognition.
最后,通过根据预设的人脸表情匹配数据库对人脸图像识别特征点云空间向量集进行特征向量距离度量计算,这一步骤的关键在于利用数学上的距离度量方法(如欧氏距离或者余弦相似度等),以衡量每个人脸图像识别特征点云空间向量与数据库中每张人脸表情图像对应特征点云空间向量之间的相似性,通过这种计算,能够得到一个量化的度量值,反映出待识别人脸与已知表情图像之间的特征相似程度。Finally, the feature vector distance measurement calculation is performed on the face image recognition feature point cloud space vector set according to the preset facial expression matching database. The key to this step is to use mathematical distance measurement methods (such as Euclidean distance or cosine similarity, etc.) to measure the similarity between each face image recognition feature point cloud space vector and the corresponding feature point cloud space vector of each face expression image in the database. Through this calculation, a quantitative measurement value can be obtained, which reflects the degree of feature similarity between the face to be recognized and the known expression image.
通过基于各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值对人脸图像识别特征点云空间向量集相对应的待识别人脸数据进行人脸数据表情识别,这一步骤通过比较每张人脸表情图像对应特征点云与待识别人脸图像数据特征点云之间的相似点数量,来确定待识别人脸与数据库中哪张表情图像最为相似,从而得到人脸数据的表情识别匹配结果,这一过程通过有效的数据库管理和特征匹配算法,能够快速准确地识别出人脸图像的表情状态,为面部表情分析、情感识别等应用提供了可靠的技术支持和解决方案。Facial expression recognition is performed on the face data to be identified corresponding to the face image recognition feature point cloud space vector set based on the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each face expression image. This step determines which expression image in the database is most similar to the face to be identified by comparing the number of similarities between the feature point cloud corresponding to each face expression image and the feature point cloud of the face image data to be identified, thereby obtaining the expression recognition matching result of the face data. This process can quickly and accurately identify the expression state of the face image through effective database management and feature matching algorithm, providing reliable technical support and solutions for applications such as facial expression analysis and emotion recognition.
进一步的,本发明还公开一种基于人工智能的人脸识别分析系统,用于执行如上所述的基于人工智能的人脸识别分析方法,该基于人工智能的人脸识别分析系统包括:Furthermore, the present invention also discloses an artificial intelligence-based face recognition and analysis system, which is used to execute the artificial intelligence-based face recognition and analysis method as described above. The artificial intelligence-based face recognition and analysis system includes:
待识别人脸数据背景裁切模块,用于获取待识别人脸图像数据集,并对待识别人脸图像数据集进行人脸灰度化处理,以得到待识别人脸灰度图数据集;对待识别人脸灰度图数据集进行人脸边界背景裁切,从而得到待识别人脸背景裁切图像数据集;The background cropping module of the face data to be identified is used to obtain the face image data set to be identified, and perform face grayscale processing on the face image data set to be identified to obtain the face grayscale image data set to be identified; perform face boundary background cropping on the face grayscale image data set to be identified, so as to obtain the background cropped image data set of the face to be identified;
人脸数据第一识别分析模块,用于利用卷积神经网络对待识别人脸背景裁切图像数据集进行人脸识别特征表征分析,并引入空间金字塔池化以及注意力机制进行识别特征增强处理,从而得到人脸图像第一识别表征特征数据;The first recognition and analysis module of face data is used to use a convolutional neural network to perform face recognition feature characterization analysis on the background cropped image dataset of the face to be recognized, and introduce spatial pyramid pooling and attention mechanism to perform recognition feature enhancement processing, so as to obtain the first recognition characterization feature data of the face image;
人脸识别特征空间向量转换模块,用于对人脸图像第一识别表征特征数据进行三维特征虚拟空间转换,得到人脸图像识别特征三维虚拟空间;对人脸图像识别特征三维虚拟空间进行特征点云空间向量分析,得到人脸图像识别特征点云空间向量集;A face recognition feature space vector conversion module is used to perform a three-dimensional feature virtual space conversion on the first recognition representation feature data of the face image to obtain a three-dimensional virtual space of face image recognition features; perform feature point cloud space vector analysis on the three-dimensional virtual space of face image recognition features to obtain a face image recognition feature point cloud space vector set;
人脸数据再次识别匹配模块,用于根据预设的人脸表情匹配数据库对人脸图像识别特征点云空间向量集进行特征向量距离度量计算,以得到各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值;基于各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值对人脸图像识别特征点云空间向量集相对应的待识别人脸数据进行人脸数据表情识别,以得到人脸数据表情识别匹配结果。The face data re-identification and matching module is used to perform feature vector distance measurement calculation on the face image recognition feature point cloud space vector set according to the preset face expression matching database, so as to obtain the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each face expression image; based on the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each face expression image, face data expression recognition is performed on the face data to be identified corresponding to the face image recognition feature point cloud space vector set, so as to obtain the face data expression recognition matching result.
本发明的有益效果是:The beneficial effects of the present invention are:
本发明提供了一种基于人工智能的人脸识别分析方法及系统,该基于人工智能的人脸识别分析系统由待识别人脸数据背景裁切模块、人脸数据第一识别分析模块、人脸识别特征空间向量转换模块以及人脸数据再次识别匹配模块组成,能够实现本发明所述任意基于人工智能的人脸识别分析方法,用于联合各个模块上运行的计算机程序之间的操作实现基于人工智能的人脸识别分析方法,系统内部结构互相协作,这样能够大大减少重复工作和人力投入,能够快速有效地提供更为准确、更高效的基于人工智能的人脸识别分析过程,从而简化了基于人工智能的人脸识别分析系统的操作流程。The present invention provides a face recognition analysis method and system based on artificial intelligence. The face recognition analysis system based on artificial intelligence consists of a background cutting module for face data to be recognized, a first recognition and analysis module for face data, a face recognition feature space vector conversion module, and a face data re-recognition and matching module. It can realize any face recognition analysis method based on artificial intelligence described in the present invention, and is used to combine the operations between computer programs running on various modules to realize the face recognition analysis method based on artificial intelligence. The internal structures of the system cooperate with each other, which can greatly reduce duplication of work and manpower investment, and can quickly and effectively provide a more accurate and efficient face recognition analysis process based on artificial intelligence, thereby simplifying the operation flow of the face recognition analysis system based on artificial intelligence.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本发明基于人工智能的人脸识别分析方法的步骤流程示意图;FIG1 is a schematic diagram of the steps of the face recognition analysis method based on artificial intelligence of the present invention;
图2为图1中步骤S1的详细步骤流程示意图;FIG2 is a schematic diagram of a detailed step flow chart of step S1 in FIG1 ;
图3为图2中步骤S15的详细步骤流程示意图。FIG. 3 is a schematic diagram of a detailed flow chart of step S15 in FIG. 2 .
具体实施方式DETAILED DESCRIPTION
下面结合附图对本发明的技术方法进行清楚、完整的描述,显然,所描述的实施例是本发明的一部分实施例,而不是全部的实施例。The technical method of the present invention is clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments.
实施例1,一种基于人工智能的人脸识别分析方法,请参阅图1至图3,所述方法包括以下步骤:Embodiment 1, a face recognition analysis method based on artificial intelligence, please refer to Figures 1 to 3, the method comprises the following steps:
步骤S1:获取待识别人脸图像数据集,并对待识别人脸图像数据集进行人脸灰度化处理,以得到待识别人脸灰度图数据集;对待识别人脸灰度图数据集进行人脸边界背景裁切,得到待识别人脸背景裁切图像数据集;Step S1: obtaining a dataset of face images to be identified, and performing face grayscale processing on the dataset of face images to be identified to obtain a dataset of grayscale images of faces to be identified; performing face boundary background cropping on the dataset of grayscale images of faces to be identified to obtain a dataset of background cropped images of faces to be identified;
步骤S2:利用卷积神经网络对待识别人脸背景裁切图像数据集进行人脸识别特征表征分析,并引入空间金字塔池化以及注意力机制进行识别特征增强处理,得到人脸图像第一识别表征特征数据;Step S2: using a convolutional neural network to perform face recognition feature characterization analysis on the face background cropped image dataset to be recognized, and introducing spatial pyramid pooling and attention mechanism to perform recognition feature enhancement processing to obtain first recognition characterization feature data of the face image;
步骤S3:对人脸图像第一识别表征特征数据进行三维特征虚拟空间转换,得到人脸图像识别特征三维虚拟空间;对人脸图像识别特征三维虚拟空间进行特征点云空间向量分析,得到人脸图像识别特征点云空间向量集;Step S3: performing a three-dimensional feature virtual space conversion on the first recognition representation feature data of the face image to obtain a three-dimensional virtual space of face image recognition features; performing a feature point cloud space vector analysis on the three-dimensional virtual space of face image recognition features to obtain a face image recognition feature point cloud space vector set;
步骤S4:根据预设的人脸表情匹配数据库对人脸图像识别特征点云空间向量集进行特征向量距离度量计算,以得到各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值;基于各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值对人脸图像识别特征点云空间向量集相对应的待识别人脸数据进行人脸数据表情识别,以得到人脸数据表情识别匹配结果。Step S4: performing feature vector distance measurement calculation on the face image recognition feature point cloud space vector set according to the preset face expression matching database to obtain the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each face expression image; performing face data expression recognition on the face data to be recognized corresponding to the face image recognition feature point cloud space vector set based on the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each face expression image to obtain the face data expression recognition matching result.
本发明实施例中,请参考图1所示,为本发明基于人工智能的人脸识别分析方法的步骤流程示意图,在本实例中,所述基于人工智能的人脸识别分析方法包括以下步骤:In the embodiment of the present invention, please refer to FIG. 1, which is a schematic diagram of the steps of the face recognition analysis method based on artificial intelligence of the present invention. In this example, the face recognition analysis method based on artificial intelligence includes the following steps:
步骤S1:获取待识别人脸图像数据集,并对待识别人脸图像数据集进行人脸灰度化处理,以得到待识别人脸灰度图数据集;对待识别人脸灰度图数据集进行人脸边界背景裁切,得到待识别人脸背景裁切图像数据集;Step S1: obtaining a dataset of face images to be identified, and performing face grayscale processing on the dataset of face images to be identified to obtain a dataset of grayscale images of faces to be identified; performing face boundary background cropping on the dataset of grayscale images of faces to be identified to obtain a dataset of background cropped images of faces to be identified;
在本发明实施例中,通过收集大量的人脸图像数据,这些数据可以来自不同的来源,例如摄像头捕捉、图像数据库或者在线数据集,从而得到待识别人脸图像数据集。通过使用包括中值滤波、高斯滤波或小波变换等技术对先前获取得到的待识别人脸图像数据集进行噪声的消除处理,以减少图像数据中的不必要干扰和信息损失,同时可以有效平滑图像数据并去除异常值,并通过使用直方图均衡化方法对经过消噪后得到的待识别人脸图像数据集进行图像数据的对比度增强处理,以调整图像数据的灰度级分布,使得图像数据的整体亮度更加均衡,从而增强图像数据的局部细节和对比度。In an embodiment of the present invention, a large amount of face image data is collected, which may come from different sources, such as camera capture, image databases or online data sets, to obtain a face image data set to be identified. The previously acquired face image data set to be identified is subjected to noise elimination processing by using techniques including median filtering, Gaussian filtering or wavelet transform, so as to reduce unnecessary interference and information loss in the image data, and at the same time, the image data can be effectively smoothed and outliers can be removed, and the face image data set to be identified obtained after noise elimination is subjected to image data contrast enhancement processing by using a histogram equalization method, so as to adjust the grayscale distribution of the image data, so that the overall brightness of the image data is more balanced, thereby enhancing the local details and contrast of the image data.
同时,通过对经过直方图均衡化后得到的待识别人脸图像数据集进行灰度化处理,以将彩色图像转换为灰度图像,其转化后的灰度图像只包含亮度信息,而不包含色彩信息,这样可以简化后续处理步骤并减少计算复杂度,转换过程通常通过加权平均的方法来实现,从而得到待识别人脸灰度图数据集。At the same time, the face image dataset to be identified obtained after histogram equalization is grayed out to convert the color image into a grayscale image. The converted grayscale image only contains brightness information but not color information. This can simplify subsequent processing steps and reduce computational complexity. The conversion process is usually implemented through a weighted averaging method to obtain a grayscale image dataset of the face to be identified.
然后,通过对经过灰度化处理后得到的待识别人脸灰度图数据集进行人脸边界的识别,以确定出相应人脸的边缘或边界来裁剪图像,例如,根据人脸的边缘线或者特定的标记点,可以精确地裁剪出仅包含人脸的图像部分,减少无关信息的干扰,并去除背景信息,从而使得人脸在后续的识别或分析任务中更加突出和准确,最终得到待识别人脸背景裁切图像数据集。Then, the facial boundaries are identified by the grayscale image dataset of the face to be identified after grayscale processing, so as to determine the edge or boundary of the corresponding face to crop the image. For example, according to the edge line of the face or specific marking points, the image part containing only the face can be accurately cropped, reducing the interference of irrelevant information and removing background information, so that the face is more prominent and accurate in subsequent recognition or analysis tasks, and finally a background cropped image dataset of the face to be identified is obtained.
步骤S2:利用卷积神经网络对待识别人脸背景裁切图像数据集进行人脸识别特征表征分析,并引入空间金字塔池化以及注意力机制进行识别特征增强处理,得到人脸图像第一识别表征特征数据;Step S2: using a convolutional neural network to perform face recognition feature characterization analysis on the face background cropped image dataset to be recognized, and introducing spatial pyramid pooling and attention mechanism to perform recognition feature enhancement processing to obtain first recognition characterization feature data of the face image;
在本发明实施例中,通过使用卷积神经网络算法构建了3x3卷积网络层、2x2池化层以及1x1全连接层,其中卷积层的作用是对输入的人脸灰度图像进行特征捕捉处理,池化层则通过在每个区域中选取一个值(例如最大值或平均值)来减少了特征图的尺寸,同时保留了最重要的特征,而全连接层则对经过池化后的特征图进行特征降维,以减少特征的冗余性和噪声影响,同时保留最具代表性的特征信息。In an embodiment of the present invention, a 3x3 convolutional network layer, a 2x2 pooling layer, and a 1x1 fully connected layer are constructed by using a convolutional neural network algorithm, wherein the convolution layer is used to perform feature capture processing on the input grayscale face image, the pooling layer reduces the size of the feature map by selecting a value (such as the maximum value or the average value) in each area, while retaining the most important features, and the fully connected layer performs feature dimensionality reduction on the pooled feature map to reduce feature redundancy and noise impact, while retaining the most representative feature information.
例如,假设有一张待识别的人脸图像,通过卷积操作在图像上滑动3x3的卷积核,每一次滑动计算出一个输出值,这些输出值构成了新的特征图,每个特征图对应不同的特征检测,如边缘、纹理等,并向下卷积至2x2池化层,该池化层的作用可以减少特征图的空间尺寸,同时保留最显著的特征信息,还通过在2x2池化层中引入空间金字塔池化技术对先前卷积学习到的人脸灰度图识别特征进行多尺度的特征分析,以进一步提升其网络在多尺度特征分析上的能力,确保人脸灰度图的多尺度识别特征数据能够覆盖不同层次和范围的信息,并将经过空间金字塔池化后得到的多尺度识别特征进行特征的融合分析,以综合不同尺度的特征信息,从而得到更加全面和丰富的特征表示。For example, suppose there is a face image to be recognized. A 3x3 convolution kernel is slid on the image through a convolution operation. An output value is calculated for each slide. These output values constitute a new feature map. Each feature map corresponds to different feature detections, such as edges, textures, etc., and is convolved down to the 2x2 pooling layer. The role of this pooling layer is to reduce the spatial size of the feature map while retaining the most significant feature information. The spatial pyramid pooling technology is introduced in the 2x2 pooling layer to perform multi-scale feature analysis on the facial grayscale image recognition features previously learned by convolution, so as to further enhance the network's ability in multi-scale feature analysis, ensure that the multi-scale recognition feature data of the facial grayscale image can cover information at different levels and ranges, and perform feature fusion analysis on the multi-scale recognition features obtained after spatial pyramid pooling to integrate feature information at different scales, thereby obtaining a more comprehensive and rich feature representation.
同时还向下卷积至1x1全连接层,该1x1全连接层的作用是将池化后的特征数据转换为向量形式,并通过全连接操作进行主成分降维处理,主成分分析(PCA)可以帮助减少特征的维度,保留最重要的特征信息,从而减少计算负担和降低模型复杂度,然后,通过引入注意力机制对其降维后的识别特征数据进行识别特征的增强处理,以根据特征的重要性自动调整权重,并提高关键特征的可区分性和识别准确性,例如,基于已降维的特征数据,注意力机制可以帮助卷积神经网络模型集中注意力在最具区分性的特征上,从而增强对人脸图像的识别能力,最终得到人脸图像第一识别表征特征数据。At the same time, it is also convolved down to the 1x1 fully connected layer. The role of this 1x1 fully connected layer is to convert the pooled feature data into a vector form and perform principal component dimensionality reduction through a fully connected operation. Principal component analysis (PCA) can help reduce the dimension of the feature and retain the most important feature information, thereby reducing the computational burden and reducing the complexity of the model. Then, the recognition feature data after dimensionality reduction is enhanced by introducing an attention mechanism to automatically adjust the weight according to the importance of the feature and improve the distinguishability and recognition accuracy of key features. For example, based on the reduced dimensionality feature data, the attention mechanism can help the convolutional neural network model focus on the most distinguishing features, thereby enhancing the recognition ability of facial images and ultimately obtaining the first recognition representation feature data of facial images.
步骤S3:对人脸图像第一识别表征特征数据进行三维特征虚拟空间转换,得到人脸图像识别特征三维虚拟空间;对人脸图像识别特征三维虚拟空间进行特征点云空间向量分析,得到人脸图像识别特征点云空间向量集;Step S3: performing a three-dimensional feature virtual space conversion on the first recognition representation feature data of the face image to obtain a three-dimensional virtual space of face image recognition features; performing a feature point cloud space vector analysis on the three-dimensional virtual space of face image recognition features to obtain a face image recognition feature point cloud space vector set;
在本发明实施例中,通过使用AI虚拟技术将先前经过卷积神经网络特征学习得到的人脸图像第一识别表征特征数据进行三维特征虚拟空间的转换,以将图像中的二维特征信息转换为三维虚拟空间中的特征表示,以便更准确地描述人脸的空间结构和形态特征,从而能够更好地捕捉人脸的几何形状、深度信息以及空间分布特性,从而得到人脸图像识别特征三维虚拟空间。In an embodiment of the present invention, the first recognition representation feature data of the facial image previously obtained through convolutional neural network feature learning is converted into a three-dimensional feature virtual space by using AI virtual technology, so as to convert the two-dimensional feature information in the image into a feature representation in a three-dimensional virtual space, so as to more accurately describe the spatial structure and morphological characteristics of the face, thereby better capturing the geometric shape, depth information and spatial distribution characteristics of the face, thereby obtaining a three-dimensional virtual space of facial image recognition features.
通过对先前转换得到的人脸图像识别特征三维虚拟空间进行关键部位处特征点云的采样提取处理,以从转换后的三维虚拟空间中提取关键的面部特征点集合,这些点通常是表达面部结构和特征的关键点位,其中关键部位通常包括人脸的眼睛、鼻子、嘴巴等重要特征点,并进一步分析每个关键点云的具体空间位置和特征,以便更精确地描述人脸的结构和形态变化。The feature point cloud at key parts of the previously converted three-dimensional virtual space of facial image recognition features is sampled and extracted to extract a set of key facial feature points from the converted three-dimensional virtual space. These points are usually key points that express facial structure and features, where key parts usually include important feature points such as eyes, nose, and mouth. The specific spatial position and features of each key point cloud are further analyzed to more accurately describe the structure and morphological changes of the face.
然后,通过结合先前确定得到的每一个关键部位特征点云的三维空间坐标对关键部位特征点云集内相对应每一个关键部位特征点云处的识别特征数据进行空间向量的转换,以将每个关键部位特征点云处的三维信息转换为高维度的特征空间向量,该特征空间向量不仅包含了关键部位的空间位置信息,还包括颜色、纹理等空间识别特征数据,最终得到人脸图像识别特征点云空间向量集。Then, by combining the three-dimensional spatial coordinates of each key part feature point cloud determined previously, the identification feature data corresponding to each key part feature point cloud in the key part feature point cloud set is converted into a spatial vector, so as to convert the three-dimensional information at each key part feature point cloud into a high-dimensional feature space vector. The feature space vector not only contains the spatial position information of the key parts, but also includes spatial identification feature data such as color and texture, and finally a spatial vector set of feature point clouds for facial image recognition is obtained.
步骤S4:根据预设的人脸表情匹配数据库对人脸图像识别特征点云空间向量集进行特征向量距离度量计算,以得到各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值;基于各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值对人脸图像识别特征点云空间向量集相对应的待识别人脸数据进行人脸数据表情识别,以得到人脸数据表情识别匹配结果。Step S4: performing feature vector distance measurement calculation on the face image recognition feature point cloud space vector set according to the preset face expression matching database to obtain the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each face expression image; performing face data expression recognition on the face data to be recognized corresponding to the face image recognition feature point cloud space vector set based on the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each face expression image to obtain the face data expression recognition matching result.
在本发明实施例中,通过对预先设置的人脸表情匹配数据库内的每张人脸表情图像进行尺寸的压缩处理,以使其与待识别人脸图像数据的尺寸保持一致,并确保它们具有统一的大小和格式,并对经过尺寸压缩处理后的人脸表情压缩图像集进行图像的匹配对准处理,以确保所有处理后的图像在空间上对准,并将每张图像的表情部位(如眼睛、嘴巴)在空间上对齐,还通过使用空间向量转换方法对经过图像匹配对准处理的人脸表情图像集进行特征点云的空间向量转换,旨在提取每张人脸表情匹配对准图像的特征点信息,例如面部轮廓、眼睛位置、鼻子位置等关键点的空间向量表示,并通过结合先前提取得到的每张人脸表情图像中每一个特征点云处的特征空间向量,使用例如欧氏距离或余弦相似度等方法对人脸图像识别特征点云空间向量集中相对应特征点云处的特征空间向量并进行空间距离的度量计算,以评估计算每张人脸图像的特征点向量与预设表情图像特征点向量之间的相似度或距离,从而得到各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值。In an embodiment of the present invention, by compressing the size of each facial expression image in a preset facial expression matching database to make it consistent with the size of the facial image data to be identified and to ensure that they have a uniform size and format, and performing image matching and alignment processing on the facial expression compressed image set after the size compression processing to ensure that all processed images are aligned in space, and the expression parts (such as eyes and mouth) of each image are aligned in space, and also performing spatial vector conversion of the feature point cloud on the facial expression image set after the image matching and alignment processing by using a spatial vector conversion method, the purpose is to extract the facial expression of each facial expression matching and alignment image. Feature point information, such as the spatial vector representation of key points such as facial contour, eye position, nose position, etc., and by combining the feature space vectors at each feature point cloud in each facial expression image extracted previously, using methods such as Euclidean distance or cosine similarity to measure the spatial distance of the feature space vectors at the corresponding feature point cloud in the facial image recognition feature point cloud space vector set, so as to evaluate the similarity or distance between the feature point vector of each facial image and the feature point vector of the preset expression image, thereby obtaining the vector space distance measurement value between each facial image recognition feature point cloud space vector and the corresponding feature point cloud space vector of each facial expression image.
通过使用预先设置的特征向量空间距离阈值对先前量化计算得到的各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值进行比较判断,如果某一个识别特征点云处的空间向量与表情数据库中每张人脸表情图像对应特征点云空间向量之间的空间距离度量值大于或等于预设的特征向量空间距离阈值,就将表情图像中相对应的特征点云标记为该待识别人脸图像的表情识别相似点;反之,则不对该表情图像进行标记处理,并实现对人脸表情匹配数据库内所有被标记存在有人脸表情识别相似点的人脸表情图像进行相似点数量统计计算,这一步骤的目的是确定在匹配数据库中与之相似每张人脸表情图像上存在的识别相似点数量,以便于确定与待识别人脸图像最接近的表情图像。By using a preset feature vector space distance threshold, the vector space distance measurement values between the space vectors of each facial image recognition feature point cloud obtained by previous quantitative calculation and the space vectors of the feature point cloud corresponding to each facial expression image are compared and judged. If the space distance measurement value between the space vector at a certain recognition feature point cloud and the space vector of the feature point cloud corresponding to each facial expression image in the expression database is greater than or equal to the preset feature vector space distance threshold, the corresponding feature point cloud in the expression image is marked as the expression recognition similarity point of the facial image to be recognized; otherwise, the expression image is not marked, and the number of similarity points of all facial expression images marked with facial expression recognition similarities in the facial expression matching database is statistically calculated. The purpose of this step is to determine the number of recognition similarity points on each facial expression image similar to it in the matching database, so as to determine the expression image closest to the facial image to be recognized.
然后,通过结合先前统计计算得到的人脸表情匹配数据库内每张人脸表情图像的识别相似点数量对人脸图像识别特征点云空间向量集相对应的待识别人脸数据进行人脸表情的识别分析,以从人脸表情数据库中筛选出与待识别人脸图像之间具有最多识别相似点相对应的人脸表情图像,并确定其为最匹配的表情类别或者情感类别,例如,如果待识别人脸图像与数据库中笑脸表情之间存在最多的识别特征像素点,那么可以得出该待识别人脸图像的表情识别结果为笑脸,最终识别得到人脸数据表情识别匹配结果。Then, by combining the number of recognition similarities of each facial expression image in the facial expression matching database obtained by previous statistical calculations, the facial expression recognition analysis is performed on the face data to be recognized corresponding to the facial image recognition feature point cloud space vector set, so as to screen out the facial expression image corresponding to the face image to be recognized with the most recognition similarities from the facial expression database, and determine it as the most matching expression category or emotion category. For example, if there are the most recognition feature pixels between the face image to be recognized and the smiling face expression in the database, then it can be concluded that the expression recognition result of the face image to be recognized is a smiling face, and finally the facial data expression recognition matching result is obtained.
本发明首先通过获取待识别人脸图像数据集,是人脸识别系统中的基础步骤,这一步骤确保能够获得足够的数据样本,以便后续进行有效的处理和分析,数据集的多样性和充分性直接影响到后续人脸表情识别过程中在不同场景下的准确性和鲁棒性,因此,获取高质量的人脸图像数据是保证后续处理过程稳定性和性能优化的重要前提。The present invention first obtains the face image data set to be identified, which is a basic step in the face recognition system. This step ensures that sufficient data samples can be obtained for subsequent effective processing and analysis. The diversity and adequacy of the data set directly affect the accuracy and robustness of the subsequent facial expression recognition process in different scenarios. Therefore, obtaining high-quality face image data is an important prerequisite for ensuring the stability of the subsequent processing process and performance optimization.
通过对待识别人脸图像数据集进行人脸灰度化处理,是为了简化图像的复杂性并提高后续处理的效率。人脸灰度化处理将彩色图像数据转换为灰度图像数据,这样做不仅能够减少数据处理的复杂度,还能够保留重要的人脸特征和结构信息,灰度化后的图像更易于进行特征提取和模式匹配,有助于提高人脸识别在不同光照条件和角度变化下的鲁棒性和稳定性。The purpose of graying the face image dataset to be recognized is to simplify the complexity of the image and improve the efficiency of subsequent processing. Graying converts color image data into grayscale image data, which not only reduces the complexity of data processing, but also retains important facial features and structural information. The grayed image is easier to extract features and pattern matching, which helps to improve the robustness and stability of face recognition under different lighting conditions and angle changes.
同时,通过对经过灰度化处理的人脸图像进行人脸边界背景裁切,能够进一步优化人脸区域的准确性和清晰度,背景裁切技术可以帮助去除图像中不必要的背景信息,集中关注人脸部分的特征和细节,这种精确的裁切操作能够有效地消除环境因素对识别精度的负面影响,确保后续人脸表情识别分析在实际应用中能够准确识别人脸表情并进行有效的认证或辨识。At the same time, by cropping the face boundary background of the grayscaled face image, the accuracy and clarity of the face area can be further optimized. The background cropping technology can help remove unnecessary background information in the image and focus on the features and details of the face. This precise cropping operation can effectively eliminate the negative impact of environmental factors on recognition accuracy, ensuring that subsequent facial expression recognition analysis can accurately identify facial expressions and perform effective authentication or identification in practical applications.
其次,通过使用卷积神经网络对待识别人脸背景裁切图像数据集中的待识别人脸灰度实例图进行识别特征捕捉处理,这一步骤的关键在于利用卷积操作捕捉人脸图像中的特征信息,例如边缘、纹理等,卷积神经网络能够提取出不同层次和复杂度的特征表示,为后续的特征数据学习处理奠定基础,并且,通过引入空间金字塔池化技术以及注意力机制对先前分析得到的识别特征数据进行识别特征增强处理,其中空间金字塔池化技术能够进一步提升卷积神经网络在多尺度特征分析上的能力,确保人脸灰度图的多尺度识别特征数据能够覆盖不同层次和范围的信息,而注意力机制能够动态地调整和加权特征图中不同位置的特征响应,使得网络更加关注人脸图像中的关键部位和重要特征,从而进一步提升人脸图像的识别表征特征数据质量和表达能力。Secondly, the convolutional neural network is used to capture the recognition features of the grayscale instance images of the faces to be recognized in the background cropped image dataset. The key to this step is to use the convolution operation to capture the feature information in the face image, such as edges, textures, etc. The convolutional neural network can extract feature representations of different levels and complexities, laying the foundation for subsequent feature data learning and processing. In addition, the recognition feature data obtained by the previous analysis is enhanced by introducing the spatial pyramid pooling technology and the attention mechanism. The spatial pyramid pooling technology can further enhance the ability of the convolutional neural network in multi-scale feature analysis, ensuring that the multi-scale recognition feature data of the face grayscale image can cover information of different levels and ranges, and the attention mechanism can dynamically adjust and weight the feature responses at different positions in the feature map, so that the network pays more attention to the key parts and important features in the face image, thereby further improving the quality and expression ability of the recognition representation feature data of the face image.
然后,通过对人脸图像第一识别表征特征数据进行三维特征虚拟空间转换,能够实现了从二维图像数据到三维虚拟空间的转换过程,这一步骤的关键在于利用深度学习模型或者几何学方法,将人脸图像的平面特征转换为更加丰富和具体的三维特征表示,从而更好地捕捉人脸的几何形状、深度信息以及空间分布特性,通过这种转换,不仅能够增强人脸表情识别对于复杂姿态和光照条件下的鲁棒性,还能提高识别的准确性和稳定性。Then, by performing a three-dimensional feature virtual space conversion on the first recognition representation feature data of the face image, the conversion process from two-dimensional image data to three-dimensional virtual space can be realized. The key to this step is to use a deep learning model or geometric method to convert the planar features of the face image into a richer and more specific three-dimensional feature representation, so as to better capture the geometric shape, depth information and spatial distribution characteristics of the face. Through this conversion, not only can the robustness of facial expression recognition under complex postures and lighting conditions be enhanced, but also the accuracy and stability of recognition can be improved.
通过对人脸图像识别特征三维虚拟空间进行特征点云空间向量转换,这一步骤的核心在于将每个关键部位特征点云的三维信息转换为高维度的特征空间向量集合,该特征空间向量集合不仅包含了关键部位的空间位置信息,还包括颜色、纹理等特征,这些信息对于人脸识别的精准性和全面性至关重要。通过这种向量转换,能够将复杂的三维特征数据转化为更便于处理和分析的形式,为人脸数据的最终表情识别和验证提供更加有效和可靠的特征描述,从而能够提高了面部表情识别的准确性和效率。The core of this step is to convert the three-dimensional information of the feature point cloud of each key part into a high-dimensional feature space vector set by converting the feature point cloud of the three-dimensional virtual space of the face image recognition feature. This feature space vector set not only contains the spatial position information of the key parts, but also includes features such as color and texture. This information is crucial for the accuracy and comprehensiveness of face recognition. Through this vector conversion, complex three-dimensional feature data can be converted into a form that is easier to process and analyze, providing a more effective and reliable feature description for the final expression recognition and verification of face data, thereby improving the accuracy and efficiency of facial expression recognition.
最后,通过根据预设的人脸表情匹配数据库对人脸图像识别特征点云空间向量集进行特征向量距离度量计算,这一步骤的关键在于利用数学上的距离度量方法(如欧氏距离或者余弦相似度等),以衡量每个人脸图像识别特征点云空间向量与数据库中每张人脸表情图像对应特征点云空间向量之间的相似性,通过这种计算,能够得到一个量化的度量值,反映出待识别人脸与已知表情图像之间的特征相似程度。Finally, the feature vector distance measurement calculation is performed on the face image recognition feature point cloud space vector set according to the preset facial expression matching database. The key to this step is to use mathematical distance measurement methods (such as Euclidean distance or cosine similarity, etc.) to measure the similarity between each face image recognition feature point cloud space vector and the corresponding feature point cloud space vector of each face expression image in the database. Through this calculation, a quantitative measurement value can be obtained, which reflects the degree of feature similarity between the face to be recognized and the known expression image.
通过基于各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值对人脸图像识别特征点云空间向量集相对应的待识别人脸数据进行人脸数据表情识别,这一步骤通过比较每张人脸表情图像对应特征点云与待识别人脸图像数据特征点云之间的相似点数量,来确定待识别人脸与数据库中哪张表情图像最为相似,从而得到人脸数据的表情识别匹配结果,这一过程通过有效的数据库管理和特征匹配算法,能够快速准确地识别出人脸图像的表情状态,为面部表情分析、情感识别等应用提供了可靠的技术支持和解决方案。Facial expression recognition is performed on the face data to be identified corresponding to the face image recognition feature point cloud space vector set based on the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each face expression image. This step determines which expression image in the database is most similar to the face to be identified by comparing the number of similarities between the feature point cloud corresponding to each face expression image and the feature point cloud of the face image data to be identified, thereby obtaining the expression recognition matching result of the face data. This process can quickly and accurately identify the expression state of the face image through effective database management and feature matching algorithm, providing reliable technical support and solutions for applications such as facial expression analysis and emotion recognition.
优选地,步骤S1包括以下步骤:Preferably, step S1 comprises the following steps:
步骤S11:获取待识别人脸图像数据集;Step S11: Obtain a dataset of face images to be recognized;
步骤S12:对待识别人脸图像数据集进行噪声消除处理,得到待识别人脸图像消噪数据集;Step S12: performing noise elimination processing on the face image dataset to be identified to obtain a noise elimination data set of the face image to be identified;
步骤S13:对待识别人脸图像消噪数据集进行直方图均衡化处理,得到待识别人脸图像对比均衡数据集;Step S13: performing histogram equalization processing on the denoising dataset of the face image to be identified to obtain a contrast equalized dataset of the face image to be identified;
步骤S14:对待识别人脸图像对比均衡数据集进行人脸灰度化处理,以得到待识别人脸灰度图数据集;Step S14: performing face grayscale processing on the face image contrast equalization dataset to be identified, so as to obtain a face grayscale image dataset to be identified;
步骤S15:对待识别人脸灰度图数据集进行人脸边界背景裁切,得到待识别人脸背景裁切图像数据集。Step S15: performing face boundary background cropping on the grayscale image dataset of the face to be identified to obtain a background cropped image dataset of the face to be identified.
作为本发明的一个实施例,参考图2所示,为图1中步骤S1的详细步骤流程示意图,在本实施例中步骤S1包括以下步骤:As an embodiment of the present invention, referring to FIG2 , which is a detailed flow chart of step S1 in FIG1 , in this embodiment, step S1 includes the following steps:
步骤S11:获取待识别人脸图像数据集;Step S11: Obtain a dataset of face images to be recognized;
在本发明实施例中,通过收集大量的人脸图像数据,这些数据可以来自不同的来源,例如摄像头捕捉、图像数据库或者在线数据集,最终得到待识别人脸图像数据集。In the embodiment of the present invention, a large amount of face image data is collected, which may come from different sources, such as camera capture, image databases or online data sets, to finally obtain a face image data set to be identified.
步骤S12:对待识别人脸图像数据集进行噪声消除处理,得到待识别人脸图像消噪数据集;Step S12: performing noise elimination processing on the face image dataset to be identified to obtain a noise elimination data set of the face image to be identified;
在本发明实施例中,通过使用包括中值滤波、高斯滤波或小波变换等技术对先前获取得到的待识别人脸图像数据集进行噪声的消除处理,以减少图像数据中的不必要干扰和信息损失,同时可以有效平滑图像数据并去除异常值,例如,如果图像数据集中包含因光照不均匀而导致的噪点,可以应用高斯滤波器平滑图像,从而得到更清晰和可靠的人脸数据集,最终得到待识别人脸图像消噪数据集。In an embodiment of the present invention, a noise elimination process is performed on a previously acquired face image dataset to be identified by using techniques including median filtering, Gaussian filtering or wavelet transform to reduce unnecessary interference and information loss in the image data. At the same time, the image data can be effectively smoothed and outliers can be removed. For example, if the image dataset contains noise caused by uneven lighting, a Gaussian filter can be applied to smooth the image to obtain a clearer and more reliable face dataset, and finally a denoised face image dataset to be identified is obtained.
步骤S13:对待识别人脸图像消噪数据集进行直方图均衡化处理,得到待识别人脸图像对比均衡数据集;Step S13: performing histogram equalization processing on the denoising dataset of the face image to be identified to obtain a contrast equalized dataset of the face image to be identified;
在本发明实施例中,通过使用直方图均衡化方法对经过消噪后得到的待识别人脸图像消噪数据集进行图像数据的对比度增强处理,以调整图像数据的灰度级分布,使得图像数据的整体亮度更加均衡,从而增强图像数据的局部细节和对比度,这种处理特别适合于那些灰度分布不均匀的图像数据,可以显著改善图像数据的视觉效果和识别质量,例如,一张光照不均匀的人脸图像数据经过直方图均衡化处理后,暗部和亮部的细节将更加清晰和突出,有助于后续的人脸特征提取和识别准确度,最终得到待识别人脸图像对比均衡数据集。In an embodiment of the present invention, a histogram equalization method is used to perform contrast enhancement processing on the denoised dataset of the face image to be identified after denoising, so as to adjust the grayscale distribution of the image data so that the overall brightness of the image data is more balanced, thereby enhancing the local details and contrast of the image data. This processing is particularly suitable for image data with uneven grayscale distribution, and can significantly improve the visual effect and recognition quality of the image data. For example, after a face image data with uneven illumination is processed by histogram equalization, the details of the dark and bright parts will be clearer and more prominent, which is helpful for subsequent facial feature extraction and recognition accuracy, and finally a contrast balanced dataset of the face image to be identified is obtained.
步骤S14:对待识别人脸图像对比均衡数据集进行人脸灰度化处理,以得到待识别人脸灰度图数据集;Step S14: performing face grayscale processing on the face image contrast equalization dataset to be identified, so as to obtain a face grayscale image dataset to be identified;
在本发明实施例中,通过对经过直方图均衡化后得到的待识别人脸图像对比均衡数据集进行灰度化处理,以将彩色图像转换为灰度图像,其转化后的灰度图像只包含亮度信息,而不包含色彩信息,这样可以简化后续处理步骤并减少计算复杂度,转换过程通常通过加权平均的方法来实现,例如,一张彩色的人脸图像在灰度化处理后,将变成灰度级别的图像,每个像素点只包含一个灰度值,最终得到待识别人脸灰度图数据集。In an embodiment of the present invention, a grayscale processing is performed on a contrast-equalized dataset of a face image to be identified obtained after histogram equalization to convert a color image into a grayscale image. The converted grayscale image only contains brightness information but not color information. This can simplify subsequent processing steps and reduce computational complexity. The conversion process is usually implemented by a weighted averaging method. For example, a color face image will become a grayscale image after grayscale processing, and each pixel point contains only one grayscale value, and finally a grayscale image dataset of a face to be identified is obtained.
步骤S15:对待识别人脸灰度图数据集进行人脸边界背景裁切,得到待识别人脸背景裁切图像数据集。Step S15: performing face boundary background cropping on the grayscale image dataset of the face to be identified to obtain a background cropped image dataset of the face to be identified.
在本发明实施例中,通过对经过灰度化处理后得到的待识别人脸灰度图数据集进行人脸边界的识别,以确定出相应人脸的边缘或边界来裁剪图像,例如,根据人脸的边缘线或者特定的标记点,可以精确地裁剪出仅包含人脸的图像部分,减少无关信息的干扰,并去除背景信息,从而使得人脸在后续的识别或分析任务中更加突出和准确,最终得到待识别人脸背景裁切图像数据集。In an embodiment of the present invention, facial boundaries are identified by using a grayscale image dataset of a face to be identified that is obtained after grayscale processing to determine the edge or boundary of the corresponding face to crop the image. For example, based on the edge line of the face or specific marking points, the image portion containing only the face can be accurately cropped to reduce interference from irrelevant information and remove background information, thereby making the face more prominent and accurate in subsequent recognition or analysis tasks, and ultimately obtaining a background cropped image dataset of the face to be identified.
本发明首先通过获取待识别人脸图像数据集,是人脸识别系统中的基础步骤,这一步骤确保能够获得足够的数据样本,以便后续进行有效的处理和分析,数据集的多样性和充分性直接影响到后续人脸表情识别过程中在不同场景下的准确性和鲁棒性,因此,获取高质量的人脸图像数据是保证后续处理过程稳定性和性能优化的重要前提。The present invention first obtains the face image data set to be identified, which is a basic step in the face recognition system. This step ensures that sufficient data samples can be obtained for subsequent effective processing and analysis. The diversity and adequacy of the data set directly affect the accuracy and robustness of the subsequent facial expression recognition process in different scenarios. Therefore, obtaining high-quality face image data is an important prerequisite for ensuring the stability of the subsequent processing process and performance optimization.
其次,通过对待识别人脸图像数据集进行噪声消除处理,是为了去除图像中存在的干扰信息,提高后续处理步骤的准确性和效果,噪声消除技术可以帮助过滤图像中的随机噪声、摄像设备产生的干扰或者环境光线的影响,使得图像更加清晰和可靠,这种预处理步骤能够有效地增强图像的特征,为后续的图像数据分析和识别工作奠定坚实的基础。Secondly, the purpose of performing noise elimination on the face image data set to be identified is to remove the interference information in the image and improve the accuracy and effect of subsequent processing steps. Noise elimination technology can help filter out random noise in the image, interference generated by the camera equipment or the influence of ambient light, making the image clearer and more reliable. This preprocessing step can effectively enhance the characteristics of the image and lay a solid foundation for subsequent image data analysis and recognition work.
然后,通过对待识别人脸图像消噪数据集进行直方图均衡化处理后,可以显著提升图像数据的对比度和视觉质量,直方图均衡化通过重新分布图像的像素强度值,使得图像中的灰度级别更均匀分布,从而增强了图像数据的局部对比度和细节信息,这种处理不仅能够使图像数据在视觉上更加清晰和鲜明,还能够改善后续特征提取和模式识别的效果,提高人脸表情识别的准确率和稳定性。Then, by performing histogram equalization on the denoising dataset of the face images to be identified, the contrast and visual quality of the image data can be significantly improved. Histogram equalization redistributes the pixel intensity values of the image to make the grayscale levels in the image more evenly distributed, thereby enhancing the local contrast and detail information of the image data. This processing can not only make the image data visually clearer and more vivid, but also improve the effects of subsequent feature extraction and pattern recognition, and improve the accuracy and stability of facial expression recognition.
接下来,通过对经过直方图均衡化处理后的待识别人脸图像进行人脸灰度化处理,是为了简化图像的复杂性并提高后续处理的效率。人脸灰度化处理将彩色图像转换为灰度图像,这样做不仅能够减少数据处理的复杂度,还能够保留重要的人脸特征和结构信息,灰度化后的图像更易于进行特征提取和模式匹配,有助于提高人脸识别在不同光照条件和角度变化下的鲁棒性和稳定性。Next, the face image to be recognized after histogram equalization is grayed to simplify the complexity of the image and improve the efficiency of subsequent processing. Face graying converts color images into grayscale images, which not only reduces the complexity of data processing, but also retains important facial features and structural information. The grayed image is easier to extract features and pattern matching, which helps to improve the robustness and stability of face recognition under different lighting conditions and angle changes.
最后,通过对经过灰度化处理的人脸图像进行人脸边界背景裁切,能够进一步优化人脸区域的准确性和清晰度,背景裁切技术可以帮助去除图像中不必要的背景信息,集中关注人脸部分的特征和细节,这种精确的裁切操作能够有效地消除环境因素对识别精度的负面影响,确保后续人脸表情识别分析在实际应用中能够准确识别人脸表情并进行有效的认证或辨识。Finally, by cropping the face boundary background of the grayscaled face image, the accuracy and clarity of the face area can be further optimized. Background cropping technology can help remove unnecessary background information in the image and focus on the features and details of the face. This precise cropping operation can effectively eliminate the negative impact of environmental factors on recognition accuracy, ensuring that subsequent facial expression recognition analysis can accurately identify facial expressions and perform effective authentication or identification in practical applications.
优选地,步骤S15包括以下步骤:Preferably, step S15 comprises the following steps:
步骤S151:对待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行像素点亮度分布分析,得到待识别人脸像素点亮度分布图;Step S151: performing pixel brightness distribution analysis on the grayscale image of the face to be identified corresponding to the grayscale image data set to obtain a pixel brightness distribution map of the face to be identified;
步骤S152:根据预设的边缘像素点亮度阈值对待识别人脸像素点亮度分布图内的每一个像素点亮度分布值进行边缘点位筛选标注处理,得到待识别人脸边缘像素标注点位;Step S152: performing edge point screening and labeling processing on each pixel brightness distribution value in the pixel brightness distribution map of the face to be identified according to a preset edge pixel brightness threshold, so as to obtain edge pixel labeling points of the face to be identified;
步骤S153:基于待识别人脸边缘像素标注点位对待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行边缘线连接绘制,以生成待识别人脸图像边缘线;Step S153: Drawing edge lines for the grayscale image of the face to be identified corresponding to the grayscale image of the face to be identified in the grayscale image data set based on the edge pixel marking points of the face to be identified, so as to generate edge lines of the face to be identified image;
步骤S154:通过预设四个方位限制条件,其中四个方位限制条件包括东方位、北方位、西方位以及南方位,并基于四个方位限制条件对待识别人脸图像边缘线进行方位最远非零像素点确定,得到待识别人脸边缘线在四个方位上的最远非零像素点位;Step S154: by presetting four orientation constraints, wherein the four orientation constraints include east, north, west, and south, and determining the farthest non-zero pixel point of the edge line of the face image to be identified based on the four orientation constraints, the farthest non-zero pixel point of the edge line of the face to be identified in the four orientations is obtained;
步骤S155:基于待识别人脸边缘线在四个方位上的最远非零像素点位对待识别人脸灰度图数据集进行人脸边界背景裁切,得到待识别人脸背景裁切图像数据集。Step S155: based on the farthest non-zero pixel points of the edge lines of the face to be identified in four directions, the face boundary background is cropped on the grayscale image dataset of the face to be identified to obtain a background cropped image dataset of the face to be identified.
作为本发明的一个实施例,参考图3所示,为图2中步骤S15的详细步骤流程示意图,在本实施例中步骤S15包括以下步骤:As an embodiment of the present invention, referring to FIG. 3 , which is a detailed step flow diagram of step S15 in FIG. 2 , in this embodiment, step S15 includes the following steps:
步骤S151:对待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行像素点亮度分布分析,得到待识别人脸像素点亮度分布图;Step S151: performing pixel brightness distribution analysis on the grayscale image of the face to be identified corresponding to the grayscale image data set to obtain a pixel brightness distribution map of the face to be identified;
在本发明实施例中,通过对待识别人脸灰度图数据集内相对应的每张待识别人脸灰度图进行像素点亮度的分布分析,这一过程涉及扫描图像中的每个像素点,并记录其亮度值,通常情况下,亮度值越高的像素点代表图像中较亮的区域,而亮度值较低的像素点则代表较暗的区域,通过统计和分析所有像素点的亮度分布,可以得到一张待识别人脸的像素点亮度分布图,例如,对于一张灰度图像,会将每个像素点的亮度值记录下来,并生成一个亮度分布曲线或热图,以显示图像中不同区域的亮度分布情况,最终得到待识别人脸像素点亮度分布图。In an embodiment of the present invention, a distribution analysis of pixel brightness is performed on each grayscale image of a face to be identified that corresponds to a grayscale image data set. This process involves scanning each pixel in the image and recording its brightness value. Generally, pixels with higher brightness values represent brighter areas in the image, while pixels with lower brightness values represent darker areas. By counting and analyzing the brightness distribution of all pixels, a pixel brightness distribution map of the face to be identified can be obtained. For example, for a grayscale image, the brightness value of each pixel will be recorded, and a brightness distribution curve or heat map will be generated to display the brightness distribution of different areas in the image, and finally a pixel brightness distribution map of the face to be identified will be obtained.
步骤S152:根据预设的边缘像素点亮度阈值对待识别人脸像素点亮度分布图内的每一个像素点亮度分布值进行边缘点位筛选标注处理,得到待识别人脸边缘像素标注点位;Step S152: performing edge point screening and labeling processing on each pixel brightness distribution value in the pixel brightness distribution map of the face to be identified according to a preset edge pixel brightness threshold, so as to obtain edge pixel labeling points of the face to be identified;
在本发明实施例中,通过使用预先设置的边缘像素点亮度阈值对待识别人脸像素点亮度分布图内的每一个像素点亮度分布值进行边缘点位的筛选识别并标注,以根据设定的阈值识别出图像中属于边缘的像素点,一般来说,边缘像素点的亮度值会比较低于周围区域的像素点,这是由于边缘背景色度的影响,例如,假设设定一个亮度阈值,低于该阈值的像素点被认为是边缘像素点,并将这些像素点进行标注处理,以便后续的边缘线连接和分析,最终得到待识别人脸边缘像素标注点位。In an embodiment of the present invention, a preset edge pixel brightness threshold is used to screen, identify and mark the edge points of each pixel brightness distribution value in the pixel brightness distribution map of the face to be identified, so as to identify the pixels belonging to the edge in the image according to the set threshold. Generally speaking, the brightness value of the edge pixel will be lower than the pixels in the surrounding area. This is due to the influence of the edge background chromaticity. For example, assuming that a brightness threshold is set, the pixels below the threshold are considered to be edge pixels, and these pixels are marked for subsequent edge line connection and analysis, and finally the edge pixel marking points of the face to be identified are obtained.
步骤S153:基于待识别人脸边缘像素标注点位对待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行边缘线连接绘制,以生成待识别人脸图像边缘线;Step S153: Drawing edge lines for the grayscale image of the face to be identified corresponding to the grayscale image of the face to be identified in the grayscale image data set based on the edge pixel marking points of the face to be identified, so as to generate edge lines of the face to be identified image;
在本发明实施例中,通过结合先前标注得到的待识别人脸边缘像素标注点位对其在待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行边缘线的连接绘制,以根据标注的边缘点位,将这些点位连接起来形成连续的边缘线,这种连接可以采用线段或曲线的形式,以准确地描述人脸的边缘轮廓,例如,对于标注出的边缘点位,会根据它们的位置信息绘制出一条完整的边缘线,从而形成待识别人脸图像的边缘轮廓,最终生成待识别人脸图像边缘线。In an embodiment of the present invention, edge lines are connected and drawn for the grayscale image of the face to be identified that corresponds to the grayscale image of the face to be identified in the grayscale image data set obtained by combining the edge pixel annotation points of the face to be identified obtained previously, so as to connect these points to form a continuous edge line according to the annotated edge points. This connection can be in the form of a line segment or a curve to accurately describe the edge contour of the face. For example, for the annotated edge points, a complete edge line will be drawn according to their position information, thereby forming the edge contour of the face image to be identified, and finally generating the edge line of the face image to be identified.
步骤S154:通过预设四个方位限制条件,其中四个方位限制条件包括东方位、北方位、西方位以及南方位,并基于四个方位限制条件对待识别人脸图像边缘线进行方位最远非零像素点确定,得到待识别人脸边缘线在四个方位上的最远非零像素点位;Step S154: by presetting four orientation constraints, wherein the four orientation constraints include east, north, west, and south, and determining the farthest non-zero pixel point of the edge line of the face image to be identified based on the four orientation constraints, the farthest non-zero pixel point of the edge line of the face to be identified in the four orientations is obtained;
在本发明实施例中,通过预先设置四个方位限制条件(东、北、西、南)对先前绘制得到的待识别人脸图像边缘线进行方位最远非零像素点的确定,这一步骤的目的是在每个方向上找到边缘线上距离人脸中心最远的非零像素点,以此确定人脸的边界,例如,根据东、北、西、南四个方向,会分别查找其边缘线上的最外侧非零像素点,并记录它们的位置信息作为边缘线在各方向上的最远点位,最终得到待识别人脸边缘线在四个方位上的最远非零像素点位。In an embodiment of the present invention, four azimuth restriction conditions (east, north, west, and south) are pre-set to determine the farthest non-zero pixel point in the azimuth of the edge line of the face image to be identified that is previously drawn. The purpose of this step is to find the non-zero pixel point on the edge line that is farthest from the center of the face in each direction, so as to determine the boundary of the face. For example, according to the four directions of east, north, west, and south, the outermost non-zero pixel points on the edge line will be searched respectively, and their position information will be recorded as the farthest point of the edge line in each direction, and finally the farthest non-zero pixel points of the edge line of the face to be identified in the four directions will be obtained.
步骤S155:基于待识别人脸边缘线在四个方位上的最远非零像素点位对待识别人脸灰度图数据集进行人脸边界背景裁切,得到待识别人脸背景裁切图像数据集。Step S155: based on the farthest non-zero pixel points of the edge lines of the face to be identified in four directions, the face boundary background is cropped on the grayscale image dataset of the face to be identified to obtain a background cropped image dataset of the face to be identified.
在本发明实施例中,通过根据先前确定得到的待识别人脸边缘线在四个方位上的最远非零像素点位对待识别人脸灰度图数据集内相对应的待识别人脸灰度图像进行人脸边界背景的裁切,以根据四个方位上的最远点位信息,将原始灰度图像进行裁剪,以得到仅包含人脸区域的背景裁切图像数据集,例如,根据已确定的最远点位信息,将裁剪出人脸的边界范围,确保裁剪后的图像仅包含人脸主体,便于后续的人脸识别或分析任务,最终得到待识别人脸背景裁切图像数据集。In an embodiment of the present invention, the face boundary background is cropped from the grayscale image of the face to be identified corresponding to the grayscale image data set of the face to be identified according to the farthest non-zero pixel point of the edge line of the face to be identified in four directions previously determined, so that the original grayscale image is cropped according to the farthest point information in four directions to obtain a background cropped image data set containing only the face area. For example, according to the determined farthest point information, the boundary range of the face is cropped to ensure that the cropped image contains only the main body of the face, which is convenient for subsequent face recognition or analysis tasks, and finally a background cropped image data set of the face to be identified is obtained.
本发明首先通过对待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行像素点亮度分布分析,是为了理解图像中各个像素点的亮度特征及其分布情况,这一步骤通过统计和分析每个像素点的灰度值,可以揭示出图像中不同区域的明暗变化,有助于后续边缘检测和特征提取过程的准确性和效率。通过像素点亮度分布图,可以直观地观察到人脸图像中不同部位的灰度分布情况,为进一步处理提供基础数据。The present invention first analyzes the pixel brightness distribution of the grayscale image of the face to be identified in the grayscale image data set to understand the brightness characteristics and distribution of each pixel in the image. This step can reveal the light and dark changes in different areas of the image by counting and analyzing the grayscale value of each pixel, which is helpful for the accuracy and efficiency of the subsequent edge detection and feature extraction process. Through the pixel brightness distribution map, the grayscale distribution of different parts in the face image can be intuitively observed, providing basic data for further processing.
其次,通过根据预设的边缘像素点亮度阈值对待识别人脸像素点亮度分布图内的每一个像素点进行筛选和标注处理,旨在识别出图像中代表人脸边缘的关键点位,通过设定阈值,可以有效地区分出人脸边缘和背景之间的明显差异,从而标注出人脸的外轮廓,这一步骤的关键在于准确地定位人脸边缘的关键点,为后续的边缘线连接和裁切操作提供精确的依据和支持。Secondly, by screening and labeling each pixel in the brightness distribution map of the face pixels to be identified according to the preset edge pixel brightness threshold, the key points representing the edge of the face in the image are identified. By setting the threshold, the obvious difference between the edge of the face and the background can be effectively distinguished, thereby marking the outer contour of the face. The key to this step is to accurately locate the key points of the edge of the face, providing accurate basis and support for subsequent edge line connection and cropping operations.
然后,通过基于待识别人脸边缘像素标注点位对待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行边缘线连接绘制,目的是生成准确的人脸图像边缘线,通过连接标注点位,可以形成人脸轮廓的完整边界线条,这些线条反映了人脸在图像中的精确形状和结构,生成的边缘线不仅有助于提取人脸的形状特征,还为后续的方位限制和边缘点位最远像素点位的确定提供了基础。Then, the edge lines of the corresponding grayscale image of the face to be identified in the grayscale image data set are connected and drawn based on the edge pixel annotation points of the face to be identified. The purpose is to generate accurate edge lines of the face image. By connecting the annotated points, the complete boundary lines of the face contour can be formed. These lines reflect the precise shape and structure of the face in the image. The generated edge lines not only help to extract the shape features of the face, but also provide a basis for subsequent orientation restrictions and determination of the farthest pixel points of the edge points.
接下来,通过在确定人脸边缘线的基础上,通过预设的四个方位限制条件(东、北、西、南)对人脸图像边缘线进行非零像素点位的最远位置确定,这一步骤旨在识别出人脸轮廓在各个方向上最远的边缘点,从而准确地确定人脸的边界范围,通过方位限制条件,可以有效地排除背景干扰,确保选取的最远像素点位能够真实反映出人脸的实际外廓,为后续的裁切操作提供准确的边界定义。Next, based on the determination of the face edge line, the farthest position of the non-zero pixel point on the edge line of the face image is determined through the preset four azimuth constraints (east, north, west, and south). This step aims to identify the farthest edge points of the face contour in each direction, so as to accurately determine the boundary range of the face. Through the azimuth constraints, background interference can be effectively eliminated to ensure that the selected farthest pixel point can truly reflect the actual outline of the face, providing accurate boundary definition for subsequent cropping operations.
最后,通过基于待识别人脸边缘线在四个方位上的最远非零像素点位对待识别人脸灰度图数据集进行人脸边界背景裁切,这一步骤的目的是将人脸区域与背景明确分离,以获得清晰的人脸背景裁切图像数据集,裁切后的图像集中精确包含了人脸的主要特征和结构,去除了不必要的背景信息,为后续的人脸识别特征分析过程提供了更加准确和可靠的输入数据,这样的预处理步骤不仅提高了人工智能中卷积神经网络算法对人脸特征的敏感度,还增强了其在复杂环境下的稳定性和可用性。Finally, the face boundary background is cropped on the grayscale image dataset of the face to be identified based on the farthest non-zero pixel point of the edge line of the face to be identified in four directions. The purpose of this step is to clearly separate the face area from the background to obtain a clear face background cropped image dataset. The cropped image set accurately contains the main features and structure of the face, removes unnecessary background information, and provides more accurate and reliable input data for the subsequent face recognition feature analysis process. Such a preprocessing step not only improves the sensitivity of the convolutional neural network algorithm in artificial intelligence to facial features, but also enhances its stability and usability in complex environments.
优选地,步骤S155包括以下步骤:Preferably, step S155 includes the following steps:
对待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行灰度中心识别分析,得到待识别人脸灰度图灰度中心点;Perform grayscale center recognition analysis on the grayscale image of the face to be identified corresponding to the grayscale image data set to obtain the grayscale center point of the grayscale image of the face to be identified;
在本发明实施例中,通过从先前经过灰度化处理后待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行灰度中心点的分析确定,以找到图像中灰度值集中的区域,也即灰度中心点,这个点通常代表了人脸图像的主要特征或焦点,例如,对于一张灰度图像,会扫描每个像素点的灰度值,并标记灰度值最高的点作为图像的中心点,最终得到待识别人脸灰度图灰度中心点。In an embodiment of the present invention, the grayscale center point is analyzed and determined from the grayscale image of the face to be identified that corresponds to the grayscale image data set of the face to be identified after previous grayscale processing, so as to find the area where the grayscale values in the image are concentrated, that is, the grayscale center point. This point usually represents the main feature or focus of the face image. For example, for a grayscale image, the grayscale value of each pixel is scanned, and the point with the highest grayscale value is marked as the center point of the image, and finally the grayscale center point of the grayscale image of the face to be identified is obtained.
优选地,基于待识别人脸灰度图灰度中心点对待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行二维空间坐标系转换,得到以灰度中心点为原点的待识别人脸灰度图二维空间坐标系;Preferably, based on the grayscale center point of the grayscale image of the face to be identified, the corresponding grayscale image of the face to be identified in the grayscale image data set is transformed into a two-dimensional space coordinate system to obtain a two-dimensional space coordinate system of the grayscale image of the face to be identified with the grayscale center point as the origin;
在本发明实施例中,通过结合先前确定得到的待识别人脸灰度图灰度中心点对待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行二维空间坐标系的转换,以将待识别人脸灰度图像转换为以灰度中心点为原点的二维空间坐标系,这个步骤涉及将每个像素点的坐标进行调整,使得灰度中心点成为新的坐标系原点,例如,如果灰度中心点在图像坐标系中的坐标为(x_c, y_c),则将原始图像中每个像素的坐标(x, y)转换为新坐标系中的(x' = x - x_c, y' = y - y_c),最终得到以灰度中心点为原点的待识别人脸灰度图二维空间坐标系。In an embodiment of the present invention, the two-dimensional spatial coordinate system of the grayscale image of the face to be identified corresponding to the grayscale image of the face to be identified in the grayscale image data set is transformed by combining the grayscale center point of the grayscale image of the face to be identified previously determined, so as to convert the grayscale image of the face to be identified into a two-dimensional spatial coordinate system with the grayscale center point as the origin. This step involves adjusting the coordinates of each pixel point so that the grayscale center point becomes the new origin of the coordinate system. For example, if the coordinates of the grayscale center point in the image coordinate system are (x_c, y_c), then the coordinates (x, y) of each pixel in the original image are converted to (x' = x - x_c, y' = y - y_c) in the new coordinate system, and finally the two-dimensional spatial coordinate system of the grayscale image of the face to be identified with the grayscale center point as the origin is obtained.
优选地,根据以灰度中心点为原点的待识别人脸灰度图二维空间坐标系对待识别人脸边缘线在四个方位上的最远非零像素点位进行方位空间坐标计算,得到待识别人脸边缘线在四个方位上最远非零像素点的方位空间坐标;Preferably, the azimuth spatial coordinates of the farthest non-zero pixel points of the edge line of the face to be identified in four directions are calculated according to the two-dimensional spatial coordinate system of the grayscale image of the face to be identified with the grayscale center point as the origin, so as to obtain the azimuth spatial coordinates of the farthest non-zero pixel points of the edge line of the face to be identified in four directions;
在本发明实施例中,通过使用先前建立的以灰度中心点为原点的待识别人脸灰度图二维空间坐标系对相对应待识别人脸边缘线在四个方位上的最远非零像素点位进行横纵轴坐标的测量,以测量并记录它们的横纵轴坐标值,并对其进行相对于灰度中心点的距离计算,以通过使用两点之间的距离计算方法或者勾股定理计算确定待识别人脸边缘线在四个方位上最远非零像素点相对于灰度中心点的具体空间距离,同时通过使用反正切函数计算每个方向上最远点与中心点之间的空间坐标偏角,并将相对于中心原点之间的空间距离值作为极径,并将空间坐标偏角作为极角,从而将以灰度中心为原点的二维坐标系转换为方位空间坐标系,用于描述人脸边缘线在空间中的具体位置和方向,最终得到待识别人脸边缘线在四个方位上最远非零像素点的方位空间坐标。In an embodiment of the present invention, a previously established two-dimensional spatial coordinate system of the grayscale image of the face to be identified with the grayscale center point as the origin is used to measure the horizontal and vertical axis coordinates of the farthest non-zero pixel points corresponding to the edge line of the face to be identified in four directions, so as to measure and record their horizontal and vertical axis coordinate values, and calculate the distance relative to the grayscale center point, so as to determine the specific spatial distance of the farthest non-zero pixel points of the edge line of the face to be identified in four directions relative to the grayscale center point by using a distance calculation method between two points or the Pythagorean theorem, and at the same time, the spatial coordinate deflection between the farthest point and the center point in each direction is calculated by using an inverse tangent function, and the spatial distance value relative to the center origin is used as the polar diameter, and the spatial coordinate deflection is used as the polar angle, so that the two-dimensional coordinate system with the grayscale center as the origin is converted into an azimuthal space coordinate system for describing the specific position and direction of the edge line of the face in space, and finally the azimuthal space coordinates of the farthest non-zero pixel points of the edge line of the face to be identified in four directions are obtained.
优选地,对待识别人脸边缘线在四个方位上最远非零像素点的方位空间坐标进行最大外接矩形绘制,以生成待识别人脸边缘最大外接矩形边界;Preferably, the maximum circumscribed rectangle is drawn for the azimuth space coordinates of the farthest non-zero pixel points of the edge line of the face to be identified in four directions, so as to generate the maximum circumscribed rectangle boundary of the edge of the face to be identified;
在本发明实施例中,通过连接先前确定得到的待识别人脸边缘线在四个方位上最远非零像素点的方位空间坐标来绘制出能够完全包围待识别人脸图像边缘内所有非零像素点的最小矩形区域,也即最大外接矩形边界范围,以精确地标定待识别人脸图像的边界范围,最终生成待识别人脸边缘最大外接矩形边界。In an embodiment of the present invention, the azimuthal spatial coordinates of the farthest non-zero pixel points of the edge line of the face to be identified in four directions that have been previously determined are connected to draw a minimum rectangular area that can completely surround all non-zero pixel points within the edge of the face image to be identified, that is, the maximum circumscribed rectangular boundary range, so as to accurately calibrate the boundary range of the face image to be identified, and finally generate the maximum circumscribed rectangular boundary of the edge of the face to be identified.
优选地,根据待识别人脸边缘最大外接矩形边界对待识别人脸灰度图数据集进行人脸边界背景裁切,得到待识别人脸背景裁切图像数据集。Preferably, the face boundary background is cropped from the grayscale image dataset of the face to be identified according to the maximum circumscribed rectangular boundary of the edge of the face to be identified, so as to obtain a background cropped image dataset of the face to be identified.
在本发明实施例中,通过使用先前绘制确定得到的待识别人脸边缘最大外接矩形边界对待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行外接背景的裁切处理,以将待识别人脸灰度图中的像素裁剪到其最大外接矩形框定的边界内,并从中去除多余的背景部分,也即将人脸区域从其周围的背景中分离出来,从而得到仅包含人脸区域的裁切图像,并对经过裁切处理后得到的图像进行集合,最终得到待识别人脸背景裁切图像数据集。In an embodiment of the present invention, the maximum circumscribed rectangular boundary of the edge of the face to be identified determined previously is used to perform circumscribed background cropping on the grayscale image of the face to be identified corresponding to the grayscale image data set, so that the pixels in the grayscale image of the face to be identified are cropped to the boundary defined by its maximum circumscribed rectangle, and the redundant background part is removed therefrom, that is, the face area is separated from the background around it, so as to obtain a cropped image containing only the face area, and the images obtained after the cropping process are collected, and finally a data set of cropped images of the background of the face to be identified is obtained.
本发明首先通过对待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行灰度中心识别分析,是为了准确定位人脸图像的中心点,通过分析灰度图像的像素分布,可以找到图像中灰度值集中的区域,也即灰度中心点,这个点通常代表了人脸图像的主要特征或焦点,有助于后续处理步骤准确地定位和识别人脸的核心区域。The present invention first performs grayscale center recognition analysis on the grayscale image of the face to be identified that corresponds to the grayscale image data set in order to accurately locate the center point of the face image. By analyzing the pixel distribution of the grayscale image, the area in the image where the grayscale values are concentrated, that is, the grayscale center point, can be found. This point usually represents the main feature or focus of the face image, which helps the subsequent processing steps to accurately locate and identify the core area of the face.
其次,通过基于待识别人脸灰度图灰度中心点对待识别人脸灰度图数据集内相对应的待识别人脸灰度图进行二维空间坐标系转换,是为了将人脸图像在处理过程中统一到一个标准的坐标系中,通过以灰度中心点为原点,可以简化人脸图像的处理和分析,使得后续的几何计算和边界检测更为方便和精确,这种转换不仅有助于统一处理流程,还能够保持图像在不同处理阶段的一致性和稳定性。Secondly, the two-dimensional spatial coordinate system transformation of the corresponding grayscale image of the face to be identified in the grayscale image data set is performed based on the grayscale center point of the grayscale image of the face to be identified. The purpose is to unify the face image into a standard coordinate system during the processing process. By taking the grayscale center point as the origin, the processing and analysis of the face image can be simplified, making subsequent geometric calculations and boundary detection more convenient and accurate. This conversion not only helps to unify the processing process, but also maintains the consistency and stability of the image in different processing stages.
然后,通过根据以灰度中心点为原点的待识别人脸灰度图二维空间坐标系对待识别人脸边缘线在四个方位上的最远非零像素点位进行方位空间坐标计算,这一步骤的目的是确定人脸边缘在各个方向上的极限点位,从而更精确地定义人脸的外轮廓。通过计算方位空间坐标,可以确定人脸边缘线的具体位置和形状,为后续的边缘矩形绘制提供准确的基础数据。接下来,通过对待识别人脸边缘线在四个方位上最远非零像素点的方位空间坐标进行最大外接矩形绘制,这一矩形将围绕着人脸边缘的极限点位进行绘制,以定义人脸的最大外接矩形边界,最大外接矩形是对人脸区域的一种简化和优化表示,它能够有效地框定人脸的整体轮廓,同时保留重要的结构特征和细节信息。Then, the azimuth space coordinates of the furthest non-zero pixel points of the edge line of the face to be identified in four directions are calculated according to the two-dimensional space coordinate system of the grayscale image of the face to be identified with the grayscale center point as the origin. The purpose of this step is to determine the extreme points of the edge of the face in all directions, so as to more accurately define the outer contour of the face. By calculating the azimuth space coordinates, the specific position and shape of the edge line of the face can be determined, providing accurate basic data for the subsequent edge rectangle drawing. Next, the maximum circumscribed rectangle is drawn by the azimuth space coordinates of the furthest non-zero pixel points of the edge line of the face to be identified in four directions. This rectangle will be drawn around the extreme points of the edge of the face to define the maximum circumscribed rectangle boundary of the face. The maximum circumscribed rectangle is a simplified and optimized representation of the face area, which can effectively frame the overall contour of the face while retaining important structural features and detail information.
最后,通过根据待识别人脸边缘最大外接矩形边界对待识别人脸灰度图数据集进行人脸边界背景裁切,这一步骤的目的是将人脸区域与背景明确分离,从而生成清晰的人脸背景裁切图像数据集,裁切后的图像集中包含了精确的人脸特征和结构,去除了无关的背景干扰,为后续的人脸识别和分析工作提供了准确和可靠的输入数据。Finally, the face boundary background is cropped from the grayscale image dataset of the face to be identified according to the maximum circumscribed rectangular boundary of the edge of the face to be identified. The purpose of this step is to clearly separate the face area from the background, thereby generating a clear face background cropped image dataset. The cropped image set contains precise facial features and structures, removes irrelevant background interference, and provides accurate and reliable input data for subsequent face recognition and analysis work.
优选地,所述根据以灰度中心点为原点的待识别人脸灰度图二维空间坐标系对待识别人脸边缘线在四个方位上的最远非零像素点位进行方位空间坐标计算包括以下步骤:Preferably, the step of calculating the azimuth space coordinates of the farthest non-zero pixel points of the edge line of the face to be identified in four directions according to the two-dimensional space coordinate system of the grayscale image of the face to be identified with the grayscale center point as the origin comprises the following steps:
根据以灰度中心点为原点的待识别人脸灰度图二维空间坐标系对待识别人脸边缘线在四个方位上的最远非零像素点位进行横纵轴坐标测量处理,得到待识别人脸边缘线在四个方位上最远非零像素点的空间横纵轴坐标值;According to the two-dimensional space coordinate system of the grayscale image of the face to be identified with the grayscale center point as the origin, the horizontal and vertical axis coordinates of the farthest non-zero pixel points of the edge line of the face to be identified in four directions are measured, and the horizontal and vertical axis coordinates of the farthest non-zero pixel points of the edge line of the face to be identified in four directions are obtained;
在本发明实施例中,通过使用先前建立的以灰度中心点为原点的待识别人脸灰度图二维空间坐标系对相对应待识别人脸边缘线在四个方位上的最远非零像素点位进行横纵轴坐标的测量,这意味着在每个方向上,会通过建立好的空间坐标系来寻找离中心最远的非零像素点,并记录它们的横纵轴坐标值,例如,对于一张人脸图像,能够找到了上方最远的非零像素点在坐标(x_up, y_up),下方在坐标(x_down, y_down),左方在坐标(x_left, y_left),右方在坐标(x_right, y_right),最终得到待识别人脸边缘线在四个方位上最远非零像素点的空间横纵轴坐标值。In an embodiment of the present invention, the horizontal and vertical axis coordinates of the farthest non-zero pixel points corresponding to the edge line of the face to be identified in four directions are measured by using the previously established two-dimensional spatial coordinate system of the grayscale image of the face to be identified with the grayscale center point as the origin. This means that in each direction, the non-zero pixel points farthest from the center will be found through the established spatial coordinate system, and their horizontal and vertical axis coordinate values will be recorded. For example, for a face image, the farthest non-zero pixel points on the top can be found at coordinates (x_up, y_up), on the bottom at coordinates (x_down, y_down), on the left at coordinates (x_left, y_left), and on the right at coordinates (x_right, y_right), and finally the horizontal and vertical axis coordinate values of the farthest non-zero pixel points on the edge line of the face to be identified in four directions are obtained.
优选地,根据待识别人脸边缘线在四个方位上最远非零像素点的空间横纵轴坐标值进行相对原点距离计算,得到待识别人脸边缘线在四个方位上最远非零像素点相对于中心原点之间的空间距离值;Preferably, the distance relative to the origin is calculated based on the spatial horizontal and vertical axis coordinate values of the farthest non-zero pixel points on the edge line of the face to be identified in the four directions, so as to obtain the spatial distance values between the farthest non-zero pixel points on the edge line of the face to be identified in the four directions and the central origin;
在本发明实施例中,通过结合先前确定得到的待识别人脸边缘线在四个方位上最远非零像素点的空间横纵轴坐标值进行相对于灰度中心点的距离计算,以通过使用两点之间的距离计算方法或者勾股定理计算确定待识别人脸边缘线在四个方位上最远非零像素点相对于灰度中心点的具体空间距离,从而计算得到了上方最远点到中心的距离为d_up,下方为d_down,左方为d_left,右方为d_right,最终得到待识别人脸边缘线在四个方位上最远非零像素点相对于中心原点之间的空间距离值。In an embodiment of the present invention, the distance relative to the grayscale center point is calculated by combining the spatial horizontal and vertical axis coordinate values of the farthest non-zero pixel points of the edge line of the face to be identified in the four directions determined previously, so as to determine the specific spatial distances of the farthest non-zero pixel points of the edge line of the face to be identified in the four directions relative to the grayscale center point by using the distance calculation method between two points or the Pythagorean theorem, thereby calculating the distances from the farthest point to the center at the top as d_up, the bottom as d_down, the left as d_left, and the right as d_right, and finally obtaining the spatial distance values between the farthest non-zero pixel points of the edge line of the face to be identified in the four directions relative to the center origin.
优选地,根据待识别人脸边缘线在四个方位上最远非零像素点的空间横纵轴坐标值进行像素点偏角反正切求解处理,得到待识别人脸边缘线在四个方位上最远非零像素点相对于中心原点之间的空间坐标偏角;Preferably, the pixel point deflection arctangent is solved according to the spatial horizontal and vertical axis coordinate values of the farthest non-zero pixel points on the edge line of the face to be identified in the four directions, so as to obtain the spatial coordinate deflection angle between the farthest non-zero pixel points on the edge line of the face to be identified in the four directions and the central origin;
在本发明实施例中,通过结合先前确定得到的待识别人脸边缘线在四个方位上最远非零像素点的空间横纵轴坐标值进行像素点偏角的反正切求解处理,这一步骤的目的是计算每个方向上最远点与中心点之间的空间坐标偏角,以确定其相对于中心的位置方向,例如,通过反正切函数计算得到上方最远点与中心点之间的偏角为θ_up,下方为θ_down,左方为θ_left,右方为θ_right,最终得到待识别人脸边缘线在四个方位上最远非零像素点相对于中心原点之间的空间坐标偏角。In an embodiment of the present invention, the inverse tangent of the pixel deflection angle is solved by combining the spatial horizontal and vertical axis coordinate values of the farthest non-zero pixel point in the four directions of the edge line of the face to be identified that are previously determined. The purpose of this step is to calculate the spatial coordinate deflection angle between the farthest point and the center point in each direction to determine its position direction relative to the center. For example, the deflection angle between the farthest point above and the center point is calculated by the inverse tangent function as θ_up, θ_down below, θ_left to the left, and θ_right to the right. Finally, the spatial coordinate deflection angle between the farthest non-zero pixel point in the four directions of the edge line of the face to be identified relative to the center origin is obtained.
优选地,将待识别人脸边缘线在四个方位上最远非零像素点相对于中心原点之间的空间距离值以及空间坐标偏角进行方位空间坐标系转换,得到待识别人脸边缘线在四个方位上最远非零像素点的方位空间坐标。Preferably, the spatial distance values between the farthest non-zero pixel points of the edge line of the face to be identified in the four directions relative to the central origin and the spatial coordinate deflection angle are transformed into the azimuth space coordinate system to obtain the azimuth space coordinates of the farthest non-zero pixel points of the edge line of the face to be identified in the four directions.
在本发明实施例中,通过将先前计算得到的待识别人脸边缘线在四个方位上最远非零像素点相对于中心原点之间的空间距离值以及空间坐标偏角进行方位空间坐标系的转换,以将相对于中心原点之间的空间距离值作为极径,并将空间坐标偏角作为极角,从而将以灰度中心为原点的二维坐标系转换为方位空间坐标系,用于描述人脸边缘线在空间中的具体位置和方向,最终得到待识别人脸边缘线在四个方位上最远非零像素点的方位空间坐标。In an embodiment of the present invention, the azimuthal space coordinate system is converted by using the previously calculated spatial distance values between the farthest non-zero pixel points of the edge line of the face to be identified in four directions relative to the center origin and the spatial coordinate deflection angle, so that the spatial distance values relative to the center origin are used as the polar diameter, and the spatial coordinate deflection angle is used as the polar angle, thereby converting the two-dimensional coordinate system with the grayscale center as the origin into the azimuthal space coordinate system for describing the specific position and direction of the edge line of the face in space, and finally obtaining the azimuthal space coordinates of the farthest non-zero pixel points of the edge line of the face to be identified in four directions.
本发明首先通过根据以灰度中心点为原点的待识别人脸灰度图二维空间坐标系对待识别人脸边缘线在四个方位上的最远非零像素点位进行横纵轴坐标测量处理,是为了精确测算出人脸边缘在四个方位上最远的非零像素点的空间位置,通过测量横纵轴坐标值,可以确定每个方向上人脸边缘线的极限点位,这些点位将用于后续距离和角度计算,为精确裁切人脸图像提供必要的空间参考。The present invention firstly performs horizontal and vertical axis coordinate measurement processing on the farthest non-zero pixel points of the edge line of the face to be identified in four directions according to the two-dimensional spatial coordinate system of the grayscale image of the face to be identified with the grayscale center point as the origin, in order to accurately calculate the spatial position of the farthest non-zero pixel points of the edge of the face in four directions. By measuring the horizontal and vertical axis coordinate values, the extreme points of the edge line of the face in each direction can be determined. These points will be used for subsequent distance and angle calculations to provide the necessary spatial reference for accurately cropping the face image.
其次,通过根据待识别人脸边缘线在四个方位上最远非零像素点的空间横纵轴坐标值进行相对原点距离计算,是为了确定待识别人脸边缘线在四个方位上最远非零像素点相对于灰度中心点的具体距离,这一步骤关键在于量化边缘点位与中心点之间的距离关系,为后续的空间坐标转换和角度计算提供基础数据,精确的距离计算可以确保最大外接矩形的准确性,从而精确裁切出人脸图像。Secondly, the relative distance to the origin is calculated based on the spatial horizontal and vertical axis coordinate values of the farthest non-zero pixel point on the edge line of the face to be identified in the four directions, in order to determine the specific distance of the farthest non-zero pixel point on the edge line of the face to be identified in the four directions relative to the grayscale center point. The key to this step is to quantify the distance relationship between the edge point and the center point, providing basic data for subsequent spatial coordinate conversion and angle calculation. Accurate distance calculation can ensure the accuracy of the maximum circumscribed rectangle, thereby accurately cropping the face image.
然后,通过根据待识别人脸边缘线在四个方位上最远非零像素点的空间横纵轴坐标值进行像素点偏角反正切求解处理,是为了计算出待识别人脸边缘线在四个方位上最远非零像素点相对于中心原点的空间坐标偏角,这一步骤的目的是确定边缘点位相对于中心点的角度,即人脸轮廓在不同方向上的倾斜角度,以便进行后续的坐标系转换和几何分析。Then, the inverse tangent of the pixel angle is solved according to the spatial horizontal and vertical axis coordinate values of the farthest non-zero pixel point on the edge line of the face to be identified in the four directions, in order to calculate the spatial coordinate deflection angle of the farthest non-zero pixel point on the edge line of the face to be identified in the four directions relative to the center origin. The purpose of this step is to determine the angle of the edge point relative to the center point, that is, the inclination angle of the face contour in different directions, so as to carry out subsequent coordinate system transformation and geometric analysis.
最后,通过将距离值和角度值进行方位空间坐标系转换是为了将待识别人脸边缘线在四个方位上最远非零像素点的空间位置和角度转换为方位空间坐标系中的具体表示,这一转换过程确保了边缘点位的准确性和一致性,使得最终得到的方位空间坐标能够直接应用于最大外接矩形的绘制和人脸图像的精确裁切。Finally, the distance value and angle value are converted into the azimuth space coordinate system in order to convert the spatial position and angle of the farthest non-zero pixel point of the edge line of the face to be identified in the four directions into a specific representation in the azimuth space coordinate system. This conversion process ensures the accuracy and consistency of the edge point positions, so that the final azimuth space coordinates can be directly applied to the drawing of the maximum circumscribed rectangle and the precise cropping of the face image.
优选地,步骤S2包括以下步骤:Preferably, step S2 comprises the following steps:
步骤S21:利用卷积神经网络构建3x3卷积网络层、2x2池化层以及1x1全连接层,并将待识别人脸背景裁切图像数据集中的待识别人脸灰度实例图输入至3x3卷积网络层进行识别特征捕捉处理,得到人脸灰度图初始识别特征数据;Step S21: using a convolutional neural network to construct a 3x3 convolutional network layer, a 2x2 pooling layer, and a 1x1 fully connected layer, and inputting the grayscale instance image of the face to be identified in the background cropped image data set to be identified into the 3x3 convolutional network layer for recognition feature capture processing, and obtaining initial recognition feature data of the face grayscale image;
在本发明实施例中,通过使用卷积神经网络算法构建了3x3卷积网络层、2x2池化层以及1x1全连接层,其中卷积层的作用是对输入的人脸灰度图像进行特征捕捉处理,池化层则通过在每个区域中选取一个值(例如最大值或平均值)来减少了特征图的尺寸,同时保留了最重要的特征,而全连接层则对经过池化后的特征图进行特征降维,以减少特征的冗余性和噪声影响,同时保留最具代表性的特征信息,例如,假设有一张待识别的人脸图像,通过卷积操作在图像上滑动3x3的卷积核,每一次滑动计算出一个输出值,这些输出值构成了新的特征图,每个特征图对应不同的特征检测,如边缘、纹理等,这种操作有助于从原始图像中提取出更加抽象和有意义的特征,这些特征图反映了图像不同位置的视觉信息,最终得到人脸灰度图初始识别特征数据。In an embodiment of the present invention, a 3x3 convolutional network layer, a 2x2 pooling layer, and a 1x1 fully connected layer are constructed by using a convolutional neural network algorithm, wherein the convolution layer is used to perform feature capture processing on the input grayscale face image, the pooling layer reduces the size of the feature map by selecting a value (such as the maximum value or the average value) in each area, while retaining the most important features, and the fully connected layer performs feature dimensionality reduction on the feature map after pooling to reduce the redundancy and noise influence of the features, while retaining the most representative feature information. For example, assuming that there is a face image to be recognized, a 3x3 convolution kernel is slid on the image through a convolution operation, and an output value is calculated for each slide. These output values constitute a new feature map, and each feature map corresponds to different feature detections, such as edges, textures, etc. This operation helps to extract more abstract and meaningful features from the original image. These feature maps reflect the visual information of different positions of the image, and finally obtain the initial recognition feature data of the grayscale face image.
步骤S22:通过在3x3卷积网络层将人脸灰度图初始识别特征数据向下卷积至2x2池化层,并通过在2x2池化层引入空间金字塔池化技术对人脸灰度图初始识别特征数据进行多尺度特征分析,以得到人脸灰度图多尺度识别特征数据;Step S22: convolve the initial recognition feature data of the face grayscale image downward to the 2x2 pooling layer in the 3x3 convolutional network layer, and perform multi-scale feature analysis on the initial recognition feature data of the face grayscale image by introducing the spatial pyramid pooling technology in the 2x2 pooling layer to obtain multi-scale recognition feature data of the face grayscale image;
在本发明实施例中,通过在3x3卷积网络层将人脸灰度图初始识别特征数据向下卷积至2x2池化层,该池化层的作用可以减少特征图的空间尺寸,同时保留最显著的特征信息,并通过在2x2池化层中引入空间金字塔池化技术对人脸灰度图初始识别特征数据进行多尺度的特征分析,以进一步提升其网络在多尺度特征分析上的能力,确保人脸灰度图的多尺度识别特征数据能够覆盖不同层次和范围的信息,最终得到人脸灰度图多尺度识别特征数据。In an embodiment of the present invention, the initial recognition feature data of the grayscale image of the face is convolved downward to the 2x2 pooling layer in the 3x3 convolutional network layer. The pooling layer can reduce the spatial size of the feature map while retaining the most significant feature information. The spatial pyramid pooling technology is introduced in the 2x2 pooling layer to perform multi-scale feature analysis on the initial recognition feature data of the grayscale image of the face, so as to further enhance the ability of the network in multi-scale feature analysis, ensure that the multi-scale recognition feature data of the grayscale image of the face can cover information of different levels and ranges, and finally obtain multi-scale recognition feature data of the grayscale image of the face.
步骤S23:对人脸灰度图多尺度识别特征数据进行多尺度特征融合处理,得到人脸灰度图多尺度特征融合数据;Step S23: performing multi-scale feature fusion processing on the multi-scale recognition feature data of the face grayscale image to obtain multi-scale feature fusion data of the face grayscale image;
在本发明实施例中,通过对先前经过空间金字塔池化后得到的人脸灰度图多尺度识别特征数据进行特征的融合分析,以综合不同尺度的特征信息,从而得到更加全面和丰富的特征表示,例如,将来自不同尺度池化的特征进行加权融合或简单拼接,以获取得到了一个综合考虑了局部细节和整体结构的特征向量,可以用于进一步的降维和增强处理,最终得到人脸灰度图多尺度特征融合数据。In an embodiment of the present invention, feature fusion analysis is performed on multi-scale recognition feature data of a facial grayscale image previously obtained after spatial pyramid pooling to integrate feature information of different scales, thereby obtaining a more comprehensive and rich feature representation. For example, features from pooling of different scales are weighted fused or simply spliced to obtain a feature vector that comprehensively considers local details and overall structure, which can be used for further dimensionality reduction and enhancement processing, and finally obtain multi-scale feature fusion data of a facial grayscale image.
步骤S24:通过在2x2池化层将人脸灰度图多尺度特征融合数据向下卷积至1x1全连接层,并通过在1x1全连接层对人脸灰度图多尺度特征融合数据进行主成分降维处理,以得到人脸灰度图多尺度识别特征降维数据;Step S24: convolve the multi-scale feature fusion data of the face grayscale image downward to the 1x1 fully connected layer in the 2x2 pooling layer, and perform principal component dimensionality reduction processing on the multi-scale feature fusion data of the face grayscale image in the 1x1 fully connected layer to obtain multi-scale recognition feature dimensionality reduction data of the face grayscale image;
在本发明实施例中,通过在2x2池化层处将人脸灰度图多尺度特征融合数据向下卷积至1x1全连接层,该1x1全连接层的作用是将池化后的特征数据转换为向量形式,并通过全连接操作进行主成分降维处理,主成分分析(PCA)可以帮助减少特征的维度,保留最重要的特征信息,从而减少计算负担和降低模型复杂度,例如,通过PCA处理后得到的特征向量可以更有效地表示人脸图像的识别特征,最终得到人脸灰度图多尺度识别特征降维数据。In an embodiment of the present invention, the multi-scale feature fusion data of the grayscale image of the face is convolved down to the 1x1 fully connected layer at the 2x2 pooling layer. The function of the 1x1 fully connected layer is to convert the pooled feature data into a vector form, and perform principal component dimensionality reduction processing through a fully connected operation. Principal component analysis (PCA) can help reduce the dimension of the features and retain the most important feature information, thereby reducing the computational burden and reducing the model complexity. For example, the feature vector obtained after PCA processing can more effectively represent the recognition features of the face image, and finally obtain the multi-scale recognition feature dimensionality reduction data of the grayscale image of the face.
步骤S25:通过引入注意力机制对人脸灰度图多尺度识别特征降维数据进行识别特征增强处理,得到人脸图像第一识别表征特征数据。Step S25: The attention mechanism is introduced to perform recognition feature enhancement processing on the multi-scale recognition feature dimensionality reduction data of the face grayscale image to obtain the first recognition representation feature data of the face image.
在本发明实施例中,还通过引入注意力机制对人脸灰度图多尺度识别特征降维数据进行识别特征的增强处理,以根据特征的重要性自动调整权重,并提高关键特征的可区分性和识别准确性,例如,基于已降维的特征数据,注意力机制可以帮助卷积神经网络模型集中注意力在最具区分性的特征上,从而增强对人脸图像的识别能力,最终得到人脸图像第一识别表征特征数据。In an embodiment of the present invention, an attention mechanism is introduced to enhance the recognition features of the reduced-dimensional data of the multi-scale recognition features of the grayscale image of the face, so as to automatically adjust the weights according to the importance of the features and improve the distinguishability and recognition accuracy of the key features. For example, based on the reduced-dimensional feature data, the attention mechanism can help the convolutional neural network model focus on the most distinguishing features, thereby enhancing the recognition ability of the face image and ultimately obtaining the first recognition representation feature data of the face image.
本发明首先通过使用卷积神经网络构建3x3卷积网络层、2x2池化层以及1x1全连接层,并将待识别人脸背景裁切图像数据集中的待识别人脸灰度实例图输入至3x3卷积网络层进行识别特征捕捉处理,这一步骤的关键在于利用卷积操作捕捉人脸图像中的特征信息,例如边缘、纹理等,从而得到人脸灰度图的初始识别特征数据,通过3x3卷积核的滑动和特征映射,网络能够提取出不同层次和复杂度的特征表示,为后续的深度学习处理奠定基础。The present invention first constructs a 3x3 convolutional network layer, a 2x2 pooling layer and a 1x1 fully connected layer by using a convolutional neural network, and inputs the grayscale instance image of the face to be identified in the background cropped image data set of the face to be identified into the 3x3 convolutional network layer for recognition feature capture processing. The key to this step is to use the convolution operation to capture the feature information in the face image, such as edges, textures, etc., so as to obtain the initial recognition feature data of the face grayscale image. Through the sliding and feature mapping of the 3x3 convolution kernel, the network can extract feature representations of different levels and complexities, laying the foundation for subsequent deep learning processing.
其次,通过在3x3卷积网络层将人脸灰度图初始识别特征数据向下卷积至2x2池化层,并通过在2x2池化层引入空间金字塔池化技术对人脸灰度图初始识别特征数据进行多尺度特征分析,在这一步骤中,利用池化操作可以减少特征图的空间尺寸,同时保留最显著的特征信息,使得网络对于平移、旋转等变换具有更好的鲁棒性,通过引入空间金字塔池化技术则进一步提升了网络在多尺度特征分析上的能力,确保人脸灰度图的多尺度识别特征数据能够覆盖不同层次和范围的信息。Secondly, the initial recognition feature data of the face grayscale image is convolved down to the 2x2 pooling layer in the 3x3 convolutional network layer, and the spatial pyramid pooling technology is introduced in the 2x2 pooling layer to perform multi-scale feature analysis on the initial recognition feature data of the face grayscale image. In this step, the pooling operation can reduce the spatial size of the feature map while retaining the most significant feature information, making the network more robust to transformations such as translation and rotation. The introduction of spatial pyramid pooling technology further enhances the network's ability in multi-scale feature analysis, ensuring that the multi-scale recognition feature data of the face grayscale image can cover information at different levels and ranges.
随后,通过对从2x2池化层得到的多尺度识别特征数据进行多尺度特征融合处理,这一步骤的主要目的是将不同尺度下提取的特征信息进行整合,以获得更加全面和综合的人脸灰度图多尺度特征融合数据,通过特征融合,可以有效地减少特征维度,提高网络的计算效率,并加强网络对于复杂场景和不同表情的识别能力。Subsequently, multi-scale feature fusion processing is performed on the multi-scale recognition feature data obtained from the 2x2 pooling layer. The main purpose of this step is to integrate the feature information extracted at different scales to obtain more comprehensive and integrated multi-scale feature fusion data of the face grayscale image. Through feature fusion, the feature dimension can be effectively reduced, the computational efficiency of the network can be improved, and the network's recognition ability for complex scenes and different expressions can be enhanced.
接下来,通过进一步将多尺度特征融合数据传递至1x1全连接层,并通过全连接层进行主成分降维处理,这一步骤旨在利用主成分分析方法,将高维度的特征空间映射到更低维度的空间中,以减少特征的冗余性和噪声影响,同时保留最具代表性的特征信息,主成分降维能够有效提高特征的区分度和分类性能,为后续的特征增强处理奠定基础。Next, the multi-scale feature fusion data is further passed to the 1x1 fully connected layer, and principal component dimensionality reduction is performed through the fully connected layer. This step aims to use the principal component analysis method to map the high-dimensional feature space to a lower-dimensional space to reduce the redundancy and noise impact of the features while retaining the most representative feature information. Principal component dimensionality reduction can effectively improve the feature discrimination and classification performance, laying the foundation for subsequent feature enhancement processing.
最后,通过引入注意力机制对人脸灰度图多尺度识别特征降维数据进行识别特征增强处理,注意力机制能够动态地调整和加权特征图中不同位置的特征响应,使得网络更加关注人脸图像中的关键部位和重要特征,从而进一步提升人脸图像的识别表征特征数据质量和表达能力。Finally, by introducing the attention mechanism, the recognition feature enhancement processing is performed on the multi-scale recognition feature reduction data of the face grayscale image. The attention mechanism can dynamically adjust and weight the feature responses at different positions in the feature map, so that the network pays more attention to the key parts and important features in the face image, thereby further improving the quality and expression ability of the recognition representation feature data of the face image.
优选地,步骤S3包括以下步骤:Preferably, step S3 comprises the following steps:
步骤S31:对人脸图像第一识别表征特征数据进行三维特征虚拟空间转换,得到人脸图像识别特征三维虚拟空间;Step S31: performing a three-dimensional feature virtual space conversion on the first recognition representation feature data of the face image to obtain a three-dimensional virtual space of the face image recognition feature;
在本发明实施例中,通过使用AI虚拟技术将先前经过卷积神经网络特征学习得到的人脸图像第一识别表征特征数据进行三维特征虚拟空间的转换,以将图像中的二维特征信息转换为三维虚拟空间中的特征表示,以便更准确地描述人脸的空间结构和形态特征,从而能够更好地捕捉人脸的几何形状、深度信息以及空间分布特性,最终得到人脸图像识别特征三维虚拟空间。In an embodiment of the present invention, the first recognition representation feature data of the facial image previously obtained through convolutional neural network feature learning is converted into a three-dimensional feature virtual space by using AI virtual technology, so as to convert the two-dimensional feature information in the image into a feature representation in a three-dimensional virtual space, so as to more accurately describe the spatial structure and morphological characteristics of the face, thereby better capturing the geometric shape, depth information and spatial distribution characteristics of the face, and finally obtaining a three-dimensional virtual space of facial image recognition features.
步骤S32:对人脸图像识别特征三维虚拟空间进行关键部位特征点云提取,得到人脸图像关键部位特征点云集;Step S32: extracting key part feature point cloud from the three-dimensional virtual space of facial image recognition features to obtain a key part feature point cloud set of the facial image;
在本发明实施例中,通过对先前转换得到的人脸图像识别特征三维虚拟空间进行关键部位处特征点云的采样提取处理,以从转换后的三维虚拟空间中提取关键的面部特征点集合,这些点通常是表达面部结构和特征的关键点位,例如,可以从三维虚拟空间中选择和提取出具有显著意义和区分度的关键部位特征点云集,其中关键部位通常包括人脸的眼睛、鼻子、嘴巴等重要特征点,这些点在人脸识别中扮演着关键的角色,最终得到人脸图像关键部位特征点云集。In an embodiment of the present invention, a sampling and extraction process is performed on the feature point cloud at key parts of the previously converted three-dimensional virtual space of facial image recognition features to extract a set of key facial feature points from the converted three-dimensional virtual space. These points are usually key points that express facial structure and features. For example, a set of key part feature point clouds with significant meaning and distinction can be selected and extracted from the three-dimensional virtual space. The key parts usually include important feature points such as eyes, nose, and mouth of the face. These points play a key role in face recognition, and finally a set of key part feature point clouds of the face image is obtained.
步骤S33:对人脸图像关键部位特征点云集内的每一个关键部位特征点云进行三维虚拟空间坐标分析,以得到每一个关键部位特征点云的三维虚拟空间坐标;Step S33: performing a three-dimensional virtual space coordinate analysis on each key part feature point cloud in the key part feature point cloud set of the face image to obtain the three-dimensional virtual space coordinates of each key part feature point cloud;
在本发明实施例中,通过对先前采样提取得到的人脸图像关键部位特征点云集内的每一个关键部位特征点云进行三维空间坐标的定位分析,以进一步分析每个关键点云的具体空间位置和特征,以便更精确地描述人脸的结构和形态变化,例如,对于每一个关键点云,可以分析其坐标在三维空间中的分布和相对位置以及存在的角度和旋转信息,最终得到每一个关键部位特征点云的三维虚拟空间坐标。In an embodiment of the present invention, by performing three-dimensional spatial coordinate positioning analysis on each key part feature point cloud in the key part feature point cloud set of the facial image previously sampled and extracted, the specific spatial position and characteristics of each key point cloud are further analyzed to more accurately describe the structure and morphological changes of the face. For example, for each key point cloud, the distribution and relative position of its coordinates in three-dimensional space as well as the existing angles and rotation information can be analyzed, and finally the three-dimensional virtual space coordinates of each key part feature point cloud can be obtained.
步骤S34:基于每一个关键部位特征点云的三维虚拟空间坐标对人脸图像关键部位特征点云集进行特征空间向量转换,得到人脸图像识别特征点云空间向量集。Step S34: Based on the three-dimensional virtual space coordinates of each key part feature point cloud, the feature space vector conversion is performed on the key part feature point cloud set of the face image to obtain the face image recognition feature point cloud space vector set.
在本发明实施例中,通过结合先前确定得到的每一个关键部位特征点云的三维虚拟空间坐标对人脸图像关键部位特征点云集内相对应每一个关键部位特征点云处的识别特征数据进行空间向量的转换,以将每个关键部位特征点云处的三维信息转换为高维度的特征空间向量,该特征空间向量不仅包含了关键部位的空间位置信息,还包括颜色、纹理等空间识别特征数据,最终得到人脸图像识别特征点云空间向量集。In an embodiment of the present invention, the identification feature data corresponding to each key part feature point cloud in the key part feature point cloud set of the face image is converted into a spatial vector by combining the three-dimensional virtual space coordinates of each key part feature point cloud previously determined, so as to convert the three-dimensional information at each key part feature point cloud into a high-dimensional feature space vector. The feature space vector not only includes the spatial position information of the key parts, but also includes spatial identification feature data such as color and texture, and finally a spatial vector set of face image recognition feature point clouds is obtained.
本发明首先通过对人脸图像第一识别表征特征数据进行三维特征虚拟空间转换,能够实现了从二维图像数据到三维虚拟空间的转换过程,这一步骤的关键在于利用深度学习模型或者几何学方法,将人脸图像的平面特征转换为更加丰富和具体的三维特征表示,从而更好地捕捉人脸的几何形状、深度信息以及空间分布特性,通过这种转换,不仅能够增强人脸表情识别对于复杂姿态和光照条件下的鲁棒性,还能提高识别的准确性和稳定性。The present invention firstly realizes the conversion process from two-dimensional image data to three-dimensional virtual space by performing three-dimensional feature virtual space conversion on the first recognition representation feature data of the facial image. The key of this step is to use a deep learning model or a geometric method to convert the planar features of the facial image into a richer and more specific three-dimensional feature representation, so as to better capture the geometric shape, depth information and spatial distribution characteristics of the face. Through this conversion, not only the robustness of facial expression recognition under complex postures and lighting conditions can be enhanced, but also the accuracy and stability of recognition can be improved.
其次,通过对人脸图像识别特征三维虚拟空间进行关键部位特征点云提取,这一步骤的目的是从三维虚拟空间中选择和提取出具有显著意义和区分度的关键部位特征点云集,关键部位通常包括人脸的眼睛、鼻子、嘴巴等重要特征点,这些点在人脸识别中扮演着关键的角色,通过提取关键部位特征点云,可以进一步减少数据的复杂性,提高后续处理的效率,并且有助于在复杂场景中更精确地定位和识别人脸。Secondly, by extracting the key parts feature point cloud of the three-dimensional virtual space of the face image recognition feature, the purpose of this step is to select and extract the key parts feature point cloud set with significant significance and distinction from the three-dimensional virtual space. The key parts usually include the eyes, nose, mouth and other important feature points of the face. These points play a key role in face recognition. By extracting the key parts feature point cloud, the complexity of the data can be further reduced, the efficiency of subsequent processing can be improved, and it is helpful to more accurately locate and identify faces in complex scenes.
然后,通过对人脸图像关键部位特征点云集内的每一个关键部位特征点云进行三维虚拟空间坐标分析,这一步骤通过深入分析每个关键部位特征点云的三维空间坐标信息,可以获取其在整个人脸模型中的位置、方向和相对位置关系,通过这种分析,能够更加精确地描述和理解人脸的空间结构特征,为后续的特征处理和识别准备充足的数据基础。Then, by performing three-dimensional virtual space coordinate analysis on each key part feature point cloud in the key part feature point cloud set of the face image, this step can obtain its position, direction and relative position relationship in the entire face model through in-depth analysis of the three-dimensional space coordinate information of each key part feature point cloud. Through this analysis, the spatial structural characteristics of the face can be more accurately described and understood, preparing sufficient data foundation for subsequent feature processing and recognition.
最后,通过基于每一个关键部位特征点云的三维虚拟空间坐标对人脸图像关键部位特征点云集进行特征空间向量转换,这一步骤的核心在于将每个关键部位特征点云的三维信息转换为高维度的特征空间向量集合,该特征空间向量集合不仅包含了关键部位的空间位置信息,还包括颜色、纹理等特征,这些信息对于人脸识别的精准性和全面性至关重要。通过这种向量转换,能够将复杂的三维特征数据转化为更便于处理和分析的形式,为人脸数据的最终表情识别和验证提供更加有效和可靠的特征描述。Finally, the feature point cloud set of the key parts of the face image is converted into a feature space vector based on the three-dimensional virtual space coordinates of each key part feature point cloud. The core of this step is to convert the three-dimensional information of each key part feature point cloud into a high-dimensional feature space vector set. This feature space vector set not only contains the spatial position information of the key parts, but also includes features such as color and texture. This information is crucial for the accuracy and comprehensiveness of face recognition. Through this vector conversion, complex three-dimensional feature data can be converted into a form that is easier to process and analyze, providing a more effective and reliable feature description for the final expression recognition and verification of face data.
优选地,步骤S4包括以下步骤:Preferably, step S4 comprises the following steps:
步骤S41:根据预设的人脸表情匹配数据库对人脸图像识别特征点云空间向量集进行特征向量距离度量计算,以得到各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值;Step S41: performing feature vector distance metric calculation on the face image recognition feature point cloud space vector set according to the preset face expression matching database to obtain the vector space distance metric value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each face expression image;
在本发明实施例中,通过对先前预先设置的人脸表情匹配数据库内的每张人脸表情图像进行尺寸的压缩处理,以使其与待识别人脸图像数据的尺寸保持一致,并确保它们具有统一的大小和格式,并对先前经过尺寸压缩处理后的人脸表情尺寸匹配压缩图像集进行图像的匹配对准处理,以确保所有处理后的图像在空间上对准,并将每张图像的表情部位(如眼睛、嘴巴)在空间上对齐,还通过使用空间向量转换方法对经过图像匹配对准处理的人脸表情图像集进行特征点云的空间向量转换,旨在提取每张人脸表情匹配对准图像的特征点信息,例如面部轮廓、眼睛位置、鼻子位置等关键点的空间向量表示,并通过结合先前提取得到的每张人脸表情图像中每一个特征点云处的特征空间向量,使用例如欧氏距离或余弦相似度等方法对人脸图像识别特征点云空间向量集中相对应特征点云处的特征空间向量进行空间距离的度量计算,以评估计算每张人脸图像的特征点向量与预设表情图像特征点向量之间的相似度或距离,最终得到各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值。In an embodiment of the present invention, by compressing the size of each facial expression image in a previously preset facial expression matching database to make it consistent with the size of the facial image data to be recognized and to ensure that they have a uniform size and format, and performing image matching and alignment processing on the facial expression size matching compressed image set that has previously undergone size compression processing to ensure that all processed images are aligned in space, and the expression parts (such as eyes and mouth) of each image are aligned in space, and also performing spatial vector conversion of the feature point cloud on the facial expression image set that has undergone image matching and alignment processing by using a spatial vector conversion method, the purpose is to extract the spatial vector of each facial expression matching pair. The feature point information of the quasi-image, such as the spatial vector representation of key points such as facial contour, eye position, nose position, etc., is combined with the feature space vector at each feature point cloud in each facial expression image extracted previously, and the feature space vector at the corresponding feature point cloud in the facial image recognition feature point cloud space vector set is measured and calculated using methods such as Euclidean distance or cosine similarity to evaluate the similarity or distance between the feature point vector of each facial image and the feature point vector of the preset expression image, and finally the vector space distance measurement value between each facial image recognition feature point cloud space vector and the corresponding feature point cloud space vector of each facial expression image is obtained.
步骤S42:根据预设的特征向量空间距离阈值对各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值进行比较判断,当各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值大于或等于预设的特征向量空间距离阈值时,则将其人脸表情匹配数据库内相对应人脸表情图像的特征点云标记为人脸表情识别相似点;当各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值小于预设的特征向量空间距离阈值时,则不对人脸表情匹配数据库内相对应人脸表情图像的特征点云做出标记处理;Step S42: comparing and judging the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each facial expression image according to a preset feature vector space distance threshold value; when the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each facial expression image is greater than or equal to the preset feature vector space distance threshold value, marking the feature point cloud corresponding to the facial expression image in the facial expression matching database as a facial expression recognition similarity point; when the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each facial expression image is less than the preset feature vector space distance threshold value, no marking is performed on the feature point cloud corresponding to the facial expression image in the facial expression matching database;
在本发明实施例中,通过使用预先设置的特征向量空间距离阈值对先前量化计算得到的各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值进行比较判断,如果待识别人脸图像中某一个识别特征点云处的空间向量与表情数据库中每张人脸表情图像对应特征点云空间向量之间的空间距离度量值大于或等于预设的特征向量空间距离阈值,就将表情图像中相对应的特征点云标记为该待识别人脸图像的表情识别相似点;反之,如果距离小于阈值,则不对该表情图像进行标记处理,例如,设定一个阈值,如果待识别的人脸图像与笑脸表情的距离小于设定值,那么笑脸表情图像中相对应的特征点将不会被标记为相似点,而如果距离大于或等于设定值,则笑脸表情中相对应的特征点将被标记为相似点。In an embodiment of the present invention, a vector space distance measurement value between each face image recognition feature point cloud space vector obtained by previous quantitative calculation and the feature point cloud space vector corresponding to each face expression image is compared and judged by using a preset feature vector space distance threshold. If the space distance measurement value between the space vector at a certain recognition feature point cloud in the face image to be recognized and the feature point cloud space vector corresponding to each face expression image in the expression database is greater than or equal to the preset feature vector space distance threshold, the corresponding feature point cloud in the expression image is marked as the expression recognition similarity point of the face image to be recognized; otherwise, if the distance is less than the threshold, the expression image is not marked. For example, a threshold is set. If the distance between the face image to be recognized and the smiling face expression is less than the set value, the corresponding feature points in the smiling face expression image will not be marked as similar points. If the distance is greater than or equal to the set value, the corresponding feature points in the smiling face expression will be marked as similar points.
步骤S43:对人脸表情匹配数据库内被标记有人脸表情识别相似点的人脸表情图像进行相似点数量统计计算,以得到人脸表情匹配数据库内每张人脸表情图像的识别相似点数量;Step S43: performing a statistical calculation of the number of similarity points on the facial expression images marked with facial expression recognition similarity points in the facial expression matching database, so as to obtain the number of recognition similarity points of each facial expression image in the facial expression matching database;
在本发明实施例中,通过对人脸表情匹配数据库内所有被标记存在有人脸表情识别相似点的人脸表情图像进行相似点数量统计计算,这一步骤的目的是确定在匹配数据库中每张人脸表情图像的识别相似点数量,以便于确定与待识别人脸图像最接近的表情图像,最终得到人脸表情匹配数据库内每张人脸表情图像的识别相似点数量。In an embodiment of the present invention, by performing statistical calculations on the number of similarities of all facial expression images marked with facial expression recognition similarities in the facial expression matching database, the purpose of this step is to determine the number of recognition similarities of each facial expression image in the matching database, so as to determine the expression image closest to the facial image to be recognized, and ultimately obtain the number of recognition similarities of each facial expression image in the facial expression matching database.
步骤S44:基于人脸表情匹配数据库内每张人脸表情图像的识别相似点数量对人脸图像识别特征点云空间向量集相对应的待识别人脸数据进行人脸数据表情识别,以得到人脸数据表情识别匹配结果。Step S44: performing facial data expression recognition on the face data to be recognized corresponding to the facial image recognition feature point cloud space vector set based on the number of recognition similarity points of each facial expression image in the facial expression matching database to obtain facial data expression recognition matching results.
在本发明实施例中,通过结合先前统计计算得到的人脸表情匹配数据库内每张人脸表情图像的识别相似点数量对人脸图像识别特征点云空间向量集相对应的待识别人脸数据进行人脸表情的识别分析,以从人脸表情数据库中筛选出与待识别人脸图像之间具有最多识别相似点相对应的人脸表情图像,并确定其为最匹配的表情类别或者情感类别,例如,如果待识别人脸图像与数据库中笑脸表情之间存在最多的识别特征像素点,那么可以得出该待识别人脸图像的表情识别结果为笑脸,最终识别得到人脸数据表情识别匹配结果。In an embodiment of the present invention, facial expression recognition analysis is performed on the face data to be recognized corresponding to the face image recognition feature point cloud space vector set by combining the number of recognition similarities of each face expression image in the face expression matching database obtained by previous statistical calculation, so as to screen out the face expression image corresponding to the face image to be recognized having the most recognition similarities from the face expression database, and determine it as the most matching expression category or emotion category. For example, if there are the most recognition feature pixels between the face image to be recognized and the smiling face expression in the database, then it can be concluded that the expression recognition result of the face image to be recognized is a smiling face, and finally the facial data expression recognition matching result is obtained.
本发明首先通过根据预设的人脸表情匹配数据库对人脸图像识别特征点云空间向量集进行特征向量距离度量计算,这一步骤的关键在于利用数学上的距离度量方法(如欧氏距离或者余弦相似度等),以衡量每个人脸图像识别特征点云空间向量与数据库中每张人脸表情图像对应特征点云空间向量之间的相似性,通过这种计算,能够得到一个量化的度量值,反映出待识别人脸与已知表情图像之间的特征相似程度。The present invention first performs feature vector distance measurement calculation on the face image recognition feature point cloud space vector set according to a preset face expression matching database. The key to this step is to use mathematical distance measurement methods (such as Euclidean distance or cosine similarity, etc.) to measure the similarity between each face image recognition feature point cloud space vector and the corresponding feature point cloud space vector of each face expression image in the database. Through this calculation, a quantitative measurement value can be obtained, which reflects the degree of feature similarity between the face to be recognized and the known expression image.
其次,通过根据预设的特征向量空间距离阈值对各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值进行比较判断,如果某个人脸图像识别特征点云空间向量与某张人脸表情图像对应特征点云空间向量之间的距离度量值大于或等于预设的阈值,就将该人脸表情图像在数据库中的特征点云标记为人脸表情识别相似点;反之,如果距离度量值小于预设的阈值,则不做标记处理,这一步骤的目的在于根据设定的阈值,筛选出与待识别人脸数据特征最相似的表情图像,为后续的表情识别提供依据和参考。Secondly, the vector space distance measurement values between the feature point cloud space vectors of each face image recognition and the feature point cloud space vectors corresponding to each facial expression image are compared and judged according to the preset feature vector space distance threshold. If the distance measurement value between the feature point cloud space vector of a face image recognition and the feature point cloud space vector corresponding to a facial expression image is greater than or equal to the preset threshold, the feature point cloud of the facial expression image in the database is marked as a facial expression recognition similarity point; conversely, if the distance measurement value is less than the preset threshold, no marking is performed. The purpose of this step is to screen out the expression image that is most similar to the features of the face data to be recognized according to the set threshold, so as to provide a basis and reference for subsequent expression recognition.
然后,通过对人脸表情匹配数据库内被标记有人脸表情识别相似点的人脸表情图像进行相似点数量统计计算,这一步骤的核心是统计每张人脸表情图像在匹配数据库中的识别相似点数量,通过统计,可以了解每张表情图像与待识别人脸之间的相似度程度,为最终的表情匹配结果提供量化指标和参考依据。最后,通过基于人脸表情匹配数据库内每张人脸表情图像的识别相似点数量对人脸图像识别特征点云空间向量集相对应的待识别人脸数据进行人脸数据表情识别,这一步骤通过比较每张表情图像的相似点数量,以确定待识别人脸与数据库中哪张表情图像最为相似,从而得到人脸数据的表情识别匹配结果,这一过程通过有效的数据库管理和特征匹配算法,能够快速准确地识别出人脸图像的表情状态,为面部表情分析、情感识别等应用提供了可靠的技术支持和解决方案。Then, the number of similarity points of facial expression images marked with facial expression recognition similarity points in the facial expression matching database is statistically calculated. The core of this step is to count the number of recognition similarity points of each facial expression image in the matching database. Through statistics, the degree of similarity between each expression image and the face to be recognized can be understood, providing quantitative indicators and reference basis for the final expression matching results. Finally, facial data expression recognition is performed on the face data to be recognized corresponding to the face image recognition feature point cloud space vector set based on the number of recognition similarity points of each facial expression image in the facial expression matching database. This step compares the number of similarity points of each expression image to determine which expression image in the database is most similar to the face to be recognized, thereby obtaining the expression recognition matching result of the face data. This process can quickly and accurately identify the expression state of the face image through effective database management and feature matching algorithms, providing reliable technical support and solutions for applications such as facial expression analysis and emotion recognition.
优选地,步骤S41包括以下步骤:Preferably, step S41 includes the following steps:
步骤S411:对预设的人脸表情匹配数据库内的每张人脸表情图像进行尺寸匹配压缩处理,得到人脸表情尺寸匹配压缩图像集;Step S411: performing size matching compression processing on each facial expression image in a preset facial expression matching database to obtain a facial expression size matching compressed image set;
在本发明实施例中,通过对先前预先设置的人脸表情匹配数据库内的每张人脸表情图像进行尺寸的压缩处理,以使其与待识别人脸图像数据的尺寸保持一致,并确保它们具有统一的大小和格式,这一过程通常包括调整图像的分辨率、裁剪或缩放,使其适应后续的处理和比对需求,例如,假设要待识别一个人的人脸图像,并设置有一个人脸表情数据库,其中包含多种表情的图像,如笑脸、愤怒、惊讶等,这一步骤会将所有这些表情图像的尺寸调整为与待识别人脸图像相同的像素尺寸,比如统一调整为200x200像素,以便后续步骤能够有效处理和比较它们的特征,最终得到人脸表情尺寸匹配压缩图像集。In an embodiment of the present invention, each facial expression image in a previously preset facial expression matching database is compressed to make it consistent with the size of the facial image data to be identified, and to ensure that they have a uniform size and format. This process usually includes adjusting the resolution, cropping or scaling of the image to adapt it to subsequent processing and comparison requirements. For example, assuming that a facial image of a person is to be identified, and a facial expression database is set up, which contains images of various expressions, such as smiling, angry, surprised, etc., this step will adjust the size of all these expression images to the same pixel size as the facial image to be identified, such as uniformly adjusting them to 200x200 pixels, so that the subsequent steps can effectively process and compare their features, and finally obtain a facial expression size matching compressed image set.
步骤S412:对人脸表情尺寸匹配压缩图像集进行图像匹配对准处理,得到人脸表情匹配对准图像集;Step S412: performing image matching and alignment processing on the facial expression size matching compressed image set to obtain a facial expression matching and aligned image set;
在本发明实施例中,通过对先前经过尺寸压缩处理后的人脸表情尺寸匹配压缩图像集进行图像的匹配对准处理,以确保所有处理后的图像在空间上对准,以便后续的特征分析能够在一致的参考框架下进行,例如,如果有一个包含笑脸、愤怒、惊讶等的压缩图像集合,图像匹配对准处理将确保每张图像的表情部位(如眼睛、嘴巴)在空间上对齐,以便后续分析可以基于相同的参考点进行比较和测量,最终得到人脸表情匹配对准图像集。In an embodiment of the present invention, image matching and alignment processing is performed on a facial expression size matching compressed image set that has previously undergone size compression processing to ensure that all processed images are spatially aligned so that subsequent feature analysis can be performed under a consistent reference frame. For example, if there is a compressed image set containing smiles, anger, surprise, etc., the image matching and alignment processing will ensure that the expression parts (such as eyes and mouth) of each image are spatially aligned so that subsequent analysis can be compared and measured based on the same reference points, ultimately obtaining a facial expression matching and aligned image set.
步骤S413:对人脸表情匹配对准图像集进行相同的特征点云空间向量分析,得到每张人脸表情匹配对准图像对应的特征点云空间向量集;Step S413: performing the same feature point cloud space vector analysis on the facial expression matching alignment image set to obtain a feature point cloud space vector set corresponding to each facial expression matching alignment image;
在本发明实施例中,通过使用空间向量转换方法对经过图像匹配对准处理的人脸表情图像集进行特征点云的空间向量转换,这一步骤旨在提取每张人脸表情匹配对准图像的特征点信息,例如面部轮廓、眼睛位置、鼻子位置等关键点的空间向量表示,例如,如果分析一个笑脸的图像,提取得到的特征点云空间向量集包括眼睛的相对位置、嘴角的位置等信息,最终得到每张人脸表情匹配对准图像对应的特征点云空间向量集。In an embodiment of the present invention, a spatial vector conversion method is used to perform spatial vector conversion of a feature point cloud on a facial expression image set that has undergone image matching and alignment processing. This step is intended to extract feature point information of each facial expression matching and alignment image, such as the spatial vector representation of key points such as facial contour, eye position, and nose position. For example, if an image of a smiling face is analyzed, the extracted feature point cloud spatial vector set includes information such as the relative position of the eyes and the position of the corners of the mouth, and ultimately a feature point cloud spatial vector set corresponding to each facial expression matching and alignment image is obtained.
步骤S414:基于每张人脸表情匹配对准图像对应的特征点云空间向量集对人脸图像识别特征点云空间向量集进行特征向量距离度量计算,以得到各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值。Step S414: Perform feature vector distance measurement calculation on the facial image recognition feature point cloud space vector set based on the feature point cloud space vector set corresponding to each facial expression matching alignment image, so as to obtain the vector space distance measurement value between each facial image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each facial expression image.
在本发明实施例中,通过结合先前提取得到的每张人脸表情匹配对准图像对应特征点云空间向量集中的每一个特征点云处的特征空间向量使用例如欧氏距离或余弦相似度等方法对人脸图像识别特征点云空间向量集中相对应特征点云处的特征空间向量进行空间距离的度量计算,以评估计算每张人脸图像的特征点向量与预设表情图像特征点向量之间的相似度或距离,例如,对于一张未知的人脸图像,通过比较其特征点向量与数据库中已有表情图像的特征点向量,可以计算出它们之间的空间距离度量值,进而确定最匹配的表情类别或者进行情感识别的分类,最终得到各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值。In an embodiment of the present invention, by combining the feature space vectors at each feature point cloud in the feature point cloud space vector set corresponding to each facial expression matching alignment image extracted previously, a spatial distance measurement calculation is performed on the feature space vectors at the corresponding feature point cloud in the facial image recognition feature point cloud space vector set using methods such as Euclidean distance or cosine similarity, so as to evaluate the similarity or distance between the feature point vector of each facial image and the feature point vector of the preset expression image. For example, for an unknown facial image, by comparing its feature point vector with the feature point vector of the existing expression image in the database, the spatial distance measurement value between them can be calculated, and then the most matching expression category can be determined or emotion recognition classification can be performed, and finally the vector space distance measurement value between each facial image recognition feature point cloud space vector and the corresponding feature point cloud space vector of each facial expression image is obtained.
本发明首先通过对预设的人脸表情匹配数据库内的每张人脸表情图像进行尺寸匹配压缩处理,这一步骤的目的在于确保所有的人脸表情图像在尺寸上保持一致,以便后续的图像处理和特征提取。通过尺寸匹配压缩,可以统一不同图像的分辨率和尺寸,减少后续处理的复杂性和计算量,同时确保图像质量在压缩过程中不丢失重要的信息和特征。The present invention first performs size matching compression processing on each facial expression image in a preset facial expression matching database. The purpose of this step is to ensure that all facial expression images remain consistent in size for subsequent image processing and feature extraction. Through size matching compression, the resolution and size of different images can be unified, reducing the complexity and calculation amount of subsequent processing, while ensuring that the image quality does not lose important information and features during the compression process.
其次,通过对经过尺寸匹配压缩处理的人脸表情图像集进行图像匹配对准处理,这一步骤的关键在于确保不同表情图像在视觉上的对准和对齐,以消除因表情变化导致的图像偏移或者畸变,通过精确的图像匹配对准,可以使得每张表情图像在同一空间坐标系下具有一致的位置和姿态,为后续特征分析和比较提供准确的基础。Secondly, image matching and alignment are performed on the facial expression image set that has undergone size matching and compression processing. The key to this step is to ensure the visual alignment and alignment of images with different expressions to eliminate image offset or distortion caused by changes in expression. Through precise image matching and alignment, each expression image can have a consistent position and posture in the same spatial coordinate system, providing an accurate basis for subsequent feature analysis and comparison.
然后,通过对经过匹配对准的图像集进行相同的特征点云空间向量分析,这一步骤的目的是从每张表情匹配对准图像中提取出特征点云空间向量集合,这些向量集合反映了图像中关键特征点的位置和特征,通过分析特征点云空间向量,可以进一步理解和比较不同表情图像之间的结构和形态差异,为后续的表情匹配和识别提供详细的数据支持。Then, the same feature point cloud space vector analysis is performed on the matched and aligned image set. The purpose of this step is to extract a set of feature point cloud space vectors from each expression matching and aligned image. These vector sets reflect the position and characteristics of the key feature points in the image. By analyzing the feature point cloud space vectors, we can further understand and compare the structural and morphological differences between different expression images, providing detailed data support for subsequent expression matching and recognition.
最后,通过基于每张人脸表情匹配对准图像对应的特征点云空间向量集对人脸图像识别特征点云空间向量集进行特征向量距离度量计算,这一步骤通过数学上的距离度量方法,如欧氏距离或余弦相似度,以计算每个待识别人脸图像特征点云空间向量与数据库中每张匹配对准图像特征点云空间向量之间的相似性,通过这种度量计算,可以得到每个人脸图像与不同表情图像之间的特征相似度,从而为后续的表情识别分析和匹配结果提供量化的评估和依据。Finally, the feature vector distance measurement calculation is performed on the feature point cloud space vector set for facial image recognition based on the feature point cloud space vector set corresponding to each facial expression matching alignment image. This step uses mathematical distance measurement methods, such as Euclidean distance or cosine similarity, to calculate the similarity between the feature point cloud space vector of each facial image to be identified and the feature point cloud space vector of each matching alignment image in the database. Through this measurement calculation, the feature similarity between each facial image and different expression images can be obtained, thereby providing quantitative evaluation and basis for subsequent expression recognition analysis and matching results.
优选地,本发明还提供了一种基于人工智能的人脸识别分析系统,用于执行如上所述的基于人工智能的人脸识别分析方法,该基于人工智能的人脸识别分析系统包括:Preferably, the present invention further provides an artificial intelligence-based face recognition and analysis system for executing the artificial intelligence-based face recognition and analysis method as described above, the artificial intelligence-based face recognition and analysis system comprising:
待识别人脸数据背景裁切模块,用于获取待识别人脸图像数据集,并对待识别人脸图像数据集进行人脸灰度化处理,以得到待识别人脸灰度图数据集;对待识别人脸灰度图数据集进行人脸边界背景裁切,从而得到待识别人脸背景裁切图像数据集;The background cropping module of the face data to be identified is used to obtain the face image data set to be identified, and perform face grayscale processing on the face image data set to be identified to obtain the face grayscale image data set to be identified; perform face boundary background cropping on the face grayscale image data set to be identified, so as to obtain the background cropped image data set of the face to be identified;
人脸数据第一识别分析模块,用于利用卷积神经网络对待识别人脸背景裁切图像数据集进行人脸识别特征表征分析,并引入空间金字塔池化以及注意力机制进行识别特征增强处理,从而得到人脸图像第一识别表征特征数据;The first recognition and analysis module of face data is used to use a convolutional neural network to perform face recognition feature characterization analysis on the background cropped image dataset of the face to be recognized, and introduce spatial pyramid pooling and attention mechanism to perform recognition feature enhancement processing, so as to obtain the first recognition characterization feature data of the face image;
人脸识别特征空间向量转换模块,用于对人脸图像第一识别表征特征数据进行三维特征虚拟空间转换,得到人脸图像识别特征三维虚拟空间;对人脸图像识别特征三维虚拟空间进行特征点云空间向量分析,得到人脸图像识别特征点云空间向量集;A face recognition feature space vector conversion module is used to perform a three-dimensional feature virtual space conversion on the first recognition representation feature data of the face image to obtain a three-dimensional virtual space of face image recognition features; perform feature point cloud space vector analysis on the three-dimensional virtual space of face image recognition features to obtain a face image recognition feature point cloud space vector set;
人脸数据再次识别匹配模块,用于根据预设的人脸表情匹配数据库对人脸图像识别特征点云空间向量集进行特征向量距离度量计算,以得到各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值;基于各个人脸图像识别特征点云空间向量与每张人脸表情图像对应特征点云空间向量之间的向量空间距离度量值对人脸图像识别特征点云空间向量集相对应的待识别人脸数据进行人脸数据表情识别,以得到人脸数据表情识别匹配结果。The face data re-identification and matching module is used to perform feature vector distance measurement calculation on the face image recognition feature point cloud space vector set according to the preset face expression matching database, so as to obtain the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each face expression image; based on the vector space distance measurement value between each face image recognition feature point cloud space vector and the feature point cloud space vector corresponding to each face expression image, face data expression recognition is performed on the face data to be identified corresponding to the face image recognition feature point cloud space vector set, so as to obtain the face data expression recognition matching result.
综上所述,该基于人工智能的人脸识别分析系统由待识别人脸数据背景裁切模块、人脸数据第一识别分析模块、人脸识别特征空间向量转换模块以及人脸数据再次识别匹配模块组成,能够实现本发明所述任意基于人工智能的人脸识别分析方法,用于联合各个模块上运行的计算机程序之间的操作实现基于人工智能的人脸识别分析方法,系统内部结构互相协作,这样能够大大减少重复工作和人力投入,能够快速有效地提供更为准确、更高效的基于人工智能的人脸识别分析过程,从而简化了基于人工智能的人脸识别分析系统的操作流程。In summary, the face recognition and analysis system based on artificial intelligence is composed of a background cropping module for face data to be recognized, a first recognition and analysis module for face data, a face recognition feature space vector conversion module, and a face data re-recognition and matching module. It can realize any face recognition and analysis method based on artificial intelligence described in the present invention, and is used to combine the operations between computer programs running on various modules to realize the face recognition and analysis method based on artificial intelligence. The internal structures of the system cooperate with each other, which can greatly reduce duplication of work and manpower investment, and can quickly and effectively provide a more accurate and efficient face recognition and analysis process based on artificial intelligence, thereby simplifying the operation flow of the face recognition and analysis system based on artificial intelligence.
以上所述仅是本发明的具体实施方式,使本领域技术人员能够理解或实现本发明。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所发明的原理和新颖特点相一致的最宽的范围。The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411039605.1A CN118570865B (en) | 2024-07-31 | 2024-07-31 | Face recognition analysis method and system based on artificial intelligence |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411039605.1A CN118570865B (en) | 2024-07-31 | 2024-07-31 | Face recognition analysis method and system based on artificial intelligence |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118570865A true CN118570865A (en) | 2024-08-30 |
CN118570865B CN118570865B (en) | 2024-11-26 |
Family
ID=92478600
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202411039605.1A Active CN118570865B (en) | 2024-07-31 | 2024-07-31 | Face recognition analysis method and system based on artificial intelligence |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118570865B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119206698A (en) * | 2024-09-23 | 2024-12-27 | 广东电网有限责任公司惠州供电局 | A method for recognizing and calibrating equipment nameplate images |
CN119649506A (en) * | 2024-11-11 | 2025-03-18 | 安徽建工生态科技股份有限公司 | Image processing-based face access control recognition system, method and storage medium |
CN120183021A (en) * | 2025-05-20 | 2025-06-20 | 北京众世通科技有限公司 | Face recognition method based on 3D modeling |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160196467A1 (en) * | 2015-01-07 | 2016-07-07 | Shenzhen Weiteshi Technology Co. Ltd. | Three-Dimensional Face Recognition Device Based on Three Dimensional Point Cloud and Three-Dimensional Face Recognition Method Based on Three-Dimensional Point Cloud |
WO2017219391A1 (en) * | 2016-06-24 | 2017-12-28 | 深圳市唯特视科技有限公司 | Face recognition system based on three-dimensional data |
CN108108677A (en) * | 2017-12-12 | 2018-06-01 | 重庆邮电大学 | One kind is based on improved CNN facial expression recognizing methods |
CN108549873A (en) * | 2018-04-19 | 2018-09-18 | 北京华捷艾米科技有限公司 | Three-dimensional face identification method and three-dimensional face recognition system |
CN109948400A (en) * | 2017-12-20 | 2019-06-28 | 宁波盈芯信息科技有限公司 | It is a kind of to be able to carry out the smart phone and its recognition methods that face characteristic 3D is identified |
WO2021051539A1 (en) * | 2019-09-18 | 2021-03-25 | 平安科技(深圳)有限公司 | Face recognition method and apparatus, and terminal device |
WO2022151535A1 (en) * | 2021-01-15 | 2022-07-21 | 苏州大学 | Deep learning-based face feature point detection method |
CN116895088A (en) * | 2023-05-30 | 2023-10-17 | 慧之安信息技术股份有限公司 | Intelligent face recognition method and system based on edge training |
CN117332395A (en) * | 2023-11-23 | 2024-01-02 | 江西财经大学 | A data management method and system for data sharing |
CN118230391A (en) * | 2024-04-15 | 2024-06-21 | 江苏理工学院 | A 3D face enhanced recognition system based on point cloud and RGB image |
-
2024
- 2024-07-31 CN CN202411039605.1A patent/CN118570865B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160196467A1 (en) * | 2015-01-07 | 2016-07-07 | Shenzhen Weiteshi Technology Co. Ltd. | Three-Dimensional Face Recognition Device Based on Three Dimensional Point Cloud and Three-Dimensional Face Recognition Method Based on Three-Dimensional Point Cloud |
WO2017219391A1 (en) * | 2016-06-24 | 2017-12-28 | 深圳市唯特视科技有限公司 | Face recognition system based on three-dimensional data |
CN108108677A (en) * | 2017-12-12 | 2018-06-01 | 重庆邮电大学 | One kind is based on improved CNN facial expression recognizing methods |
CN109948400A (en) * | 2017-12-20 | 2019-06-28 | 宁波盈芯信息科技有限公司 | It is a kind of to be able to carry out the smart phone and its recognition methods that face characteristic 3D is identified |
CN108549873A (en) * | 2018-04-19 | 2018-09-18 | 北京华捷艾米科技有限公司 | Three-dimensional face identification method and three-dimensional face recognition system |
WO2021051539A1 (en) * | 2019-09-18 | 2021-03-25 | 平安科技(深圳)有限公司 | Face recognition method and apparatus, and terminal device |
WO2022151535A1 (en) * | 2021-01-15 | 2022-07-21 | 苏州大学 | Deep learning-based face feature point detection method |
CN116895088A (en) * | 2023-05-30 | 2023-10-17 | 慧之安信息技术股份有限公司 | Intelligent face recognition method and system based on edge training |
CN117332395A (en) * | 2023-11-23 | 2024-01-02 | 江西财经大学 | A data management method and system for data sharing |
CN118230391A (en) * | 2024-04-15 | 2024-06-21 | 江苏理工学院 | A 3D face enhanced recognition system based on point cloud and RGB image |
Non-Patent Citations (3)
Title |
---|
D. PETRIE;SIPEZ LLC.;S. CHANNABASAPPA;CABLELABS;S. GANESAN;MOTOROLA;: "A Schema and Guidelines for Defining Session Initiation Protocol User Agent Profile Datasets draft-petrie-sipping-profile-datasets-05.txt", IETF, 17 November 2007 (2007-11-17) * |
叶晓明;林小竹;: "基于主元分析的人脸识别方法研究", 北京印刷学院学报, no. 02, 26 April 2010 (2010-04-26) * |
白耀辉;陈明: "通过物理层实现响应的入侵检测系统模型", 计算机工程与设计, 28 November 2005 (2005-11-28) * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119206698A (en) * | 2024-09-23 | 2024-12-27 | 广东电网有限责任公司惠州供电局 | A method for recognizing and calibrating equipment nameplate images |
CN119649506A (en) * | 2024-11-11 | 2025-03-18 | 安徽建工生态科技股份有限公司 | Image processing-based face access control recognition system, method and storage medium |
CN120183021A (en) * | 2025-05-20 | 2025-06-20 | 北京众世通科技有限公司 | Face recognition method based on 3D modeling |
Also Published As
Publication number | Publication date |
---|---|
CN118570865B (en) | 2024-11-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN118570865B (en) | Face recognition analysis method and system based on artificial intelligence | |
CN105956582B (en) | A kind of face identification system based on three-dimensional data | |
CN112907519A (en) | Metal curved surface defect analysis system and method based on deep learning | |
CN103164692B (en) | A kind of special vehicle instrument automatic identification system based on computer vision and method | |
CN113177977A (en) | Non-contact three-dimensional human body size measuring method | |
CN113962306B (en) | Image processing method, device, electronic device and computer readable storage medium | |
CN106023151B (en) | Tongue object detection method under a kind of open environment | |
CN111126240A (en) | A three-channel feature fusion face recognition method | |
CN103440035A (en) | Gesture recognition system in three-dimensional space and recognition method thereof | |
CN118430054B (en) | Human face recognition method and system based on AI intelligence | |
CN112784712B (en) | Missing child early warning implementation method and device based on real-time monitoring | |
CN113763274B (en) | A Multi-source Image Matching Method Combined with Local Phase Sharpness Orientation Description | |
CN111274944A (en) | A 3D Face Reconstruction Method Based on Single Image | |
CN116703895B (en) | Small sample 3D visual detection method and system based on generation countermeasure network | |
CN110222661A (en) | It is a kind of for motion estimate and the feature extracting method of tracking | |
CN111161227B (en) | A bullseye positioning method and system based on deep neural network | |
CN108596176A (en) | A kind of diatom region to extraction carries out diatom kind identification method and device | |
CN114463534A (en) | Target key point detection method, device, equipment and storage medium | |
Fathy et al. | Benchmarking of pre-processing methods employed in facial image analysis | |
CN113052234A (en) | Jade classification method based on image features and deep learning technology | |
CN112270287A (en) | A Rotation-Invariant Palm Vein Recognition Method | |
CN109615626B (en) | Quality evaluation method for chip surface printing symbol structure defects | |
CN119399803B (en) | Training method and device for vein recognition model | |
CN119478276B (en) | Tunnel surrounding rock modeling and all types of rock mass structural surface identification method and device | |
CN116503429B (en) | Model image segmentation method for biological material 3D printing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |