CN109214501B - Method and apparatus for identifying information - Google Patents

Method and apparatus for identifying information Download PDF

Info

Publication number
CN109214501B
CN109214501B CN201710513137.0A CN201710513137A CN109214501B CN 109214501 B CN109214501 B CN 109214501B CN 201710513137 A CN201710513137 A CN 201710513137A CN 109214501 B CN109214501 B CN 109214501B
Authority
CN
China
Prior art keywords
type
information
probability
model
neural network
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.)
Active
Application number
CN201710513137.0A
Other languages
Chinese (zh)
Other versions
CN109214501A (en
Inventor
张爱喜
叶韵
陈宇
翁志
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710513137.0A priority Critical patent/CN109214501B/en
Publication of CN109214501A publication Critical patent/CN109214501A/en
Application granted granted Critical
Publication of CN109214501B publication Critical patent/CN109214501B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic networks
    • 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

Landscapes

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

Abstract

Methods and apparatus for identifying information are disclosed. One embodiment of the method comprises: acquiring information to be identified; importing the information to be identified into a neural network model, generating probabilities that the information to be identified respectively belongs to various types of at least three preset types, and identifying the type of the information to be identified according to the generated probabilities, wherein the neural network model is obtained according to an updated initial neural network model, and the initial neural network model is updated based on the following steps: leading the first training sample into an initial neural network model, and generating the probability that the first training sample belongs to the various types; obtaining at least one discrimination difficulty weight; determining a model error of the initial neural network model based on the at least one discrimination difficulty weight and the probability that the first training sample belongs to various types; the initial neural network model is updated based on the model error. The embodiment improves the accuracy of information identification.

Description

Method and apparatus for identifying information
Technical Field
The present application relates to the field of computer technologies, and in particular, to the field of internet technologies, and in particular, to a method and an apparatus for identifying information.
Background
With the development of computer technology, information can be identified by a computer, for example, picture information, text information, voice information, and the like. In the prior art, information is generally identified by using a pre-established model.
However, the conventional information recognition method generally has a problem that it is difficult to distinguish relatively similar information, and thus, the accuracy of information recognition is low.
Disclosure of Invention
It is an object of the present application to propose an improved method and apparatus for identifying information to solve the technical problems mentioned in the background section above.
In a first aspect, an embodiment of the present application provides a method for identifying information, where the method includes: acquiring information to be identified; importing the information to be identified into a neural network model, generating probabilities that the information to be identified respectively belongs to various types of at least three preset types, and identifying the type of the information to be identified according to the generated probabilities, wherein the neural network model is obtained according to an updated initial neural network model, and the initial neural network model is updated based on the following steps: leading a first training sample into an initial neural network model, and generating the probability that the first training sample belongs to the various types, wherein the initial neural network model is used for representing the corresponding relation between information and the probability that the information belongs to the various types; acquiring at least one discrimination difficulty weight, wherein the discrimination difficulty weight is used for representing the difficulty of distinguishing two types of information in a type pair, and the type pair consists of two types of the at least three preset types; determining a model error of the initial neural network model based on the at least one discrimination difficulty weight and the probability that the first training sample belongs to the various types; and updating the initial neural network model according to the model error.
In a second aspect, an embodiment of the present application provides an apparatus for identifying information, where the apparatus includes: an acquisition unit configured to acquire information to be identified; the identification unit is configured to import the information to be identified into a neural network model, generate probabilities that the information to be identified respectively belongs to each of at least three preset types, and identify a type to which the information to be identified belongs according to the generated probabilities, where the neural network model is obtained according to an updated initial neural network model, the initial neural network model is updated by an updating unit, and the updating unit includes: a generating module, configured to introduce a first training sample into an initial neural network model, and generate probabilities that the first training sample belongs to the various types, where the initial neural network model is used to represent a correspondence between information and probabilities that the information belongs to the various types; the system comprises an acquisition module, a comparison module and a comparison module, wherein the acquisition module is used for acquiring at least one distinguishing difficulty weight, the distinguishing difficulty weight is used for representing the difficulty of distinguishing two types of information in a type pair, and the type pair consists of two types of the at least three preset types; a determining module, configured to determine a model error of an initial neural network model based on the at least one difficulty of distinguishing weight and a probability that the first training sample belongs to the various types; and the updating module is used for updating the initial neural network model according to the model error.
In a third aspect, an embodiment of the present application provides a server, where the server includes: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium on which a computer program is stored, which when executed by a processor, implements the method according to the first aspect.
According to the method and the device for identifying information, the neural network model for identifying information is utilized, and the model error is determined according to the distinguishing difficulty weight, so that the model error is related to the distinguishing difficulty weight. In a colloquial way, if the difficulty in distinguishing corresponding to the type pair which is difficult to distinguish is weighted more heavily, the model error contribution of the type pair which is difficult to distinguish to the model is larger, and if the distinguishing capability of the model to the type pair which is difficult to distinguish is poorer, the model error is still larger. In the process of reducing the model error, the distinguishing capability of the model for the type pairs which are difficult to distinguish is improved, so that the accuracy of the identification information can be improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for identifying information according to the present application;
FIG. 3a is a flow diagram of one implementation of a method for identifying information according to the present application;
FIG. 3b is a flow chart for implementing step 303 of the flow chart shown in FIG. 3 a;
FIG. 4 is a schematic illustration of an application scenario of a method for identifying information according to the present application;
FIG. 5 is a flow diagram of another implementation of a method for identifying information according to the present application;
FIG. 6 is a schematic diagram of an embodiment of an apparatus for identifying information according to the present application;
FIG. 7 is a block diagram of a computer system suitable for use in implementing a server according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the method for identifying information or the apparatus for identifying information of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various communication client applications, such as an image capture application, a video playing application, a picture display editing application, an instant messaging tool, a mailbox client, social platform software, and the like, may be installed on the terminal devices 101, 102, and 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting uploading and browsing of pictures or videos, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, motion Picture Experts compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, motion Picture Experts compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for information (e.g., pictures or videos) uploaded or displayed by the terminal devices 101, 102, 103. The background server may analyze and process the received data such as the information (e.g., the picture or the video), and optionally, may feed back a processing result (e.g., the type of the identified picture or the video) to the terminal device.
It should be noted that the method for identifying information provided in the embodiment of the present application is generally performed by the server 105, and accordingly, the apparatus for identifying information is generally disposed in the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. It should be noted that in some implementations, the terminal device and the network may not be included in the exemplary system architecture shown in fig. 1.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for identifying information in accordance with the present application is shown. The above method for identifying information, comprising the steps of:
step 201, information to be identified is obtained.
In this embodiment, the first electronic device (e.g., the server shown in fig. 1) on which the method for identifying information operates may acquire the information to be identified locally from the first electronic device or from another electronic device.
As an example, the information to be recognized may be text information, picture information, video information, sound information, or the like.
Step 202, importing the information to be identified into a neural network model, generating probabilities that the information to be identified respectively belongs to various types of at least three preset types, and identifying the type to which the information to be identified belongs according to the generated probabilities.
In this embodiment, the first electronic device (for example, the server shown in fig. 1) on which the method for identifying information operates may first import the information to be identified obtained in step 201 into the neural network model, then generate probabilities that the information to be identified belongs to each of at least three preset types, and finally identify the type to which the information to be identified belongs according to the generated probabilities.
As an example, the information to be identified may be an animal picture, and the at least three preset types may be a dog picture, a tiger picture, and a cat picture, respectively. The animal pictures are led into the neural network model, and the probability that the animal pictures belong to dog pictures, the probability that the animal pictures belong to tiger pictures and the probability that the animal pictures belong to cat pictures are 10%, 20% and 80% respectively. The cat picture type indicated by the highest probability of 80% can be determined as the type to which the above-mentioned animal picture belongs.
In this embodiment, the neural network model may be obtained according to an updated initial neural network model, please refer to fig. 3a, which shows an exemplary process 300 for updating the initial neural network model, and the initial neural network model may be updated based on steps 301, 302, 303, and 304 in the process 300:
step 301, importing the first training sample into the initial neural network model, and generating the probability that the first training sample belongs to various types.
In this embodiment, the second electronic device (for example, the server shown in fig. 1) may import the first training sample into the initial neural network model, and generate a probability that the first training sample belongs to the above-mentioned types. Here, the initial neural network model described above is used to characterize the correspondence between information and the probability that the information belongs to the various types described above.
In this embodiment, the first training sample may be one or more.
The second electronic device may be the same as or different from the first electronic device. The execution subjects of steps 301 to 304 may pre-establish the neural network model before step 201, and then use the established neural network model for the execution subjects of steps 201 and 202.
In this embodiment, the initial neural network model may be a pre-built neural network model. How to build the initial neural network model is well known to those skilled in the art and will not be described in detail herein.
Step 302, at least one difficulty of distinguishing weight is obtained.
In this embodiment, the electronic device may obtain at least one difficulty level weight. Here, the discrimination difficulty weight is used to characterize the difficulty of discriminating between two types of information in a pair of types. Here, the type pair is composed of two types of the above-mentioned at least three preset types.
As an example, the at least three preset types may be a dog-like picture, a tiger-like picture, and a cat-like picture, respectively. The type pair can be composed of two types of a dog picture and a tiger picture, the type pair can be composed of the dog picture and a cat picture, and the type pair can also be composed of the tiger picture and a cat picture. The derived discriminative difficulty weights may be one or more of: the weight used for representing the difficulty of distinguishing the dog pictures from the tiger pictures, the weight used for representing the difficulty of distinguishing the dog pictures from the cat pictures and the weight used for representing the difficulty of distinguishing the tiger pictures from the cat pictures.
In some optional implementations of this embodiment, each differentiation difficulty weight may be a preset default value.
In some optional implementation manners of this embodiment, each difficulty of distinguishing weight may be obtained by the following steps: various types of information are acquired. The similarity between various types of information is determined. The above-described discrimination difficulty weight is determined according to the degree of similarity between various types of information.
As an example, the at least three preset types may be a dog type picture type, a tiger type picture type, and a cat type picture type, respectively. The pictures of the dog picture type, the tiger picture type and the cat picture type can be respectively obtained. And respectively calculating to obtain the similarity between the picture of the dog picture type and the picture of the tiger picture type by 10 percent, the similarity between the picture of the dog picture type and the picture of the cat picture type by 20 percent and the similarity between the picture of the tiger picture type and the picture of the cat picture type by 60 percent. The similarity 10% can be determined as a difficulty distinguishing weight between a dog picture type and a tiger picture type, the similarity 20% can be determined as a difficulty distinguishing weight between a dog picture type and a cat picture type, and the similarity 60% can be determined as a difficulty distinguishing weight between a tiger picture type and a cat picture type.
Step 303, determining a model error of the initial neural network model based on the at least one difficulty of distinguishing weight and the probability that the first training sample belongs to each type.
In this embodiment, the second electronic device may determine a model error of the initial neural network model based on the at least one difficulty of distinguishing weight obtained in step 302 and the probability that the first training sample generated in step 301 belongs to the above types.
One skilled in the art will appreciate that model errors can be used to characterize the gap between the actual output and the desired output of the model. It should be noted that, for the classification model, the existing training mode adopts a mode of equally treating each type to train the model. However, the difficulty of distinguishing between different types of pairs may be different, and this is not considered in the conventional training mode.
In some optional implementations of this embodiment, the first training sample is pre-identified with the type to which the first training sample belongs, and the first training sample includes a plurality of training samples. Step 303 may be implemented by: the highest probability among the probabilities that the first training sample belongs to the respective types is selected. And comparing the type corresponding to the maximum probability with the type identified in advance by the first training sample. If the comparison result is the same, determining that the neural network model is correctly identified; and if the comparison result is different, determining that the neural network model is identified wrongly. For each of at least three types, a proportion of the first training samples of that type that are recognized as erroneous by the neural network model is determined. For each of the at least one type pair, a sum of proportions corresponding to the type pair is determined, and a product of the sum of proportions corresponding to the any two types and the discrimination difficulty weight for the type pair is determined. The determined products are summed up as the model error described above.
In some optional implementations of this embodiment, step 303 may also be implemented by step 3031, step 3032, and step 3033 in the flow 303 shown in fig. 3 b:
step 3031, determining probability errors for representing the first training sample to belong to various probabilities according to the probabilities of the first training sample belonging to various types.
In this implementation, the second electronic device may determine, according to the probability that the first training sample belongs to each type, a probability error for characterizing the probability that the first training sample belongs to each type.
As an example, the probability error may be determined using the following equation:
zi=xi-max(x1,x2,...,xN) (1)
Figure BDA0001336046520000081
wherein: x is the number ofiThe probability that the first training sample belongs to the ith type is shown, and the value range of i is 1, 2, 3 … …, N; x is the number of1,x1,...,xNX in (2)1Is the probability, x, that the first training sample belongs to type 12Is the probability, x, that the first training sample belongs to type 2NThe probability that the first training sample belongs to the Nth type is shown, and N is the number of types of the preset type; max () represents taking the maximum value; zjThe value range of j in (1) is 1, 2, 3 … …, N; it can be seen that when j takes a value of 1, Z1The value of (2) can be determined according to the formula (1), and by analogy, each Z can be determinedj;liFor the probability error of the probability that the first training sample belongs to the i-th type, Z obtained by the formula (1) is usediSubstituting equation (2) into, each l can be obtainedi
Step 3032, for each type pair in at least one type pair, determining the weighted probability error of the type pair according to the sum of the discrimination difficulty weights of the two types in the type pair and the corresponding probability errors.
In this implementation manner, for each type pair in the at least one type pair, the second electronic device may determine a weighted probability error of the type pair according to a sum of the differentiation difficulty weights of the two types in the type pair and the corresponding probability errors.
As an example, for each of at least one type pair, a product of a difficulty of distinguishing weight of two of the type pairs and a sum of corresponding probability errors may be determined as a weighted probability error for the type pair.
Step 3033, determining a model error according to the determined weight error.
In this implementation, the second electronic device may determine a model error according to the determined weight probability error.
As an example, the sum of the determined at least one weighted probability error may be determined as the above-mentioned model error.
Step 304, updating the initial neural network model according to the model error.
In this embodiment, the second electronic device may update the initial neural network model according to the model error determined in step 303.
It should be noted that how to update the model according to the model error itself is a technique provided in the prior art, and those skilled in the art can implement step 304 based on the prior art, which is not described herein again.
It should be noted that the initial neural network model is updated based on steps 301 to 304, and may be updated once by performing steps 301 to 304, or may be updated multiple times by performing steps 301 to 304 multiple times. When the loop of steps 301 to 304 is executed for a plurality of times, the initial neural network model updated in step 304 in the secondary loop can be used as the initial neural network model in step 301 in the next loop. The neural network model may be an updated neural network model.
With continued reference to fig. 4, fig. 4 is a schematic diagram of an application scenario of the method for identifying information according to the present embodiment. In the application scenario of fig. 4, first, the server 401 may update the pre-built initial neural network model 402 based on the update flow 403, and establish the neural network model 404 according to the updated initial neural network, where it is to be noted that the update flow may refer to the description in steps 301 to 304, and is not described herein again. Then, the user can send information to be identified 406, which is a picture with a cat image as an example, to the server 401 using the terminal 405. And then, the server can acquire the information to be identified. Finally, the server 401 may import the information to be identified 406 into the neural network model 404, generate probabilities that the information to be identified respectively belongs to various types of at least three preset types, identify the type to which the information to be identified belongs according to the generated probabilities, and output a type of "cat picture" as an example.
The method provided by the embodiment of the application utilizes the neural network model for information identification, and the model error is determined according to the differentiation difficulty weight, so that the model error and the differentiation difficulty weight are related. In a colloquial way, if the difficulty in distinguishing corresponding to the type pair which is difficult to distinguish is weighted more heavily, the model error contribution of the type pair which is difficult to distinguish to the model is larger, and if the distinguishing capability of the model to the type pair which is difficult to distinguish is poorer, the model error is still larger. In the process of reducing the model error, the distinguishing capability of the model for the type pairs which are difficult to distinguish is improved, so that the accuracy of the identification information can be improved. In contrast, the existing method for determining the model error does not distinguish the source of the model error, and has no difference treatment for various types of probabilities, so that when the model is updated according to the model error, even if the model error is already small, the distinguishing capability of the neural network model is still poor for the type pairs which are difficult to distinguish.
In some optional implementations of this embodiment, please refer to fig. 5, which illustrates an exemplary process 500 for updating the initial neural network model, and the initial neural network model may be further updated based on steps 501, 502, 503, 504, 505, and 506 in the process 500:
step 501, importing the first training sample into an initial neural network model, and generating the probability that the first training sample belongs to various types.
In this embodiment, the second electronic device (for example, the server shown in fig. 1) may import the first training sample into the initial neural network model, and generate a probability that the first training sample belongs to the above-mentioned types.
It should be noted that, the implementation details of step 501 may refer to the description in step 301, and are not described herein again.
Step 502, for each type pair of at least one type pair, training a binary model for the type pair.
In this embodiment, the second electronic device (e.g., the server shown in fig. 1) may, for each of at least one pair of types, train a classification model for the pair of types. Here, the binary model is used to represent the correspondence between information and indication information, and the indication information is used to indicate that the information belongs to one of the two types in the type pair.
In some optional implementations of this embodiment, step 502 may be implemented by: for each type in each of the at least one type pair, obtaining a second sample set pre-labeled with the type and probabilities of belonging to the type. And in response to the fact that the proportion of the second training samples belonging to the type and having the probability smaller than the preset probability threshold value in the set is smaller than the preset proportion threshold value, amplifying to obtain the amplified samples based on the second training samples belonging to the type and having the probability smaller than the preset probability threshold value. And combining the amplified sample with the second training sample in the set to obtain a combined sample set. And for each type pair in at least one type pair, utilizing the combined sample sets respectively corresponding to two types in the type pair to train a binary classification model for the type pair.
In this implementation, if the probability that the second training sample belongs to the type is smaller than the preset probability threshold, the second training sample may be determined as a hard sample (hard example). If the proportion of the samples difficult to identify in the set is smaller than the preset proportion threshold value, amplification can be performed based on the samples difficult to identify, and one or more amplified samples are obtained.
In this implementation, the amplification is performed based on the hard-to-recognize sample mode, and the hard-to-recognize sample may be processed by one or more of the following modes: upsampling, downsampling, mirroring, and the like. In particular, for picture information, amplification may be performed in one or more of the following ways: crop, slight rotation, mirror image, change channel color, and slight blur.
In this implementation, it should be noted that the amplified sample is also a sample that is difficult to identify, and the type of the amplified sample is the same as the sample that is difficult to identify based on which the amplification is performed. The ratio of the hard-to-recognize sample (including the amplified sample and the second training sample having the probability of belonging to the type smaller than the preset probability threshold) to the normal sample (the second training sample having the probability of belonging to the type not smaller than the preset probability threshold) in the merged sample set may be set.
It should be noted that, in general, for the second training sample set of the type, the proportion of the samples difficult to recognize may be small, and thus the trained binary model may not have a good recognition capability for the samples difficult to recognize. The proportion of the samples which are difficult to identify in the combined sample set is high, the two classification models trained by the combined sample set can be used for better identifying the samples which are difficult to identify of the type, and then the two types in the type pair which the two classification models aim at can be better distinguished.
In some optional implementations of this embodiment, obtaining the second sample set pre-labeled with the type and the probability of belonging to the type may be implemented by: the type and probability can be labeled empirically by the worker in advance.
In some optional implementations of this embodiment, obtaining the second sample set pre-labeled with the type and the probability of belonging to the type may be implemented by: and acquiring a second training sample which is labeled with the type in advance. And importing the second training sample which is pre-labeled with the type into a pre-established probability generation model, and determining the probability that the second training sample which is pre-labeled with the type belongs to the type. Here, the probability generation model is used to characterize the correspondence between the probabilities that the second training sample and the second training sample respectively belong to the various types described above.
In this implementation, the probability generation model may be a model of recognition capability intersection for making a preliminary estimate of the probability that the second training sample belongs to a pre-labeled type, in order to later determine the difficult-to-recognize sample.
Step 503, determining the model error of each binary model by using the test sample with the type marked in advance.
In this embodiment, the second electronic device may determine the model error of each binary model by using the test samples labeled with the types in advance.
As an example, for each binary model, two types of test samples may be selected first, and the selected test samples are labeled with the type in the type pair for which the binary model is directed. And introducing the selected test sample into the two classification models to obtain the probabilities belonging to the two types, and determining the type with higher probability as the type of the test sample. And judging whether the type determined by the two-classification model is consistent with the type marked by the test sample. And counting the inconsistent proportion to determine the error of the binary model.
And step 504, for each trained binary model, determining the distinguishing difficulty weight of the type pair to which the binary model aims according to the model error of the binary model.
In this embodiment, for each trained binary model, the second electronic device may determine, according to a model error of the binary model, a difficulty in distinguishing weight of a type pair to which the binary model is directed.
As an example, the model error of the binary model may be determined as the difficulty of distinguishing weight of the type pair for which the binary model is directed.
And 505, determining a model error of the initial neural network model based on at least one distinguishing difficulty weight and the probability that the first training sample belongs to various types.
In this embodiment, the second electronic device may determine a model error of the initial neural network model based on the at least one difficulty of distinguishing weight and a probability that the first training sample belongs to the various types.
Step 506, updating the initial neural network model according to the model error.
In this embodiment, the second electronic device may update the initial neural network model according to the model error determined in step 505.
It should be noted that, details of the implementation of step 505 and step 506 may refer to the descriptions in step 303 and step 304, respectively, and are not described herein again.
It should be noted that the initial neural network model is updated based on steps 501 to 505, and may be updated once by performing steps 501 to 506, or multiple times by performing steps 501 to 506. When the loop of steps 501 to 506 is executed for a plurality of times, the initial neural network model updated in step 506 in the next loop can be used as the initial neural network model in step 501 in the next loop. The neural network model may be an updated neural network model.
As can be seen from fig. 5, compared with the updating process of the initial neural network model corresponding to fig. 3, the updating process of the initial neural network model corresponding to fig. 5 highlights the step of determining the discrimination difficulty weights, so that more accurate discrimination difficulty weights can be introduced, and more effective information identification can be realized.
With further reference to fig. 6, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for identifying information, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 6, the apparatus 600 for identifying information described above in this embodiment includes: the acquisition unit 601, the identification unit 602, and the update unit 603, and the update unit includes a generation module 6031, an acquisition module 6032, a determination module 6033, and an update module 6034. The device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring information to be identified; the identification unit is configured to import the information to be identified into a neural network model, generate probabilities that the information to be identified respectively belongs to each of at least three preset types, and identify a type to which the information to be identified belongs according to the generated probabilities, where the neural network model is obtained according to an updated initial neural network model, the initial neural network model is updated by an updating unit, and the updating unit includes: a generating module, configured to introduce a first training sample into an initial neural network model, and generate probabilities that the first training sample belongs to the various types, where the initial neural network model is used to represent a correspondence between information and probabilities that the information belongs to the various types; the system comprises an acquisition module, a comparison module and a comparison module, wherein the acquisition module is used for acquiring at least one distinguishing difficulty weight, the distinguishing difficulty weight is used for representing the difficulty of distinguishing two types of information in a type pair, and the type pair consists of two types of the at least three preset types; a determining module, configured to determine a model error of an initial neural network model based on the at least one difficulty of distinguishing weight and a probability that the first training sample belongs to the various types; and the updating module is used for updating the initial neural network model according to the model error.
In this embodiment, the specific processing of the obtaining unit 601, the identifying unit 602, and the updating unit 603 and the technical effects thereof can refer to the related descriptions of step 201, step 202, and step 203 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementation manners of this embodiment, the determining module is further configured to: determining a probability error for representing the probability that the first training sample belongs to the various types according to the probability that the first training sample belongs to the various types; for each type pair in at least one type pair, determining the weighted probability error of the type pair according to the sum of the distinguishing difficulty weights of the two types in the type pair and the corresponding probability errors; and determining the model error according to the determined weight probability error.
In some optional implementation manners of this embodiment, the obtaining module is further configured to: for each type pair in at least one type pair, training a binary classification model for the type pair, wherein the binary classification model is used for representing the corresponding relation between information and indicating information, and the indicating information is used for indicating that the information belongs to one of two types in the type pair; determining the model error of each two-classification model by using a test sample with a type marked in advance; and for each trained binary model, determining the distinguishing difficulty weight of the type pair for which the binary model aims according to the model error of the binary model.
In some optional implementation manners of this embodiment, the obtaining module is further configured to: for each type in each type pair in the at least one type pair, acquiring a set of second training samples which are pre-labeled with the type and the probability of belonging to the type; in response to that the proportion of the second training samples belonging to the type and having the probability smaller than the preset probability threshold value in the set is smaller than the preset proportion threshold value, amplifying to obtain amplified samples based on the second training samples belonging to the type and having the probability smaller than the preset probability threshold value; merging the amplified sample with a second training sample in the set to obtain a merged sample set; and for each type pair in the at least one type pair, utilizing the combined sample sets respectively corresponding to the two types in the type pair to train a binary classification model for the type pair.
In some optional implementation manners of this embodiment, the obtaining module is further configured to: for each type in each type pair in the at least one type pair, acquiring a second training sample which is labeled with the type in advance; and importing a second training sample which is labeled with the type in advance into a pre-established probability generation model, and determining the probability that the second training sample which is labeled with the type in advance belongs to the type, wherein the probability generation model is used for representing the corresponding relation between the probabilities that the second training sample and the second training sample respectively belong to the various types.
It should be noted that, for details of implementation and technical effects of each unit in the apparatus for identifying information provided in this embodiment, reference may be made to descriptions of other embodiments in this application, and details are not described herein again.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use in implementing a server according to embodiments of the present application. The server shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program, when executed by a Central Processing Unit (CPU)701, performs the above-described functions defined in the method of the present application.
It should be noted that the computer readable medium mentioned above in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. 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 some 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.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a recognition unit, and an update unit, wherein the update unit includes a generation module, an acquisition module, a determination module, and an update module. The names of these units or modules do not in some cases constitute a limitation on the unit itself, and for example, the receiving unit may also be described as a "unit that acquires information to be identified".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: acquiring information to be identified; importing the information to be identified into a neural network model, generating probabilities that the information to be identified respectively belongs to various types of at least three preset types, and identifying the type of the information to be identified according to the generated probabilities, wherein the neural network model is obtained according to an updated initial neural network model, and the initial neural network model is updated based on the following steps: leading a first training sample into an initial neural network model, and generating the probability that the first training sample belongs to the various types, wherein the initial neural network model is used for representing the corresponding relation between information and the probability that the information belongs to the various types; acquiring at least one discrimination difficulty weight, wherein the discrimination difficulty weight is used for representing the difficulty of distinguishing two types of information in a type pair, and the type pair consists of two types of the at least three preset types; determining a model error of the initial neural network model based on the at least one discrimination difficulty weight and the probability that the first training sample belongs to the various types; and updating the initial neural network model according to the model error.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (10)

1. A method for identifying information, the method comprising:
acquiring information to be identified;
importing the information to be identified into a neural network model, generating probabilities that the information to be identified respectively belongs to various types of at least three preset types, and identifying the type of the information to be identified according to the generated probabilities, wherein the neural network model is obtained according to an updated initial neural network model, and the initial neural network model is updated based on the following steps:
importing a first training sample into an initial neural network model, and generating the probability that the first training sample belongs to the various types, wherein the initial neural network model is used for representing the corresponding relation between information and the probability that the information belongs to the various types;
acquiring at least one discrimination difficulty weight, wherein the discrimination difficulty weight is used for representing the difficulty of two types of information in a discrimination type pair, the discrimination difficulty weight comprises the similarity between the two types of information, and the type pair consists of two types of the at least three preset types;
determining a model error of an initial neural network model based on the at least one discriminative difficulty weight and the probability that the first training sample belongs to the various types;
and updating the initial neural network model according to the model error.
2. The method of claim 1, wherein determining a model error of an initial neural network model based on the at least one difficulty of distinguishing weight and a probability that the first training sample belongs to the various types comprises:
determining a probability error for characterizing the probability that the first training sample belongs to the various types according to the probability that the first training sample belongs to the various types;
for each type pair in at least one type pair, determining the weighted probability error of the type pair according to the sum of the distinguishing difficulty weights of the two types in the type pair and the corresponding probability errors;
and determining the model error according to the determined weight probability error.
3. The method of claim 1 or 2, wherein the obtaining at least one difficulty of distinguishing weight comprises:
for each type pair in at least one type pair, training a binary classification model for the type pair, wherein the binary classification model is used for representing the corresponding relation between information and indicating information, and the indicating information is used for indicating that the information belongs to one of two types in the type pair;
determining the model error of each two-classification model by using a test sample with a type marked in advance;
and for each trained binary model, determining the distinguishing difficulty weight of the type pair for which the binary model aims according to the model error of the binary model.
4. The method of claim 3, wherein training, for each of the at least one type pair, a binary model for the type pair comprises:
for each type in each type pair of the at least one type pair, acquiring a set of second training samples which are pre-labeled with the type and the probability of belonging to the type; in response to that the proportion of the second training samples belonging to the type and having the probability smaller than the preset probability threshold value in the set is smaller than the preset proportion threshold value, amplifying to obtain amplified samples based on the second training samples belonging to the type and having the probability smaller than the preset probability threshold value; merging the amplified sample with a second training sample in the set to obtain a merged sample set;
and for each type pair in the at least one type pair, utilizing the combined sample sets respectively corresponding to the two types in the type pair to train a binary classification model for the type pair.
5. The method of claim 4, wherein obtaining, for each type in each of the at least one pair of types, a set of second training samples pre-labeled with the type and probabilities of belonging to the type comprises:
for each type in each type pair in the at least one type pair, obtaining a second training sample which is labeled with the type in advance; and importing the second training sample which is labeled with the type in advance into a pre-established probability generation model, and determining the probability that the second training sample which is labeled with the type in advance belongs to the type, wherein the probability generation model is used for representing the corresponding relation between the probabilities that the second training sample and the second training sample respectively belong to the various types.
6. An apparatus for identifying information, the apparatus comprising:
an acquisition unit configured to acquire information to be identified;
the identification unit is used for importing the information to be identified into a neural network model, generating probabilities that the information to be identified respectively belongs to various types of at least three preset types, and identifying the type to which the information to be identified belongs according to the generated probabilities, wherein the neural network model is obtained according to an updated initial neural network model, the initial neural network model is updated through an updating unit, and the updating unit comprises:
the generating module is used for importing a first training sample into an initial neural network model and generating the probability that the first training sample belongs to the various types, wherein the initial neural network model is used for representing the corresponding relation between information and the probability that the information belongs to the various types;
the system comprises an acquisition module, a comparison module and a comparison module, wherein the acquisition module is used for acquiring at least one distinguishing difficulty weight, the distinguishing difficulty weight is used for representing the difficulty of distinguishing two types of information in a type pair, the distinguishing difficulty weight comprises the similarity between the two types of information, and the type pair consists of two types of the at least three preset types;
a determination module for determining a model error of an initial neural network model based on the at least one discrimination difficulty weight and a probability that the first training sample belongs to the various types;
and the updating module is used for updating the initial neural network model according to the model error.
7. The apparatus of claim 6, wherein the determining module is further configured to:
determining a probability error for characterizing the probability that the first training sample belongs to the various types according to the probability that the first training sample belongs to the various types;
for each type pair in at least one type pair, determining the weighted probability error of the type pair according to the sum of the distinguishing difficulty weights of the two types in the type pair and the corresponding probability errors;
and determining the model error according to the determined weight probability error.
8. The apparatus of claim 6 or 7, wherein the obtaining module is further configured to:
for each type pair in at least one type pair, training a binary classification model for the type pair, wherein the binary classification model is used for representing the corresponding relation between information and indicating information, and the indicating information is used for indicating that the information belongs to one of two types in the type pair;
determining the model error of each two-classification model by using a test sample with a type marked in advance;
and for each trained binary model, determining the distinguishing difficulty weight of the type pair for which the binary model aims according to the model error of the binary model.
9. A server, characterized in that the server comprises:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method recited in any of claims 1-5.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201710513137.0A 2017-06-29 2017-06-29 Method and apparatus for identifying information Active CN109214501B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710513137.0A CN109214501B (en) 2017-06-29 2017-06-29 Method and apparatus for identifying information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710513137.0A CN109214501B (en) 2017-06-29 2017-06-29 Method and apparatus for identifying information

Publications (2)

Publication Number Publication Date
CN109214501A CN109214501A (en) 2019-01-15
CN109214501B true CN109214501B (en) 2021-11-30

Family

ID=64960452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710513137.0A Active CN109214501B (en) 2017-06-29 2017-06-29 Method and apparatus for identifying information

Country Status (1)

Country Link
CN (1) CN109214501B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109785072A (en) * 2019-01-23 2019-05-21 北京京东尚科信息技术有限公司 Method and apparatus for generating information
CN110674414A (en) * 2019-09-20 2020-01-10 北京字节跳动网络技术有限公司 Target information identification method, device, equipment and storage medium
CN110796366A (en) * 2019-10-28 2020-02-14 中国联合网络通信集团有限公司 Quality difference cell identification method and device
CN113093967A (en) 2020-01-08 2021-07-09 富泰华工业(深圳)有限公司 Data generation method, data generation device, computer device, and storage medium
CN113642592A (en) * 2020-04-27 2021-11-12 武汉Tcl集团工业研究院有限公司 Training method of training model, scene recognition method and computer equipment
CN115114467B (en) * 2021-03-17 2024-05-14 腾讯科技(深圳)有限公司 Training method and device for picture neural network model

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101591626B1 (en) * 2015-02-04 2016-02-04 한양대학교 산학협력단 Method and apparatus for conceal packet loss based on the deep neural network
CN106778820A (en) * 2016-11-25 2017-05-31 北京小米移动软件有限公司 Identification model determines method and device
CN106845330A (en) * 2016-11-17 2017-06-13 北京品恩科技股份有限公司 A kind of training method of the two-dimension human face identification model based on depth convolutional neural networks

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101591626B1 (en) * 2015-02-04 2016-02-04 한양대학교 산학협력단 Method and apparatus for conceal packet loss based on the deep neural network
CN106845330A (en) * 2016-11-17 2017-06-13 北京品恩科技股份有限公司 A kind of training method of the two-dimension human face identification model based on depth convolutional neural networks
CN106778820A (en) * 2016-11-25 2017-05-31 北京小米移动软件有限公司 Identification model determines method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Neural-network based regression model with prior from ranking information;Yajun Qu et al;《The 2010 International Joint Conference on Neural Networks (IJCNN)》;20101231;第1-10页 *
监控视频中的行人检测技术及其应用;高晨旭;《中国优秀硕士学位论文全文数据库 信息科技辑》;20170315(第3期);第I138-5651页 *

Also Published As

Publication number Publication date
CN109214501A (en) 2019-01-15

Similar Documents

Publication Publication Date Title
CN109214501B (en) Method and apparatus for identifying information
US11978245B2 (en) Method and apparatus for generating image
CN109858445B (en) Method and apparatus for generating a model
CN108427939B (en) Model generation method and device
CN109993150B (en) Method and device for identifying age
CN108197652B (en) Method and apparatus for generating information
CN108280477B (en) Method and apparatus for clustering images
CN109376267B (en) Method and apparatus for generating a model
CN108229419B (en) Method and apparatus for clustering images
CN109308490B (en) Method and apparatus for generating information
CN109034069B (en) Method and apparatus for generating information
CN108171203B (en) Method and device for identifying vehicle
CN108960316B (en) Method and apparatus for generating a model
CN109447156B (en) Method and apparatus for generating a model
CN109740018B (en) Method and device for generating video label model
CN109145828B (en) Method and apparatus for generating video category detection model
CN107609506B (en) Method and apparatus for generating image
CN109919244B (en) Method and apparatus for generating a scene recognition model
CN108108743B (en) Abnormal user identification method and device for identifying abnormal user
CN109389072B (en) Data processing method and device
CN109961032B (en) Method and apparatus for generating classification model
CN110502665B (en) Video processing method and device
CN109389096B (en) Detection method and device
CN110059623B (en) Method and apparatus for generating information
CN108509994B (en) Method and device for clustering character images

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
GR01 Patent grant
GR01 Patent grant