WO2023009055A1 - 用于图像识别模型的训练方法及其装置、图像识别方法 - Google Patents

用于图像识别模型的训练方法及其装置、图像识别方法 Download PDF

Info

Publication number
WO2023009055A1
WO2023009055A1 PCT/SG2022/050281 SG2022050281W WO2023009055A1 WO 2023009055 A1 WO2023009055 A1 WO 2023009055A1 SG 2022050281 W SG2022050281 W SG 2022050281W WO 2023009055 A1 WO2023009055 A1 WO 2023009055A1
Authority
WO
WIPO (PCT)
Prior art keywords
category
image
distribution function
augmented
image recognition
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.)
Ceased
Application number
PCT/SG2022/050281
Other languages
English (en)
French (fr)
Inventor
孙敬娜
陈培滨
曾伟宏
王旭
刘晶
黎振邦
桑燊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lemon Inc Cayman Island
Original Assignee
Lemon Inc Cayman Island
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Lemon Inc Cayman Island filed Critical Lemon Inc Cayman Island
Publication of WO2023009055A1 publication Critical patent/WO2023009055A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/72Data preparation, e.g. statistical preprocessing of image or video features
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/09Supervised learning

Definitions

  • One solution is to solve the problem from the data level, and the other is to solve the problem from the loss function level.
  • the data is usually expanded by under-sampling, over-sampling or data enhancement in order to alleviate the learning problem of the model for the few-sample categories.
  • Undersampling and oversampling are to improve the problem of poor recognition rate of few samples by changing the probability of samples being sampled so that samples of few sample categories can be trained multiple times.
  • Data enhancement is to expand the data of the few-sample category by adding noise to the samples of the few-sample category. The addition of noise is divided into various types, such as: rotation, flipping, etc.
  • a training method for an image recognition model including: obtaining image samples of multiple categories; inputting image samples of each category into a feature extraction layer of the image recognition model, to extracting the feature vector of each image sample; calculating the statistical feature information of the actual distribution function corresponding to each category according to the feature vector of each image sample of each category; according to the feature vector corresponding to each category Statistical feature information of the actual distribution function, establishing an augmented distribution function corresponding to each category; obtaining augmented sample features of each category based on the augmented distribution function corresponding to each category; and The feature vector of the image sample and the augmented sample features are input to the classification layer of the image recognition model for supervised learning.
  • an image recognition method including: inputting an image to be recognized into an image recognition model, wherein the image recognition model is trained by the aforementioned training method; and using the The image recognition model recognizes the image to be recognized and outputs an image recognition result.
  • a training device for an image recognition model including: a first acquisition unit, configured to obtain image samples of multiple categories; a feature extraction unit, configured to extract each category The image samples are input into the feature extraction layer of the image recognition model to extract the feature vector of each image sample; the calculation unit is used to calculate the Statistical characteristic information of the corresponding actual distribution function; an augmented distribution function establishing unit, configured to establish an augmented distribution function corresponding to each category according to the statistical characteristic information of the actual distribution function corresponding to each category; A second acquisition unit, based on the augmented distribution function corresponding to each category to obtain the augmented sample features of each category; and a supervised learning unit, used to combine the feature vector of the image sample with the augmented sample The features are input into the classification layer of the image recognition model for supervised learning.
  • an image recognition device including: an input unit, configured to input an image to be recognized into an image recognition model, wherein the image recognition model is trained by the aforementioned training method and a recognition unit, configured to use the image recognition model to recognize the image to be recognized and output an image recognition result.
  • an electronic device including: a memory; and a processor coupled to the memory, the processor is configured to execute the instructions in the present disclosure based on instructions stored in the memory. The method of any of the embodiments described.
  • a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method of any embodiment described in the present disclosure is implemented. Law.
  • a computer program including: an instruction, which when executed by a processor causes the processor to execute the method of any embodiment described in the present disclosure.
  • a computer program product is provided, including instructions, and the instructions, when executed by a processor, cause the processor to execute the method of any embodiment described in the present disclosure.
  • FIG. 1 is a flowchart illustrating a training method for an image recognition model according to some embodiments of the present disclosure
  • FIG. 2 is a flowchart illustrating an image recognition method according to some embodiments of the present disclosure
  • FIG. 3 is a schematic structural diagram showing a training device for an image recognition model according to some embodiments of the present disclosure
  • FIG. 4 is a schematic structural diagram showing an image recognition device according to some embodiments of the present disclosure
  • FIG. 6 is a schematic structural diagram showing an electronic device according to other embodiments of the present disclosure
  • FIG. 7 is a schematic structural diagram showing an image recognition model according to some embodiments of the present disclosure.
  • method embodiments may include additional steps and/or omit performing illustrated steps.
  • the scope of the present disclosure is not limited in this respect. Unless specifically stated otherwise, the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments should be interpreted as merely exemplary and not limiting the scope of the present disclosure.
  • the term “comprising” and its variants used in the present disclosure mean an open term including at least the following elements/features but not excluding other elements/features, ie "including but not limited to”.
  • the term “comprising” and its variants used in the present disclosure mean an open term that includes at least the following elements/features but does not exclude other elements/features, that is, “comprising but not limited to”.
  • the camera assembly can be mobilized to take pictures.
  • the acquired image may be a captured image, or a frame of an image in a captured video, and is not particularly limited thereto.
  • an image may refer to any one of various images, such as a color image, a grayscale image, and the like. It should be noted that in the context of this description, the type of image is not specifically limited.
  • the image may be any appropriate image, such as an original image obtained by a camera, or an image that has undergone specific processing on the original image, such as preliminary filtering, anti-aliasing, color adjustment, contrast adjustment, normalization, and so on.
  • the preprocessing operation may also include other types of preprocessing operations known in the art, which will not be described in detail here.
  • One of the technical problems solved by the present disclosure is to increase the number of samples in the few-sample category, thereby improving the accuracy of model training.
  • the present disclosure provides a training method for an image recognition model according to some embodiments of the present disclosure. The training method for the image recognition model will be described in detail below with reference to the accompanying drawings.
  • step S102 image samples of multiple categories are obtained.
  • step S102 includes: sampling image samples of multiple categories under the same attribute, to obtain at least part of image samples of each category. For example, the number of image samples of each category collected in the plurality of categories is substantially equal. That is, class-balanced sampling is performed for each class.
  • the "substantially equal” here includes but not limited to absolute equality, but may be slightly unequal.
  • the first category has 200 image samples
  • the second category has 2000 image samples
  • 150 samples are collected from the 200 image samples of the first category
  • 200 samples are collected from the 2000 image samples of the second category
  • the number of samples collected from the first category is basically equal to the number of samples collected from the second category. That is to say, in some embodiments, there may be a certain difference in the number of collected image samples of different categories, as long as the difference is within a predetermined range, or in other words, as long as the difference is within an acceptable range That's it.
  • the step of sampling image samples of multiple categories under the same attribute includes: if the actual number of image samples of the first category among the above multiple categories is less than the planned number of image samples, at least a portion of the image samples of the first category are oversampled.
  • the first category among multiple categories has 200 image samples, when planning to collect 300 image samples from the first category, since the actual number of image samples owned by the first category is smaller than the number of image samples collected for the first category
  • the planned number of image samples after all the 200 image samples are collected, some image samples in the 200 image samples (for example, 100 image samples in the 200 image samples) can be repeatedly sampled, so as to satisfy Planned number of 300 image samples.
  • the step of sampling image samples of a plurality of categories under the same attribute includes: the planned number of samples, all image samples of the second category are collected.
  • the second category among the multiple categories has 300 image samples, when it is planned to collect 300 image samples from the second category, since the actual number of image samples of the second category is exactly equal to the number of image samples collected for the second category is the planned number of image samples of the second category, all image samples of the second category are collected.
  • the step of sampling image samples of multiple categories under the same attribute includes: if the actual number of image samples of a third category among the multiple categories is greater than the images collected for the third category the planned number of samples, then some image samples of the third category are collected.
  • the third category among the plurality of categories has 2000 image samples, when planning to collect 300 image samples from the third category, since the actual number of image samples of the third category is greater than the number of image samples collected for the third category the planned number of image samples, then some image samples of the third category are collected. For example, 300 image samples may be randomly collected from 2000 image samples in the third category.
  • the above image recognition model is used in the field of face recognition.
  • the above attributes represent a certain part of the human face.
  • the aforementioned attributes include eyes, eyebrows, nose, and the like.
  • the above category is the shape category of the certain part of the human face.
  • the image sample includes an image sample of the certain part of the human face.
  • the image samples may include image samples of eyes, eyebrows, or noses, and so on.
  • the image samples of each category are input into the feature extraction layer of the image recognition model (feature extraction layer 702 shown in FIG. 7) to extract the feature vector of each image sample.
  • feature extraction layer 702 shown in FIG. 7 feature extraction layer 702 shown in FIG. 7
  • the image recognition model is a convolutional neural network.
  • step S106 according to the feature vector of each image sample of each category, calculate the The statistical feature information of the corresponding actual distribution function.
  • the feature vectors of these image samples may conform to a certain actual distribution function.
  • the actual distribution function is a Gaussian distribution function.
  • the statistical characteristic information of the actual distribution function can be obtained.
  • the statistical feature information includes first statistical feature information and second statistical feature information.
  • the first statistical feature information is the mean value of the actual distribution function
  • the second statistical feature information is the variance or standard deviation of the actual distribution function.
  • the mean or variance (or standard deviation) of the Gaussian distribution function corresponding to each category can be calculated. For example, if a certain attribute includes N categories, and N is a positive integer, then the mean and variance of (or standard deviation) corresponding to each category i (IS N, and i is a positive integer) can be calculated.
  • the mean value of a certain category i is the essential information representing the category i
  • the variance (or standard deviation) of the category represents the diversity of samples in the category, and does not represent category information. Sex is transferable. Classes are homogeneous across single attribute classification tasks.
  • the large, medium, and small eyes are all categories representing the size of the eyes. It can be considered that the distribution of each category under a single attribute is similar, and the focus of attention is on the size of the eyes.
  • an augmented distribution function corresponding to each category is established according to the statistical feature information of the actual distribution function corresponding to each category.
  • the function type of the augmented distribution function is the same as the function type of the actual distribution function.
  • both the actual distribution function and the augmented distribution function are Gaussian distribution functions.
  • step S108 includes: calculating the average value of the second statistical feature information of the actual distribution function corresponding to multiple categories; and using the average value of the second statistical feature information and the first statistical feature information of each category As statistical characteristic parameters, an augmented distribution function corresponding to each category is established.
  • the second statistical feature information is the variance
  • the second statistical feature information is the standard deviation
  • the augmented sample features of each class are obtained based on the augmented distribution function corresponding to each class.
  • the step S110 includes: sampling the augmented distribution function corresponding to each category, and obtaining the corresponding augmented sample features of each category.
  • the augmented sample feature is the augmented sample feature vector.
  • the number of acquired image samples of each category is equal to the number of augmented sample features of each category.
  • 300 image samples are collected from each category, then in the process of executing step S110, 300 samples are also collected from the augmented distribution function of each category. In this way, in the subsequent training process, while improving the diversity and generalization ability of the few-sample category, it will basically not affect the recognition of the multi-sample category.
  • the augmented sample features are obtained through the augmentation operation, as shown in Figure 7.
  • the feature vector of the image sample and the augmented sample feature are input into the classification layer of the image recognition model (the classification layer 704 shown in FIG. 7) for supervised learning.
  • step S112 includes: inputting the feature vector of the image sample and the augmented sample feature into the classification layer 704 of the image recognition model to output an image recognition result corresponding to the image sample and the augmented sample; according to the image recognition result calculating a loss function value based on the difference between the label value of the image sample and the augmented sample; and adjusting parameters of the image recognition model according to the loss function value.
  • the above steps can be repeated to satisfy the training end condition.
  • the training end condition may be that the training times threshold or the loss function value is smaller than the function threshold. That is, the training ends when the number of training times reaches the threshold value of the number of training times, or ends the training when the value of the loss function is less than the threshold value of the function after cyclic adjustment.
  • the training method includes: obtaining image samples of multiple categories; inputting the image samples of each category into the feature extraction layer of the image recognition model to extract the feature vector of each image sample; eigenvectors, calculating the statistical feature information of the actual distribution function corresponding to each category; according to the statistical feature information of the actual distribution function corresponding to each category, establishing an augmented distribution function corresponding to each category; based on each The augmented distribution function corresponding to the class obtains the augmented sample features of each class; and the feature vector of the image sample and the augmented sample features are input into the classification layer of the image recognition model for supervised learning.
  • This training method can increase the number of samples in the few-sample category, alleviate the problem of sample imbalance, and thus improve the accuracy of model training.
  • the above methods use the distribution priors of multi-sample categories at the feature level to augment the data of few-sample categories. wide, thereby optimizing the recognition accuracy of few-sample categories.
  • data imbalance is a common problem, and it is almost impossible to collect a data set with strong data diversity and category balance during the data collection process. In some extreme cases, the data may even be severely unbalanced, resulting in serious model deviations during training, making it almost unusable.
  • FIG. 2 is a flowchart illustrating an image recognition method according to some embodiments of the present disclosure.
  • the image recognition method includes steps S202 to S204.
  • step S202 the image to be recognized is input to the image recognition model.
  • Fig. 3 is a schematic structural diagram showing a training device for an image recognition model according to some embodiments of the present disclosure. As shown in FIG. 3, the training device includes a first acquisition unit 302, a feature extraction unit 304, a calculation unit 306, an augmented distribution function establishment unit 308, a second acquisition unit 310 and a supervised learning unit 312.
  • the first obtaining unit 302 is used to obtain image samples of multiple categories.
  • the first obtaining unit 302 is configured to sample image samples of multiple categories under the same attribute, so as to obtain at least part of image samples of each category.
  • the number of image samples of each category collected in multiple categories is substantially equal.
  • the first acquiring unit 302 is configured to, if the actual number of image samples of the first class among the plurality of classes is less than the planned number of image samples collected for the first class, then for the first class At least some of the image samples of a category are oversampled.
  • the first acquiring unit 302 is further configured to collect All image samples of the second category.
  • the first acquiring unit 302 is further configured to if the third category in the plurality of categories is having an actual number of image samples that is greater than the planned number of image samples collected for the third category, collecting a portion of the image samples for the third category.
  • the feature extraction unit 304 is used to input the image samples of each category into the feature extraction layer of the image recognition model, so as to extract the feature vector of each image sample.
  • the calculation unit 306 is used for calculating the statistical feature information of the actual distribution function corresponding to each category according to the feature vector of each image sample of each category.
  • the statistical feature information includes first statistical feature information and second statistical feature information.
  • the first statistical feature information is the mean value of the actual distribution function
  • the second statistical feature information is the variance or standard deviation of the actual distribution function.
  • the augmented distribution function establishing unit 308 is configured to establish the augmented distribution function corresponding to each class according to the statistical feature information of the actual distribution function corresponding to each class.
  • the function type of the augmented distribution function is the same as the function type of the real distribution function.
  • both the actual distribution function and the augmented distribution function are Gaussian distribution functions.
  • the augmented distribution function establishing unit 308 is used to calculate the average value of the second statistical characteristic information of the actual distribution function corresponding to multiple categories, and the average value of the second statistical characteristic information and the average value of each category
  • the first statistical feature information is used as a statistical feature parameter to establish an augmented distribution function corresponding to each category.
  • the second obtaining unit 310 is configured to obtain the augmented sample features of each class based on the augmented distribution function corresponding to each class.
  • the second obtaining unit 310 is configured to sample the augmented distribution function corresponding to each category, and obtain corresponding augmented sample features of each category.
  • the number of image samples of each category acquired by the first acquiring unit 302 is equal to the number of augmented sample features of each category acquired by the second acquiring unit 310 .
  • the supervised learning unit 312 is used to input the feature vector of the image sample and the augmented sample features into the classification layer of the image recognition model for supervised learning.
  • the supervised learning unit 312 is used to input the feature vector of the image sample and the augmented sample feature into the classification layer of the image recognition model to output the image recognition result corresponding to the image sample and the augmented sample, according to the image recognition
  • the difference between the result and the label value of the image sample and the augmented sample is used to calculate the loss function value, and the parameters of the image recognition model are adjusted according to the loss function value.
  • FIG. 4 is a schematic structural diagram illustrating an image recognition device according to some embodiments of the present disclosure.
  • the image recognition device includes an input unit 402 and a recognition unit 404 .
  • the input unit 402 is used for inputting the image to be recognized to the image recognition model.
  • the image recognition model is trained by the training method as described above.
  • the recognition unit 404 is configured to use the image recognition model to recognize the image to be recognized and output the image recognition result. So far, the image recognition device according to some embodiments of the present disclosure is provided.
  • the image recognition model used in the image recognition device has been trained by the aforementioned training method, the accuracy of image recognition can be improved in the process of using the image recognition model to recognize the image to be recognized.
  • the above-mentioned units are only logical modules divided according to the specific functions they implement, and are not used to limit specific implementation methods. For example, they can be implemented in software, hardware, or a combination of software and hardware. In actual implementation, each of the above units may be implemented as an independent physical entity, or may also be implemented by a single entity (for example, a processor (CPU or DSP, etc.), an integrated circuit, etc.). In addition, the operations/functions implemented by the above units may be implemented by the processing circuit itself.
  • the device may also include a memory, which may store various information generated during operation of the device, each unit included in the device, programs and data used for operation, data to be sent by the communication unit, etc. .
  • the memory can be volatile memory and/or non-volatile memory.
  • the memory may include but not limited to random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), read only memory (ROM), and flash memory.
  • RAM random access memory
  • DRAM dynamic random access memory
  • SRAM static random access memory
  • ROM read only memory
  • flash memory may also be located external to the device.
  • the device may also include a communication unit, which can be used to communicate with other devices.
  • the communication unit may be implemented in an appropriate manner known in the art, for example, including communication components such as an antenna array and/or a radio frequency link, various types of interfaces, a communication unit, and the like. It will not be described in detail here.
  • the device may further include other components not shown, such as a radio frequency link, a baseband processing unit, a network interface, a processor, a controller, and the like. It will not be described in detail here.
  • Some embodiments of the present disclosure also provide an electronic device.
  • Figure 5 shows a block diagram of some embodiments of an electronic device of the present disclosure.
  • the electronic device 5 can be various types of devices, such as but not limited to mobile phones, notebook computers, digital broadcast receivers, PDA (personal digital assistant), PAD (tablet computer), Mobile terminals such as PMP (Portable Multimedia Player), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like.
  • the electronic device 5 may include a display panel for displaying data and/or execution results utilized in the solutions according to the present disclosure.
  • the display panel can be in various shapes, such as a rectangular panel, an oval panel, or a polygonal panel.
  • the display panel can be not only a flat panel, but also a curved panel, or even a spherical panel.
  • the electronic device 5 of this embodiment includes: a memory 51 and a processor 52 coupled to the memory 51 .
  • the components of the electronic device 5 shown in FIG. 5 are only exemplary rather than limiting, and the electronic device 5 may also have other components according to actual application requirements.
  • Processor 52 may control other components in electronic device 5 to perform desired functions.
  • memory 51 is used to store one or more computer readable instructions. When the processor 52 is used to execute computer-readable instructions, the computer-readable instructions are executed by the processor 52 to implement the method according to any of the foregoing embodiments.
  • the processor 52 and the memory 51 may directly or indirectly communicate with each other.
  • the processor 52 and the memory 51 may communicate through a network.
  • the network may include a wireless network, a wired network, and/or any combination of a wireless network and a wired network.
  • the processor 52 and the memory 51 may also communicate with each other through the system bus, which is not limited in the present disclosure.
  • the processor 52 may be embodied as various appropriate processors, processing devices, etc., such as a central processing unit (CPU), a graphics processing unit (Graphics Processing Unit, GPU), a network processor (NP), etc.; it may also be a digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other Programmable Logic Devices, Discrete Gate or Transistor Logic Devices, Discrete Hardware Components.
  • the central processing unit (CPU) may be an X86 or ARM architecture and the like.
  • memory 51 may include any combination of various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory.
  • the memory 51 may include, for example, a system memory, and the system memory stores, for example, an operating system, an application program, a boot loader (Boot Loader), a database, and other programs.
  • Various application programs, various data, and the like can also be stored in the storage medium.
  • when various operations/processing according to the present disclosure are implemented by software and/or firmware, they can be transferred from a storage medium or a network to a computer system with a dedicated hardware structure, such as shown in FIG. 6
  • the computer system 600 shown is installed with programs constituting the software. When various programs are installed on the computer system, various functions can be performed, including the functions described above.
  • FIG. 6 is a block diagram illustrating an example structure of a computer system employable in a computer system according to an embodiment of the present disclosure.
  • a central processing unit (CPU) 601 executes various processes according to programs stored in a read only memory (ROM) 602 or programs loaded from a storage section 608 to a random access memory (RAM) 603 .
  • ROM read only memory
  • RAM random access memory
  • the central processing unit is only exemplary, and it may also be other types of processors, such as the various processors mentioned above.
  • the ROM 602, RAM 603, and storage portion 608 may be various forms of computer-readable storage media, as described below. It should be noted that although the ROM 602, the RAM 603 and the storage device 608 are shown separately in FIG. 6, one or more of them may be combined or located in the same or different memories or storage modules.
  • the CPU 601 , ROM 602 , and RAM 603 are connected to each other via a bus 604 .
  • the input/output interface 605 is also connected to the bus 604 .
  • the following components are connected to the input/output interface 605: an input part 606, such as a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output part 607, including a display, such as a cathode ray tube (CRT ), a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage part 608, including a hard disk, a magnetic tape, etc.; and a communication part 609, including a network interface card such as a LAN card, a modem, and the like.
  • CTR cathode ray tube
  • LCD liquid crystal display
  • a speaker a vibrator
  • a storage part 608 including a hard disk,
  • the communication section 609 allows communication processing to be performed via a network such as the Internet. It is easy to understand that although it is shown in FIG. 6 that each device or module in the electronic device 600 communicates through the bus 604, they may also communicate through a network or other methods, where the network may include a wireless network, a wired network , and/or any combination of wireless and wired networks.
  • a driver 610 is also connected to the input/output interface 605 as needed.
  • a removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is mounted on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
  • the processes described above with reference to the flowcharts may be implemented as computer software programs.
  • the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program code for executing the method shown in the flowchart.
  • the computer program can be downloaded and installed from the network through the communication section 609 , or installed from the storage section 608 , or installed from the ROM 602 .
  • a computer-readable medium may be a tangible medium, which may contain or be stored for use by an instruction execution system, device, or device or in combination with an instruction execution system, device, or device. program.
  • a computer readable medium may be a computer readable signal medium or a computer readable storage medium or any combination of the two.
  • a computer-readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof.
  • Computer-readable storage media may include, but are not limited to: electrically connected, portable Disk, Hard Disk, Random Access Memory (RAM), Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM or Flash), Optical Fiber, Portable Compact Disk Read Only Memory (CD-ROM), Optical Memory components, magnetic storage devices, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, device, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program codes are carried.
  • the propagated data signal may take various forms, including but not limited to electromagnetic signal, optical signal, or any suitable combination of the above.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable signal medium may send, propagate or transmit a program for use by or in combination with an instruction execution system, apparatus or device .
  • the program code contained on the computer readable medium can be transmitted by any appropriate medium, including but not limited to: electric wire, optical cable, RF (radio frequency), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist independently without being assembled into the electronic device.
  • a computer program including: instructions, and when executed by a processor, the instructions cause the processor to execute the method in any one of the above embodiments.
  • instructions may be embodied as computer program code.
  • the computer program codes for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, the above-mentioned programming languages include but not limited to object-oriented programming languages, Such as Java, Smalltalk, C++, also includes conventional procedural programming languages, such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external connect) .
  • LAN local area network
  • WAN wide area network
  • each block in the flowchart or block diagram may represent a module, program segment, or part of code that contains one or more logic functions for implementing the specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures.
  • two Blocks shown in succession may, in fact, be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block in the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented by a dedicated hardware-based system that performs specified functions or operations , or may be implemented by a combination of special purpose hardware and computer instructions.
  • modules, components or units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of a module, component or unit does not constitute a limitation of the module, component or unit itself under certain circumstances.
  • the functions described herein above may be performed at least in part by one or more hardware logic components.
  • exemplary hardware logic components include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Product (ASSP), System on Chip (SOC), Complex Programmable Logical device (CPLD) and so on.
  • a training method for an image recognition model including: obtaining image samples of multiple categories; inputting image samples of each category into a feature extraction layer of the image recognition model, to extracting the feature vector of each image sample; calculating the statistical feature information of the actual distribution function corresponding to each category according to the feature vector of each image sample of each category; according to the feature vector corresponding to each category Statistical feature information of the actual distribution function, establishing an augmented distribution function corresponding to each category; obtaining augmented sample features of each category based on the augmented distribution function corresponding to each category; The feature vector of the image sample and the augmented sample features are input to the classification layer of the image recognition model for supervised learning.
  • the statistical feature information includes first statistical feature information and second statistical feature information; the step of establishing an augmented distribution function corresponding to each category includes: calculating an actual distribution corresponding to the plurality of categories The average value of the second statistical feature information of the function; and using the average value of the second statistical feature information and the first statistical feature information of each category as statistical feature parameters, establishing an augmented distribution corresponding to each category function.
  • the first statistical feature information is the mean value of the actual distribution function
  • the second statistical feature information is the variance or standard deviation of the actual distribution function.
  • the step of obtaining image samples of multiple categories includes: sampling image samples of multiple categories under the same attribute, so as to obtain at least part of image samples of each category.
  • the number of image samples collected for each category among the plurality of categories is substantially equal.
  • the step of sampling image samples of multiple categories under the same attribute includes: if the actual number of image samples of a first category among the multiple categories is less than At least some of the image samples of the first category are resampled.
  • the step of sampling image samples of a plurality of categories under the same attribute includes: if the actual number of image samples of a second category in the plurality of categories is equal to is the planned number of image samples of the second category, all image samples of the second category are collected.
  • the step of sampling image samples of multiple categories under the same attribute includes: if the actual number of image samples of a third category among the multiple categories is greater than that of the third category the planned number of image samples of the third category, then some image samples of the third category are collected.
  • the step of obtaining the augmented sample features of each class based on the augmented distribution function corresponding to each class includes: sampling the augmented distribution function corresponding to each class, and obtaining the corresponding Augmented sample features for each class.
  • the number of acquired image samples of each category is equal to the number of augmented sample features of each category.
  • both the actual distribution function and the augmented distribution function are Gaussian distribution functions.
  • the attribute represents a certain part of the human face; the category is an appearance category of the certain part of the human face; the image sample includes an image of the certain part of the human face sample.
  • the function type of the augmented distribution function is the same as the function type of the actual distribution function.
  • the image recognition model is a convolutional neural network. According to some other embodiments of the present disclosure, an image recognition method is provided, including: inputting an image to be recognized into an image recognition model, wherein the image recognition model is trained by the aforementioned training method; and using the The image recognition model recognizes the image to be recognized and outputs an image recognition result.
  • a training device for an image recognition model including: a first acquisition unit, configured to acquire image samples of multiple categories; a feature extraction unit, configured to extract each category The image samples are input into the feature extraction layer of the image recognition model to extract the feature vector of each image sample; the calculation unit is used to calculate the Statistical characteristic information of the corresponding actual distribution function; an augmented distribution function establishing unit, configured to establish an augmented distribution function corresponding to each category according to the statistical characteristic information of the actual distribution function corresponding to each category; The second obtaining unit obtains the augmented sample characteristics of each class based on the augmented distribution function corresponding to each class feature; and a supervised learning unit, configured to input the feature vector of the image sample and the augmented sample features into the classification layer of the image recognition model for supervised learning.
  • an image recognition device including: an input unit, configured to input an image to be recognized into an image recognition model, wherein the image recognition model is trained by the aforementioned training method and a recognition unit, configured to use the image recognition model to recognize the image to be recognized and output an image recognition result.
  • an electronic device including: a memory; and a processor coupled to the memory, the processor is configured to execute the above-described instructions based on instructions stored in the memory described method.
  • a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the aforementioned method is implemented.
  • a computer program including: instructions, and when executed by a processor, the instructions cause the processor to execute the method of any embodiment described in the present disclosure.
  • a computer program product is provided, including instructions, and when the instructions are executed by a processor, the method of any embodiment described in the present disclosure is implemented.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Human Computer Interaction (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Image Analysis (AREA)

Abstract

本公开提供了一种用于图像识别模型的训练方法及其装置、图像识别方法。训练方法包括:获得多个类别的图像样本;将每个类别的图像样本输入到图像识别模型的特征提取层中,以提取每个图像样本的特征向量;根据每个类别的每个图像样本的特征向量,计算与每个类别对应的实际分布函数的统计特征信息;根据与每个类别对应的实际分布函数的统计特征信息,建立与每个类别对应的增广分布函数;基于与每个类别对应的增广分布函数获得所述每个类别的增广样本特征;以及将图像样本的特征向量和增广样本特征输入到图像识别模型的分类层中进行监督学习。

Description

用 于图 像 识别 棋型 的 训练 方 法及 其 装匿 、 图像识 别方 法 相关 申请的交叉引用 本 申请是以申请号为 202110863490.8, 申请日为 2021年 7月 29 日的中国申请为基 础, 并主张其优先权, 该中国申请的公开内容在此作为整体引入本申请中。 技术领域 本公开涉及图像识别技 术领域, 特别涉及一种用于图像识别模型的训练方法 及其 装置、 图像识别方法。 背景技术 在图像识别领域的模型 训练阶段, 会存在数据不平衡问题, 这是指数据集中的各 个类别的样 本数目极不平衡。 这是一个较难解决的问题, 并且广泛分布于现实中的数 据收集中 。 目前, 解决数据不平衡的方案主要分为两种, 一种方案是从数据层面解决 该问题, 另一种方案是从损失函数层面 解决该问题。 在数据层面, 通常通过对数据进行欠采样、 过采样或者数据增强的方式来对 数据 进行扩充 , 以期能够缓解模型对少样本类别的学习问题。 欠采样和过采样是通过改变 样本被采样 的概率, 使少样本类别的样本能够被多次训练来改善 少样本识别率较差的 问题。 数据増强是通过对少样本类别 的样本添加噪声来对少样本 类别的数据进行扩充, 噪声的添加 分为多种, 比如: 旋转、 翻转等。 这些对数据的操作确实可以在一定程度 上缓解样本 不平衡问题, 但是这些简单的操作可能会造成信息丢 失或者导致模型在少 样本类别上 过拟合。 在损失函数层面, 通常通过改进损失函数来着重 惩罚少样本类别的损失 。 对少样 本类别的损 失着重加权, 可以在一定程度上缓解少样本类别 的识别问题。 但是, 加权 的参数往往 需要根据经验或者模型训 练来获得, 在不同的任务上往往需要进行大量实 验进行参数 搜索, 而且同一套参数无法泛化到所有任务。 发明内容 提供该发明内容部分 以便以简要的形式介绍构思 , 这些构思将在后面的具体实施 方式部分被 详细描述。 该发明内容部分并不旨在标识要求保护 的技术方案的关键特征 或必要特征 , 也不旨在用于限制所要求的保护的技术方案的范 围。 根据本公开的一些实施 例, 提供了一种用于图像识别模型的训练方法, 包括: 获 得多个类别 的图像样本; 将每个类别的图像样本输入到图像识别 模型的特征提取层中, 以提取每个 图像样本的特征向量; 根据每个类别的所述每个 图像样本的特征向量, 计 算与所述每 个类别对应的实际分布 函数的统计特征信息; 根据与所述每个类别对应的 实际分布 函数的统计特征信息, 建立与所述每个类别对应的增广 分布函数; 基于与所 述每个类别 对应的增广分布函数获得所 述每个类别的增广样本特征 ; 以及将所述图像 样本的特 征向量和所述增 广样本特征输入 到所述图像识别 模型的分类层 中进行监督 学习。 根据本公开的另一些实施 例, 提供了一种图像识别方法, 包括: 向图像识别模型 输入待识别 图像, 其中, 所述图像识别模型通过如前所述的训练方法进行训练; 以及 利用所述 图像识别模型对所述待识别 图像进行识别并输出图像识 别结果。 根据本公开的另一 些实施例, 提供了一种用于图像识别模型 的训练装置, 包括: 第一获取单 元, 用于获得多个类别的图像样本; 特征提取单元, 用于将每个类别的图 像样本输入 到图像识别模型的特征提 取层中, 以提取每个图像样本的特征向量; 计算 单元, 用于根据每个类别的所述每个 图像样本的特征向量, 计算与所述每个类别对应 的实际分布 函数的统计特征信息; 增广分布函数建立单元, 用于根据与所述每个类别 对应的实 际分布函数的统计特征信息 , 建立与所述每个类别对应的增广分布函数; 第 二获取单元 , 基于所述每个类别对应的増广分布函数获得所述每 个类别的增广样本特 征; 以及监督学习单元, 用于将所述图像样本的特征向量和所述 増广样本特征输入到 所述图像识 别模型的分类层中进行监 督学习。 根据本公开的另一些实施 例, 提供了一种图像识别装置, 包括: 输入单元, 用于 向图像识别 模型输入待识别图像, 其中, 所述图像识别模型通过如前所述的训练方法 进行训练 ; 以及识别单元, 用于利用所述图像识别模型对所述待识别图像进行识别并 输出图像识 别结果。 根据本公开的另一些实施 例, 提供了一种电子设备, 包括: 存储器; 以及耦接至 所述存储器 的处理器, 所述处理器被配置为基于存储在所述存储 器的指令执行本公开 中所述的任 一实施例的方法。 根据本公开的另一些实施 例, 提供了一种计算机可读存储介质, 其上存储有计算 机程序指令 , 该计算机程序指令被处理器执行时实现本公开 中所述的任一实施例的方 法。 根据本公开的另一些实施 例, 提供了一种计算机程序, 包括: 指令, 所述指令当 由处理器执 行时使所述处理器执行本 公开中所述的任一实施例 的方法。 根据本公开的另一些实施 例, 提供了一种计算机程序产品, 包括指令, 所述指令 当由处理器 执行时使所述处理器执行 本公开中所述的任一实施例 的方法。 通过以下参照附图对本 公开的示例性实施例的详 细描述, 本公开的其它特征、 方 面及其优 点将会变得清楚。 附图说明 下面参照附图说明本公 开的优选实施例。 此处所说明的附图用来提供对本公 开的 进一步理解 , 各附图连同下面的具体描述一起包含在本说明书 中并形成说明书的一部 分, 用于解释本公开。 应当理解的是, 下面描述中的附图仅仅涉及本公开的一些实施 例, 而非对本公开构成限制。 在附图中: 图 1是示出根据本公开一些实施 例的用于图像识别模型 的训练方法的流程图; 图 2是示出根据本公开一些实施 例的图像识别方法的流程 图; 图 3是示出根据本公开一些实施 例的用于图像识别模型 的训练装置的结构示意图; 图 4是示出根据本公开一些实施 例的图像识别装置的结构示 意图; 图 5是示出根据本公开一些实施 例的电子设备的结构示意 图; 图 6是示出根据本公开另一些实 施例的电子设备的结构示 意图; 图 7是示出根据本公开一些实施 例的图像识别模型的结构示 意图。 应当明白, 为了便于描述, 附图中所示出的各个部分的尺寸并不一定是按照 实际 的比例关系 绘制的。 在各附图中使用了相同或相似的附图标记来 表示相同或者相似的 部件。 因此, 一旦某一项在一个附图中被定义, 则在随后的附图中可能不再对其进行 进一步讨论 。 具体实施方式 下面将结合本公开实施 例中的附图, 对本公开实施例中的技术方案进行清 楚、 完 整地描述 , 但是显然, 所描述的实施例仅仅是本公开一部分实施例, 而不是全部的实 施例。 以下对实施例的描述实际上也仅仅是说明性的, 决不作为对本公开及其应用或 使用的任何 限制。 应当理解的是, 本公开可以通过各种形式来实现, 而且不应该被解 释为限于这 里阐述的实施例。 应当理解, 本公开的方法实施方式中记 载的各个步骤可 以按照不同的顺序执行 , 和 /或并行执行。此外,方法实施方式可以包括附加的步骤和 /或省略执行示出的步骤。 本公开的范 围在此方面不受限制 。 除非另外具体说明, 否则在这些实施例中阐述的部 件和步骤 的相对布置、 数字表达式和数值应被解释为仅仅是示例 性的, 不限制本公开 的范围 。 本公开中使用的术语“包括”及其 变型意指至少包括后面 的元件 /特征、但不排除其 他元件 /特征的开放性术语, 即 “包括但不限于”。 此外, 本公开使用的术语 “包含 ”及其 变型意指至 少包含后面的元件 /特征、 但不排除其他元件 /特征的开放性术语, S卩 “包含 但不限于 ”。 因此, 包括与包含是同义的。 术语“基于”意指“至少部分地基于 ”。 整个说明书中所称“一个实施 例”、 “一些实施例”或“实施例”意味着与实施例结合 描述的特定 的特征、结构或特性被包括在本发 明的至少一个实施例中 。例如, 术语“一 个实施例”表示“至少 一个实施例 ”; 术语“另一实施例”表示“至少一个另外的实施例 ”; 术语“一些实施例”表 示“至少一些实施例 ”。而且, 短语“在一个实施例中 ”、 “在一些实 施例中”或 “在实施例中 ”在整个说明书中各个地方的出现不 一定全都指的是同一 个实 施例, 但是也可以指同一个实施例 。 需要注意, 本公开中提及的 “第一 ”、 “第二”等概念仅用于对不同的装置、 模块或 单元进行 区分, 并非用于限定这些装置、 模块或单元所执行的功能的顺序或者相互依 存关系 。 除非另有指定, 否则“第一”、 “第二 ”等概念并非意图暗示如此描述的对象必 须按时间上 、 空间上、 排名上的给定顺序或任何其他方式的给定顺序。 需要注意, 本公开中提及的 “一个 ”、 “多个 ”的修饰是示意性而非限制性的, 本领 域技术人 员应当理解, 除非在上下文另有明确指出 , 否则应该理解为 “一个或多个 ”。 本公开实施方 式中的多个装置之 间所交互的消 息或者信息的名称 仅用于说明性 的目的, 而并不是用于对这些消息或 信息的范围进行限制。 下面结合附图对本公开 的实施例进行详细说明 , 但是本公开并不限于这些具体的 实施例 。 下面这些具体实施例可以相互结合, 对于相同或者相似的概念或过程可能在 某些实施例 不再赘述。 此外, 在一个或多个实施例中, 特定的特征、 结构或特性可以 由本领域 的普通技术人员从本公开将 清楚的任何合适的方式组合 。 应理解, 本公开对于如何获得待应用 /待处理的图像也不做限制。在本公开的一个 实施例 中, 可以从存储装置, 例如内部存储器或者外部存储装置获取, 在本公开的另 一个实施例 中, 可以调动摄影组件来拍摄。 需要说明的是, 所获取的图像可以是一张 采集到的 图像, 也可以是采集到的视频中的一帧图像, 并不特别局限于此。 在本公开的上下文中 , 图像可指的是多种图像中的任一种, 诸如彩色图像、 灰度 图像等。 应指出, 在本说明书的上下文中, 图像的类型未被具体限制。 此外, 图像可 以是任何适 当的图像, 例如由摄像装置获得的原始图像, 或者已对原始图像进行过特 定处理的 图像, 例如初步过滤、 去混叠、 颜色调整、 对比度调整、 规范化等等。 应指 出, 预处理操作还可以包括本领域 已知的其它类型的预处理操作 , 这里将不再详细描 述。 本公开解决的技术问题之 一是提升少样本类别 的样本数量, 从而提髙模型训练的 准确率。 鉴于此, 本公开提供了根据本公开一些 实施例的用于图像识 别模型的训练方法 。 下面结合 附图详细描述该用于图像识别 模型的训练方法。 图 1是示出根据本公开一些实施 例的用于图像识别模型 的训练方法的流程图。 该 训练方法包括 步骤 S102至 S112。 图 7是示出根据本公开一些实施例的图像识别模型 的结构示意 图。 下面结合图 1和图 7详细描述该训练方法。 如图 1所示, 在步骤 S102, 获得多个类别的图像样本。 在一些实施例中, 该步骤 S102包括: 对在同一属性下的多个类别的图像样 本进 行采样, 以获得每个类别的至少部分的图像样本。 例如, 在该多个类别中采集得到的 每个类别 的图像样本的数量基本相等 。 即, 对各个类别进行类均衡采样。 需要说明的是, 这里的 “基本相等”包括但不限于绝对的相等, 而是可以稍微不相 等。例如, 第一类别具有 200个图像样本, 第二类别具有 2000个图像样本, 从第一类 别的 200个图像样本中采集 150个样本,从第二类别的 2000个图像样本中采集 200个 样本, 则可以认为从第一类别采集的样 本数量与从第二类别采集 的样本数量基本相等。 也就是说 , 在一些实施例中, 采集得到的不同类别的图像样本的数量可以存着一定的 差异, 只要该差异在预定的范围内即可 , 或者说, 只要该差异在可以接受的范围内即 可。 当然, 本领域技术人员能够理解, 这里关于样本数量的举例仅是示例性的, 并不 作为对本公开 的样本数量的限制。 在一些实施例中 , 对在同一属性下的多个类别的图像样本进 行采样的步骤包括 : 如果上述 多个类别中的第 一类别所具有 的图像样本的实际 数量小于对该第 一类别采 集的图像样本 的计划数量, 则对该第一类别的至少部分图像样本 进行重复采样。 例如,多个类别中的第一类别具有 200个图像样本,当计划从第一类别中采集 300 个图像样本 时, 由于第一类别所具有的图像样本的实际数量小于 对该第一类别采集的 图像样本 的计划数量, 则可以在全部采集完这 200个图像样本后, 对这 200个图像样 本中的部分 图像样本 (例如这 200个图像样本中的 100个图像样本) 进行重复采样, 从而满足 300个图像样本的计划数量。 在一些实施例中 , 对在同一属性下的多个类别的图像样本进 行采样的步骤包括: 如果多个 类别中的第二类 别所具有的图像 样本的实际数量 等于对该第二类 别采集的 图像样本 的计划数量, 则采集该第二类别的全部图像样本。 例如,多个类别中的第二类别具有 300个图像样本,当计划从第二类别中采集 300 个图像样本 时, 由于第二类别所具有的图像样本的实际数量正好 等于对该第二类别采 集的图像样 本的计划数量, 则采集该第二类别的全部图像样本 。 在一些实施例中 , 对在同一属性下的多个类别的图像样本进 行采样的步骤包括: 如果多个 类别中的第三类 别所具有的图像 样本的实际数量 大于对该第三类 别采集的 图像样本 的计划数量, 则采集该第三类别的部分图像样本。 例如, 多个类别中的第三类别具有 2000个图像样本, 当计划从第三类别中采集 300 个图像样本时, 由于第三类别所具有的图像样本 的实际数量大于对该第三类 别采 集的图像样 本的计划数量, 则采集该第三类别的部分图像样本 。 例如, 可以从第三类 别的 2000个图像样本中随机采集 300个图像样本。 在一些实施例中, 上述图像识别模型用于人脸识 别领域。 在这样的情况下, 上述 属性表示人 脸的某个部位。 例如, 上述属性包括眼睛、 眉毛、 鼻子等。 上述类别为人 脸的该某个 部位的外形类别。 例如, 眼睛可以分别大、 中、 小等三个类别, 眉毛可以 分为粗、 中、 细等三个类别、 鼻子分为高、 中、 低等三个类别, 等等。 图像样本包括 人脸的该某 个部位的图像样本。 例如, 图像样本可以包括眼睛的图像样本、 眉毛的图 像样本或鼻 子的图像样本, 等等。 在步骤 S104, 将每个类别的图像样本输入到图像识别模型 的特征提取层 (如图 7 所示的特征 提取层 702) 中, 以提取每个图像样本的特征向量。 良口, 在该步骤中, 将通过步骤 S102获得的每个类别的图像样本输入到图像识别 模型中, 通过图像识别模型的特征提 取层提取出每个图像样本 的特征向量。 例如, 图 像识别模型 为卷积神经网络。 在步骤 S106 中, 根据每个类别的每个图像样本的特征向量, 计算与该每个类别 对应的实 际分布函数的统计特征信息 。 这里, 对于通过步骤 S102采集得到的每个类别 的图像样本, 这些图像样本的特 征向量可 以符合某种实际分布函数 。 例如, 该实际分布函数为髙斯分布函数。 通过采 用已知的计 算方法, 可以得到该实际分布函数的统计特征信息 。 在一些实施例中 , 该统计特征信息包括第一统计特征信息和 第二统计特征信息 。 例如, 第一统计特征信息为实际分布 函数的均值, 第二统计特征信息为实际分布函数 的方差或标 准差。 例如, 在实际分布函数为髙斯分布函数的情况下 , 可以计算得到与每个类别对应 的髙斯分布 函数的均值或方差 (也可以是标准差) 。 例如, 某个属性包括 N个类别, N 为正整数, 则可以计算得到与每个类别 i(IS N, 且 i为正整数) 对应的均值 和 方差 of (或者标准差 ) 。 在本公开的实施例中 , 某个类别 i的均值是表征该类别 i的本质信息, 该类别的 方差 (或标准差) 表示该类别内样本的多样性, 并不代表类别信息, 这种多样性是可 以迁移的 。 单一属性分类任务的各 个类别是同质的。 例如, 眼睛的大、 中、 小都是代表眼睛 大小的类别 , 可以认为单一属性下各个类别的分布是相似的 , 关注的重点都是眼睛的 大小。 在步骤 S108 中, 根据与每个类别对应的实际分布函数的统计特征信息, 建立与 该每个类别 对应的增广分布函数。 例如, 该増广分布函数的函数类型与该实际分布函 数的函数类 型相同。 例如, 实际分布函数和增广分布函数均为髙斯分布函数。 在一些实施例中, 步骤 S108包括: 计算与多个类别对应的实际分布函数 的第二 统计特征信 息的平均值; 以及以第二统计特征信息的平均值和每 个类别的第一统计特 征信息作为 统计特征参数, 建立与该每个类别对应的增广分布 函数。 例如, 第二统计特征信息为方差, 可以计算与 N个类别对应的高斯分布函数的方 差的平均值 7 =
Figure imgf000009_0001
Figure imgf000009_0002
(该方差的平均值可以近似代表这一属性的多样性 ,可以称为类 别平均方差 );然后以该方差的平均值 7作为某个类别 i的新方差, 以及以该类别 i的 均值 作为均值,建立与该类别 i对应的新的髙斯分布函数,作为该类别 i的增广分布 函数。 又例如, 第二统计特征信息为标准差, 可以计算与 N个类别对应的髙斯分布函数 的标准差 的平均值 = ¥ N ; 然后以该标准差的平均值 乍为某个类别 i的新标准差, 以及以该类 别 i的均值 作为均值,建立与该类别 i对应的新的高斯分布函数,作为该 类别 i的增广分布函数。 在步骤 S110 中, 基于与每个类别对应的增广分布函数获得该每个类别的增广样 本特征。 在一些实施例中,该步骤 S110包括:对每个类别对应的增广分布函数进行采样, 获得对应 的每个类别的增广样本特征 。这里,该增广样本特征即为增广样本特征向量。 在一些实施例中, 采集得到的每个类别的图像样本 的数目与该每个类别的增广 样 本特征的数 目相等。例如,在执行步骤 S102的过程中,从每个类别中采集了 300个图 像样本, 则在执行步骤 S110的过程中, 从每个类别的增广分布函数中也采集 300个 样本。 这样, 在后续训练的过程中, 在提升少样本类别的多样性和泛化 能力的同时, 基本不会影 响多样本类别的识别。 经过上面的步骤, 通过增广操作获取了增广样本特征 , 如图 7所示。 在步骤 S112 中, 将图像样本的特征向量和增广样本特征输入到图像识别模型的 分类层 (如图 7所示的分类层 704) 中进行监督学习。 在一些实施例中, 步骤 S112包括: 将图像样本的特征向量和增广样本特征输 入 到图像识别模 型的分类层 704 中以输出与图像样本和増广样本对应的图像识别结果; 根据图像识 别结果与图像样本和増广样 本的标注值的差异计算损 失函数值; 以及根据 损失函数值 调整图像识别模型的参数 。 可以重复执行上述步骤 以满足训练结束条件。 例如, 该训练结束条件可以是训练 次数阈值或损 失函数值小于函数阈值 。即,当训练次数达到训练次数阈值时结束训练 , 或者当经过循 环调整, 使得损失函数值小于函数阈值时结束训练 。 至此, 提供了根据本公开一些实施例的用于图像识 别模型的训练方法。 该训练方 法包括: 获得多个类别的图像样本 ; 将每个类别的图像样本输入到图像识别模型的特 征提取层 中, 以提取每个图像样本的特征向量; 根据每个类别的每个图像样本的特征 向量, 计算与每个类别对应的实际分布 函数的统计特征信息; 根据与每个类别对应的 实际分布 函数的统计特征信息, 建立与该每个类别对应的增广分布 函数; 基于每个类 别对应的增广 分布函数获得每个类别 的增广样本特征; 以及将图像样本的特征向量和 增广样本特征 输入到图像识别模型的分类 层中进行监督学习。 该训练方法能够提升少 样本类别 的样本数量, 缓解样本不均衡问题, 从而提高模型训练的准确率。 上述方法在特征 层面利用多样本 类别的分布先验 对少样本类别数 据进行数据增 广, 从而优化少样本类别的识别准确率 。 对于单一人脸属性的识别任务而言, 数据的 不平衡是经 常存在的问题, 在数据收集过程中几乎无法收集数据 多样性强并且类别平 衡的数据集 。 在某些极端的情况下, 甚至会造成数据严重不平衡, 导致训练过程中模 型偏差严重 , 几乎无法使用。 对于这些少样本类别, 本公开的上述方法为这些少样本 类别添加增广 样本来提升少样本的识别 准确率, 增强少样本的泛化能力。 对于多样本 类别, 由于自身样本的多样性, 因此, 上述方法的数据增广方式在提升少样本类别的 多样性和泛化 能力的同时, 基本不会影响多样本类别的识别, 这样减少对多样本类别 识别准确率 的损害。 图 2是示出根据本公开一些实施 例的图像识别方法的流程 图。 如图 2所示, 该图 像识别方法包 括步骤 S202至 S204。 在步骤 S202, 向图像识别模型输入待识别图像。该图像识别模型通过如前所 述的 训练方法进 行训练。 在步骤 S204, 利用图像识别模型对待识别图像进行识别并输 出图像识别结果。 至此, 提供了根据本公开一些实施例的图像识别方 法。 由于该图像识别方法中采 用的图像识 别模型己经通过如前所述 的训练方法进行训练, 因此在利用该图像识别模 型对待识别 图像进行识别的过程中 , 可以提高图像识别的准确率。 图 3是示出根据本公开一些实施例 的用于图像识别模型 的训练装置的结构示意图。 如图 3所示, 该训练装置包括第一获取单元 302、 特征提取单元 304、 计算单元 306、 増广分布 函数建立单元 308、 第二获取单元 310和监督学习单元 312。 第一获取单元 302用于获得多个类别的图像样本。 例如, 第一获取单元 302用于 对在同一属 性下的多个类别的图像样本 进行采样, 以获得每个类别的至少部分的图像 样本。 例如, 在多个类别中采集得到的每个类别的图像样 本的数量基本相等。 在一些实施例中, 第一获取单元 302用于如果所述多个类别中的第 一类别所具有 的图像样本 的实际数量小于对该第一类 别采集的图像样本的计划 数量, 则对该第一类 别的至少部 分图像样本进行重复采样 。 在另一些实施例中, 第一获取单元 302还用于如果所述多个类别 中的第二类别所 具有的图像样 本的实际数量等于对该第 二类别采集的图像样本 的计划数量, 则采集该 第二类别 的全部图像样本。 在另一些实施例中, 第一获取单元 302还用于如果所述多个类别 中的第三类别所 具有的 图像样本的实际数量大于对该 第三类别采集的图像样本 的计划数量, 则采集该 第三类别 的部分图像样本。 特征提取单元 304用于将每个类别的图像样本输入到图像识别模 型的特征提取层 中, 以提取每个图像样本的特征向量 。 计算单元 306用于根据每个类别的每个 图像样本的特征向量, 计算与该每个类别 对应的实 际分布函数的统计特征信息 。 在一些实施例中, 统计特征信息包括第一统计特征 信息和第二统计特征信 息。 例 如, 第一统计特征信息为实际分布 函数的均值, 第二统计特征信息为实际分布函数的 方差或标准 差。 增广分布函数建立单元 308用于根据与每个类别对应的实际分布 函数的统计特征 信息, 建立与该每个类别对应的增广分 布函数。 例如, 增广分布函数的函数类型与实 际分布函数 的函数类型相同。例如,实际分布函数和增广分布 函数均为髙斯分布函数 。 在一些实施例中, 增广分布函数建立单元 308用于计算与多个类别对应的实际分 布函数的第 二统计特征信息的平均值 , 以及以第二统计特征信息的平均值和每个类别 的第一统计 特征信息作为统计特征参 数, 建立与每个类别对应的增广分布函数。 第二获取单元 310用于基于每个类别对应的增广分布函数获得每个 类别的增广样 本特征 。 例如, 第二获取单元 310用于对每个类别对应的增广分布函数进行采样, 获 得对应的每 个类别的增广样本特征 。 在一些实施例中, 第一获取单元 302采集得到的每个类别的图像样 本的数目与第 二获取单元 310获得的每个类别的增广样本特征的数 目相等。 监督学习单元 312用于将图像样本的特征向量和増广样本特征输入 到图像识别模 型的分类层 中进行监督学习。 在一些实施例中, 监督学习单元 312用于将图像样本的特征向量和 増广样本特征 输入到 图像识别模型的分类层 中以输出与图像样本 和増广样本对应的 图像识别结果, 根据图像识 别结果与图像样本和増广 样本的标注值的差异计算损 失函数值, 以及根据 损失函数值 调整图像识别模型的参数 。 至此, 提供了根据本公开一些实施例的用于图像识 别模型的训练装置。 该训练装 置能够提升 少样本类别的样本数量 , 缓解样本不均衡问题, 从而提高模型训练的准确 率。 图 4是示出根据本公 开一些实施例的图像识别 装置的结构示意图。 如图 4所示, 该图像识别 装置包括输入单元 402和识别单元 404。 输入单元 402用于向图像识别模型输入 待识别图像。 该图像识别模型通过如前所 述的训练方 法进行训练。 识别单元 404用于利用图像识别模型对 待识别图像进行识别并输 出图像识别结果。 至此, 提供了根据本公开一些实施例的图像识别 装置。 由于该图像识别装置中采 用的图像识 别模型己经通过如前所述 的训练方法进行训练, 因此在利用该图像识别模 型对待识别 图像进行识别的过程 中, 可以提髙图像识别的准确率。 应注意, 上述各个单元仅是根据其所实现的具体 功能划分的逻辑模块, 而不是用 于限制具体 的实现方式, 例如可以以软件、 硬件或者软硬件结合的方式来实现。 在实 际实现 时, 上述各个单元可被实现为独立的物理 实体, 或者也可由单个实体 (例如, 处理器 (CPU或 DSP等)、 集成电路等)来实现。此外, 上述各个单元所实现的操作 /功能可由处理电路本身 来实现。 此外, 尽管未示出, 该设备也可以包括存储器, 其可以存储由设备、 设备所包含 的各个单元 在操作中产生的各种信 息、 用于操作的程序和数据、 将由通信单元发送的 数据等 。存储器可以是易失性存储器和 /或非易失性存储器。例如, 存储器可以包括但 不限于随机 存储存储器 (RAM) 、 动态随机存储存储器(DRAM) 、 静态随机存取存 储器 (SRAM) 、 只读存储器(ROM) 、 闪存存储器。 当然, 存储器可也位于该设备 之外。 可选地, 尽管未示出, 但是该设备也可以包括通信单元, 其可用于与其它装置 进行通信 。 在一个示例中, 通信单元可以被按照本领域己知的适当方式来实现, 例如 包括天线 阵列和 /或射频链路等通信部件, 各种类型的接口、 通信单元等等。 这里将不 再详细描述 。 此外, 设备还可以包括未示出的其它部件, 诸如射频链路、 基带处理单 元、 网络接口、 处理器、 控制器等。 这里将不再详细描述。 本公开的一些实施例还 提供一种电子设备。 图 5示出本公开的电子设备的一些实 施例的框 图。 例如, 在一些实施例中, 电子设备 5可以为各种类型的设备, 例如可以 包括但不 限于诸如移动电话、笔记本电脑、数字广播接 收器、 PDA(个人数字助理)、 PAD (平板电脑) 、 PMP (便携式多媒体播放器) 、 车载终端 (例如车载导航终端) 等等的移动 终端以及诸如数字 TV、台式计算机等等的固定终端。例如, 电子设备 5可 以包括显示 面板,以用于显示根据本公开的方案中所利 用的数据和 /或执行结果。例如, 显示面板可 以为各种形状, 例如矩形面板、 椭圆形面板或多边形面板等。 另外, 显示 面板不仅可 以为平面面板, 也可以为曲面面板, 甚至球面面板。 如图 5所示, 该实施例的电子设备 5包括: 存储器 51以及耦接至该存储器 51的 处理器 52。 应当注意, 图 5所示的电子设备 5的组件只是示例性的, 而非限制性的, 根据实际应 用需要, 该电子设备 5还可以具有其他组件 。 处理器 52可以控制电子设 备 5中的其它组件以执行期望的功能。 在一些实施例中, 存储器 51用于存储一个或多个计算机可读 指令。 处理器 52用 于运行计算机 可读指令时, 计算机可读指令被处理器 52 运行时实现根据上述任一实 施例所述 的方法。 关于该方法的各个步骤的具体实现以及相关解 释内容可以参见上述 的实施例 , 重复之处在此不作赘述。 例如, 处理器 52和存储器 51之间可以直接或间接地互相通信。 例如, 处理器 52 和存储器 51可以通过网络进行通信。 网络可以包括无线网络、 有线网络、 和 /或无线 网络和有线 网络的任意组合。 处理器 52和存储器 51之间也可以通过系统总线实现相 互通信, 本公开对此不作限制。 例如, 处理器 52 可以体现为各种适当的处理器、 处理装置等, 诸如中央处理器 (CPU) 、 图形处理器(Graphics Processing Unit, GPU) 、 网络处理器 (NP) 等; 还可以是数 字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA) 或者其他可 编程逻辑器件、 分立门或者晶体管逻辑器件、 分立硬件组件。 中央处理元 (CPU) 可以为 X86或 ARM 架构等。 例如, 存储器 51可以包括各种形式的计算机 可读存储介 质的任意组合, 例如易失性存储器和 /或非易失性存储器。 存储器 51例如 可以包括 系统存储器, 系统存储器例如存储有操作系统 、 应用程序、 引导装载程序 (Boot Loader) , 数据库以及其他程序等。 在存储介质中还可以存储各种应用程序和 各种数据等 。 另外,根据本公开的一些实施例,根据本公开的各种 操作 /处理在通过软件和 /或固 件实现的情 况下, 可从存储介质或网络向具有专用硬件结构的计算 机系统, 例如图 6 所示的计算 机系统 600 安装构成该软件的程序, 该计算机系统在安装有各种程序时, 能够执行各 种功能, 包括诸如前文所述的功能等等。 图 6是示出根据本公开的实施例 的中可采用 的计算机系统的示例结构 的框图。 在图 6中, 中央处理单元 (CPU) 601根据只读存储器 (ROM) 602中存储的程 序或从存储 部分 608 加载到随机存取存储器 (RAM) 603 的程序执行各种处理。 在 RAM 603中, 也根据需要存储当 CPU 601执行各种处理等时所需的数据。 中央处理 单元仅仅 是示例性的, 其也可以是其它类型的处理 器, 诸如前文所述的各种处理器。 ROM 602、 RAM 603和存储部分 608可以是各种形式的计算机可读存储介质, 如下文 所述。 需要注意的是, 虽然图 6中分别示出了 ROM 602、 RAM 603和存储装置 608, 但是它们 中的一个或多个可以合并或 者位于相同或不同的存储器 或存储模块中。
CPU 601、 ROM 602和 RAM 603经由总线 604彼此连接。 输入 /输出接口 605也 连接到总线 604。 下述部件连接到输入 /输出接口 605: 输入部分 606, 诸如触摸屏、触摸板、键盘、 鼠标、 图像传感器、 麦克风、 加速度计、 陀螺仪等; 输出部分 607, 包括显示器, 比如 阴极射线管 (CRT) 、 液晶显示器 (LCD) , 扬声器, 振动器等; 存储部分 608, 包 括硬盘, 磁带等; 和通信部分 609, 包括网络接口卡比如 LAN卡、 调制解调器等。 通 信部分 609允许经由网络比如因特网执行通信处理。 容易理解的是, 虽然图 6中示出 电子设备 600中的各个装置或模块是通过总线 604来通信的, 但它们也可以通过网络 或其它方式 进行通信, 其中, 网络可以包括无线网络、 有线网络、 和 /或无线网络和有 线网络的任 意组合。 根据需要, 驱动器 610也连接到输入 /输出接口 605。 可拆卸介质 611 比如磁盘、 光盘、 磁光盘、 半导体存储器等等根据需要被安装在驱动器 610上, 使得从中读出的 计算机程序 根据需要被安装到存储部 分 608中。 在通过软件实现上述系 列处理的情况下, 可以从网络比如因特网或存储介质 比如 可拆卸介质 611安装构成软件的程序。 根据本公开的实施例 , 上文参考流程图描述的过程可以被实现为计算机软件 程序。 例如, 本公开的实施例包括一种计算机 程序产品, 其包括承载在计算机可读介质上的 计算机程序 , 该计算机程序包含用于执行流程图所示的方法 的程序代码。 在这样的实 施例中, 该计算机程序可以通过通信 部分 609从网络上被下载和安装, 或者从存储部 分 608被安装, 或者从 ROM 602被安装。 在该计算机程序被 CPU 601执行时, 执行 本公开实施 例的方法中限定的上述功 能。 需要说明的是, 在本公开的上下文中, 计算机可读介质可以是有形的介质 , 其可 以包含或存 储以供指令执行系统、 装置或设备使用或与指令执行 系统、 装置或设备结 合地使用 的程序。 计算机可读介质可以是计算机可读信号介质或 者计算机可读存储介 质或者是上 述两者的任意组合。计算机可读存储介 质例如可以是,但不限于: 电、磁、 光、 电磁、 红外线、 或半导体的系统、 装置或器件, 或者任意以上的组合。 计算机可 读存储介质 的更具体的例子可以包括但 不限于: 具有一个或多个导线的电连接、 便携 式计算机磁盘 、 硬盘、 随机访问存储器(RAM) 、 只读存储器(ROM) 、 可擦式可编 程只读存储器 (EPROM 或 闪存)、光纤、便携式紧凑磁盘只读存储器 (CD-ROM)、 光存储器件 、 磁存储器件、 或者上述的任意合适的组合。 在本公开中, 计算机可读存 储介质可 以是任何包含或存储程序 的有形介质, 该程序可以被指令执行系统、 装置或 者器件使用 或者与其结合使用。 而在本公开中, 计算机可读信号介质可以包括在基带 中或者作为载 波一部分传播的数据信 号, 其中承载了计算机可读的程序代码。 这种传 播的数据信 号可以采用多种形式, 包括但不限于电磁信号、 光信号或上述的任意合适 的组合。 计算机可读信号介质还可 以是计算机可读存储介质 以外的任何计算机可读介 质, 该计算机可读信号介质可以发送 、 传播或者传输用于由指令执行系统、 装置或者 器件使用或 者与其结合使用的程序 。 计算机可读介质上包含的程序代码可以用任何适 当的介质传输 , 包括但不限于: 电线、 光缆、 RF(射频) 等等, 或者上述的任意合适 的组合。 上述计算机可读介质可 以是上述电子设备中所包含 的; 也可以是单独存在, 而未 装配入该 电子设备中。 在一些实施例中, 还提供了一种计算机程序, 包括: 指令, 指令当由处理器执行 时使处理器 执行上述任一个实施 例的方法。 例如, 指令可以体现为计算机程序代码。 在本公开的实施例中 , 可以以一种或多种程序设计语言或其组合来编写用于执 行 本公开的操作 的计算机程序代码, 上述程序设计语言包括但不 限于面向对象的程序设 计语言, 诸如 Java, Smalltalk、 C++, 还包括常规的过程式程序设计语言, 诸如 “C” 语言或类似 的程序设计语言。 程序代码可以完全地在用户计算机 上执行、 部分地在用 户计算机上执 行、 作为一个独立的软件包执行、 部分在用户计算机上部分在远程计算 机上执行 、 或者完全在远程计算机或服务器上执行。 在涉及远程计算机的情形中, 远 程计算机可 以通过任意种类的网络 (包括局域网 (LAN)或广域网 (WAN) ) 连接到 用户计算机 , 或者, 可以连接到外部计算机 (例如利用因特网服务提供商来通过因特 网连接) 。 附图中的流程图和框图 , 图示了按照本公开各种实施例的系统、 方法和计算机程 序产品的可 能实现的体系架构、 功能和操作。 在这点上, 流程图或框图中的每个方框 可以代表一个 模块、 程序段、 或代码的一部分, 该模块、 程序段、 或代码的一部分包 含一个或多个 用于实现规定的逻辑功 能的可执行指令。 也应当注意, 在有些作为替换 的实现中 , 方框中所标注的功能也可以以不同于附图中所标注 的顺序发生。 例如, 两 个接连地表 示的方框实际上可以基本 并行地执行, 它们有时也可以按相反的顺序执行, 这依所涉及 的功能而定。 也要注意的是, 框图和 /或流程图中的每个方框、 以及框图和 /或流程图中的方框的组合 ,可以用执行规定的功能或操作的专用 的基于硬件的系统来 实现, 或者可以用专用硬件与计算机 指令的组合来实现。 描述于本公开实施 例中所涉及到的模块 、 部件或单元可以通过软件的方式实现 , 也可以通过 硬件的方式来实现。 其中, 模块、 部件或单元的名称在某种情况下并不构 成对该模块 、 部件或单元本身的限定。 本文中以上描述的功 能可以至少部分地由一个或 多个硬件逻辑部件来执行 。 例如, 非限制性地 , 可以使用的示例性的硬件逻辑部件包括: 现场可编程门阵列(FPGA)、 专用集成 电路(ASIC) 、 专用标准产品(ASSP) 、 片上系统(SOC) 、 复杂可编程逻 辑设备 (CPLD) 等等。 根据本公开的一些实施 例, 提供了一种用于图像识别模型的训练方法, 包括: 获 得多个类别 的图像样本; 将每个类别的图像样本输入到图像识 别模型的特征提取层中 , 以提取每个 图像样本的特征向量; 根据每个类别的所述每个 图像样本的特征向量, 计 算与所述每 个类别对应的实际分布 函数的统计特征信息; 根据与所述每个类别对应的 实际分布 函数的统计特征信息, 建立与所述每个类别对应的增广 分布函数; 基于与所 述每个类别 对应的增广分布函数获得所 述每个类别的増广样本特 征; 以及将所述图像 样本 的特征向量和所述 增广样本特征输入 到所述图像识别 模型的分类层 中进行监督 学习。 在一些实施例中, 所述统计特征信息包括第一统计 特征信息和第二统计特征 信息; 建立与每个 类别对应的増广分布函数 的步骤包括: 计算与所述多个类别对应的实际分 布函数 的第二统计特征信息的平均值 ; 以及以所述第二统计特征信息的平均值和每个 类别的第一 统计特征信息作为统计特 征参数, 建立与所述每个类别对应的增广分布函 数。 在一些实施例中, 所述第一统计特征信息为所述 实际分布函数的均值, 第二统计 特征信息为 所述实际分布函数的方差 或标准差。 在一些实施例中, 获得多个类别的图像样本的步 骤包括: 对在同一属性下的多个 类别的 图像样本进行采样, 以获得每个类别的至少部分的图像 样本。 在一些实施例中, 在所述多个类别中采集得到 的每个类别的图像样本的数量 基本 相等。 在一些实施例中 , 对在同一属性下的多个类别的图像样本进 行采样的步骤包括: 如果所述 多个类别中的第 一类别所具有 的图像样本的实际 数量小于对该第 一类别采 集的图像样本 的计划数量, 则对该第一类别的至少部分图像样本 进行重复采样。 在一些实施例中 , 对在同一属性下的多个类别的图像样本进 行采样的步骤包括: 如果所述 多个类别中的第 二类别所具有 的图像样本的实际 数量等于对该第 二类别采 集的图像样本 的计划数量, 则采集该第二类别的全部图像样本 。 在一些实施例中 , 对在同一属性下的多个类别的图像样本进 行采样的步骤包括: 如果所述 多个类别中的第 三类别所具有 的图像样本的实际 数量大于对该第 三类别采 集的图像样本 的计划数量, 则采集该第三类别的部分图像样本 。 在一些实施例中, 基于与所述每个类别对应的增广 分布函数获得所述每个类别 的 增广样本特征 的步骤包括: 对每个类别对应的增广分布函数进行采 样, 获得对应的每 个类别的增广 样本特征。 在一些实施例中, 采集得到的每个类别的图像样本 的数目与所述每个类别 的增广 样本特征 的数目相等。 在一些实施例中, 所述实际分布函数和所述增广分 布函数均为髙斯分布函数 。 在一些实施例中, 所述属性表示人脸的某个部位 ; 所述类别为所述人脸的该某个 部位的外形类 别; 所述图像样本包括所述人脸的该某个部位的 图像样本。 在一些实施例中, 所述增广分布函数的函数类型与所 述实际分布函数的函数类 型 相同。 在一些实施例中, 所述图像识别模型为卷积神经 网络。 根据本公开的另一些实施 例, 提供了一种图像识别方法, 包括: 向图像识别模型 输入待识别 图像, 其中, 所述图像识别模型通过如前所述的训练方法进行训练; 以及 利用所述 图像识别模型对所述待识别 图像进行识别并输出图像识 别结果。 根据本公开的另一些 实施例, 提供了一种用于图像识别模型 的训练装置, 包括: 第一获取单 元, 用于获得多个类别的图像样本; 特征提取单元, 用于将每个类别的图 像样本输入 到图像识别模型的特征提取 层中, 以提取每个图像样本的特征向量; 计算 单元, 用于根据每个类别的所述每个 图像样本的特征向量, 计算与所述每个类别对应 的实际分布 函数的统计特征信息; 增广分布函数建立单元, 用于根据与所述每个类别 对应的实 际分布函数的统计特征信息 , 建立与所述每个类别对应的增广分布函数; 第 二获取单元 , 基于所述每个类别对应的增广分布函数获得所述每个 类别的增广样本特 征; 以及监督学习单元, 用于将所述图像样本的特征向量和所述 增广样本特征输入到 所述图像识 别模型的分类层中进行监 督学习。 根据本公开的另一些实施 例, 提供了一种图像识别装置, 包括: 输入单元, 用于 向图像识别 模型输入待识别图像, 其中, 所述图像识别模型通过如前所述的训练方法 进行训练 ; 以及识别单元, 用于利用所述图像识别模型对所述待识别图像进行识别并 输出图像识 别结果。 根据本公开的另一些实施 例, 提供了一种电子设备, 包括: 存储器; 以及耦接至 所述存储器 的处理器, 所述处理器被配置为基于存储在所述存储 器的指令执行如前所 述的方法 。 根据本公开的另一些实施 例, 提供了一种计算机可读存储介质, 其上存储有计算 机程序指令 , 该计算机程序指令被处理器执行时实现如前所述 的方法。 根据本公开的又一些实 施例, 提供一种计算机程序, 包括: 指令, 指令当由处理 器执行时使 处理器执行本公开中所述 的任一实施例的方法。 根据本公开的一些实施 例, 提供一种计算机程序产品, 包括指令, 所述指令当由 处理器执行 时实现本公开中所述的任 一实施例的方法。 以上描述仅为本公开 的一些实施例以及对所运用技 术原理的说明。 本领域技术人 员应当理解 , 本公开中所涉及的公开范围, 并不限于上述技术特征的特定组合而成的 技术方案 , 同时也应涵盖在不脱离上述公开构思的情况下, 由上述技术特征或其等同 特征进行任 意组合而形成的其它技术 方案。例如上述特征与本公开中公开的(但不限于) 具有类似功 能的技术特征进行互相替 换而形成的技术方案。 在本文提供的描述中 , 阐述了许多特定细节。 然而, 理解的是, 可以在没有这些 特定细节 的情况下实施本发 明的实施例。 在其他情况下, 为了不模糊该描述的理解, 没有对众所 周知的方法、 结构和技术进行详细展示。 此外, 虽然采用特定次序描绘了各操作, 但是这不应当理解为要求这些操作 以所 示出的特定 次序或以顺序次序执行来 执行。 在一定环境下, 多任务和并行处理可能是 有利的 。 同样地, 虽然在上面论述中包含了若干具体实现细节, 但是这些不应当被解 释为对本公 开的范围的限制。 在单独的实施例的上下文中描述 的某些特征还可以组合 地实现在单 个实施例中。 相反地, 在单个实施例的上下文中描述的各种特征也可以单 独地或 以任何合适的子组合的方式实现 在多个实施例中。 虽然己经通过示例对本 公开的一些特定实施例进 行了详细说明, 但是本领域的技 术人员应该 理解, 以上示例仅是为了进行说明, 而不是为了限制本公开的范围。 本领 域的技术人 员应该理解, 可在不脱离本公开的范围和精神的情况 下, 对以上实施例进 行修改。 本公开的范围由所附权利要求 来限定。

Claims

权 利 要 求
1、 一种用于图像识别模型的训练方法, 包括: 获得多个类别的图像样本 ; 将每个类别的图像样本输 入到图像识别模型的特征 提取层中, 以提取每个图像样 本的特征 向量; 根据每个类别的所述每个 图像样本的特征向量 , 计算与所述每个类别对应的实际 分布函数 的统计特征信息; 根据与所述每个类别对应 的实际分布函数的统计特 征信息, 建立与所述每个类别 对应的增广分 布函数; 基于与所述每个类别对应 的增广分布函数获得所述 每个类别的增广样本特征 ; 以 及 将所述图像样本 的特征向量和所 述增广样本特征 输入到所述图像 识别模型的分 类层中进行监 督学习。
2、 根据权利要求 1所述的训练方法, 其中, 所述统计特征信息包括第 一统计特征信息和第二 统计特征信息; 建立与每个类别对应 的增广分布函数的步骤包括 : 计算与所述多个类别对应 的实际分布函数的第二 统计特征信息的平均值; 以及 以所述第二统计 特征信息的平均 值和每个类别 的第一统计特征信 息作为统计特 征参数, 建立与所述每个类别对应 的增广分布函数。
3、 根据权利要求 2所述的训练方法, 其中, 所述第一统计特征信息 为所述实际分布函数的均值 , 所述第二统计特征信息为所 述实际分布 函数的方差或标准差。
4、 根据权利要求 1 所述的训练方法, 其中, 获得多个类别的图像样本的步骤包 括: 对在同一属性下的多个类 别的图像样本进行采样 , 以获得每个类别的至少部分的 图像样本 。
5、 根据权利要求 4所述的训练方法, 其中, 在所述多个类别中采集得 到的每个类别的图像样本 的数量基本相等。
6、根据权利要求 4所述的训练方法, 其中,对在同一属性下的多个类别的图像样 本进行采样 的步骤包括: 如果所述多个类 别中的第一类别 所具有的图像样 本的实际数量小 于对该第一类 别采集 的图像样本的计划数量 , 则对该第一类别的至少部分图像样本进 行重复采样。
7、根据权利要求 4所述的训练方法, 其中,对在同一属性下的多个类别的图像样 本进行采样 的步骤包括: 如果所述多个类 别中的第二类别 所具有的图像样 本的实际数量等 于对该第二类 别采集的 图像样本的计划数量, 则采集该第二类别的全部图像样 本。
8、根据权利要求 4所述的训练方法, 其中,对在同一属性下的多个类别的图像样 本进行采样 的步骤包括: 如果所述多个类 别中的第三类别 所具有的图像样 本的实际数量大 于对该第三类 别采集的 图像样本的计划数量, 则采集该第三类别的部分图像样 本。
9、根据权利要求 1所述的训练方法, 其中,基于与所述每个类别对应的増广分布 函数获得所述 每个类别的增广样本特征 的步骤包括: 对每个类别对应的増广 分布函数进行采样, 获得对应的每个类别的增广样本特 征。
10、 根据权利要求 9所述的训练方法, 其中, 采集得到的每个 类别的图像样本 的数目与所述每 个类别的增广样 本特征的数 目 相等。
11、 根据权利要求 1所述的训练方法, 其中, 所述实际分布函数和所述 增广分布函数均为髙斯分 布函数。
12、 根据权利要求 4所述的训练方法, 其中, 所述属性表示人脸的某个 部位; 所述类别为所述人脸 的该某个部位的外形类别 ; 所述图像样本包括所述人 脸的该某个部位的图像样 本。
13、 根据权利要求 1所述的训练方法, 其中, 所述增广分布函数的函数 类型与所述实际分布函数 的函数类型相同。
14、 根据权利要求 1所述的训练方法, 其中, 所述图像识别模型为卷积 神经网络。
15、 一种图像识别方法, 包括: 向图像识别模型输入待识 别图像, 其中, 所述图像识别模型通过如权利要求 1至 14任意一 项所述的训练方法进行训练 ; 以及 利用所述图像识别模型对 所述待识别图像进行识别 并输出图像识别结果 。
16、 一种用于图像识别模型的训练装置, 包括: 第一获取单元, 用于获得多个类别的图像样本 ; 特征提取单元, 用于将每个类别的图像样本输入到 图像识别模型的特征提取 层中, 以提取每个 图像样本的特征向量; 计算单元, 用于根据每个类别的所述每个图像样本 的特征向量, 计算与所述每个 类别对应 的实际分布函数的统计特征信 息; 増广分布函数建立单元 , 用于根据与所述每个类别对应的实际分布函数的统计 特 征信息, 建立与所述每个类别对应 的増广分布函数; 第二获取单元, 基于所述每个类别对应的増广分布 函数获得所述每个类别 的増广 样本特征 ; 以及 监督学习单元, 用于将所述图像样本的特征向量和 所述增广样本特征输入到所 述 图像识别模 型的分类层中进行监督学 习。
17、 一种图像识别装置, 包括: 输入单元, 用于向图像识别模型输入待识别图像 , 其中, 所述图像识别模型通过 如权利要求 1至 14任意一项所述的训练方法进行训练; 以及 识别单元, 用于利用所述图像识别模型对所述待识 别图像进行识别并输出 图像识 别结果。
18、 一种电子设备, 包括: 存储器; 以及 耦接至所述存储器的处理 器, 所述处理器被配置为基于存储在所述存储器 的指令 执行如权利 要求 1至 15任意一项所述的方法。
19、 一种计算机可读存储介质, 其上存储有计算机程序指令, 该计算机程序指令 被处理器执 行时实现如权利要求 1至 15任意一项所述的方法。
20、 一种计算机程序, 包括: 指令, 所述指令当由处理器执行时使所述处理器执 行根据权利要求 1至 15任意 一项所述 的方法。
21、 一种计算机程序产品, 包括指令, 所述指令当由处理器执行时使所述处理器 执行根据权 利要求 1至 15任意一项所述的方法。
PCT/SG2022/050281 2021-07-29 2022-05-06 用于图像识别模型的训练方法及其装置、图像识别方法 Ceased WO2023009055A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110863490.8A CN115700838A (zh) 2021-07-29 2021-07-29 用于图像识别模型的训练方法及其装置、图像识别方法
CN202110863490.8 2021-07-29

Publications (1)

Publication Number Publication Date
WO2023009055A1 true WO2023009055A1 (zh) 2023-02-02

Family

ID=85037455

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/SG2022/050281 Ceased WO2023009055A1 (zh) 2021-07-29 2022-05-06 用于图像识别模型的训练方法及其装置、图像识别方法

Country Status (3)

Country Link
US (1) US12106545B2 (zh)
CN (1) CN115700838A (zh)
WO (1) WO2023009055A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116468985B (zh) * 2023-03-22 2024-03-19 北京百度网讯科技有限公司 模型训练方法、质量检测方法、装置、电子设备及介质
CN117725498B (zh) * 2023-03-29 2025-02-25 书行科技(北京)有限公司 数据处理方法、装置、电子设备及介质
CN116630793B (zh) * 2023-04-19 2025-06-10 北京师范大学 一种洪积扇提取方法、装置及计算机

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080114564A1 (en) * 2004-11-25 2008-05-15 Masayoshi Ihara Information Classifying Device, Information Classifying Method, Information Classifying Program, Information Classifying System
US20200250491A1 (en) * 2017-11-01 2020-08-06 Tencent Technology (Shenzhen) Company Limited Image classification method, computer device, and computer-readable storage medium
CN113111803A (zh) * 2021-04-20 2021-07-13 复旦大学 一种小样本字符与手绘草图识别方法及装置

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6751354B2 (en) * 1999-03-11 2004-06-15 Fuji Xerox Co., Ltd Methods and apparatuses for video segmentation, classification, and retrieval using image class statistical models
US9589205B2 (en) * 2014-05-15 2017-03-07 Fuji Xerox Co., Ltd. Systems and methods for identifying a user's demographic characteristics based on the user's social media photographs
JP7104810B2 (ja) * 2019-01-15 2022-07-21 オリンパス株式会社 画像処理システム、学習済みモデル及び画像処理方法
JP7433602B2 (ja) * 2019-04-26 2024-02-20 国立大学法人大阪大学 機械学習に用いられる教師データを増幅するためのシステム、方法、プログラム
CN110210321B (zh) 2019-05-08 2020-11-24 华南理工大学 基于多维尺度变换网络与分块加权法的欠样本人脸识别方法
CN111104466B (zh) * 2019-12-25 2023-07-28 中国长峰机电技术研究设计院 一种海量数据库表快速分类的方法
CN112257738B (zh) * 2020-07-31 2025-01-17 北京京东尚科信息技术有限公司 机器学习模型的训练方法、装置和图像的分类方法、装置
CN112446428B (zh) 2020-11-27 2024-03-05 杭州海康威视数字技术股份有限公司 一种图像数据处理方法及装置
CN112733808B (zh) * 2021-02-22 2025-08-22 深圳市商汤科技有限公司 模型训练与图像处理方法、装置、电子设备和存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080114564A1 (en) * 2004-11-25 2008-05-15 Masayoshi Ihara Information Classifying Device, Information Classifying Method, Information Classifying Program, Information Classifying System
US20200250491A1 (en) * 2017-11-01 2020-08-06 Tencent Technology (Shenzhen) Company Limited Image classification method, computer device, and computer-readable storage medium
CN113111803A (zh) * 2021-04-20 2021-07-13 复旦大学 一种小样本字符与手绘草图识别方法及装置

Also Published As

Publication number Publication date
US20230035131A1 (en) 2023-02-02
CN115700838A (zh) 2023-02-07
US12106545B2 (en) 2024-10-01

Similar Documents

Publication Publication Date Title
US20240233334A1 (en) Multi-modal data retrieval method and apparatus, medium, and electronic device
WO2023009055A1 (zh) 用于图像识别模型的训练方法及其装置、图像识别方法
US11436863B2 (en) Method and apparatus for outputting data
CN111696176B (zh) 图像处理方法、装置、电子设备及计算机可读介质
CN118097157B (zh) 基于模糊聚类算法的图像分割方法及系统
WO2023143178A1 (zh) 对象分割方法、装置、设备及存储介质
WO2022161357A1 (zh) 基于数据增强的训练样本获取方法、装置和电子设备
CN108764176A (zh) 一种动作序列识别方法、系统及设备和存储介质
CN114049417B (zh) 虚拟角色图像的生成方法、装置、可读介质及电子设备
WO2022012179A1 (zh) 生成特征提取网络的方法、装置、设备和计算机可读介质
WO2023009056A1 (zh) 图像处理方法、图像处理设备和计算机可读介质
CN116596748A (zh) 图像风格化处理方法、装置、设备、存储介质和程序产品
WO2023072015A1 (zh) 人物风格形象图的生成方法、装置、设备及存储介质
WO2023093683A1 (zh) 图像剪裁方法、模型训练方法、装置、电子设备及介质
WO2023009058A1 (zh) 图像属性分类方法、装置、电子设备、介质和程序产品
CN115270981A (zh) 对象处理方法、装置、可读介质及电子设备
WO2023143222A1 (zh) 图像处理方法、装置、设备及存储介质
CN112967299B (zh) 图像裁剪方法、装置、电子设备和计算机可读介质
US20260120230A1 (en) Image processing
WO2024120446A1 (zh) 特效道具、特效图的生成方法、装置、设备及存储介质
US20250005827A1 (en) Image generation method, apparatus and device, and storage medium
CN112418233A (zh) 图像处理方法、装置、可读介质及电子设备
CN117217294A (zh) 一种模型的训练方法、图像处理方法、装置、介质及设备
CN110765304A (zh) 图像处理方法、装置、电子设备及计算机可读介质
CN115408609A (zh) 泊车路线推荐方法、装置、电子设备和计算机可读介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22849985

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22849985

Country of ref document: EP

Kind code of ref document: A1