CN109460792A - A kind of artificial intelligence model training method and device based on image recognition - Google Patents
A kind of artificial intelligence model training method and device based on image recognition Download PDFInfo
- Publication number
- CN109460792A CN109460792A CN201811353403.9A CN201811353403A CN109460792A CN 109460792 A CN109460792 A CN 109460792A CN 201811353403 A CN201811353403 A CN 201811353403A CN 109460792 A CN109460792 A CN 109460792A
- Authority
- CN
- China
- Prior art keywords
- artificial intelligence
- intelligence model
- sample set
- images
- optimized
- 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.)
- Pending
Links
- 238000013473 artificial intelligence Methods 0.000 title claims abstract description 206
- 238000012549 training Methods 0.000 title claims abstract description 90
- 238000000034 method Methods 0.000 title claims abstract description 64
- 238000005457 optimization Methods 0.000 claims abstract description 79
- 239000000523 sample Substances 0.000 claims description 134
- 239000013074 reference sample Substances 0.000 claims description 65
- 238000012795 verification Methods 0.000 claims description 36
- 230000006870 function Effects 0.000 claims description 22
- 238000004590 computer program Methods 0.000 claims description 10
- 238000000605 extraction Methods 0.000 claims description 4
- 230000003252 repetitive effect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 6
- 210000004027 cell Anatomy 0.000 description 5
- 238000012360 testing method Methods 0.000 description 5
- 238000013528 artificial neural network Methods 0.000 description 4
- 241001465754 Metazoa Species 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 229910052500 inorganic mineral Inorganic materials 0.000 description 1
- 238000012804 iterative process Methods 0.000 description 1
- 239000011707 mineral Substances 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 241000894007 species Species 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Human Computer Interaction (AREA)
- Multimedia (AREA)
- Image Analysis (AREA)
Abstract
The present invention provides a kind of artificial intelligence model training method and system based on image recognition, wherein the artificial intelligence model training method includes: to obtain baseline sample collection, registration sample set and verifying collection;It is according to the original artificial intelligence model of training with GoogLeNet network structure and baseline sample collection;Repetitive exercise is optimized to original artificial intelligence model, obtains at least one optimization artificial intelligence model;Input verifying collection obtains original accuracy rate and optimizes accuracy rate at least one;Judge the optimal accuracy rate for meeting restrictive condition at least one optimization accuracy rate with the presence or absence of one;When optimal accuracy rate there are when, determine the corresponding optimization artificial intelligence model of optimal accuracy rate be optimal artificial intelligence model.As it can be seen that described in the invention can improve efficiency, the precision of image recognition by using the artificial intelligence model based on the artificial intelligence model training method of image recognition with the means of artificial intelligence, and reduce the cost of image recognition.
Description
Technical Field
The invention relates to the field of artificial intelligence, in particular to an artificial intelligence model training method and device based on image recognition.
Background
Image recognition refers to a technique of processing, analyzing, and understanding an image with a computer to recognize various patterns of objects and objects. In a conventional image recognition method, various software is generally used to perform different aspects of processing on a picture for recognition. Therefore, the traditional image identification method can identify the image only through a large amount of work, and the later work needs to be participated by workers, so that the subjectivity of image identification is stronger, the labor cost is higher, and the problem of low precision is also accompanied; on the other hand, image recognition is usually based on a fixed scale, so that the difficulty and workload of image recognition are exponentially multiplied when the scales are different, and the recognition accuracy is greatly reduced.
Disclosure of Invention
In view of the above problems, the present invention provides an artificial intelligence model training method and apparatus based on image recognition, which can improve the efficiency and accuracy of image recognition and reduce the cost of image recognition by using the artificial intelligence model and artificial intelligence.
In order to achieve the purpose, the invention adopts the following technical scheme:
in a first aspect, the present invention provides an artificial intelligence model training method based on image recognition, including:
acquiring a reference sample set, a registration sample set and a verification set; the reference sample set, the registration sample set and the verification set respectively comprise images, the images included in the reference sample set are classified into normal images, the images included in the registration sample set are classified into special images, the images included in the verification set are classified into other images which are not included in the reference sample set and the registration sample set, and the normal images, the special images and the other images belong to the same type of images according to a level system standard; training an original artificial intelligence model by taking a GoogLeNet network structure and the reference sample set as a basis;
performing optimization iterative training on the original artificial intelligence model based on a preset optimization model, the reference sample set and the registration sample set, and acquiring at least one optimization artificial intelligence model existing in the optimization iterative training process;
inputting the verification set into the original artificial intelligence model and the at least one optimized artificial intelligence model, and calculating an original accuracy corresponding to the original artificial intelligence model and at least one optimized accuracy corresponding to the at least one optimized artificial intelligence model one by one;
judging whether an optimized accuracy rate which is larger than an original accuracy rate exists in the at least one optimized accuracy rate or not, wherein the absolute value of the difference value between the optimized accuracy rate and the original accuracy rate is smaller than the optimal accuracy rate of a preset threshold value;
and when the optimal accuracy exists, determining the optimized artificial intelligence model corresponding to the optimal accuracy as the optimal artificial intelligence model.
As an alternative embodiment, the normal image, the special image and the other images all belong to a human face image.
As an optional implementation manner, the reference sample set includes multiple groups of normal images, where each group of normal images includes three face images of the same user, and at least one of the three face images meets a preset image requirement.
As an optional implementation, the reference sample set includes a plurality of sets of positive sample sets, wherein the step of training the original artificial intelligence model based on the google lenet network structure and the reference sample set includes:
acquiring a plurality of groups of positive sample sets in the reference sample set;
extracting feature sets corresponding to the multiple groups of positive sample sets through a GoogLeNet network structure;
taking each group of positive sample sets included in the multiple groups of positive sample sets and the feature set as a basis, acquiring negative samples corresponding to each group of positive sample sets, and combining all negative samples to form a negative sample set;
and updating the weights of the multiple groups of positive sample sets according to a preset loss function and the negative sample sets to obtain an original artificial intelligence model.
As an optional implementation manner, the step of performing optimization iterative training on the original artificial intelligence model based on a preset optimization model, the reference sample set, and the registration sample set, and acquiring at least one optimization artificial intelligence model existing in an optimization iterative training process includes:
obtaining samples in the reference sample set and the registration sample set according to a preset proportion to obtain an optimized sample set;
performing optimization iterative training on the original artificial intelligence model based on a preset optimization model and the optimization sample set, and acquiring at least one optimization artificial intelligence model existing in the optimization iterative training process; wherein,
the preset optimization model is an optimization model based on the GoogleLeNet network structure and the triple Loss function.
In a second aspect, the invention provides an artificial intelligence model training device based on image recognition, comprising an acquisition module, a training module, an optimization module, a verification module, a judgment module and a determination module, wherein,
the acquisition module is used for acquiring a reference sample set, a registration sample set and a verification set; the reference sample set, the registration sample set and the verification set respectively comprise images, the images included in the reference sample set are classified into normal images, the images included in the registration sample set are classified into special images, the images included in the verification set are classified into other images which are not included in the reference sample set and the registration sample set, and the normal images, the special images and the other images belong to the same type of images according to a level system standard;
the training module is used for training an original artificial intelligence model by taking a GoogLeNet network structure and the reference sample set as the basis;
the optimization module is used for performing optimization iterative training on the original artificial intelligence model according to a preset optimization model, the reference sample set and the registration sample set, and acquiring at least one optimization artificial intelligence model existing in the optimization iterative training process;
the verification module is used for inputting the verification set in the original artificial intelligence model and the at least one optimized artificial intelligence model and calculating an original accuracy corresponding to the original artificial intelligence model and at least one optimized accuracy corresponding to the at least one optimized artificial intelligence model one by one;
the judging module is used for judging whether the at least one optimized accuracy rate has an optimized accuracy rate which is greater than an original accuracy rate and the absolute value of the difference value between the optimized accuracy rate and the original accuracy rate is less than the optimal accuracy rate of a preset threshold value;
and the determining module is used for determining the optimized artificial intelligence model corresponding to the optimal accuracy as the optimal artificial intelligence model when the optimal accuracy exists.
As an alternative embodiment, the normal image, the special image and the other images all belong to a human face image.
As an optional implementation manner, the training module includes an obtaining unit, an extracting unit, and a training unit, wherein,
the acquiring unit is used for acquiring a plurality of groups of positive sample sets in the reference sample set;
the extraction unit is used for extracting feature sets corresponding to the multiple groups of positive sample sets through a GoogleLeNet network structure;
the acquiring unit is further configured to acquire negative samples corresponding to each group of positive sample sets based on each group of positive sample sets included in the plurality of groups of positive sample sets and the feature set, and combine all negative samples to form a negative sample set;
and the training unit is used for updating the weights of the multiple groups of positive sample sets according to a preset loss function and the negative sample set to obtain an original artificial intelligence model.
In a third aspect, the present invention provides a computer device, which includes a memory for storing a computer program and a processor for executing the computer program to make the computer device execute the artificial intelligence model training method based on image recognition according to the first aspect of the present invention.
In a fourth aspect, the invention provides a computer-readable storage medium storing a computer program for use in the computer apparatus of the third aspect of the invention.
According to the artificial intelligence model training method and device based on image recognition provided by the invention, various sample data can be preferentially acquired, an original artificial intelligence model is acquired by training according to the sample data, at least one optimized artificial intelligence model in a plurality of optimized iterative processes is acquired by performing optimized iteration on the original artificial intelligence model, after the at least one optimized artificial intelligence model is acquired, the original artificial intelligence model and the at least one optimized artificial intelligence model are verified by using unused sample data to acquire corresponding accuracy, and under the condition that the accuracy of the at least one optimized artificial intelligence model is higher than that of the original artificial intelligence model and the difference between the accuracy of the at least one optimized artificial intelligence model and the accuracy of the original artificial intelligence model is not larger than a limit threshold value, and obtaining an optimal artificial intelligence model. Therefore, by implementing the implementation mode, the optimal artificial intelligence model can be obtained through the preset neural network architecture, the specified sample set and the corresponding optimization model, so that the efficiency and the precision of image recognition can be improved and the cost of the image recognition can be reduced in the application process of the artificial intelligence model.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are required to be used in the embodiments will be briefly described below, and it should be understood that the following drawings only illustrate some embodiments of the present invention, and therefore should not be considered as limiting the scope of the present invention.
FIG. 1 is a schematic flowchart of a method for training an artificial intelligence model based on image recognition according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for training an artificial intelligence model based on image recognition according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an artificial intelligence model training apparatus based on image recognition according to a third embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Aiming at the problems in the prior art, the invention provides an artificial intelligence model training method based on image recognition, which can preferentially acquire various sample data, train according to the sample data to obtain an original artificial intelligence model, optimize and iterate the original artificial intelligence model to obtain at least one optimized artificial intelligence model in a plurality of optimized iteration processes, verify the original artificial intelligence model and the at least one optimized artificial intelligence model by using unused sample data after acquiring the at least one optimized artificial intelligence model to obtain corresponding accuracy, and ensure that the accuracy of the at least one optimized artificial intelligence model is higher than that of the original artificial intelligence model and simultaneously ensure that the difference between the accuracy of the at least one optimized artificial intelligence model and the accuracy of the original artificial intelligence model is not larger than a limit threshold value, and obtaining an optimal artificial intelligence model. Therefore, by implementing the implementation mode, the optimal artificial intelligence model can be obtained through the preset neural network architecture, the specified sample set and the corresponding optimization model, so that the efficiency and the precision of image recognition can be improved and the cost of the image recognition can be reduced in the application process of the artificial intelligence model. The following is described by way of example.
The above technical method can also be implemented by using related software or hardware, and further description is not repeated in this embodiment. The following describes an embodiment of the method and apparatus for training an artificial intelligence model based on image recognition.
Example 1
Please refer to fig. 1, which is a schematic flow chart of an artificial intelligence model training method based on image recognition according to this embodiment, where the artificial intelligence model training method based on image recognition includes the following steps:
s101, acquiring a reference sample set, a registration sample set and a verification set; the reference sample set, the registration sample set and the verification set all comprise images, the images included in the reference sample set are classified into normal images, the images included in the registration sample set are classified into special images, the images included in the verification set are classified into other images which are not included in the reference sample set and the registration sample set, and the normal images, the special images and the other images belong to the same type of images according to a level system standard.
In this embodiment, the class element system is a large system for dividing the natural world into three kingdoms of plants, animals and minerals, and the system is also provided with four grades of class, order, genus and species in the animal and plant kingdoms to obtain a classified class element system. Wherein, the system of order elements can indicate a kind of object and is a kind recognized in nature.
In this embodiment, the normal image, the special image and the other images all belong to the face image.
In this embodiment, the reference sample set includes multiple groups of normal images, where each group of normal images includes three face images of the same user, and at least one of the three face images meets the requirement of a preset image.
In this embodiment, the normal image is relative to the special image, wherein the normal image is a general image, and the special image is an image having an obvious feature or a feature that the general image does not have; the other images do not have any requirement for the features as long as they are not in the reference sample set or the registration sample set.
In this embodiment, the reference sample set, the registration sample set, and the verification set are pre-stored large data sample sets.
In this embodiment, the sample data in the training method may be from an actual life scene, and specifically may be a picture taken by a mobile phone or an image in a video.
As an alternative embodiment, the reference sample set and the registration sample set are both in units of sample groups, wherein each sample group includes multiple photos of the same person, and one of the photos is an identification card photo.
As a preferred embodiment, each sample set includes three photographs of the same person.
In this embodiment, the reference sample set is a sample set that does not include a specific registrant, and the reference sample set is mainly used for training an original artificial intelligence model for performing basic dynamic face recognition.
In this embodiment, the preferred collection of reference samples includes 20 million people and 60 million photographs.
In this embodiment, the registered sample set is a sample set of specific registrants, and the registered sample set is used to learn the differences between specific registrants, so as to optimize the basic model, and train an optimized artificial intelligence model that is more suitable for registrants.
In this example, the registered sample collection includes 1000 persons, 3000 photographs.
In this embodiment, the persons in the verification set do not appear in the reference sample set and the registration sample set, and the sample set is mainly used to test whether the optimized artificial intelligence model deviates or not, and to determine whether the usage accuracy of the artificial intelligence model is within an error range or not.
In this example, the verification collected 8 thousand people, 2 photos per person.
And S102, training an original artificial intelligence model by taking the GoogleLeNet network structure and the reference sample set as the basis.
In this embodiment, the main idea of the google lenet structure is how an optimized local sparse structure in a convolutional visual network can be approximated and covered by a series of easily available dense substructures. The above mentioned network topology is formed by analyzing the relevant statistics of the previous layer one by one and clustering into a highly relevant set of cells, these clusters (sets of cells) express the cells (neurons) of the next layer and are connected to the previous cells, while the relevant cells of the bottom layer near the input image are clustered in a local area, which means that we can cluster clusters over a single area to end up and they can be covered by a layer of convolution layers of 1 × 1 in the next layer, i.e. clusters spread in a larger space with a smaller number can be covered by convolutions over larger ones, which will also reduce the number of lots over larger and larger areas.
S103, performing optimization iterative training on the original artificial intelligence model according to a preset optimization model, a reference sample set and a registration sample set, and acquiring at least one optimization artificial intelligence model existing in the optimization iterative training process.
In this embodiment, the preset optimization model may be a model constructed based on a google lenet network structure, and the preset optimization model may be optimized based on the google lenet network structure by using a loss algorithm or a corresponding feedback algorithm.
In this embodiment, the at least one optimized artificial intelligence model is a result of the obtained plurality of artificial intelligence models; is the combination of multiple results of the training process.
And S104, inputting a verification set in the original artificial intelligence model and the at least one optimized artificial intelligence model, and calculating an original accuracy corresponding to the original artificial intelligence model and at least one optimized accuracy corresponding to the at least one optimized artificial intelligence model one by one.
In this embodiment, at least one optimization accuracy is used to evaluate the optimization degree of the optimized artificial intelligence model.
By implementing the implementation mode, the optimization rate of the artificial intelligence model can be obtained, so that the artificial intelligence model can be evaluated.
S105, judging whether an optimized accuracy rate which is larger than the original accuracy rate exists in the at least one optimized accuracy rate or not, and judging whether the optimal accuracy rate of which the absolute value of the difference value with the original accuracy rate is smaller than a preset threshold value exists or not; if yes, go to step S106; if not, the flow is ended.
In this embodiment, the optimization accuracy greater than the original accuracy indicates that the optimization artificial intelligence model is good and varied.
In this embodiment, the absolute value of the difference between the at least one optimized accuracy and the original accuracy is smaller than the preset threshold, which indicates that the artificial intelligence model is successfully optimized and the deviation is reasonable.
In this embodiment, the preset threshold is used to indicate whether an absolute value of a difference between the at least one optimized accuracy and the original accuracy exceeds a deviation threshold of the deviation.
By implementing this embodiment, the optimum accuracy can be obtained under the above-described limiting conditions.
And S106, determining the optimized artificial intelligence model corresponding to the optimal accuracy as the optimal artificial intelligence model.
In this embodiment, step S106 is to determine, when the optimal accuracy exists, that the optimized artificial intelligence model corresponding to the optimal accuracy is the optimal artificial intelligence model.
By implementing the implementation mode, the optimal artificial intelligence model can be determined, and therefore training of the artificial intelligence model is completed.
As an optional implementation manner, after obtaining the optimal artificial intelligence model, the method may further include:
and acquiring a corresponding test set which is only used for testing various attributes of the optimal artificial intelligence model.
Implementing such an embodiment may show the effect of the optimal artificial intelligence model.
In the artificial intelligence model training method based on image recognition described in fig. 1, various sample data can be acquired preferentially, training according to the sample data to obtain an original artificial intelligence model, performing optimization iteration on the original artificial intelligence model to obtain at least one optimized artificial intelligence model in a plurality of optimization iteration processes, after at least one optimized artificial intelligence model is obtained, the original artificial intelligence model and at least one optimized artificial intelligence model are verified by using unused sample data to obtain corresponding accuracy, and while ensuring that the accuracy of at least one optimized artificial intelligence model is higher than the accuracy of the original artificial intelligence model, and obtaining an optimal artificial intelligence model under the condition that the difference between the accuracy of at least one optimized artificial intelligence model and the accuracy of the original artificial intelligence model is not greater than a limit threshold value. Therefore, by implementing the artificial intelligence model training method based on image recognition described in fig. 1, an optimal artificial intelligence model can be obtained through a preset neural network architecture, a specified sample set and a corresponding optimization model, so that the efficiency and the precision of image recognition can be improved and the cost of image recognition can be reduced in the application process of the artificial intelligence model.
Example 2
Referring to fig. 2, fig. 2 is a schematic flowchart of an artificial intelligence model training method based on image recognition according to this embodiment. As shown in fig. 2, the artificial intelligence model training method based on image recognition includes the following steps:
s201, acquiring a reference sample set, a registration sample set and a verification set; the reference sample set, the registration sample set and the verification set all comprise images, the images included in the reference sample set are classified into normal images, the images included in the registration sample set are classified into special images, the images included in the verification set are classified into other images which are not included in the reference sample set and the registration sample set, and the normal images, the special images and the other images belong to the same type of images according to a level system standard.
In this embodiment, the normal image, the special image and the other images all belong to the face image.
In this embodiment, the reference sample set includes multiple groups of normal images, where each group of normal images includes three face images of the same user, and at least one of the three face images meets the requirement of a preset image.
S202, acquiring a plurality of groups of positive sample sets in the reference sample set.
In this embodiment, the multiple sets of positive sample data may be multiple sets of positive sample image pairs selected in the reference sample set.
S203, extracting feature sets corresponding to the multiple groups of positive sample sets through a GoogleLeNet network structure.
In this embodiment, a neural network formed by a google lenet network structure is used to obtain more and accurate feature sets, where the features in the feature sets may be that all the features are included in a plurality of images in the plurality of sets of positive samples.
S204, taking each group of positive sample sets and the feature set included in the multiple groups of positive sample sets as a basis, obtaining negative samples corresponding to each group of positive sample sets, and combining all the negative samples to form a negative sample set.
In this embodiment, the negative sample refers to a sample that is most similar to the features of a group of positive samples.
In this embodiment, the negative samples are used to assist in determining the distinguishing features corresponding to the positive sample set.
And S205, updating the weights of the multiple groups of positive sample sets according to a preset loss function and the negative sample set to obtain an original artificial intelligence model.
In this embodiment, the process of updating the weight is a process of continuously distinguishing images.
And S206, obtaining samples in the reference sample set and the registration sample set according to a preset proportion to obtain an optimized sample set.
In this embodiment, the preset ratio may be two-to-one to obtain samples in the reference sample set and the registration sample set.
S207, performing optimization iterative training on the original artificial intelligence model based on a preset optimization model and an optimization sample set, and acquiring at least one optimization artificial intelligence model in the optimization iterative training process; the preset optimization model is an optimization model based on a GoogleLeNet network structure and a triple Loss function.
In this embodiment, the TripletLoss function is a loss function in deep learning, and is used to train samples with small differences, such as faces, and Feed data includes an anchor instance, a positive instance, and a negative instance, and similarity calculation of the samples is implemented by optimizing that a distance between the anchor instance and the positive instance is smaller than a distance between the anchor instance and the negative instance. Wherein, the positive example is a positive sample set, and the negative example is a negative sample set.
S208, inputting a verification set in the original artificial intelligence model and the at least one optimized artificial intelligence model, and calculating an original accuracy corresponding to the original artificial intelligence model and at least one optimized accuracy corresponding to the at least one optimized artificial intelligence model one by one.
In this embodiment, the original accuracy is used as the data for reference comparison, and the at least one optimized accuracy is used as the data for comparison with the original accuracy. And the result of comparing the original accuracy with the at least one optimized accuracy is used for representing the optimization degree of the at least one optimized artificial intelligence model.
S209, judging whether the at least one optimized accuracy rate has an optimized accuracy rate which is greater than the original accuracy rate and the absolute value of the difference value between the optimized accuracy rate and the original accuracy rate is less than the optimal accuracy rate of a preset threshold value; if yes, go to step S210; if not, the flow is ended.
In this embodiment, the optimization accuracy greater than the original accuracy indicates that the optimization artificial intelligence model is good and varied.
In this embodiment, the absolute value of the difference between the at least one optimized accuracy and the original accuracy is smaller than the preset threshold, which indicates that the artificial intelligence model is successfully optimized and the deviation is reasonable.
In this embodiment, the preset threshold is used to indicate whether an absolute value of a difference between the at least one optimized accuracy and the original accuracy exceeds a deviation threshold of the deviation.
By implementing this embodiment, the optimum accuracy can be obtained under the above-described limiting conditions.
S210, determining the optimized artificial intelligence model corresponding to the optimal accuracy rate as the optimal artificial intelligence model.
By implementing the implementation mode, the optimal artificial intelligence model can be determined, and therefore training of the artificial intelligence model is completed.
As an optional implementation manner, after obtaining the optimal artificial intelligence model, the method may further include:
and acquiring a corresponding test set which is only used for testing various attributes of the optimal artificial intelligence model.
Implementing such an embodiment may show the effect of the optimal artificial intelligence model.
In the artificial intelligence model training method based on image recognition described in fig. 2, various sample data may be preferentially acquired, training according to the sample data to obtain an original artificial intelligence model, performing optimization iteration on the original artificial intelligence model to obtain at least one optimized artificial intelligence model in a plurality of optimization iteration processes, after at least one optimized artificial intelligence model is obtained, the original artificial intelligence model and at least one optimized artificial intelligence model are verified by using unused sample data to obtain corresponding accuracy, and while ensuring that the accuracy of at least one optimized artificial intelligence model is higher than the accuracy of the original artificial intelligence model, obtaining an optimal artificial intelligence model under the condition that the difference between the accuracy of at least one optimized artificial intelligence model and the accuracy of the original artificial intelligence model is not larger than a limit threshold; and simultaneously, the original artificial intelligence model and at least one optimized artificial intelligence model are optimized by using a GoogleLeNet network structure and a triple Loss function, so that the method obtains an optimal artificial intelligence model. Therefore, by implementing the artificial intelligence model training method based on image recognition described in fig. 2, the optimal artificial intelligence model can be obtained through the google lenet network structure, the triple Loss function, the specified sample set and the corresponding optimization model, so that the efficiency and the precision of image recognition can be improved and the cost of image recognition can be reduced in the application process of the artificial intelligence model.
Example 3
Please refer to fig. 3, which is a schematic structural diagram of an artificial intelligence model training apparatus based on image recognition according to this embodiment.
As shown in fig. 3, the artificial intelligence model training apparatus based on image recognition comprises an obtaining module 30, a training module 40, an optimizing module 50, a verifying module 60, a judging module 70 and a determining module 80, wherein,
the obtaining module 30 is configured to obtain a reference sample set, a registration sample set, and a verification set; the reference sample set, the registration sample set and the verification set respectively comprise images, the images included in the reference sample set are classified into normal images, the images included in the registration sample set are classified into special images, the images included in the verification set are classified into other images which are not included in the reference sample set and the registration sample set, and the normal images, the special images and the other images belong to the same type of images according to a level system standard;
the training module 40 is used for training an original artificial intelligence model according to the GoogLeNet network structure and the reference sample set;
the optimization module 50 is configured to perform optimization iterative training on the original artificial intelligence model based on a preset optimization model, a reference sample set and a registration sample set, and obtain at least one optimization artificial intelligence model existing in the optimization iterative training process;
the verification module 60 is configured to input a verification set into the original artificial intelligence model and the at least one optimized artificial intelligence model, and calculate an original accuracy corresponding to the original artificial intelligence model and at least one optimized accuracy corresponding to the at least one optimized artificial intelligence model one to one;
the judging module 70 is configured to judge whether there is an optimized accuracy rate greater than the original accuracy rate in the at least one optimized accuracy rate, and an optimal accuracy rate whose absolute value of a difference from the original accuracy rate is smaller than a preset threshold;
the determining module 80 is configured to determine, when the optimal accuracy rate exists, that the optimized artificial intelligence model corresponding to the optimal accuracy rate is the optimal artificial intelligence model.
In this embodiment, the normal image, the special image and the other images all belong to the face image.
As an alternative embodiment, the training module 40 includes an obtaining unit 41, an extracting unit 42, and a training unit 43, wherein,
the acquiring unit 41 is configured to acquire a plurality of sets of positive sample sets in the reference sample set;
the extraction unit 42 is configured to extract feature sets corresponding to multiple sets of positive sample sets through a google lenet network structure;
the obtaining unit 41 is further configured to obtain, based on each set of positive sample sets and the feature set included in the multiple sets of positive sample sets, negative samples corresponding to each set of positive sample sets, and combine all negative samples to form a negative sample set;
the training unit 43 is configured to perform weight update on multiple sets of positive sample sets based on a preset loss function and a negative sample set, so as to obtain an original artificial intelligence model.
In this embodiment, the artificial intelligence model training device based on image recognition corresponds to the artificial intelligence model training method based on image recognition described in embodiment 1 or embodiment 2, and the corresponding steps of the training method can be executed by corresponding modules and units.
It can be seen that, by implementing the artificial intelligence model training device based on image recognition described in this embodiment, an optimal artificial intelligence model can be obtained through the google lenet network structure, the triple Loss function, the specified sample set, and the corresponding optimization model, so that the efficiency and the accuracy of image recognition can be improved and the cost of image recognition can be reduced in the application process of the artificial intelligence model.
In addition, the invention also provides another computer device which can comprise a smart phone, a tablet computer, a vehicle-mounted computer, an intelligent wearable device and the like. The computer device comprises a memory and a processor, wherein the memory can be used for storing a computer program, and the processor can be used for executing the computer program so as to enable the computer device to execute the method or the functions of each unit in the device.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the computer device, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The embodiment also provides a computer storage medium for storing a computer program used in the computer device.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, each functional module or unit in each embodiment of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The described functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention or a part of the technical solution that contributes to the prior art in essence can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. An artificial intelligence model training method based on image recognition is characterized by comprising the following steps:
acquiring a reference sample set, a registration sample set and a verification set; the reference sample set, the registration sample set and the verification set respectively comprise images, the images included in the reference sample set are classified into normal images, the images included in the registration sample set are classified into special images, the images included in the verification set are classified into other images which are not included in the reference sample set and the registration sample set, and the normal images, the special images and the other images belong to the same type of images according to a level system standard;
training an original artificial intelligence model by taking a GoogLeNet network structure and the reference sample set as a basis;
performing optimization iterative training on the original artificial intelligence model based on a preset optimization model, the reference sample set and the registration sample set, and acquiring at least one optimization artificial intelligence model existing in the optimization iterative training process;
inputting the verification set into the original artificial intelligence model and the at least one optimized artificial intelligence model, and calculating an original accuracy corresponding to the original artificial intelligence model and at least one optimized accuracy corresponding to the at least one optimized artificial intelligence model one by one;
judging whether an optimized accuracy rate which is larger than an original accuracy rate exists in the at least one optimized accuracy rate or not, wherein the absolute value of the difference value between the optimized accuracy rate and the original accuracy rate is smaller than the optimal accuracy rate of a preset threshold value;
and when the optimal accuracy exists, determining the optimized artificial intelligence model corresponding to the optimal accuracy as the optimal artificial intelligence model.
2. The method of claim 1, wherein the normal image, the special image and the other images are face images.
3. The method of claim 2, wherein the reference sample set comprises a plurality of groups of normal images, wherein each group of normal images comprises three face images of the same user, and at least one of the three face images meets a predetermined image requirement.
4. The method of claim 1, wherein the set of reference samples comprises a plurality of sets of positive samples, and wherein the step of training the original artificial intelligence model based on the google lenet network structure and the set of reference samples comprises:
acquiring a plurality of groups of positive sample sets in the reference sample set;
extracting feature sets corresponding to the multiple groups of positive sample sets through a GoogLeNet network structure;
taking each group of positive sample sets included in the multiple groups of positive sample sets and the feature set as a basis, acquiring negative samples corresponding to each group of positive sample sets, and combining all negative samples to form a negative sample set;
and updating the weights of the multiple groups of positive sample sets according to a preset loss function and the negative sample sets to obtain an original artificial intelligence model.
5. The method for training an artificial intelligence model according to claim 1, wherein the step of performing an optimization iterative training on the original artificial intelligence model based on a preset optimization model, the reference sample set and the registration sample set, and obtaining at least one optimized artificial intelligence model existing in the optimization iterative training process comprises:
obtaining samples in the reference sample set and the registration sample set according to a preset proportion to obtain an optimized sample set;
performing optimization iterative training on the original artificial intelligence model based on a preset optimization model and the optimization sample set, and acquiring at least one optimization artificial intelligence model existing in the optimization iterative training process; wherein,
the preset optimization model is an optimization model based on the GoogleLeNet network structure and the triple Loss function.
6. An artificial intelligence model training device based on image recognition is characterized by comprising an acquisition module, a training module, an optimization module, a verification module, a judgment module and a determination module, wherein,
the acquisition module is used for acquiring a reference sample set, a registration sample set and a verification set; the reference sample set, the registration sample set and the verification set respectively comprise images, the images included in the reference sample set are classified into normal images, the images included in the registration sample set are classified into special images, the images included in the verification set are classified into other images which are not included in the reference sample set and the registration sample set, and the normal images, the special images and the other images belong to the same type of images according to a level system standard;
the training module is used for training an original artificial intelligence model by taking a GoogLeNet network structure and the reference sample set as the basis;
the optimization module is used for performing optimization iterative training on the original artificial intelligence model according to a preset optimization model, the reference sample set and the registration sample set, and acquiring at least one optimization artificial intelligence model existing in the optimization iterative training process;
the verification module is used for inputting the verification set in the original artificial intelligence model and the at least one optimized artificial intelligence model and calculating an original accuracy corresponding to the original artificial intelligence model and at least one optimized accuracy corresponding to the at least one optimized artificial intelligence model one by one;
the judging module is used for judging whether the at least one optimized accuracy rate has an optimized accuracy rate which is greater than an original accuracy rate and the absolute value of the difference value between the optimized accuracy rate and the original accuracy rate is less than the optimal accuracy rate of a preset threshold value;
and the determining module is used for determining the optimized artificial intelligence model corresponding to the optimal accuracy as the optimal artificial intelligence model when the optimal accuracy exists.
7. The artificial intelligence model training apparatus of claim 6, wherein the normal image, the special image and the other images are face images.
8. The artificial intelligence model training apparatus of claim 6, wherein the training module comprises an acquisition unit, an extraction unit, and a training unit, wherein,
the acquiring unit is used for acquiring a plurality of groups of positive sample sets in the reference sample set;
the extraction unit is used for extracting feature sets corresponding to the multiple groups of positive sample sets through a GoogleLeNet network structure;
the acquiring unit is further configured to acquire negative samples corresponding to each group of positive sample sets based on each group of positive sample sets included in the plurality of groups of positive sample sets and the feature set, and combine all negative samples to form a negative sample set;
and the training unit is used for updating the weights of the multiple groups of positive sample sets according to a preset loss function and the negative sample set to obtain an original artificial intelligence model.
9. A computer device comprising a memory for storing a computer program and a processor for executing the computer program to cause the computer device to perform an artificial intelligence model training method based on image recognition according to any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that it stores a computer program for use in the computer device of claim 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811353403.9A CN109460792A (en) | 2018-11-14 | 2018-11-14 | A kind of artificial intelligence model training method and device based on image recognition |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811353403.9A CN109460792A (en) | 2018-11-14 | 2018-11-14 | A kind of artificial intelligence model training method and device based on image recognition |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109460792A true CN109460792A (en) | 2019-03-12 |
Family
ID=65610371
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811353403.9A Pending CN109460792A (en) | 2018-11-14 | 2018-11-14 | A kind of artificial intelligence model training method and device based on image recognition |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109460792A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110399927A (en) * | 2019-07-26 | 2019-11-01 | 玖壹叁陆零医学科技南京有限公司 | Identification model training method, target identification method and device |
CN110909780A (en) * | 2019-11-14 | 2020-03-24 | 腾讯科技(深圳)有限公司 | Image recognition model training and image recognition method, device and system |
WO2021057062A1 (en) * | 2019-09-23 | 2021-04-01 | 平安科技(深圳)有限公司 | Method and apparatus for optimizing attractiveness judgment model, electronic device, and storage medium |
CN113284141A (en) * | 2021-07-09 | 2021-08-20 | 武汉精创电子技术有限公司 | Model determination method, device and equipment for defect detection |
CN113610803A (en) * | 2021-08-06 | 2021-11-05 | 苏州迪美格智能科技有限公司 | Automatic layered focusing method and device of digital slice scanner |
CN114185793A (en) * | 2021-12-13 | 2022-03-15 | 建信金融科技有限责任公司 | Financial system non-functional test method and system based on artificial intelligence |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101719222A (en) * | 2009-11-27 | 2010-06-02 | 北京中星微电子有限公司 | Method and device for training classifiers and method and device for identifying human face |
CN105184367A (en) * | 2014-06-09 | 2015-12-23 | 讯飞智元信息科技有限公司 | Model parameter training method and system for depth neural network |
CN105426857A (en) * | 2015-11-25 | 2016-03-23 | 小米科技有限责任公司 | Training method and device of face recognition model |
US9412065B1 (en) * | 2012-05-22 | 2016-08-09 | Google Inc. | Training a model using parameter server shards |
CN106250877A (en) * | 2016-08-19 | 2016-12-21 | 深圳市赛为智能股份有限公司 | Near-infrared face identification method and device |
-
2018
- 2018-11-14 CN CN201811353403.9A patent/CN109460792A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101719222A (en) * | 2009-11-27 | 2010-06-02 | 北京中星微电子有限公司 | Method and device for training classifiers and method and device for identifying human face |
US9412065B1 (en) * | 2012-05-22 | 2016-08-09 | Google Inc. | Training a model using parameter server shards |
CN105184367A (en) * | 2014-06-09 | 2015-12-23 | 讯飞智元信息科技有限公司 | Model parameter training method and system for depth neural network |
CN105426857A (en) * | 2015-11-25 | 2016-03-23 | 小米科技有限责任公司 | Training method and device of face recognition model |
CN106250877A (en) * | 2016-08-19 | 2016-12-21 | 深圳市赛为智能股份有限公司 | Near-infrared face identification method and device |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110399927A (en) * | 2019-07-26 | 2019-11-01 | 玖壹叁陆零医学科技南京有限公司 | Identification model training method, target identification method and device |
WO2021057062A1 (en) * | 2019-09-23 | 2021-04-01 | 平安科技(深圳)有限公司 | Method and apparatus for optimizing attractiveness judgment model, electronic device, and storage medium |
CN110909780A (en) * | 2019-11-14 | 2020-03-24 | 腾讯科技(深圳)有限公司 | Image recognition model training and image recognition method, device and system |
CN113284141A (en) * | 2021-07-09 | 2021-08-20 | 武汉精创电子技术有限公司 | Model determination method, device and equipment for defect detection |
CN113610803A (en) * | 2021-08-06 | 2021-11-05 | 苏州迪美格智能科技有限公司 | Automatic layered focusing method and device of digital slice scanner |
CN114185793A (en) * | 2021-12-13 | 2022-03-15 | 建信金融科技有限责任公司 | Financial system non-functional test method and system based on artificial intelligence |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109460792A (en) | A kind of artificial intelligence model training method and device based on image recognition | |
CN110334765B (en) | Remote sensing image classification method based on attention mechanism multi-scale deep learning | |
WO2020221298A1 (en) | Text detection model training method and apparatus, text region determination method and apparatus, and text content determination method and apparatus | |
CN107169504B (en) | A kind of hand-written character recognition method based on extension Non-linear Kernel residual error network | |
CN108960314B (en) | Training method and device based on difficult samples and electronic equipment | |
CN111046886B (en) | Automatic identification method, device and equipment for number plate and computer readable storage medium | |
CN110874550A (en) | Data processing method, device, equipment and system | |
CN110162643B (en) | Electronic album report generation method, device and storage medium | |
CN112434742A (en) | Method, system and equipment for identifying Pompe frauds on Ether house | |
KR101224312B1 (en) | Friend recommendation method for SNS user, recording medium for the same, and SNS and server using the same | |
CN110705573A (en) | Automatic modeling method and device of target detection model | |
Chandran et al. | Missing child identification system using deep learning and multiclass SVM | |
CN107967442A (en) | A kind of finger vein identification method and system based on unsupervised learning and deep layer network | |
CN108447048B (en) | Convolutional neural network image feature processing method based on attention layer | |
CN111709775A (en) | House property price evaluation method and device, electronic equipment and storage medium | |
CN109598301B (en) | Detection area removing method, device, terminal and storage medium | |
CN111291627A (en) | Face recognition method and device and computer equipment | |
CN111914902A (en) | Traditional Chinese medicine identification and surface defect detection method based on deep neural network | |
CN115424053A (en) | Small sample image identification method, device and equipment and storage medium | |
CN109697447A (en) | Disaggregated model construction device, method and electronic equipment based on random forest | |
CN111352926B (en) | Method, device, equipment and readable storage medium for data processing | |
CN115062186A (en) | Video content retrieval method, device, equipment and storage medium | |
CN114140663A (en) | Multi-scale attention and learning network-based pest identification method and system | |
CN112861692B (en) | Method and device for constructing room classification model, and method and device for classifying rooms | |
CN114547365A (en) | Image retrieval method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190312 |