Method for collecting and storing face data and related equipment
By converting floating-point facial feature data into integer data and generating a compressed dictionary, the problem of computational power and storage space consumption in facial data collection and storage is solved, achieving more efficient data processing and storage.
Patent Information
- Application Number
- CN202310119848.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-15
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2043-02-15
AI Technical Summary
Existing methods for collecting and storing facial data consume a lot of computing power and storage space, resulting in low efficiency.
Floating-point facial feature data is determined based on calibrated facial images and facial recognition neural networks, and then converted into integer facial feature data. A compressed dictionary is generated using quantization encoding methods to achieve data storage and compression.
It reduces the need for computing power, increases processing speed, and saves storage space, achieving more efficient data storage without compromising recognition accuracy.
Smart Images

Figure CN117056296B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of face recognition, and in particular to a method for collecting and storing face data and related equipment. Background Art
[0002] The face recognition system based on deep neural network is widely used due to its high accuracy and fast speed. In order to identify a specific user, it is necessary to collect the face data of the user. Common face data collection methods require manual operations such as face selection, alignment, storage, and feature extraction. However, when implementing these operations, the current methods are still not simple enough, and there are problems such as collection taking up computing power and storage taking up a large space. Summary of the invention
[0003] In view of the above problems, the present invention provides a method for collecting and storing facial data and related equipment, the main purpose of which is to solve the problem that the current collection and storage of facial data takes up a lot of computing power and storage space.
[0004] In order to solve at least one of the above technical problems, in a first aspect, the present invention provides a method for collecting and storing face data, the method comprising:
[0005] Determine floating point facial feature data based on the corrected facial image and the facial recognition neural network;
[0006] Converting the floating point facial feature data into integer facial feature data by a quantization coding method;
[0007] A compression dictionary is determined based on the integer facial feature data, wherein the compression dictionary includes a conversion relationship between the integer facial feature data and target stored facial feature data, and the target stored facial feature data is data that is ultimately stored in a facial feature database.
[0008] Optionally, the above method further includes:
[0009] Determine a similarity transformation matrix based on an initial face image and a first deep neural network, wherein the first deep neural network is a convolutional neural network pre-trained and determined on a face detection dataset;
[0010] The corrected facial image is determined based on the similarity transformation matrix.
[0011] Optionally, converting the floating-point facial feature data into integer facial feature data by a quantization encoding method includes:
[0012] The floating point facial feature data is converted into integer facial feature data through a quantization encoding method based on a quantization bit width, a constraint function, a quantization interval, a quantization zero point and a quantization compensation,
[0013] The quantization bit width is determined in advance based on calculation power consumption and calculation accuracy.
[0014] Optionally, determining a compression dictionary based on the integer facial feature data includes:
[0015] Obtaining the cosine similarity between the integer facial feature data and reference data, wherein the reference data is determined based on a facial feature database
[0016] When the cosine similarity is lower than a preset value, a compression dictionary is determined based on the integer facial feature data,
[0017] The reference data is facial feature data previously stored in a facial feature database.
[0018] Optionally, obtaining the cosine similarity between the integer facial feature data and reference data includes:
[0019] Determine the Euclidean distance based on the integer facial feature data and the reference data;
[0020] The cosine similarity between the integer facial feature data and the reference data is determined based on the Euclidean distance.
[0021] Optionally, the above method further includes:
[0022] Counting the number of occurrences of all values of the integer facial feature data within a quantization interval, wherein the quantization interval is determined based on a quantization bit width;
[0023] In the case where there is an invalid value with a zero occurrence number, the invalid value is deleted from the quantization interval.
[0024] Optionally, determining a compression dictionary based on the integer facial feature data includes:
[0025] Determine a target quantization interval based on the number of times all values of the integer facial feature data appear in the quantization interval, wherein the target quantization interval is an ascending quantization interval or a descending quantization interval;
[0026] The target quantization interval is compressed based on a hexadecimal form or an ASCII code form to obtain a compression dictionary.
[0027] In a second aspect, an embodiment of the present invention further provides a device for collecting and storing face data, comprising:
[0028] A first determining unit, used to determine floating-point facial feature data based on the corrected facial image and the facial recognition neural network;
[0029] A conversion unit, used for converting the floating point facial feature data into integer facial feature data through a quantization coding method;
[0030] The second determining unit is used to determine a compression dictionary based on the integer facial feature data, wherein the compression dictionary includes a conversion relationship between the integer facial feature data and target stored facial feature data, and the target stored facial feature data is data finally stored in a facial feature database.
[0031] In order to achieve the above-mentioned purpose, according to the third aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the above-mentioned program is executed by a processor, the steps of the above-mentioned method for collecting and storing facial data are implemented.
[0032] In order to achieve the above-mentioned purpose, according to the fourth aspect of the present invention, there is provided an electronic device, comprising at least one processor and at least one memory connected to the processor; wherein the above-mentioned processor is used to call the program instructions in the above-mentioned memory to execute the steps of the above-mentioned method for collecting and storing facial data.
[0033] Through the above technical scheme, the face data collection and storage method and related equipment provided by the present invention solve the problem that the current face data collection and storage occupy more computing power and storage space. The present invention determines floating-point face feature data based on the corrected face image and the face recognition neural network; converts the floating-point face feature data into integer face feature data through a quantization coding method; determines a compression dictionary based on the integer face feature data, wherein the compression dictionary includes the conversion relationship between the integer face feature data and the target stored face feature data, and the target stored face feature data is the data finally stored in the face feature database. In the above scheme, since floating-point facial feature data is converted into integer facial feature data, processing integer data can save computer computing power and improve processing speed compared to processing floating-point data. Therefore, for some scenarios with low recognition accuracy, the effect of reducing computing power while improving processing speed is achieved. Moreover, since the integer facial feature data is compressed, the storage space is saved while retaining the facial features of different users. When it is necessary to call the facial image data of a certain user, it is only necessary to reversely decompress the target stored facial feature data stored in the facial feature database through the compression dictionary.
[0034] Correspondingly, the facial data collection and storage device, equipment and computer-readable storage medium provided by the embodiments of the present invention also have the above-mentioned technical effects.
[0035] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0037] Figure 1 A schematic diagram showing a flow chart of a method for collecting and storing face data provided by an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of inter-partition coding of a method for collecting and storing face data provided by an embodiment of the present invention is shown;
[0039] Figure 3 A schematic block diagram showing the composition of a device for collecting and storing face data provided by an embodiment of the present invention is shown;
[0040] Figure 4 A schematic block diagram showing the composition of an electronic device for collecting and storing face data provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0041] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0042] In order to solve the problem that the current collection and storage of face data takes up a lot of computing power and storage space, an embodiment of the present invention provides a method for collecting and storing face data, such as Figure 1 As shown, the method includes:
[0043] S101, determining floating-point facial feature data based on the corrected facial image and the facial recognition neural network;
[0044] Exemplarily, floating-point facial feature data is determined based on the corrected facial image and the facial recognition neural network to provide data support for subsequent calculation and processing.
[0045] S102, converting the floating-point facial feature data into integer facial feature data through a quantization coding method;
[0046] For example, by converting floating point facial feature data into integer facial feature data, calculating the integer data can save more computing power than calculating the floating point data.
[0047] S103. Determine a compression dictionary based on the integer facial feature data, wherein the compression dictionary includes a conversion relationship between the integer facial feature data and target stored facial feature data, and the target stored facial feature data is data that is ultimately stored in a facial feature database.
[0048] For example, the method based on the embodiment of the present invention can achieve a compression rate of 58% to 80%, which can save 20% to 42% of storage space. The quantization method of the embodiment of the present invention can reduce the demand for hardware resources such as running memory and computing bandwidth, and is more suitable for deployment on mobile terminals.
[0049] Through the above technical scheme, the method for collecting and storing facial data provided by the present invention solves the problem that the current collection and storage of facial data takes up more computing power and storage space. The present invention determines floating-point facial feature data based on a corrected facial image and a facial recognition neural network; converts the floating-point facial feature data into integer facial feature data through a quantization coding method; determines a compression dictionary based on the integer facial feature data, wherein the compression dictionary includes a conversion relationship between the integer facial feature data and target stored facial feature data, and the target stored facial feature data is the data finally stored in the facial feature database. In the above scheme, since floating-point facial feature data is converted into integer facial feature data, processing integer data can save computer computing power and improve processing speed compared to processing floating-point data. Therefore, for some scenarios with low recognition accuracy, the effect of reducing computing power while improving processing speed is achieved. Moreover, since the integer facial feature data is compressed, the storage space is saved while retaining the facial features of different users. When it is necessary to call the facial image data of a certain user, it is only necessary to reversely decompress the target stored facial feature data stored in the facial feature database through the compression dictionary.
[0050] Exemplarily, the above method further includes:
[0051] Determine a similarity transformation matrix based on an initial face image and a first deep neural network, wherein the first deep neural network is a convolutional neural network pre-trained and determined on a face detection dataset;
[0052] The corrected facial image is determined based on the similarity transformation matrix.
[0053] Exemplarily, based on the face image acquisition device, a scene image is acquired, and the scene image includes an initial face image of a person. First, the scene image is normalized, and the formula is expressed as follows:
[0054]
[0055] Where I(x, y) is the value of image I at the pixel position (x, y), I′(x, y) is the normalized value, μ and σ are the mean and standard deviation of the pixels in the face image dataset, respectively, which can also be adjusted in practical applications.
[0056] Then, face detection is performed based on the first deep neural network to obtain the bounding box information and key point information of the face. Based on the bounding box information of the face, the initial face image can be cropped. The coordinate information of the key points of the face includes five coordinates, namely the coordinates of the center point of the left eye, the coordinates of the center point of the right eye, the coordinates of the tip of the nose, the coordinates of the left corner of the mouth, and the coordinates of the center of the right corner of the mouth. The above face alignment operation is specifically as follows: based on the coordinate information of the key points of the face and the coordinate information of the standard template face, the similarity transformation matrix M is obtained based on the least squares method, wherein the coordinate information of the standard template face can be obtained by clustering the coordinates of the key points of the face in a large face data set, or it can be manually assigned according to the actual situation. The formula for obtaining the similarity transformation matrix M is expressed as follows:
[0057] M=(Q T Q) ―1 Q T S
[0058] Among them, Q is a matrix composed of the coordinate information of the key points of the face, Q T is the transposed matrix of matrix Q, (Q T Q) ―1 Indicates Q T The inverse matrix of Q, S is the matrix composed of the standard template face coordinate information.
[0059] Based on the above method, the coordinate information of the key points of the face is matched with the coordinate information of the standard template face as much as possible, so as to determine the above corrected face image.
[0060] It is understandable that even after the coordinates of the facial image have been matched one-to-one with the coordinates of the standard template face, there may still be lateral and / or vertical displacement of the face. In this case, the embodiment of the present invention performs a radial transformation on the initial facial image based on a similarity transformation matrix to obtain the above-mentioned corrected facial image.
[0061] Exemplarily, the converting the floating-point facial feature data into integer facial feature data by a quantization encoding method includes:
[0062] The floating point facial feature data is converted into integer facial feature data through a quantization encoding method based on a quantization bit width, a constraint function, a quantization interval, a quantization zero point and a quantization compensation,
[0063] The quantization bit width is determined in advance based on calculation power consumption and calculation accuracy.
[0064] Exemplarily, the quantization encoding method converts the floating point facial feature data A f Convert to integer facial feature data A i .
[0065] The formula for the quantization encoding method is as follows:
[0066]
[0067] Among them, A fi is floating point facial feature data, A i is the quantized integer facial feature data, i represents the i-th element, n is the quantization bit width, clip() is a constraint function that limits all input values to (-1,1), that is:
[0068]
[0069] Δ is the quantization interval, which is obtained as follows:
[0070]
[0071] The quantized zero point z is:
[0072]
[0073] σ is the quantization compensation, and its value is:
[0074]
[0075] The above-mentioned quantization bit width is an optimal value determined in advance based on computing power consumption and computing accuracy. The larger the value of the quantization bit width, the higher the corresponding computing power consumption and the higher the computing accuracy. The smaller the value of the quantization bit width, the lower the corresponding computing power consumption and the lower the computing accuracy.
[0076] Exemplarily, determining a compression dictionary based on the integer facial feature data includes:
[0077] Obtaining the cosine similarity between the integer facial feature data and reference data, wherein the reference data is determined based on a facial feature database
[0078] When the cosine similarity is lower than a preset value, a compression dictionary is determined based on the integer facial feature data,
[0079] The reference data is facial feature data previously stored in a facial feature database.
[0080] Exemplarily, in the embodiment of the present invention, a compression dictionary is determined based on the integer facial feature data only when the cosine similarity is lower than a preset value. If the cosine similarity is higher than or equal to the preset value, it reflects that the face has been entered into the facial feature database and there is no need to re-enter it.
[0081] Exemplarily, the obtaining of the cosine similarity between the integer facial feature data and reference data includes:
[0082] Determine the Euclidean distance based on the integer facial feature data and the reference data;
[0083] The cosine similarity between the integer facial feature data and the reference data is determined based on the Euclidean distance.
[0084] For example, whether the face already exists in the database can be obtained by measuring the cosine similarity between the feature data and the face database data. The cosine similarity calculation formula is as follows:
[0085] 2cos(A,B)=2-d euc 2
[0086] Among them, d euc is the Euclidean distance between two vectors,
[0087] In the formula, the feature data A and a record B of the face database data have the same quantization interval Δ and quantization zero point z, so
[0088]
[0089] Illustratively, the embodiment of the present invention does not use square root operations, which also saves computer computing power to a certain extent.
[0090] Exemplarily, the above method further includes:
[0091] Counting the number of occurrences of all values of the integer facial feature data within a quantization interval, wherein the quantization interval is determined based on a quantization bit width and a quantization zero point;
[0092] In the case where there is an invalid value with a zero occurrence number, the invalid value is deleted from the quantization interval.
[0093] Exemplarily, the quantization bit width n and the quantization zero point z uniquely determine the quantization interval. For example, when the quantization bit width n=8 and the quantization zero point z=0, the quantization interval contains 2 n =28 = 256 elements, and its quantization interval is [-128, z]∪[z, 127] = [128, 0]∪[0, 127]. It can be understood that an invalid value with zero occurrence is an invalid value and has nothing to do with the facial features of the user, so the invalid value is deleted from the quantization interval.
[0094] Exemplarily, determining a compression dictionary based on the integer facial feature data includes:
[0095] Determine a target quantization interval based on the number of times all values of the integer facial feature data appear in the quantization interval, wherein the target quantization interval is an ascending quantization interval or a descending quantization interval;
[0096] The target quantization interval is compressed based on a hexadecimal form or an ASCII code form to obtain a compression dictionary.
[0097] Exemplarily, the above compression dictionary is stored in key-value pairs, where the key is a string of quantized interval values and the corresponding value is in hexadecimal form, for example:
[0098] The original data containing 15360 floating-point numbers is quantized into 8-bit integer data. According to the quantization formula, the values of all data belong to the set [-126, 126], with a total of 253 quantized values.
[0099] The quantized data sequence is:
[0100] [96,-29,20,-58,42,19,……,-1,-20]
[0101] The file is stored in binary mode and the size of the file is 60KB.
[0102] Count the number of times the value appears. Assume that after deleting the integers that do not appear, there are 216 elements left in the quantization interval. The sequence of these elements in descending order of the number of occurrences is:
[0103] [-4,5,0,-2,4,2,11,……,114,126]
[0104] Then, the compression dictionary is:
[0105]
[0106] Compression dictionary model:
[0107] {key [string]: value [hexadecimal]}
[0108] The translated data sequence is:
[0109] [ba,3e,15,7d,4c,23,5a,……,19,2c]
[0110] The file is stored in binary mode and a Compressd.bin file with a size of 42KB is obtained.
[0111] Compared with ORI.bin file, the compression rate is 70%, which can save 30% of storage space.
[0112] This method can achieve a compression rate of 70% to 86%, which can save 14% to 30% of storage space.
[0113] Exemplarily, the target quantization interval may also be compressed based on the ASCII code form to obtain a compression dictionary, for example:
[0114] The original data containing 15360 floating-point numbers is quantized into 8-bit integer data. According to the quantization formula, the values of all data belong to the set [-126, 126], with a total of 253 quantized values.
[0115] The quantized data sequence is:
[0116] [96,-29,20,-58,42,19,……,-1,-20]
[0117] The file is stored in binary mode and the size of the file is 60KB.
[0118] Count the number of times the value appears. Assume that after deleting the integers that do not appear, there are 216 elements left in the quantization interval. The sequence of these elements in descending order of the number of occurrences is:
[0119] [-4,5,0,-2,4,2,11,……,114,126]
[0120] Divide the arranged sequence into two segments (the encoding between the segments is as follows Figure 2 shown).
[0121] The first 128 elements are encoded using the ASCII code table, and the remaining values are encoded using 2-bit hexadecimal. This encoding method ensures that all data are 1 or 2 characters.
[0122] The following compression dictionary is obtained:
[0123]
[0124] Compression dictionary model:
[0125] {key [string]: value [variable length bitstream]}
[0126] The translated data sequence is:
[0127] [ba,>,15,},L,#,……,19,2c]
[0128] Store in binary mode and get a 35KB RE_Compressd.bin file.
[0129] Compared with the ORI.bin file, the compression rate is 58%, which can save 42% of storage space.
[0130] Furthermore, as a response to the above Figure 1 In order to realize the method shown in the figure, the embodiment of the present invention also provides a device for collecting and storing face data, which is used for Figure 1 The device embodiment corresponds to the aforementioned method embodiment. For ease of reading, this device embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. Figure 3 As shown, the device includes: a first determining unit 21, a conversion unit 22, and a second determining unit 23, wherein
[0131] A first determining unit 21, configured to determine floating point facial feature data based on the corrected facial image and the facial recognition neural network;
[0132] A conversion unit 22, used for converting the floating point facial feature data into integer facial feature data through a quantization coding method;
[0133] The second determining unit 23 is used to determine a compression dictionary based on the integer facial feature data, wherein the compression dictionary includes a conversion relationship between the integer facial feature data and target stored facial feature data, and the target stored facial feature data is data finally stored in the facial feature database.
[0134] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and a method for collecting and storing face data can be implemented by adjusting kernel parameters, which can solve the problem that the collection and storage of face data currently occupies more computing power and storage space.
[0135] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, and when the program is executed by a processor, the method for collecting and storing facial data is implemented.
[0136] An embodiment of the present invention provides a processor, which is used to run a program, wherein the method for collecting and storing facial data is executed when the program is run.
[0137] An embodiment of the present invention provides an electronic device, the electronic device comprising at least one processor and at least one memory connected to the processor; wherein the processor is used to call program instructions in the memory to execute the above-mentioned method for collecting and storing face data
[0138] An embodiment of the present invention provides an electronic device 30, such as Figure 4 As shown, the electronic device includes at least one processor 301, and at least one memory 302 and a bus 303 connected to the processor; wherein the processor 301 and the memory 302 communicate with each other through the bus 303; the processor 301 is used to call the program instructions in the memory to execute the above-mentioned facial data collection and storage method.
[0139] The intelligent electronic devices in this article can be PCs, PADs, mobile phones, etc.
[0140] The present application also provides a computer program product, which, when executed on a process management electronic device, is suitable for executing a program for initializing the above-mentioned method for collecting and storing facial data.
[0141] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0142] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0143] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0144] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0145] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0146] The present application also provides a computer program product, which includes computer software instructions. When the computer software instructions are executed on a processing device, the processing device is caused to execute the following Figure 1 This corresponds to the flow of control of the memory in the embodiment.
[0147] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.
[0148] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0149] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0150] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0151] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0152] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0153] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for collecting and storing face data, characterized in that: include: Determine floating point facial feature data based on the corrected facial image and the facial recognition neural network; Converting the floating point facial feature data into integer facial feature data by a quantization coding method; Determine a compression dictionary based on the integer facial feature data, wherein the compression dictionary includes a conversion relationship between the integer facial feature data and target stored facial feature data, and the target stored facial feature data is data that is finally stored in a facial feature database; Determine a similarity transformation matrix based on an initial face image and a first deep neural network, wherein the first deep neural network is a convolutional neural network pre-trained and determined on a face detection dataset; Determining the corrected facial image based on the similarity transformation matrix; The above method further includes: Acquire a scene image based on a face image acquisition device, wherein the scene image includes an initial face image; Performing normalization processing on the scene image; Performing face detection on the scene image based on a first deep neural network to obtain bounding box information of the face and key point information of the face, wherein the key point information of the face includes left eye center point coordinates, right eye center point coordinates, nose tip coordinates, left mouth corner coordinates, and right mouth corner center coordinates; Crop an initial face image based on the face bounding box information and the face key point information; Performing a face alignment operation based on key point information of the initial face image and key point information of a standard template face to determine the corrected face image, wherein the key point information of the standard template face is obtained by clustering the coordinates of key points of faces in a large face data set; The step of converting the floating point facial feature data into integer facial feature data by a quantization coding method comprises: The floating point facial feature data is converted into integer facial feature data through a quantization encoding method based on a quantization bit width, a constraint function, a quantization interval, a quantization zero point and a quantization compensation, The quantization bit width is determined in advance based on calculation power consumption and calculation accuracy.
2. The method according to claim 1, characterized in that The step of determining a compression dictionary based on the integer facial feature data comprises: Obtaining cosine similarity between the integer facial feature data and reference data, wherein the reference data is determined based on a facial feature database; When the cosine similarity is lower than a preset value, a compression dictionary is determined based on the integer facial feature data, The reference data is facial feature data previously stored in a facial feature database.
3. The method according to claim 2, characterized in that The step of obtaining the cosine similarity between the integer facial feature data and the reference data comprises: Determine the Euclidean distance based on the integer facial feature data and the reference data; The cosine similarity between the integer facial feature data and the reference data is determined based on the Euclidean distance.
4. The method according to claim 1, characterized in that: Also includes: Counting the number of occurrences of all values of the integer facial feature data within a quantization interval, wherein the quantization interval is determined based on a quantization bit width; In the case where there is an invalid value with a zero occurrence number, the invalid value is deleted from the quantization interval.
5. The method according to claim 4, characterized in that The step of determining a compression dictionary based on the integer facial feature data comprises: Determine a target quantization interval based on the number of times all values of the integer facial feature data appear in the quantization interval, wherein the target quantization interval is an ascending quantization interval or a descending quantization interval; The target quantization interval is compressed based on a hexadecimal form or an ASCII code form to obtain a compression dictionary.
6. A device for collecting and storing face data, characterized in that: A first determining unit, configured to determine floating-point facial feature data based on the corrected facial image and the facial recognition neural network; A conversion unit, used for converting the floating point facial feature data into integer facial feature data through a quantization coding method; A second determining unit is used to determine a compression dictionary based on the integer facial feature data, wherein the compression dictionary includes a conversion relationship between the integer facial feature data and target stored facial feature data, and the target stored facial feature data is data finally stored in the facial feature database; Determine a similarity transformation matrix based on an initial face image and a first deep neural network, wherein the first deep neural network is a convolutional neural network pre-trained and determined on a face detection dataset; Determining the corrected facial image based on the similarity transformation matrix; The above method further includes: Acquire a scene image based on a face image acquisition device, wherein the scene image includes an initial face image; Performing normalization processing on the scene image; Performing face detection on the scene image based on a first deep neural network to obtain bounding box information of the face and key point information of the face, wherein the key point information of the face includes left eye center point coordinates, right eye center point coordinates, nose tip coordinates, left mouth corner coordinates, and right mouth corner center coordinates; Crop an initial face image based on the face bounding box information and the face key point information; Performing a face alignment operation based on key point information of the initial face image and key point information of a standard template face to determine the corrected face image, wherein the key point information of the standard template face is obtained by clustering the coordinates of key points of faces in a large face data set; The step of converting the floating point facial feature data into integer facial feature data by a quantization coding method comprises: The floating point facial feature data is converted into integer facial feature data through a quantization encoding method based on a quantization bit width, a constraint function, a quantization interval, a quantization zero point and a quantization compensation, The quantization bit width is determined in advance based on calculation power consumption and calculation accuracy.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed by a processor, the steps of the method for collecting and storing facial data as described in any one of claims 1 to 5 are implemented.
8. An electronic device, characterized in that: The electronic device includes at least one processor and at least one memory connected to the processor; wherein the processor is used to call program instructions in the memory to execute the steps of the method for collecting and storing facial data as described in any one of claims 1 to 5.
