Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, completeSite preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based onEmbodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every otherEmbodiment shall fall within the protection scope of the present invention.
As shown in Figure 1, being a kind of flow chart of facial image gender identification method of the embodiment of the present invention, the method packetIt includes:
Facial image is converted into gray level image by S101, and obtain the local binary patterns feature of the gray level image toAmount;
Before facial image is converted into gray level image, being obtained by image collecting device such as camera acquisition includes peopleThe image of face carries out Face datection to image, obtains facial image only comprising face part, specifically, Face datection canTo be carried out using existing way, the present embodiment is not particularly limited, such as can be identified and be distinguished only comprising people by facial contourThe image of face part.
Preferably, above-mentioned facial image is changed into gray level image by RGB RGB color image, and image size is unified150*150 is set as to a preset size, such as picture size.
The facial image that different facial images or different detection algorithms detect is not of uniform size, and needing will be differentThe image of size is unified to a size, and the feature that can just obtain identical dimensional is trained and tests, for picture sizeConversion, can be used and be not limited to such as compression of images, image cutting-out mode in the prior art and convert to picture size.
Preferably, the local binary patterns of the face's face for embodying the gray level image, shape of face and textural characteristics are obtainedFeature vector;8 neighborhoods are set as when extracting LBP feature vector in one embodiment of the invention, and when statistic histogram is arrangedFirst packet size is 32, is normalized using two norm rules, finally obtains the feature vector of 944 dimensions.
Local binary patterns LBP is that a kind of image local textural characteristics describe operator, has rotational invariance and gray scale notIt is denaturalized advantage.The feature difference of men and women's different sexes is mainly reflected in the parts such as face's face, shape of face, texture.LBP operator can be withAbove-mentioned face regional area is described well.
S102 carries out dimensionality reduction to described eigenvector by linear discriminent parser;
Preferably, by the local binary patterns eigenvector projection to vector space, the local binary patterns are obtainedThe feature vector that feature vector is 1 in the dimension of vector space, the feature vector that the dimension is 1 have maximum between class distance andMinimum inter- object distance.One embodiment of the invention using Fisher LDA dimension reduction method, finally obtain feature that dimension is 1 toAmount.
The LBP feature vector dimension that step S101 is obtained is relatively high, and there are redundancies between feature vector.LDA algorithm claimsFor linear discriminent analysis, basic thought is that the mode sample of higher-dimension is projected to best discriminant technique vector space, is taken out with reachingThe effect of classification information and compressive features Spatial Dimension is taken, between Assured Mode sample has maximum class in new subspace after projectionDistance and the smallest inter- object distance, i.e. mode have optimal separability within this space.Therefore, by LDA linear discriminant pointLBP local binary patterns feature after analysis dimensionality reduction has the most separable characteristic of men and women's sample.
Feature vector after dimensionality reduction is input in preparatory trained gender sorter and tests, obtains people by S103The Gender Classification result of face image.
Preferably, obtain it is described in advance trained gender sorter the step of include:
S1031: the local binary patterns feature vector of everyone face image of training set of images is obtained;
S1032: by linear discriminent parser to the local binary mould of everyone face image of training set of imagesFormula feature vector carries out dimensionality reduction;
S1033: according to the feature vector and each face figure after the dimensionality reduction of everyone face image of training image collectionAs corresponding gender, by transfiniting, learning machine classifier training obtains gender sorter.
Since face has the characteristics that the identification that structure is complicated, variations in detail is more, for face gender feature, obtain toAfter the feature vector for identifying facial image, it is corresponding next for gender identification about property another characteristic how to distinguish this feature vectorIt says it is particularly important, for example in view of the difference of gender's feature when all ages and classes, different regions, how to treatThe influence that face characteristic under these differences identifies gender? in technical solution of the present invention, for the identification of face gender,Targetedly propose following solution, gender identification firstly the need of one gender sorter of training, by collect country variant,As training image collection, training image concentrates men and women's amount of images to approach for all ages and classes and different equal men and women's image of dressing up, byAll images pass through the method for above-mentioned steps S101, S102 such as and handle, and each image obtains the LBP spy after a corresponding dimensionality reductionSign, is input to the learning machine that transfinites (Extreme Learning with corresponding gender label for the feature of all training samplesMachine) in ELM Machine learning classifiers, study obtains gender sorter.For image to be tested, extraction obtains faceIt is directly inputted in gender sorter after the dimensionality reduction LBP feature divided, can predicts the gender result classified.Such as the present inventionMen and women's image of 5000 width country variants, all ages and classes is had collected in one embodiment as training sample, the hidden layer of ELM classifierNeuron number is set as 20.
Pass through the method for above-mentioned steps S101, S102 such as by the image for concentrating training sample image to handle to be dividedThe training of class device overcomes and is carried out in gender identification by face characteristic in conjunction with the feature extraction processing for image to be classifiedExisting structure is complicated, the feature more than variations in detail, so that the classification of gender is accurate.
It is illustrated in figure 2 a kind of structural schematic diagram of facial image gender identification device of the embodiment of the present invention, described deviceInclude:
Feature vector acquiring unit 21 for facial image to be converted into gray level image, and obtains the gray level imageLocal binary patterns feature vector;
Dimensionality reduction unit 22, for carrying out dimensionality reduction to described eigenvector by linear discriminent parser;
Taxon 23 is surveyed for the feature vector after dimensionality reduction to be input in preparatory trained gender sorterExamination, obtains the Gender Classification result of facial image.
Further, described device further includes facial image acquiring unit, for facial image to be converted into ash describedIt spends before image, the image comprising face is obtained by image acquisition device, Face datection is carried out to image, is obtained onlyFacial image comprising face part.
Described eigenvector acquiring unit 21 is specifically used for: facial image is converted into gray level image by color image, andThe size of the gray level image is unified for preset size.
Further, the local binary patterns feature vector be embody face's face of the gray level image, shape of face withAnd the local binary patterns feature vector of textural characteristics.
Further, the dimensionality reduction unit 22 is specifically used for:
By the local binary patterns eigenvector projection to vector space, the local binary patterns feature vector is obtainedThe feature vector for being 1 in the dimension of vector space, the feature vector that the dimension is 1 have in maximum between class distance and infima speciesDistance.
Further, the taxon 23 includes gender classifier training module, the gender sorter training moduleFor:
Obtain the local binary patterns feature vector of everyone face image of training set of images;
By linear discriminent parser to the local binary patterns feature of everyone face image of training set of imagesVector carries out dimensionality reduction;
It is corresponding with everyone face image according to the feature vector after the dimensionality reduction of everyone face image of training image collectionGender, by transfiniting, learning machine classifier training obtains gender sorter.
The identification of above-mentioned technical proposal of the invention for gender, it is only necessary to which the LBP feature for extracting facial image can obtainVery high classification accuracy is obtained, it is both quick and accurate compared to existing gender identification method;What this method proposed uses LDA to originalThe method that beginning facial image LBP feature carries out dimensionality reduction has better sort feature compared to other dimensionality reduction modes such as PCA;ThisMethod is using the learning machine ELM machine learning algorithm training classifier that transfinites, compared to machine learning methods such as Adaboost, SVM,Accuracy rate is higher, and speed is faster;And for the different characteristic that different regions, all ages and classes embody in gender identification, pass through full-page proofMachine learning under this, above-mentioned different characteristic is able to be able to consider in classification and in the judgement that is used to classify, so that classification knotFruit is more accurate.
It should be understood that the particular order or level of the step of during disclosed are the examples of illustrative methods.Based on settingCount preference, it should be appreciated that in the process the step of particular order or level can be in the feelings for the protection scope for not departing from the disclosureIt is rearranged under condition.Appended claim to a method is not illustratively sequentially to give the element of various steps, and notIt is to be limited to the particular order or level.
In above-mentioned detailed description, various features are combined together in single embodiment, to simplify the disclosure.NoThis published method should be construed to reflect such intention, that is, the embodiment of theme claimed needs to compareThe more features of the feature clearly stated in each claim.On the contrary, as appended claims is reflectedLike that, the present invention is in the state fewer than whole features of disclosed single embodiment.Therefore, appended claimsIt is hereby expressly incorporated into detailed description, wherein each claim is used as alone the individual preferred embodiment of the present invention.
For can be realized any technical staff in the art or using the present invention, above to disclosed embodiment intoDescription is gone.To those skilled in the art;The various modifications mode of these embodiments will be apparent from, and thisThe General Principle of text definition can also be suitable for other embodiments on the basis of not departing from the spirit and scope of the disclosure.Therefore, the disclosure is not limited to embodiments set forth herein, but most wide with principle disclosed in the present application and novel featuresRange is consistent.
Description above includes the citing of one or more embodiments.Certainly, in order to describe above-described embodiment and description portionThe all possible combination of part or method is impossible, but it will be appreciated by one of ordinary skill in the art that each implementationExample can do further combinations and permutations.Therefore, embodiment described herein is intended to cover fall into the appended claimsProtection scope in all such changes, modifications and variations.In addition, with regard to term used in specification or claimsThe mode that covers of "comprising", the word is similar to term " includes ", just as " including " solved in the claims as transitional wordAs releasing.In addition, the use of any one of specification in claims term "or" being to indicate " non-exclusionismOr ".
Those skilled in the art will also be appreciated that the various illustrative components, blocks that the embodiment of the present invention is listed(illustrative logical block), unit and step can by electronic hardware, computer software, or both knotConjunction is realized.For the replaceability (interchangeability) for clearly showing that hardware and software, above-mentioned various explanationsProperty component (illustrative components), unit and step universally describe their function.Such functionIt can be that the design requirement for depending on specific application and whole system is realized by hardware or software.Those skilled in the artCan be can be used by various methods and realize the function, but this realization is understood not to for every kind of specific applicationRange beyond protection of the embodiment of the present invention.
Various illustrative logical blocks or unit described in the embodiment of the present invention can by general processor,Digital signal processor, specific integrated circuit (ASIC), field programmable gate array or other programmable logic devices, discrete gateOr transistor logic, discrete hardware components or above-mentioned any combination of design carry out implementation or operation described function.General placeManaging device can be microprocessor, and optionally, which may be any traditional processor, controller, microcontrollerDevice or state machine.Processor can also be realized by the combination of computing device, such as digital signal processor and microprocessor,Multi-microprocessor, one or more microprocessors combine a digital signal processor core or any other like configurationTo realize.
The step of method described in the embodiment of the present invention or algorithm can be directly embedded into hardware, processor execute it is softThe combination of part module or the two.Software module can store in RAM memory, flash memory, ROM memory, EPROM storageOther any form of storaging mediums in device, eeprom memory, register, hard disk, moveable magnetic disc, CD-ROM or this fieldIn.Illustratively, storaging medium can be connect with processor, so that processor can read information from storaging medium, andIt can be to storaging medium stored and written information.Optionally, storaging medium can also be integrated into the processor.Processor and storaging medium canTo be set in asic, ASIC be can be set in user terminal.Optionally, processor and storaging medium also can be set inIn different components in the terminal of family.
In one or more exemplary designs, above-mentioned function described in the embodiment of the present invention can be in hardware, softPart, firmware or any combination of this three are realized.If realized in software, these functions be can store and computer-readableOn medium, or it is transferred on a computer readable medium in the form of one or more instructions or code forms.Computer readable medium includes electricityBrain storaging medium and convenient for so that computer program is allowed to be transferred to from a place telecommunication media in other places.Storaging medium can be withIt is that any general or special computer can be with the useable medium of access.For example, such computer readable media may include butIt is not limited to RAM, ROM, EEPROM, CD-ROM or other optical disc storages, disk storage or other magnetic storage devices or otherWhat can be used for carry or store with instruct or data structure and it is other can be by general or special computer or general or specially treatedThe medium of the program code of device reading form.In addition, any connection can be properly termed computer readable medium, exampleSuch as, if software is to pass through a coaxial cable, fiber optic cables, double from a web-site, server or other remote resourcesTwisted wire, Digital Subscriber Line (DSL) are defined with being also contained in for the wireless way for transmitting such as example infrared, wireless and microwaveIn computer readable medium.The disk (disk) and disk (disc) includes compress disk, radium-shine disk, CD, DVD, floppy diskAnd Blu-ray Disc, disk is usually with magnetic replicate data, and disk usually carries out optically replicated data with laser.Combinations of the aboveAlso it may be embodied in computer readable medium.
Above-described specific embodiment has carried out further the purpose of the present invention, technical scheme and beneficial effectsIt is described in detail, it should be understood that being not intended to limit the present invention the foregoing is merely a specific embodiment of the inventionProtection scope, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should all includeWithin protection scope of the present invention.