WO2021189847A1 - 基于图像分类模型的训练方法、装置、设备及存储介质 - Google Patents

基于图像分类模型的训练方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2021189847A1
WO2021189847A1 PCT/CN2020/125007 CN2020125007W WO2021189847A1 WO 2021189847 A1 WO2021189847 A1 WO 2021189847A1 CN 2020125007 W CN2020125007 W CN 2020125007W WO 2021189847 A1 WO2021189847 A1 WO 2021189847A1
Authority
WO
WIPO (PCT)
Prior art keywords
sample
image
classification model
training
preset
Prior art date
Application number
PCT/CN2020/125007
Other languages
English (en)
French (fr)
Inventor
姜禹
丁伟
张国辉
宋晨
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021189847A1 publication Critical patent/WO2021189847A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • This application relates to the field of artificial intelligence technology, and in particular to a training method, device, equipment and storage medium based on an image classification model.
  • Image classification is an important part of the field of artificial intelligence. Most application systems based on machine vision require image classification algorithms to judge the attributes of the images collected by the camera before entering other processing procedures. It can be said that the ability of image classification is in the field of machine vision. Basic capabilities.
  • the inventor realizes that part of the existing image classification is based on the recognition and artificial design of classification algorithms by human engineers.
  • the algorithm debugging process is complicated, requires professional talents, and is time-consuming and labor-intensive.
  • the other part is to use neural network to train the image classification model, which requires a certain amount of manpower to collect and label samples.
  • the sample is difficult to collect and the sample size is insufficient, there is no augmentation or only augmentation based on simple affine transformation, resulting in poor model accuracy. .
  • the actual model may contain too much background information, and the information about the objects that need to be classified is insufficient, resulting in more misclassifications in practical applications.
  • the improvement of the method of increasing samples requires a 10-fold increase in the sample size to increase the accuracy of the model, which makes the cost of sample collection and labeling too high, and it is difficult to improve the overall work efficiency of algorithm improvement.
  • a training method based on an image classification model includes the following steps:
  • the image classification model to be trained is trained by the synthetic training sample and the function synthetic sample to obtain a target image classification model.
  • a training device based on an image classification model includes:
  • the acquisition module is used to separately acquire the background image sample and the foreground image sample of the object to be classified in the preset background environment;
  • the acquisition module is further configured to acquire application image samples of the object to be classified in a preset application environment, and synthesize the samples according to the application image sample construction function;
  • a fitting module configured to perform fitting according to the background image sample and the foreground image sample to obtain a synthetic training sample
  • a construction module configured to construct an image classification model for training of the object to be classified based on a preset neural network
  • the training module is used to train the image classification model to be trained through the synthetic training sample and the function synthetic sample to obtain a target image classification model.
  • a training device based on an image classification model includes a memory, a processor, and an image classification model-based training program stored in the memory and running on the processor,
  • the training program based on the image classification model is configured to implement the following steps:
  • the image classification model to be trained is trained by the synthetic training sample and the function synthetic sample to obtain a target image classification model.
  • a storage medium storing a training program based on an image classification model, and the following steps are implemented when the training program based on the image classification model is executed by a processor:
  • the image classification model to be trained is trained by the synthetic training sample and the function synthetic sample to obtain a target image classification model.
  • FIG. 1 is a schematic structural diagram of a device in a hardware operating environment involved in a solution of an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a first embodiment of a training method based on an image classification model according to this application;
  • FIG. 3 is a schematic flowchart of a second embodiment of a training method based on an image classification model according to this application;
  • FIG. 4 is a schematic flowchart of a third embodiment of a training method based on an image classification model according to this application;
  • Fig. 5 is a structural block diagram of a first embodiment of a training device based on an image classification model in this application.
  • FIG. 1 is a schematic diagram of the device structure of the hardware operating environment involved in the solution of the embodiment of the application.
  • the device may include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005.
  • the communication bus 1002 is used to implement connection and communication between these components.
  • the user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WI-FIdelity, WI-FI) interface).
  • WI-FIdelity wireless fidelity
  • the memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory.
  • RAM Random Access Memory
  • NVM Non-Volatile Memory
  • the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
  • FIG. 1 does not constitute a limitation on the device, and may include more or fewer components than those shown in the figure, or a combination of certain components, or different component arrangements.
  • the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module, and a training program based on an image classification model.
  • the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with users; the processor 1001 and the memory 1005 in the device of this application can be set in the device
  • the device calls the training program based on the image classification model stored in the memory 1005 through the processor 1001, and executes the training method based on the image classification model provided in the embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a first embodiment of the training method based on an image classification model in this application.
  • the training method based on the image classification model includes the following steps:
  • Step S10 Acquire the background image sample and the foreground image sample of the object to be classified in the preset background environment.
  • the execution subject of the method in this embodiment may be a training device based on an image classification model.
  • Acquire the background image sample and the foreground image sample of the object to be classified in the preset background environment where the preset background environment can be the environment where the object to be classified is located, and the number of image collections can be determined according to the diversity conditions of the preset background environment;
  • the number of image collections obtains background image samples of the object to be classified in the preset background environment; determines the foreground environment according to the preset background environment, and obtains the foreground image samples in the foreground environment.
  • the background image is collected in the environment where the object to be classified is located, and the number of image collections is determined according to the variety of conditions of the preset background environment, such as the lighting conditions, the shooting angle, and the shooting distance.
  • the number of acquisitions is preferably to completely cover the range of the preset background environment.
  • the foreground environment is determined according to the preset background environment.
  • the foreground environment can be the simplest background environment as possible.
  • the foreground image samples of the object to be classified are collected in the simplest background environment.
  • Possible presentation ranges such as different shooting distances and shooting angles, collect as many foreground image samples of objects to be classified as possible, and mark the foreground image samples according to different objects to be classified to facilitate image classification model training.
  • the background image sample and the foreground image sample may also be stored in a node of a blockchain.
  • Step S20 Acquire application image samples of the object to be classified in a preset application environment, and synthesize the samples according to the application image sample construction function.
  • the application image samples of the object to be classified are obtained in a preset application environment, where the preset application environment may be the application environment of the object to be classified, and the application image of the object to be classified is determined in the preset application environment.
  • a preset classification number obtaining application image samples of the object to be classified in the preset application environment according to the preset classification number; constructing a function synthesis sample according to the distance information between the application image samples.
  • the preset number of classifications is to take as many application image samples as possible under conditions.
  • the objects to be classified are photographed in the application environment.
  • Each type of object in the objects to be classified needs to be photographed and marked for image classification. If conditions permit, as many application image samples as possible are photographed.
  • the distance information constructs a function synthesis sample, and the function synthesis sample is used for subsequent training and verification of the image classification model. The more application image samples actually taken, the higher the accuracy of the image classification model obtained by training.
  • Step S30 Perform fitting according to the background image sample and the foreground image sample to obtain a synthetic training sample.
  • fitting is performed according to the captured background image samples and foreground image samples to obtain synthetic training samples.
  • a feasible fitting method is to use foreground image samples to cover background image samples and perform background transparency processing near the edge to obtain synthetic training samples.
  • the specific process can be: The background image sample is segmented to obtain the target foreground image; the background image sample and the target foreground image are classified and combined according to a preset augmentation algorithm to obtain an initial synthetic training sample; the initial synthetic training sample is obtained according to the foreground image sample Edge processing is performed on the training samples to obtain synthetic training samples.
  • the foreground environment is determined according to the preset background environment.
  • the foreground environment can be as simple as possible.
  • the foreground image samples of the object to be classified are collected in the simplest background environment.
  • the captured foreground image samples are as simple as possible.
  • the target foreground image can be obtained by matting technology, for example, the background image sample can be segmented by the preset edge detection algorithm to obtain the target foreground image, that is, the foreground and the pure color background of the background image sample can be segmented by a simple edge detection algorithm , To obtain the target foreground image.
  • the background image sample and the target foreground image are classified and combined according to the preset augmentation algorithm to obtain the initial synthetic training sample; where the preset augmentation algorithm can include augmentation algorithms such as blur, rotation, distortion, and color cast.
  • the background image sample and the target foreground image are randomly combined after being blurred, rotated, distorted, and color cast, to obtain the initial synthetic training sample, so that as many target foreground images as possible appear in the combination of as many background image samples as possible, generally can be directly combined
  • the target foreground image covers a part of the background image sample, and the initial synthetic training sample after synthesis is classified and labeled according to different target foreground image classifications.
  • the edge area of the object of the synthetic initial synthetic training sample can be obtained according to the relative position of the edge of the foreground image sample and the background image sample, and the edge area of the object can be transparent. Process to obtain synthetic training samples.
  • Step S40 Construct an image classification model for training of the object to be classified based on a preset neural network.
  • the to-be-trained image classification model of the object to be classified is constructed based on a preset neural network, or the to-be-trained image classification model of the object to be classified is constructed according to actual needs.
  • the to-be-trained image classification model of the object to be classified may be based on human
  • the image classification model to be trained of the object to be classified can also be an image classification model based on neural network training.
  • the synthetic training samples and function synthetic samples can be trained as described above. Two types of image classification models to be trained are used to obtain the target image classification model to improve the accuracy of the image classification model.
  • the image classification model to be trained of the object to be classified can also be the image classification model to be trained obtained in other ways. No restrictions.
  • Step S50 Train the image classification model to be trained through the synthetic training sample and the function synthetic sample to obtain a target image classification model.
  • the image classification model to be trained is trained through the synthetic training sample and the function synthetic sample to obtain the target image classification model.
  • This embodiment adopts The following training method is described: the network parameters of the image classification model to be trained are updated through the synthetic training samples to obtain the basic image classification model;
  • Acquire classifier parameters for image classification update the classifier parameters of the basic image classification model according to the classifier parameters, and obtain an updated basic image classification model; synthesize samples through the function to compare the updated basic image
  • the network parameters of the image classification model are updated to obtain the target image classification model.
  • this embodiment may also adopt other training methods to train the image classification model to be trained by synthesizing training samples and function synthesis samples to obtain the target image classification model, which is not limited in this embodiment.
  • Image classification is an important part of the field of artificial intelligence. Most of the application systems based on machine vision require an image classification model to judge the attributes of the image collected by the camera before entering other processing procedures. It can be said that the classification ability of the image classification model is the machine Basic competence in the field of vision. In this embodiment, the number of sample augmentation is increased exponentially, which greatly improves the classification accuracy of the image classification model, and can be applied to the artificial intelligence field of machine vision.
  • the background image sample and the foreground image sample of the object to be classified are obtained in a preset background environment;
  • the application image sample of the object to be classified is obtained in the preset application environment, and a function is constructed based on the application image sample Synthetic samples; Fit according to the background image samples and the foreground image samples to obtain synthetic training samples; build the image classification model to be trained for the objects to be classified based on a preset neural network; use the synthetic training samples and all
  • the function synthesis sample trains the image classification model to be trained to obtain the target image classification model.
  • this embodiment has no augmentation or augmentation based only on simple affine transformation, and the resulting image classification model has poor accuracy.
  • the background image samples and the foreground image samples are processed separately before fitting.
  • the sample augmentation method can increase the number of sample augmentation exponentially, greatly improve the classification accuracy of the image classification model, and solve the problem of the poor accuracy of the image classification model caused by the difficulty of collecting training samples or the excessive change of the training samples in the prior art. A technical problem that is difficult to improve the efficiency of the classification model improvement work.
  • FIG. 3 is a schematic flowchart of a second embodiment of a training method based on an image classification model according to this application.
  • the step S30 includes:
  • Step S301 Segment the background image sample by using a preset edge detection algorithm to obtain a target foreground image.
  • fitting is performed according to the captured background image samples and foreground image samples to obtain synthetic training samples.
  • a feasible fitting method is to use foreground image samples to cover background image samples and perform background transparency processing near the edge to obtain synthetic training samples.
  • the background image sample is segmented by a preset edge detection algorithm to obtain the target foreground image
  • the preset edge detection algorithm may be a simple edge detection algorithm.
  • the foreground environment can be the simplest possible background environment.
  • the foreground image samples of the object to be classified are collected in the simplest background environment.
  • the captured foreground image samples use the simplest background environment possible.
  • a simple edge detection algorithm can be used to segment the foreground and the solid-color background of the background image sample to obtain the target foreground image. It is also possible to segment the foreground and the solid-color background of the background image sample by other algorithms to obtain the target foreground image, which is not limited in this embodiment.
  • Step S302 Classify and combine the background image sample and the target foreground image according to a preset augmentation algorithm to obtain an initial synthetic training sample.
  • the background image sample and the target foreground image are classified and combined according to a preset augmentation algorithm, where the preset augmentation algorithm may include blur, rotation, distortion, and color cast among the augmentation algorithms.
  • the preset augmentation algorithm may include other augmentation algorithms, and this embodiment is not limited thereto.
  • the preset augmentation algorithm includes blur, rotation, distortion, and color cast augmentation algorithms.
  • the background image sample and the target foreground image are classified and combined according to the preset augmentation algorithm, and the process of obtaining the initial synthetic training sample can be: according to the blur, rotation, distortion, and color cast augmentation algorithm, the background image sample and the target foreground image are classified and combined.
  • the image classification is processed and randomly combined to obtain the initial synthetic training sample, so that as many target foreground images as possible appear in the combination of as many background image samples as possible.
  • the target foreground image can be directly covered in part of the background image sample area, according to Different target foreground images are classified to classify and label the synthesized initial synthetic training samples.
  • Step S303 Perform edge processing on the initial synthetic training sample according to the foreground image sample to obtain a synthetic training sample.
  • the edge processing of the synthesized initial synthetic training sample can generally be based on the edge of the foreground image sample and the relative position on the background image sample to obtain the object edge area of the initial synthetic training sample after synthesis.
  • This object edge area Perform transparency processing to obtain synthetic training samples.
  • the foreground image sample can be overlaid on the background image sample, and the relative position of the foreground image sample relative to the background image sample can be obtained; the synthetic edge area of the initial synthetic training sample can be obtained according to the edge area and relative position of the foreground image sample; Transparency processing is performed on the region to obtain the initial synthetic training sample after the transparency processing; the initial synthetic training sample after the transparency processing is used as the synthetic training sample.
  • the background image sample is segmented by a preset edge detection algorithm to obtain a target foreground image; the background image sample and the target foreground image are classified and combined according to a preset augmentation algorithm to obtain an initial synthetic training sample ; Perform edge processing on the initial synthetic training sample according to the foreground image sample to obtain a synthetic training sample.
  • the initial synthetic training samples can be edge-processed according to the foreground image samples to obtain synthetic training samples. Because the edge transparency of the foreground image samples can have different value strategies, they can be randomly selected within a certain range.
  • FIG. 4 is a schematic flowchart of a third embodiment of a training method based on an image classification model according to this application.
  • the step S303 includes:
  • Step S3031 overlay the foreground image sample on the background image sample, and obtain the relative position of the foreground image sample with respect to the background image sample.
  • the edge processing of the synthesized initial synthetic training sample can generally be based on the edge of the foreground image sample and the relative position on the background image sample to obtain the object edge area of the initial synthetic training sample after synthesis.
  • This object edge area Perform transparency processing to obtain synthetic training samples.
  • the foreground image sample needs to be overlaid on the background image sample, and the relative position of the foreground image sample with respect to the background image sample is acquired.
  • Step S3032 Obtain a synthetic edge area of the initial synthetic training sample according to the edge area of the foreground image sample and the relative position.
  • the synthetic edge area of the initial synthetic training sample can be obtained, and transparency can be obtained after the synthetic edge area is processed for transparency.
  • the processed initial synthetic training sample is used as the synthetic training sample.
  • the initial synthetic training sample after the transparency processing can further reduce the focus on the edge of the image classification model to be trained and improve the target after training. The classification accuracy of the image classification model.
  • Step S3033 Transparency processing is performed on the synthesized edge area to obtain initial synthesized training samples after transparency processing.
  • the process of performing transparency processing on the synthetic edge area to obtain the initial synthetic training sample after the transparency processing may be: obtaining the gray value of each pixel of the background image sample in the synthetic edge area; obtaining The gray value of each pixel of the foreground image sample in the synthesized edge region; the gray value of each pixel of the background image sample and the gray value of each pixel of the foreground image sample are performed based on a preset transparency Transparency processing to obtain the pixel composite value of each pixel in the composite edge region; and construct an initial composite training sample after transparency processing according to the pixel composite value.
  • the synthetic edge region is subjected to transparency processing.
  • the pixel synthesis value of the red pixel and the pixel synthesis of the blue pixel in the synthesized edge area can also be obtained.
  • the transparency processing of the synthesized edge region may also be in the RGBW color space or other color spaces, which is not limited in this embodiment.
  • Step S3034 Use the initial synthetic training sample after the transparency processing as a synthetic training sample.
  • the initial synthetic training sample after the transparency processing is used as the synthetic training sample. Since the transparency can have different value strategies, random values within a certain range or uniform values at a certain step size, etc., are obtained through synthetic training samples.
  • the image classification model to be trained with the function synthesis sample it can further reduce the focus on the edge of the image classification model to be trained, and obtain more information such as the shape and texture of the object itself, and improve the classification accuracy of the target image classification model after training. .
  • a random preset transparency alpha value can be used within a certain range.
  • the foreground image sample is overlaid on the background image sample, and the relative position of the foreground image sample with respect to the background image sample is obtained; obtained according to the edge area of the foreground image sample and the relative position
  • the synthetic edge area of the initial synthetic training sample; the synthetic edge area is subjected to transparency processing to obtain the initial synthetic training sample after the transparency processing; the initial synthetic training sample after the transparency processing is used as the synthetic training sample.
  • transparency processing can be performed on the synthetic edge area to obtain the initial synthetic training samples after transparency processing. Since transparency can have different value strategies, it can be randomly within a certain range or at a certain step size.
  • the image classification model When training the image classification model to be trained by synthesizing training samples and function synthesis samples, it can further reduce the attention to edges of the image classification model to be trained, and obtain more information such as the shape and texture of the object itself. Improve the classification accuracy of the trained target image classification model.
  • an embodiment of the present application also proposes a storage medium.
  • the storage medium may be volatile or nonvolatile.
  • the storage medium stores a training program based on an image classification model. When the training program of the image classification model is executed by the processor, the following steps are implemented:
  • the image classification model to be trained is trained by the synthetic training sample and the function synthetic sample to obtain a target image classification model.
  • FIG. 5 is a structural block diagram of a first embodiment of a training device based on an image classification model of the present application.
  • the training device based on the image classification model proposed in the embodiment of the present application includes:
  • the obtaining module 10 is used to obtain the background image sample and the foreground image sample of the object to be classified in a preset background environment.
  • the execution subject of the method in this embodiment may be a training device based on an image classification model.
  • Acquire the background image sample and the foreground image sample of the object to be classified in the preset background environment where the preset background environment can be the environment where the object to be classified is located, and the number of image collections can be determined according to the diversity conditions of the preset background environment;
  • the number of image collections obtains background image samples of the object to be classified in the preset background environment; determines the foreground environment according to the preset background environment, and obtains the foreground image samples in the foreground environment.
  • the background image is collected in the environment where the object to be classified is located, and the number of image collections is determined according to the variety of conditions of the preset background environment, such as the lighting conditions, the shooting angle, and the shooting distance.
  • the number of acquisitions is preferably to completely cover the range of the preset background environment.
  • the foreground environment is determined according to the preset background environment.
  • the foreground environment can be the simplest background environment as possible.
  • the foreground image samples of the object to be classified are collected in the simplest background environment.
  • Possible presentation ranges such as different shooting distances and shooting angles, collect as many foreground image samples of objects to be classified as possible, and mark the foreground image samples according to different objects to be classified to facilitate image classification model training.
  • the acquisition module 10 is also configured to acquire application image samples of the object to be classified in a preset application environment, and synthesize the samples according to the application image sample construction function.
  • the application image samples of the object to be classified are obtained in a preset application environment, where the preset application environment may be the application environment of the object to be classified, and the application image of the object to be classified is determined in the preset application environment.
  • a preset classification number obtaining application image samples of the object to be classified in the preset application environment according to the preset classification number; constructing a function synthesis sample according to the distance information between the application image samples.
  • the preset number of classifications is to take as many application image samples as possible under conditions.
  • the objects to be classified are photographed in the application environment.
  • Each type of object in the objects to be classified needs to be photographed and marked for image classification. If conditions permit, as many application image samples as possible are photographed.
  • the distance information constructs a function synthesis sample, and the function synthesis sample is used for subsequent training and verification of the image classification model. The more application image samples actually taken, the higher the accuracy of the image classification model obtained by training.
  • the background image sample and the foreground image sample may also be stored in a node of a blockchain.
  • the fitting module 20 is configured to perform fitting according to the background image samples and the foreground image samples to obtain synthetic training samples.
  • fitting is performed according to the captured background image samples and foreground image samples to obtain synthetic training samples.
  • a feasible fitting method is to use foreground image samples to cover background image samples and perform background transparency processing near the edge to obtain synthetic training samples.
  • the specific process can be: The background image sample is segmented to obtain the target foreground image; the background image sample and the target foreground image are classified and combined according to a preset augmentation algorithm to obtain an initial synthetic training sample; the initial synthetic training sample is obtained according to the foreground image sample Edge processing is performed on the training samples to obtain synthetic training samples.
  • the foreground environment is determined according to the preset background environment.
  • the foreground environment can be as simple as possible.
  • the foreground image samples of the object to be classified are collected in the simplest background environment.
  • the captured foreground image samples are as simple as possible.
  • the target foreground image can be obtained by matting technology, for example, the background image sample can be segmented by the preset edge detection algorithm to obtain the target foreground image, that is, the foreground and the pure color background of the background image sample can be segmented by a simple edge detection algorithm , To obtain the target foreground image.
  • the background image sample and the target foreground image are classified and combined according to the preset augmentation algorithm to obtain the initial synthetic training sample; where the preset augmentation algorithm can include augmentation algorithms such as blur, rotation, distortion, and color cast.
  • the background image sample and the target foreground image are randomly combined after being blurred, rotated, distorted, and color cast, to obtain the initial synthetic training sample, so that as many target foreground images as possible appear in the combination of as many background image samples as possible, generally can be directly combined
  • the target foreground image covers a part of the background image sample, and the initial synthetic training sample after synthesis is classified and labeled according to different target foreground image classifications.
  • the edge area of the synthetic initial synthetic training sample can be obtained according to the relative position of the foreground image sample's edge and the background image sample, and the edge area of the object can be transparent. Process to obtain synthetic training samples.
  • the construction module 30 is configured to construct an image classification model for training of the object to be classified based on a preset neural network.
  • the to-be-trained image classification model of the object to be classified is constructed based on a preset neural network, or the to-be-trained image classification model of the object to be classified is constructed according to actual needs.
  • the to-be-trained image classification model of the object to be classified may be based on human
  • the image classification model to be trained of the object to be classified can also be an image classification model based on neural network training.
  • the synthetic training samples and function synthetic samples can be trained as described above. Two types of image classification models to be trained are used to obtain the target image classification model to improve the accuracy of the image classification model.
  • the image classification model to be trained of the object to be classified can also be the image classification model to be trained obtained in other ways. No restrictions.
  • the training module 40 is configured to train the image classification model to be trained through the synthetic training sample and the function synthetic sample to obtain a target image classification model.
  • the image classification model to be trained is trained through the synthetic training sample and the function synthetic sample to obtain the target image classification model.
  • This embodiment adopts The following training method is described: the network parameters of the image classification model to be trained are updated through the synthetic training samples to obtain the basic image classification model;
  • Acquire classifier parameters for image classification update the classifier parameters of the basic image classification model according to the classifier parameters, and obtain an updated basic image classification model; synthesize samples through the function to compare the updated basic image
  • the network parameters of the image classification model are updated to obtain the target image classification model.
  • this embodiment may also adopt other training methods to train the image classification model to be trained by synthesizing training samples and function synthesis samples to obtain the target image classification model, which is not limited in this embodiment.
  • Image classification is an important part of the field of artificial intelligence. Most of the application systems based on machine vision require an image classification model to judge the attributes of the image collected by the camera before entering other processing procedures. It can be said that the classification ability of the image classification model is the machine Basic competence in the field of vision. In this embodiment, the number of sample augmentation increases exponentially, which greatly improves the classification accuracy of the image classification model, and can be applied to artificial intelligence fields such as machine vision.
  • the obtaining module 10 is used to obtain the background image samples and foreground image samples of the objects to be classified in a preset background environment; the obtaining module 10 is also used to obtain the objects to be classified in a preset application environment.
  • the fitting module 20 is used for fitting according to the background image sample and the foreground image sample to obtain the synthetic training sample;
  • the construction module 30, It is used to construct a classification model of the image to be trained for the object to be classified based on a preset neural network;
  • the training module 40 is used to train the image classification model to be trained through the synthetic training sample and the function synthetic sample to obtain a target image Classification model.
  • this embodiment Compared with the existing training samples, this embodiment has no augmentation or augmentation based only on simple affine transformation, and the resulting image classification model has poor accuracy.
  • the background image samples and the foreground image samples are processed separately before fitting.
  • the sample augmentation method can increase the number of sample augmentation exponentially, greatly improve the classification accuracy of the image classification model, and solve the problem of the poor accuracy of the image classification model caused by the difficulty of collecting training samples or the excessive change of the training samples in the prior art. A technical problem that is difficult to improve the efficiency of the classification model improvement work.
  • a second embodiment of the training device based on the image classification model of the present application is proposed.
  • the acquisition module 10 is further configured to determine the number of image acquisitions according to the diversity conditions of the preset background environment; and acquire the background image of the object to be classified in the preset background environment according to the number of image acquisitions Samples; determine the foreground environment according to the preset background environment, and obtain foreground image samples in the foreground environment.
  • the acquisition module 10 is further configured to determine the preset classification quantity of the object to be classified in a preset application environment; and acquire the to-be-classified object in the preset application environment according to the preset classification quantity.
  • the application image sample of the object; the function synthesis sample is constructed according to the distance information between the application image samples.
  • the fitting module 20 is further configured to segment the background image sample by a preset edge detection algorithm to obtain a target foreground image; according to a preset augmentation algorithm, the background image sample and the target foreground image The images are classified and combined to obtain an initial synthetic training sample; the initial synthetic training sample is edge-processed according to the foreground image sample to obtain a synthetic training sample.
  • the fitting module 20 is further configured to overlay the foreground image sample on the background image sample, and obtain the relative position of the foreground image sample with respect to the background image sample; according to the foreground image sample The edge area and the relative position of the synthetic edge area of the initial synthetic training sample are obtained; the synthetic edge area is subjected to transparency processing to obtain the initial synthetic training sample after the transparency processing; the initial synthetic training sample after the transparency processing is used as Synthesize training samples.
  • the fitting module 20 is also used to obtain the gray value of each pixel of the background image sample in the synthesized edge area; obtain the gray value of each pixel of the foreground image sample in the synthesized edge area Degree value; Transparency processing is performed on the gray value of each pixel of the background image sample and the gray value of each pixel of the foreground image sample based on the preset transparency to obtain the pixel synthesis of each pixel in the synthesized edge area Value; construct an initial synthetic training sample after transparency processing according to the pixel synthetic value.
  • the training module 40 is also used to update the network parameters of the image classification model to be trained through the synthetic training samples to obtain a basic image classification model; to obtain classifier parameters for image classification, according to the classifier Parameters update the classifier parameters of the basic image classification model to obtain an updated basic image classification model; update the network parameters of the updated basic image classification model through the function synthesis sample to obtain a target image classification model.
  • the blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as read-only memory/random access).
  • the storage, magnetic disk, and optical disk includes several instructions to make a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

本方案涉及人工智能技术领域,为一种基于图像分类模型的训练方法、装置、设备及存储介质,该方法包括分别获取待分类物体的背景图像样本、前景图像样本(S10)和应用图像样本,并根据应用图像样本构建函数合成样本(S20);对背景图像样本和前景图像样本进行拟合得到合成训练样本(S30);通过合成训练样本和函数合成样本训练待训练图像分类模型得到目标图像分类模型(S50)。该方法相比于现有的训练样本没有增广或简单仿射变换进行增广得到的图像分类模型,对背景图像样本和前景图像样本分别处理后再进行拟合的样本增广方式,使样本增广数目以指数级增长,极大提升图像分类模型的分类精度。此外,该方法还涉及区块链技术,背景图像样本和前景图像样本可存储于区块链中。

Description

基于图像分类模型的训练方法、装置、设备及存储介质
本申请要求于2020年9月3日提交中国专利局、申请号为CN202010925560.3,发明名称为“基于图像分类模型的训练方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其涉及一种基于图像分类模型的训练方法、装置、设备及存储介质。
背景技术
图像分类是人工智能领域重要的一部分,大部分基于机器视觉的应用***都会需要图像分类算法,对摄像头采集的图像进行属性判断,然后才进入其他处理流程,可以说图像分类的能力是机器视觉领域的基础能力。
技术问题
发明人意识到现有的图像分类一部分是基于人类工程师的认知人工设计分类算法,算法调试过程复杂,需要专业人才,而且耗时耗力。另一部分是用神经网络训练图像分类模型,需要一定人力采集并标注样本,当样本难以采集导致样本量不足时,没有增广或者只基于简单的仿射变换进行增广,得到的模型精度较差。如果需要识别的场景中背景单一,但训练样本的背景过于多变,实际模型中可能包含了太多背景信息,而针对实际需要分类的物体信息不足,导致在实际应用中误分类较多,单纯的增加样本的方法进行改进需要样本量以10倍增长才会有模型精度提升,使得样本采集和标注成本过高,算法改进整体工作效率难以提高。
上述内容仅用于辅助理解本申请的技术方案,并不代表承认上述内容是现有技术。
技术解决方案
一种基于图像分类模型的训练方法,所述方法包括以下步骤:
在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本;
在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本;
根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本;
基于预设神经网络构建所述待分类物体的待训练图像分类模型;
通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型。
一种基于图像分类模型的训练装置,所述基于图像分类模型的训练装置包括:
获取模块,用于在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本;
所述获取模块,还用于在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本;
拟合模块,用于根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本;
构建模块,用于基于预设神经网络构建所述待分类物体的待训练图像分类模型;
训练模块,用于通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型。
一种基于图像分类模型的训练设备,所述基于图像分类模型的训练设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的基于图像分类模型的训练程序,所述基于图像分类模型的训练程序配置为实现如下步骤:
在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本;
在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本;
根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本;
基于预设神经网络构建所述待分类物体的待训练图像分类模型;
通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型。
一种存储介质,所述存储介质上存储有基于图像分类模型的训练程序,所述基于图像分类模型的训练程序被处理器执行时实现如下步骤:
在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本;
在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本;
根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本;
基于预设神经网络构建所述待分类物体的待训练图像分类模型;
通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型。
附图说明
图1是本申请实施例方案涉及的硬件运行环境的设备的结构示意图;
图2为本申请基于图像分类模型的训练方法第一实施例的流程示意图;
图3为本申请基于图像分类模型的训练方法第二实施例的流程示意图;
图4为本申请基于图像分类模型的训练方法第三实施例的流程示意图;
图5为本申请基于图像分类模型的训练装置第一实施例的结构框图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
本发明的实施方式
应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。
参照图1,图1为本申请实施例方案涉及的硬件运行环境的设备结构示意图。
如图1所示,该设备可以包括:处理器1001,例如中央处理器(Central Processing Unit,CPU),通信总线1002、用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如无线保真(WIreless-FIdelity,WI-FI)接口)。存储器1005可以是高速的随机存取存储器(Random Access Memory,RAM)存储器,也可以是稳定的非易失性存储器(Non-Volatile Memory,NVM),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。
本领域技术人员可以理解,图1中示出的结构并不构成对设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
如图1所示,作为一种存储介质的存储器1005中可以包括操作***、数据存储模块、网络通信模块、用户接口模块以及基于图像分类模型的训练程序。
在图1所示的设备中,网络接口1004主要用于与网络服务器进行数据通信;用户接口1003主要用于与用户进行数据交互;本申请设备中的处理器1001、存储器1005可以设置在设备中,所述设备通过处理器1001调用存储器1005中存储的基于图像分类模型的训练程序,并执行本申请实施例提供的基于图像分类模型的训练方法。
本申请实施例提供了一种基于图像分类模型的训练方法,参照图2,图2为本申请基于图像分类模型的训练方法第一实施例的流程示意图。
本实施例中,所述基于图像分类模型的训练方法包括以下步骤:
步骤S10:在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本。
需要说明的是,本实施例方法的执行主体可以是基于图像分类模型的训练设备。在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本,其中,预设背景环境可以是待分类物体所在环境,可以根据预设背景环境的多样性条件确定图像采集数量;根据所述图像采集数量在所述预设背景环境中获取待分类物体的背景图像样本;根据所述预设背景环境确定前景环境,在所述前景环境中获取前景图像样本。
具体地,在待分类物体所在环境中采集背景图片,根据预设背景环境的多样性条件例如光照情况、拍摄角度和拍摄距离等条件变化判断图像采集数量即需要采集的背景图像样本的数量,图像采集数量以完全覆盖预设背景环境的范围为佳。
应理解的是,根据所述预设背景环境确定前景环境,前景环境可以为尽量简单的背景环境,在尽量简单的背景环境中采集待分类物体的前景图像样本,根据应用场景中待分类物体的可能的呈现范围,例如不同的拍摄距离和拍摄角度等采集尽可能多的待分类物体的前景图像样本,根据不同的待分类物体对前景图像样本进行图像分类标记,便于图像分类模型的训练。
需要强调的是,为进一步保证上述背景图像样本和前景图像样本的私密和安全性,上述背景图像样本和前景图像样本还可以存储于一区块链的节点中。
步骤S20:在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本。
易于理解的是,在预设应用环境中获取所述待分类物体的应用图像样本,其中,预设应用环境可以为待分类物体的应用环境,在预设应用环境中确定所述待分类物体的预设分类数量;根据所述预设分类数量在所述预设应用环境中获取所述待分类物体的应用图像样本;根据所述应用图像样本之间的距离信息构建函数合成样本。预设分类数量为在条件允许下拍摄尽量多的应用图像样本。
具体地,在应用环境中拍摄待分类物体,待分类物体中的每一类物体都需要拍摄并进行图像分类标记,在条件允许下拍摄尽量多的应用图像样本,根据所述应用图像样本之间的距离信息构建函数合成样本,将函数合成样本用于后续图像分类模型的训练及验证,实际拍摄的应用图像样本越多训练得到的图像分类模型精度会越高。
步骤S30:根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本。
需要说明的是,根据拍摄到的背景图像样本和前景图像样本进行拟合,获得合成训练样本。其中,一种可行的拟合方式是使用前景图像样本覆盖背景图像样本并在边缘附近进行背景透明度处理的方式拟合,获得合成训练样本,具体过程可以为:通过预设边缘检测算法对所述背景图像样本进行分割,获得目标前景图像;根据预设增广算法对所述背景图像样本和所述目标前景图像进行分类组合,获得初始合成训练样本;根据所述前景图像样本对所述初始合成训练样本进行边缘处理,获得合成训练样本。
具体地,根据所述预设背景环境确定前景环境,前景环境可以为尽量简单的背景环境,在尽量简单的背景环境中采集待分类物体的前景图像样本,拍摄的前景图像样本由于使用了尽量简单的背景环境,可以通过抠图技术获得目标前景图像,例如可以通过预设边缘检测算法对背景图像样本进行分割,获得目标前景图像,即通过简单的边缘检测算法分割背景图像样本的前景和纯色背景,获得目标前景图像。
进一步地,根据预设增广算法对背景图像样本和目标前景图像进行分类组合,获得初始合成训练样本;其中,预设增广算法可以包括模糊、旋转、扭曲以及偏色等增广算法,对背景图像样本和目标前景图像分类进行模糊、旋转、扭曲以及偏色后随机组合,获得初始合成训练样本,使尽量多的目标前景图像呈像于尽量多的背景图像样本组合中,一般可直接把目标前景图像覆盖于背景图像样本的部分区域,根据不同的目标前景图像分类对合成后的初始合成训练样本进行分类标记。
进一步地,对合成的初始合成训练样本进行边缘处理,一般可以根据前景图像样本的边缘和在背景图像样本上的相对位置得到合成后初始合成训练样本的物体边缘区域,对此物体边缘区域进行透明度处理,获得合成训练样本。
步骤S40:基于预设神经网络构建所述待分类物体的待训练图像分类模型。
应当理解的是,基于预设神经网络构建待分类物体的待训练图像分类模型,或者根据实际需要模型构建待分类物体的待训练图像分类模型,待分类物体的待训练图像分类模型可以是基于人类工程师的认知人工设计的分类算法构建待训练图像分类模型,待分类物体的待训练图像分类模型还可以是基于神经网络训练的图像分类模型,本实施例合成训练样本和函数合成样本可以训练上述两种类型的待训练图像分类模型,获得目标图像分类模型,提升图像分类模型的精度,待分类物体的待训练图像分类模型还可以为其他方式获得的待训练图像分类模型,本实施例对此不加以限制。
步骤S50:通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型。
易于理解的是,通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型,训练所述待训练图像分类模型可以采用多种方式,本实施例通过以下训练方式进行说明:通过所述合成训练样本对待训练图像分类模型的网络参数进行更新,获得基础图像分类模型;
获取用于图像分类的分类器参数,根据所述分类器参数更新所述基础图像分类模型的分类器参数,获得更新后的基础图像分类模型;通过所述函数合成样本对所述更新后的基础图像分类模型的网络参数进行更新,获得目标图像分类模型。
需要说明的是,本实施例还可以采用其他训练方式通过合成训练样本和函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型,本实施例对此不加以限制。图像分类是人工智能领域重要的一部分,大部分基于机器视觉的应用***都需要图像分类模型,对摄像头采集的图像进行属性判断,然后才进入其他处理流程,可以说图像分类模型的分类能力是机器视觉领域的基础能力。本实施例使样本增广数目得到指数级的增长,极大提升图像分类模型的分类精度,可以应用于机器视觉的人工智能领域。
本实施例通过在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本;在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本;根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本;基于预设神经网络构建所述待分类物体的待训练图像分类模型;通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型。本实施例相比于现有的训练样本没有增广或者只基于简单的仿射变换进行增广,得到的图像分类模型精度较差,采用背景图像样本和前景图像样本分别处理后再进行拟合的样本增广方式,可以使样本增广数目得到指数级的增长,极大提升图像分类模型的分类精度,解决了现有技术训练样本难以采集或过于多变导致的图像分类模型精度差,图像分类模型改进工作的效率难以提高的技术问题。
参考图3,图3为本申请基于图像分类模型的训练方法第二实施例的流程示意图。
基于上述第一实施例,在本实施例中,所述步骤S30包括:
步骤S301:通过预设边缘检测算法对所述背景图像样本进行分割,获得目标前景图像。
需要说明的是,根据拍摄到的背景图像样本和前景图像样本进行拟合,获得合成训练样本。其中,一种可行的拟合方式是使用前景图像样本覆盖背景图像样本并在边缘附近进行背景透明度处理的方式拟合,获得合成训练样本。
具体地,通过预设边缘检测算法对所述背景图像样本进行分割,获得目标前景图像,预设边缘检测算法可以为简单的边缘检测算法。根据预设背景环境确定前景环境,前景环境可以为尽量简单的背景环境,在尽量简单的背景环境中采集待分类物体的前景图像样本,拍摄的前景图像样本由于使用了尽量简单的背景环境,可以通过抠图技术获得目标前景图像,例如可以通过简单的边缘检测算法分割背景图像样本的前景和纯色背景,获得目标前景图像。还可以通过其他算法分割背景图像样本的前景和纯色背景,获得目标前景图像,本实施例对此不加以限制。
步骤S302:根据预设增广算法对所述背景图像样本和所述目标前景图像进行分类组合,获得初始合成训练样本。
易于理解的是,根据预设增广算法对所述背景图像样本和所述目标前景图像进行分类组合,其中,预设增广算法可以包括模糊、旋转、扭曲以及偏色等增广算法中的任意一种,预设增广算法可以包括其他增广算法,本实施例对此不加以限制,本实施例以预设增广算法包括模糊、旋转、扭曲以及偏色增广算法进行说明。
具体地,根据预设增广算法对背景图像样本和目标前景图像进行分类组合,获得初始合成训练样本的过程可以为:根据模糊、旋转、扭曲以及偏色增广算法对背景图像样本和目标前景图像分类进行处理后随机组合,获得初始合成训练样本,使尽量多的目标前景图像呈像于尽量多的背景图像样本组合中,一般可直接把目标前景图像覆盖于背景图像样本的部分区域,根据不同的目标前景图像分类对合成后的初始合成训练样本进行分类标记。
步骤S303:根据所述前景图像样本对所述初始合成训练样本进行边缘处理,获得合成训练样本。
需要说明的是,对合成的初始合成训练样本进行边缘处理,一般可以根据前景图像样本的边缘和在背景图像样本上的相对位置得到合成后初始合成训练样本的物体边缘区域,对此物体边缘区域进行透明度处理,获得合成训练样本。
具体地,可以将前景图像样本覆盖于背景图像样本,获取前景图像样本相对于背景图像样本的相对位置;根据前景图像样本的边缘区域和相对位置获得初始合成训练样本的合成边缘区域;对合成边缘区域进行透明度处理,获得透明度处理后的初始合成训练样本;将透明度处理后的初始合成训练样本作为合成训练样本。
本实施例通过预设边缘检测算法对所述背景图像样本进行分割,获得目标前景图像;根据预设增广算法对所述背景图像样本和所述目标前景图像进行分类组合,获得初始合成训练样本;根据所述前景图像样本对所述初始合成训练样本进行边缘处理,获得合成训练样本。本实施例在合成训练样本生成过程中,可以根据前景图像样本对初始合成训练样本进行边缘处理,获得合成训练样本,由于前景图像样本边缘的透明度可以有不同的取值策略,在一定范围内随机或在一定步长下均匀取值等,在通过合成训练样本和函数合成样本训练待训练图像分类模型时,又可以进一步使待训练图像分类模型降低对边缘的关注,而得到更多物体本身的形状纹理等信息,提升训练后的目标图像分类模型的分类精度。
参考图4,图4为本申请基于图像分类模型的训练方法第三实施例的流程示意图。
基于上述第二实施例,在本实施例中,所述步骤S303,包括:
步骤S3031:将所述前景图像样本覆盖于所述背景图像样本,获取所述前景图像样本相对于所述背景图像样本的相对位置。
需要说明的是,对合成的初始合成训练样本进行边缘处理,一般可以根据前景图像样本的边缘和在背景图像样本上的相对位置得到合成后初始合成训练样本的物体边缘区域,对此物体边缘区域进行透明度处理,获得合成训练样本。其中,获得合成后初始合成训练样本的物体边缘区域,需要将所述前景图像样本覆盖于所述背景图像样本,获取所述前景图像样本相对于所述背景图像样本的相对位置。
步骤S3032:根据所述前景图像样本的边缘区域和所述相对位置获得初始合成训练样本的合成边缘区域。
易于理解的是,根据前景图像样本的边缘区域和前景图像样本相对于背景图像样本的相对位置,可以获得初始合成训练样本的合成边缘区域,对所述合成边缘区域进行透明度处理后,可以获得透明度处理后的初始合成训练样本。将透明度处理后的初始合成训练样本作为合成训练样本,在训练待训练图像分类模型时,透明度处理后的初始合成训练样本可以进一步使待训练图像分类模型降低对边缘的关注,提升训练后的目标图像分类模型的分类精度。
步骤S3033:对所述合成边缘区域进行透明度处理,获得透明度处理后的初始合成训练样本。
需要说明的是,对所述合成边缘区域进行透明度处理,获得透明度处理后的初始合成训练样本的过程可以为:获取所述合成边缘区域中所述背景图像样本的各像素点灰度值;获取所述合成边缘区域中所述前景图像样本的各像素点灰度值;基于预设透明度对所述背景图像样本的各像素点灰度值和所述前景图像样本的各像素点灰度值进行透明度处理,获得所述合成边缘区域中各像素点的像素合成值;根据所述像素合成值构建透明度处理后的初始合成训练样本。
具体地,对所述合成边缘区域进行透明度处理,例如在RGB颜色空间中,当透明度为alpha,背景图像样本为B,前景图像样本为A,合成后的初始合成训练样本为C时,本实施例以绿颜色G通道为例,可以获得合成边缘区域中各像素点的像素合成值,可以通过下式计算合成边缘区域中G像素点的像素合成值:G(C)=(1-alpha)*G(B)+alpha*G(A),其中,alpha为预设透明度,G(A)为前景图像样本的G像素点灰度值,G(B)为背景图像样本的G像素点灰度值,G(C)为合成边缘区域中G像素点的像素合成值,在RGB颜色空间中,根据上述方式还可以获得合成边缘区域中红像素点的像素合成值和蓝像素点的像素合成值,根据合成边缘区域中绿像素点的像素合成值、红像素点的像素合成值和蓝像素点的像素合成值可以构建透明度处理后的初始合成训练样本。此外,对所述合成边缘区域进行透明度处理还可以在RGBW颜色空间中或者其他颜色空间,本实施例对此不加以限制。
步骤S3034:将所述透明度处理后的初始合成训练样本作为合成训练样本。
应当理解的是,将透明度处理后的初始合成训练样本作为合成训练样本,由于透明度可以有不同的取值策略,在一定范围内随机或在一定步长下均匀取值等,在通过合成训练样本和函数合成样本训练待训练图像分类模型时,又可以进一步使待训练图像分类模型降低对边缘的关注,而得到更多物体本身的形状纹理等信息,提升训练后的目标图像分类模型的分类精度。为避免合成训练样本的边缘部分过于雷同,可以在一定范围内使用随机的预设透明度alpha值。
本实施例中将所述前景图像样本覆盖于所述背景图像样本,获取所述前景图像样本相对于所述背景图像样本的相对位置;根据所述前景图像样本的边缘区域和所述相对位置获得初始合成训练样本的合成边缘区域;对所述合成边缘区域进行透明度处理,获得透明度处理后的初始合成训练样本;将所述透明度处理后的初始合成训练样本作为合成训练样本。本实施例在合成训练样本生成过程中,可以对合成边缘区域进行透明度处理,获得透明度处理后的初始合成训练样本,由于透明度可以有不同的取值策略,在一定范围内随机或在一定步长下均匀取值等,在通过合成训练样本和函数合成样本训练待训练图像分类模型时,又可以进一步使待训练图像分类模型降低对边缘的关注,而得到更多物体本身的形状纹理等信息,提升训练后的目标图像分类模型的分类精度。
此外,本申请实施例还提出一种存储介质,所述存储介质可以是易失性的,也可以是非易失性的,所述存储介质上存储有基于图像分类模型的训练程序,所述基于图像分类模型的训练程序被处理器执行时实现如下步骤:
在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本;
在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本;
根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本;
基于预设神经网络构建所述待分类物体的待训练图像分类模型;
通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型。
本申请存储介质的其他实施例或具体实现方式可参照上述各基于图像分类模型的训练方法实施例,此处不再赘述。
参照图5,图5为本申请基于图像分类模型的训练装置第一实施例的结构框图。
如图5所示,本申请实施例提出的基于图像分类模型的训练装置包括:
获取模块10,用于在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本。
需要说明的是,本实施例方法的执行主体可以是基于图像分类模型的训练设备。在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本,其中,预设背景环境可以是待分类物体所在环境,可以根据预设背景环境的多样性条件确定图像采集数量;根据所述图像采集数量在所述预设背景环境中获取待分类物体的背景图像样本;根据所述预设背景环境确定前景环境,在所述前景环境中获取前景图像样本。
具体地,在待分类物体所在环境中采集背景图片,根据预设背景环境的多样性条件例如光照情况、拍摄角度和拍摄距离等条件变化判断图像采集数量即需要采集的背景图像样本的数量,图像采集数量以完全覆盖预设背景环境的范围为佳。
应理解的是,根据所述预设背景环境确定前景环境,前景环境可以为尽量简单的背景环境,在尽量简单的背景环境中采集待分类物体的前景图像样本,根据应用场景中待分类物体的可能的呈现范围,例如不同的拍摄距离和拍摄角度等采集尽可能多的待分类物体的前景图像样本,根据不同的待分类物体对前景图像样本进行图像分类标记,便于图像分类模型的训练。
所述获取模块10,还用于在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本。
易于理解的是,在预设应用环境中获取所述待分类物体的应用图像样本,其中,预设应用环境可以为待分类物体的应用环境,在预设应用环境中确定所述待分类物体的预设分类数量;根据所述预设分类数量在所述预设应用环境中获取所述待分类物体的应用图像样本;根据所述应用图像样本之间的距离信息构建函数合成样本。预设分类数量为在条件允许下拍摄尽量多的应用图像样本。
具体地,在应用环境中拍摄待分类物体,待分类物体中的每一类物体都需要拍摄并进行图像分类标记,在条件允许下拍摄尽量多的应用图像样本,根据所述应用图像样本之间的距离信息构建函数合成样本,将函数合成样本用于后续图像分类模型的训练及验证,实际拍摄的应用图像样本越多训练得到的图像分类模型精度会越高。
需要强调的是,为进一步保证上述背景图像样本和前景图像样本的私密和安全性,上述背景图像样本和前景图像样本还可以存储于一区块链的节点中。
拟合模块20,用于根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本。
需要说明的是,根据拍摄到的背景图像样本和前景图像样本进行拟合,获得合成训练样本。其中,一种可行的拟合方式是使用前景图像样本覆盖背景图像样本并在边缘附近进行背景透明度处理的方式拟合,获得合成训练样本,具体过程可以为:通过预设边缘检测算法对所述背景图像样本进行分割,获得目标前景图像;根据预设增广算法对所述背景图像样本和所述目标前景图像进行分类组合,获得初始合成训练样本;根据所述前景图像样本对所述初始合成训练样本进行边缘处理,获得合成训练样本。
具体地,根据所述预设背景环境确定前景环境,前景环境可以为尽量简单的背景环境,在尽量简单的背景环境中采集待分类物体的前景图像样本,拍摄的前景图像样本由于使用了尽量简单的背景环境,可以通过抠图技术获得目标前景图像,例如可以通过预设边缘检测算法对背景图像样本进行分割,获得目标前景图像,即通过简单的边缘检测算法分割背景图像样本的前景和纯色背景,获得目标前景图像。
进一步地,根据预设增广算法对背景图像样本和目标前景图像进行分类组合,获得初始合成训练样本;其中,预设增广算法可以包括模糊、旋转、扭曲以及偏色等增广算法,对背景图像样本和目标前景图像分类进行模糊、旋转、扭曲以及偏色后随机组合,获得初始合成训练样本,使尽量多的目标前景图像呈像于尽量多的背景图像样本组合中,一般可直接把目标前景图像覆盖于背景图像样本的部分区域,根据不同的目标前景图像分类对合成后的初始合成训练样本进行分类标记。
进一步地,对合成的初始合成训练样本进行边缘处理,一般可以根据前景图像样本的边缘和在背景图像样本上的相对位置得到合成后初始合成训练样本的物体边缘区域,对此物体边缘区域进行透明度处理,获得合成训练样本。
构建模块30,用于基于预设神经网络构建所述待分类物体的待训练图像分类模型。
应当理解的是,基于预设神经网络构建待分类物体的待训练图像分类模型,或者根据实际需要模型构建待分类物体的待训练图像分类模型,待分类物体的待训练图像分类模型可以是基于人类工程师的认知人工设计的分类算法构建待训练图像分类模型,待分类物体的待训练图像分类模型还可以是基于神经网络训练的图像分类模型,本实施例合成训练样本和函数合成样本可以训练上述两种类型的待训练图像分类模型,获得目标图像分类模型,提升图像分类模型的精度,待分类物体的待训练图像分类模型还可以为其他方式获得的待训练图像分类模型,本实施例对此不加以限制。
训练模块40,用于通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型。
易于理解的是,通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型,训练所述待训练图像分类模型可以采用多种方式,本实施例通过以下训练方式进行说明:通过所述合成训练样本对待训练图像分类模型的网络参数进行更新,获得基础图像分类模型;
获取用于图像分类的分类器参数,根据所述分类器参数更新所述基础图像分类模型的分类器参数,获得更新后的基础图像分类模型;通过所述函数合成样本对所述更新后的基础图像分类模型的网络参数进行更新,获得目标图像分类模型。
需要说明的是,本实施例还可以采用其他训练方式通过合成训练样本和函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型,本实施例对此不加以限制。图像分类是人工智能领域重要的一部分,大部分基于机器视觉的应用***都需要图像分类模型,对摄像头采集的图像进行属性判断,然后才进入其他处理流程,可以说图像分类模型的分类能力是机器视觉领域的基础能力。本实施例使样本增广数目得到指数级的增长,极大提升图像分类模型的分类精度,可以应用于机器视觉等人工智能领域。
本实施例中获取模块10,用于在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本;所述获取模块10,还用于在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本;拟合模块20,用于根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本;构建模块30,用于基于预设神经网络构建所述待分类物体的待训练图像分类模型;训练模块40,用于通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型。本实施例相比于现有的训练样本没有增广或者只基于简单的仿射变换进行增广,得到的图像分类模型精度较差,采用背景图像样本和前景图像样本分别处理后再进行拟合的样本增广方式,可以使样本增广数目得到指数级的增长,极大提升图像分类模型的分类精度,解决了现有技术训练样本难以采集或过于多变导致的图像分类模型精度差,图像分类模型改进工作的效率难以提高的技术问题。
基于本申请上述基于图像分类模型的训练装置第一实施例,提出本申请基于图像分类模型的训练装置的第二实施例。
在本实施例中,所述获取模块10,还用于根据预设背景环境的多样性条件确定图像采集数量;根据所述图像采集数量在所述预设背景环境中获取待分类物体的背景图像样本;根据所述预设背景环境确定前景环境,在所述前景环境中获取前景图像样本。
进一步地,所述获取模块10,还用于在预设应用环境中确定所述待分类物体的预设分类数量;根据所述预设分类数量在所述预设应用环境中获取所述待分类物体的应用图像样本;根据所述应用图像样本之间的距离信息构建函数合成样本。
进一步地,所述拟合模块20,还用于通过预设边缘检测算法对所述背景图像样本进行分割,获得目标前景图像;根据预设增广算法对所述背景图像样本和所述目标前景图像进行分类组合,获得初始合成训练样本;根据所述前景图像样本对所述初始合成训练样本进行边缘处理,获得合成训练样本。
进一步地,所述拟合模块20,还用于将所述前景图像样本覆盖于所述背景图像样本,获取所述前景图像样本相对于所述背景图像样本的相对位置;根据所述前景图像样本的边缘区域和所述相对位置获得初始合成训练样本的合成边缘区域;对所述合成边缘区域进行透明度处理,获得透明度处理后的初始合成训练样本;将所述透明度处理后的初始合成训练样本作为合成训练样本。
进一步地,所述拟合模块20,还用于获取所述合成边缘区域中所述背景图像样本的各像素点灰度值;获取所述合成边缘区域中所述前景图像样本的各像素点灰度值;基于预设透明度对所述背景图像样本的各像素点灰度值和所述前景图像样本的各像素点灰度值进行透明度处理,获得所述合成边缘区域中各像素点的像素合成值;根据所述像素合成值构建透明度处理后的初始合成训练样本。
进一步地,所述训练模块40,还用于通过所述合成训练样本对待训练图像分类模型的网络参数进行更新,获得基础图像分类模型;获取用于图像分类的分类器参数,根据所述分类器参数更新所述基础图像分类模型的分类器参数,获得更新后的基础图像分类模型;通过所述函数合成样本对所述更新后的基础图像分类模型的网络参数进行更新,获得目标图像分类模型。
本申请基于图像分类模型的训练装置的其他实施例或具体实现方式可参照上述各基于图像分类模型的训练方法实施例,此处不再赘述。
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者***不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者***所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者***中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如只读存储器/随机存取存储器、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种基于图像分类模型的训练方法,其中,所述基于图像分类模型的训练方法包括:
    在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本;
    在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本;
    根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本;
    基于预设神经网络构建所述待分类物体的待训练图像分类模型;
    通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型。
  2. 如权利要求1所述的基于图像分类模型的训练方法,其中,所述在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本的步骤,包括:
    根据预设背景环境的多样性条件确定图像采集数量;
    根据所述图像采集数量在所述预设背景环境中获取待分类物体的背景图像样本;
    根据所述预设背景环境确定前景环境,在所述前景环境中获取前景图像样本。
  3. 如权利要求1所述的基于图像分类模型的训练方法,其中,所述在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本的步骤,包括:
    在预设应用环境中确定所述待分类物体的预设分类数量;
    根据所述预设分类数量在所述预设应用环境中获取所述待分类物体的应用图像样本;
    根据所述应用图像样本之间的距离信息构建函数合成样本。
  4. 如权利要求1所述的基于图像分类模型的训练方法,其中,所述根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本的步骤,包括:
    通过预设边缘检测算法对所述背景图像样本进行分割,获得目标前景图像;
    根据预设增广算法对所述背景图像样本和所述目标前景图像进行分类组合,获得初始合成训练样本;
    根据所述前景图像样本对所述初始合成训练样本进行边缘处理,获得合成训练样本。
  5. 如权利要求4所述的基于图像分类模型的训练方法,其中,所述根据所述前景图像样本对所述初始合成训练样本进行边缘处理,获得合成训练样本的步骤,包括:
    将所述前景图像样本覆盖于所述背景图像样本,获取所述前景图像样本相对于所述背景图像样本的相对位置;
    根据所述前景图像样本的边缘区域和所述相对位置获得初始合成训练样本的合成边缘区域;
    对所述合成边缘区域进行透明度处理,获得透明度处理后的初始合成训练样本;
    将所述透明度处理后的初始合成训练样本作为合成训练样本。
  6. 如权利要求5所述的基于图像分类模型的训练方法,其中,所述对所述合成边缘区域进行透明度处理,获得透明度处理后的初始合成训练样本的步骤,包括:
    获取所述合成边缘区域中所述背景图像样本的各像素点灰度值;
    获取所述合成边缘区域中所述前景图像样本的各像素点灰度值;
    基于预设透明度对所述背景图像样本的各像素点灰度值和所述前景图像样本的各像素点灰度值进行透明度处理,获得所述合成边缘区域中各像素点的像素合成值;
    根据所述像素合成值构建透明度处理后的初始合成训练样本。
  7. 如权利要求1~6中任一项所述的基于图像分类模型的训练方法,其中,所述通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型的步骤,包括:
    通过所述合成训练样本对待训练图像分类模型的网络参数进行更新,获得基础图像分类模型;
    获取用于图像分类的分类器参数,根据所述分类器参数更新所述基础图像分类模型的分类器参数,获得更新后的基础图像分类模型;
    通过所述函数合成样本对所述更新后的基础图像分类模型的网络参数进行更新,获得目标图像分类模型。
  8. 一种基于图像分类模型的训练装置,其中,所述基于图像分类模型的训练装置包括:
    获取模块,用于在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本;
    所述获取模块,还用于在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本;
    拟合模块,用于根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本;
    构建模块,用于基于预设神经网络构建所述待分类物体的待训练图像分类模型;
    训练模块,用于通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型。
  9. 一种基于图像分类模型的训练设备,其中,所述基于图像分类模型的训练设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的基于图像分类模型的训练程序,所述基于图像分类模型的训练程序配置为实现如下步骤:
    在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本;
    在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本;
    根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本;
    基于预设神经网络构建所述待分类物体的待训练图像分类模型;
    通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型。
  10. 如权利要求9所述的基于图像分类模型的训练设备,其中,所述在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本的步骤,包括:
    根据预设背景环境的多样性条件确定图像采集数量;
    根据所述图像采集数量在所述预设背景环境中获取待分类物体的背景图像样本;
    根据所述预设背景环境确定前景环境,在所述前景环境中获取前景图像样本。
  11. 如权利要求9所述的基于图像分类模型的训练设备,其中,所述在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本的步骤,包括:
    在预设应用环境中确定所述待分类物体的预设分类数量;
    根据所述预设分类数量在所述预设应用环境中获取所述待分类物体的应用图像样本;
    根据所述应用图像样本之间的距离信息构建函数合成样本。
  12. 如权利要求9所述的基于图像分类模型的训练设备,其中,所述根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本的步骤,包括:
    通过预设边缘检测算法对所述背景图像样本进行分割,获得目标前景图像;
    根据预设增广算法对所述背景图像样本和所述目标前景图像进行分类组合,获得初始合成训练样本;
    根据所述前景图像样本对所述初始合成训练样本进行边缘处理,获得合成训练样本。
  13. 如权利要求12所述的基于图像分类模型的训练设备,其中,所述根据所述前景图像样本对所述初始合成训练样本进行边缘处理,获得合成训练样本的步骤,包括:
    将所述前景图像样本覆盖于所述背景图像样本,获取所述前景图像样本相对于所述背景图像样本的相对位置;
    根据所述前景图像样本的边缘区域和所述相对位置获得初始合成训练样本的合成边缘区域;
    对所述合成边缘区域进行透明度处理,获得透明度处理后的初始合成训练样本;
    将所述透明度处理后的初始合成训练样本作为合成训练样本。
  14. 如权利要求13所述的基于图像分类模型的训练设备,其中,所述对所述合成边缘区域进行透明度处理,获得透明度处理后的初始合成训练样本的步骤,包括:
    获取所述合成边缘区域中所述背景图像样本的各像素点灰度值;
    获取所述合成边缘区域中所述前景图像样本的各像素点灰度值;
    基于预设透明度对所述背景图像样本的各像素点灰度值和所述前景图像样本的各像素点灰度值进行透明度处理,获得所述合成边缘区域中各像素点的像素合成值;
    根据所述像素合成值构建透明度处理后的初始合成训练样本。
  15. 如权利要求9~14中任一项所述的基于图像分类模型的训练设备,其中,所述通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型的步骤,包括:
    通过所述合成训练样本对待训练图像分类模型的网络参数进行更新,获得基础图像分类模型;
    获取用于图像分类的分类器参数,根据所述分类器参数更新所述基础图像分类模型的分类器参数,获得更新后的基础图像分类模型;
    通过所述函数合成样本对所述更新后的基础图像分类模型的网络参数进行更新,获得目标图像分类模型。
  16. 一种存储介质,其中,所述存储介质上存储有基于图像分类模型的训练程序,所述基于图像分类模型的训练程序被处理器执行时实现如下步骤:
    在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本;
    在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本;
    根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本;
    基于预设神经网络构建所述待分类物体的待训练图像分类模型;
    通过所述合成训练样本和所述函数合成样本训练所述待训练图像分类模型,获得目标图像分类模型。
  17. 如权利要求16所述的存储介质,其中,所述在预设背景环境中分别获取待分类物体的背景图像样本和前景图像样本的步骤,包括:
    根据预设背景环境的多样性条件确定图像采集数量;
    根据所述图像采集数量在所述预设背景环境中获取待分类物体的背景图像样本;
    根据所述预设背景环境确定前景环境,在所述前景环境中获取前景图像样本。
  18. 如权利要求16所述的存储介质,其中,所述在预设应用环境中获取所述待分类物体的应用图像样本,并根据所述应用图像样本构建函数合成样本的步骤,包括:
    在预设应用环境中确定所述待分类物体的预设分类数量;
    根据所述预设分类数量在所述预设应用环境中获取所述待分类物体的应用图像样本;
    根据所述应用图像样本之间的距离信息构建函数合成样本。
  19. 如权利要求16所述的存储介质,其中,所述根据所述背景图像样本和所述前景图像样本进行拟合,获得合成训练样本的步骤,包括:
    通过预设边缘检测算法对所述背景图像样本进行分割,获得目标前景图像;
    根据预设增广算法对所述背景图像样本和所述目标前景图像进行分类组合,获得初始合成训练样本;
    根据所述前景图像样本对所述初始合成训练样本进行边缘处理,获得合成训练样本。
  20. 如权利要求19所述的存储介质,其中,所述根据所述前景图像样本对所述初始合成训练样本进行边缘处理,获得合成训练样本的步骤,包括:
    将所述前景图像样本覆盖于所述背景图像样本,获取所述前景图像样本相对于所述背景图像样本的相对位置;
    根据所述前景图像样本的边缘区域和所述相对位置获得初始合成训练样本的合成边缘区域;
    对所述合成边缘区域进行透明度处理,获得透明度处理后的初始合成训练样本;
    将所述透明度处理后的初始合成训练样本作为合成训练样本。
PCT/CN2020/125007 2020-09-03 2020-10-30 基于图像分类模型的训练方法、装置、设备及存储介质 WO2021189847A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010925560.3 2020-09-03
CN202010925560.3A CN112016630B (zh) 2020-09-03 2020-09-03 基于图像分类模型的训练方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021189847A1 true WO2021189847A1 (zh) 2021-09-30

Family

ID=73515430

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/125007 WO2021189847A1 (zh) 2020-09-03 2020-10-30 基于图像分类模型的训练方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN112016630B (zh)
WO (1) WO2021189847A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113762422A (zh) * 2021-11-09 2021-12-07 广州思德医疗科技有限公司 一种图像训练集合成方法及***
CN114185429A (zh) * 2021-11-11 2022-03-15 杭州易现先进科技有限公司 手势关键点定位或姿态估计的方法、电子装置和存储介质
CN114333038A (zh) * 2022-03-03 2022-04-12 百度在线网络技术(北京)有限公司 对象识别模型的训练方法和对象识别方法、装置、设备
CN114359233A (zh) * 2022-01-07 2022-04-15 北京华云安信息技术有限公司 图像分割模型训练方法、装置、电子设备及可读存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468906B (zh) * 2021-07-12 2024-03-26 深圳思谋信息科技有限公司 图形码提取模型构建方法、识别方法、装置、设备和介质
CN113610968A (zh) * 2021-08-17 2021-11-05 北京京东乾石科技有限公司 目标检测模型的更新方法及装置

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120288186A1 (en) * 2011-05-12 2012-11-15 Microsoft Corporation Synthesizing training samples for object recognition
CN104715451A (zh) * 2015-03-11 2015-06-17 西安交通大学 一种基于颜色及透明度一致优化的图像无缝融合方法
CN108830780A (zh) * 2018-05-09 2018-11-16 北京京东金融科技控股有限公司 图像处理方法及装置、电子设备、存储介质
CN108932735A (zh) * 2018-07-10 2018-12-04 广州众聚智能科技有限公司 一种生成深度学习样本的方法
CN110197190A (zh) * 2018-02-27 2019-09-03 北京猎户星空科技有限公司 模型训练和物体的定位方法及装置
CN110516514A (zh) * 2018-05-22 2019-11-29 杭州海康威视数字技术股份有限公司 一种目标检测模型的建模方法和装置
CN111476284A (zh) * 2020-04-01 2020-07-31 网易(杭州)网络有限公司 图像识别模型训练及图像识别方法、装置、电子设备

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108229267B (zh) * 2016-12-29 2020-10-16 北京市商汤科技开发有限公司 对象属性检测、神经网络训练、区域检测方法和装置

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120288186A1 (en) * 2011-05-12 2012-11-15 Microsoft Corporation Synthesizing training samples for object recognition
CN104715451A (zh) * 2015-03-11 2015-06-17 西安交通大学 一种基于颜色及透明度一致优化的图像无缝融合方法
CN110197190A (zh) * 2018-02-27 2019-09-03 北京猎户星空科技有限公司 模型训练和物体的定位方法及装置
CN108830780A (zh) * 2018-05-09 2018-11-16 北京京东金融科技控股有限公司 图像处理方法及装置、电子设备、存储介质
CN110516514A (zh) * 2018-05-22 2019-11-29 杭州海康威视数字技术股份有限公司 一种目标检测模型的建模方法和装置
CN108932735A (zh) * 2018-07-10 2018-12-04 广州众聚智能科技有限公司 一种生成深度学习样本的方法
CN111476284A (zh) * 2020-04-01 2020-07-31 网易(杭州)网络有限公司 图像识别模型训练及图像识别方法、装置、电子设备

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HAITIAN ZHENG; HAOFU LIAO; LELE CHEN; WEI XIONG; TIANLANG CHEN; JIEBO LUO: "Example-Guided Image Synthesis across Arbitrary Scenes using Masked Spatial-Channel Attention and Self-Supervision", ARXIV.ORG, CORNELL UNIVERSITY LIBRARY, 201 OLIN LIBRARY CORNELL UNIVERSITY ITHACA, NY 14853, 18 April 2020 (2020-04-18), 201 Olin Library Cornell University Ithaca, NY 14853, XP081649446 *
HOU QIQI; LIU FENG: "Context-Aware Image Matting for Simultaneous Foreground and Alpha Estimation", 2019 IEEE/CVF INTERNATIONAL CONFERENCE ON COMPUTER VISION (ICCV), IEEE, 27 October 2019 (2019-10-27), pages 4129 - 4138, XP033723387, DOI: 10.1109/ICCV.2019.00423 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113762422A (zh) * 2021-11-09 2021-12-07 广州思德医疗科技有限公司 一种图像训练集合成方法及***
CN114185429A (zh) * 2021-11-11 2022-03-15 杭州易现先进科技有限公司 手势关键点定位或姿态估计的方法、电子装置和存储介质
CN114185429B (zh) * 2021-11-11 2024-03-26 杭州易现先进科技有限公司 手势关键点定位或姿态估计的方法、电子装置和存储介质
CN114359233A (zh) * 2022-01-07 2022-04-15 北京华云安信息技术有限公司 图像分割模型训练方法、装置、电子设备及可读存储介质
CN114359233B (zh) * 2022-01-07 2024-04-02 北京华云安信息技术有限公司 图像分割模型训练方法、装置、电子设备及可读存储介质
CN114333038A (zh) * 2022-03-03 2022-04-12 百度在线网络技术(北京)有限公司 对象识别模型的训练方法和对象识别方法、装置、设备

Also Published As

Publication number Publication date
CN112016630A (zh) 2020-12-01
CN112016630B (zh) 2024-03-19

Similar Documents

Publication Publication Date Title
WO2021189847A1 (zh) 基于图像分类模型的训练方法、装置、设备及存储介质
US10824910B2 (en) Image processing method, non-transitory computer readable storage medium and image processing system
US20120183238A1 (en) Rapid 3D Face Reconstruction From a 2D Image and Methods Using Such Rapid 3D Face Reconstruction
US11354797B2 (en) Method, device, and system for testing an image
CN109871845B (zh) 证件图像提取方法及终端设备
Bellavia et al. Dissecting and reassembling color correction algorithms for image stitching
US20180357819A1 (en) Method for generating a set of annotated images
CN108154149B (zh) 基于深度学习网络共享的车牌识别方法
TW202026948A (zh) 活體檢測方法、裝置以及儲存介質
WO2022213540A1 (zh) 目标检测、属性识别与跟踪方法及***
WO2020143165A1 (zh) 一种翻拍图像的识别方法、***及终端设备
CN110298829A (zh) 一种舌诊方法、装置、***、计算机设备和存储介质
CN112818767A (zh) 数据集生成、伪造检测方法、装置、电子设备及存储介质
TWI672639B (zh) 使用模擬物件影像之物件辨識系統及其方法
CN112788254B (zh) 摄像头抠像方法、装置、设备及存储介质
CN104766068A (zh) 一种多规则融合的随机游走舌像提取方法
CN111738964A (zh) 一种基于建模的图像数据增强的方法
CN108810319A (zh) 图像处理装置和图像处理方法
CN112700396A (zh) 一种人脸图片光照评价方法、装置、计算设备和存储介质
CN112464924A (zh) 一种构建训练集的方法及装置
Zhang et al. A combined approach to single-camera-based lane detection in driverless navigation
US20220327862A1 (en) Method for detecting whether a face is masked, masked-face recognition device, and computer storage medium
CN113435358B (zh) 用于训练模型的样本生成方法、装置、设备、程序产品
CN109141457A (zh) 导航评估方法、装置、计算机设备和存储介质
CN111583168A (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: 20926887

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: 20926887

Country of ref document: EP

Kind code of ref document: A1