CN113392685A - Image recognition method, image recognition device, image recognition apparatus, and storage medium - Google Patents

Image recognition method, image recognition device, image recognition apparatus, and storage medium Download PDF

Info

Publication number
CN113392685A
CN113392685A CN202011005159.4A CN202011005159A CN113392685A CN 113392685 A CN113392685 A CN 113392685A CN 202011005159 A CN202011005159 A CN 202011005159A CN 113392685 A CN113392685 A CN 113392685A
Authority
CN
China
Prior art keywords
identification
image
recognition
state
configuration information
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
Application number
CN202011005159.4A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011005159.4A priority Critical patent/CN113392685A/en
Publication of CN113392685A publication Critical patent/CN113392685A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Abstract

The embodiment of the invention discloses an image identification method, an image identification device, image identification equipment and a storage medium, wherein the method comprises the following steps: responding to an identification trigger operation aiming at an image to be identified, and detecting an identification scene where the image to be identified is located, wherein different identification scenes correspond to different identification configuration information; if the image to be recognized is in a target recognition scene, acquiring target recognition configuration information matched with the target recognition scene, wherein the target recognition configuration information is used for indicating a recognition process of performing image recognition on the image to be recognized in the target recognition scene; and according to the identification process indicated by the target identification configuration information, the image to be identified is identified to obtain an image identification result of the image to be identified, so that the flexibility of image identification can be improved.

Description

Image recognition method, image recognition device, image recognition apparatus, and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an image recognition method, an image recognition device, and a storage medium.
Background
With the development of internet technology, more and more attention is paid to image recognition technology, and the current image recognition technology includes face recognition technology, gesture recognition technology, article recognition technology, and the like, and based on the deep development of the image recognition technology, the image recognition technology can be applied to various aspects of production and life of users, such as the face recognition technology is applied to target object tracking, and the article recognition technology is applied to the operation of unmanned stores, and the like. Most of the current image recognition technologies are specific business requirements oriented, a fixed recognition method is adopted, for example, the current face recognition technology adopts the steps of firstly extracting a face image and then detecting a blocking object, and the like, and the fixed recognition method has the problem of low flexibility of a recognition algorithm, so that how to improve the flexibility of the current image recognition technology becomes a current research hotspot.
Disclosure of Invention
The embodiment of the invention provides an image identification method, an image identification device and a storage medium, which can improve the flexibility of image identification.
In one aspect, an embodiment of the present invention provides an image recognition method, including:
responding to an identification trigger operation aiming at an image to be identified, and detecting an identification scene where the image to be identified is located, wherein different identification scenes correspond to different identification configuration information;
if the image to be recognized is in a target recognition scene, acquiring target recognition configuration information matched with the target recognition scene, wherein the target recognition configuration information is used for indicating a recognition process of performing image recognition on the image to be recognized in the target recognition scene;
and according to the identification flow indicated by the target identification configuration information, carrying out identification processing on the image to be identified to obtain an image identification result of the image to be identified.
In another aspect, an embodiment of the present invention provides an image recognition apparatus, including:
the device comprises a detection unit, a processing unit and a processing unit, wherein the detection unit is used for responding to the identification triggering operation aiming at the image to be identified and detecting the identification scene where the image to be identified is located, wherein different identification scenes correspond to different identification configuration information;
the image recognition device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring target recognition configuration information matched with a target recognition scene if the image to be recognized is in the target recognition scene, and the target recognition configuration information is used for indicating a recognition process of performing image recognition on the image to be recognized in the target recognition scene;
and the identification unit is used for carrying out identification processing on the image to be identified according to the identification flow indicated by the target identification configuration information to obtain an image identification result of the image to be identified.
In one embodiment, the target identification configuration information includes state identifiers of at least one identification state and switching relations between identification states corresponding to different state identifiers, and one identification state corresponds to one identification processing logic;
the identification process indicated by the target identification configuration information comprises the following steps: and determining the execution sequence of the identification processing logic corresponding to each identification state according to the switching relation.
In one embodiment, the target identification configuration information includes at least a first state identifier and a second state identifier, and a first switching relationship for switching from a first identification state indicated by the first state identifier to a second identification state indicated by the second state identifier;
the identification unit is specifically configured to:
adopting an identification processing logic corresponding to the first identification state to identify the image to be identified to obtain a first identification result;
if the first recognition result indicates that the image to be recognized passes the recognition processing in the first recognition state, switching from the first recognition state to a second recognition state according to the first switching relation, and recognizing the image to be recognized by adopting recognition processing logic corresponding to the second recognition state to obtain a second recognition result;
and determining the image recognition result of the image to be recognized according to the second recognition result.
In one embodiment, the target identification configuration information further includes a third status identifier, and a second switching relationship switching from the first identification status indicated by the first status identifier to a third identification status indicated by the third status identifier, the apparatus further includes: a switching unit and a determining unit.
The switching unit is used for switching the to-be-recognized image from the first recognition state to a third recognition state according to the second switching relation if the first recognition result indicates that the to-be-recognized image does not pass the recognition processing in the first recognition state, and performing recognition processing on the to-be-recognized image by adopting recognition processing logic corresponding to the third recognition state to obtain a third recognition result;
and the determining unit is used for determining the image recognition result of the image to be recognized according to the third recognition result, wherein the third recognition state is the first recognition state or the previous recognition state of the first recognition state.
In one embodiment, each state identifier included in the target configuration information is selected from a preset state identifier set in a state machine;
the state identities in the set of state identities comprise one or more of: the identification of face detection state, the identification of eye sheltering state, the identification of mouth sheltering state, the identification of quality branch detection state, the identification of live body detection state, the identification of attention detection state.
In one embodiment, the apparatus further comprises: and adding a unit.
The determining unit is further configured to determine, in response to an adding operation of the recognition processing logic for the image to be recognized, a recognition state corresponding to the recognition processing logic to be added, and determine whether the state identifier set includes a state identifier of the recognition state corresponding to the recognition processing logic to be added;
and if not, adding the state identifier of the identification state corresponding to the identification processing logic to be added into the state identifier set.
In one embodiment, the identification processing logic corresponding to each identification state is determined according to state configuration information corresponding to each identification state, where the state configuration information includes: one or more identification operations related to each identification state, and an operation parameter corresponding to each identification operation;
the identification processing logic corresponding to each identification state comprises: and controlling the execution of the corresponding identification operation according to the operation parameters indicated by the state configuration information.
In one embodiment, the target identification configuration information includes a state transition diagram, the state transition diagram includes a plurality of state nodes, one state node stores one state identifier, and a pointing relationship between different state nodes is used to indicate a switching relationship between corresponding identification states.
In an embodiment, the target identification configuration information includes a plurality of state description statements, the state description statements are arranged in sequence, and each state description statement is used for describing a switching relationship between identification states corresponding to different state identifiers.
In still another aspect, an embodiment of the present invention provides an image recognition device, including a processor, an input device, an output device, and a memory, where the processor, the input device, the output device, and the memory are connected to each other, where the memory is used to store a computer program that supports a terminal to execute the above method, the computer program includes program instructions, and the processor is configured to call the program instructions to perform the following steps:
responding to an identification trigger operation aiming at an image to be identified, and detecting an identification scene where the image to be identified is located, wherein different identification scenes correspond to different identification configuration information;
if the image to be recognized is in a target recognition scene, acquiring target recognition configuration information matched with the target recognition scene, wherein the target recognition configuration information is used for indicating a recognition process of performing image recognition on the image to be recognized in the target recognition scene;
and according to the identification flow indicated by the target identification configuration information, carrying out identification processing on the image to be identified to obtain an image identification result of the image to be identified.
In still another aspect, an embodiment of the present invention provides a computer-readable storage medium, in which program instructions are stored, and when the program instructions are executed by a processor, the computer-readable storage medium is configured to perform the image recognition method according to the first aspect.
In the embodiment of the invention, the image recognition device can detect the recognition scene of the image to be recognized after detecting the recognition trigger operation aiming at the image to be recognized, so as to obtain the target recognition configuration information matched with the target recognition scene of the image to be recognized from different recognition configuration information corresponding to different recognition scenes, and further carry out recognition processing on the image to be recognized according to the recognition flow indicated by the target recognition configuration information, thereby obtaining the image recognition result aiming at the image to be recognized, based on the difference of the recognition scenes, the image recognition device can adopt different recognition flows to carry out recognition processing on the image to be recognized, compared with the mode of adopting a uniform recognition flow to carry out recognition processing on the image to be processed, the flexibility of carrying out image recognition on the image to be processed can be effectively improved, in addition, the identification flow indicated by the identification configuration information is configured based on the switching relation between the state identifiers of the identification states, so that the image identification device realizes the control of the identification sequence when the image to be identified is identified based on the control of the circulation sequence between the identification states.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1a is a schematic diagram of an image recognition system according to an embodiment of the present invention;
FIG. 1b is a schematic diagram of an image recognition system according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart diagram of an image recognition method provided by an embodiment of the invention;
FIG. 3a is a schematic diagram of an identification window provided by an embodiment of the present invention;
FIG. 3b is a diagram illustrating an image recognition result according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart diagram of an image recognition method provided by an embodiment of the invention;
FIG. 5a is a diagram illustrating target identification configuration information according to an embodiment of the present invention;
FIG. 5b is a diagram illustrating target identification configuration information according to an embodiment of the present invention;
FIG. 5c is a diagram illustrating an adjustment state transition diagram according to an embodiment of the present invention;
FIG. 5d is a diagram illustrating state configuration information according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an image recognition apparatus according to an embodiment of the present invention;
fig. 7 is a schematic block diagram of an image recognition apparatus according to an embodiment of the present invention;
fig. 8 is a schematic block diagram of an image recognition apparatus according to an embodiment of the present invention.
Detailed Description
With the research and progress of artificial intelligence technology, the artificial intelligence technology is developed and applied in a plurality of fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, unmanned aerial vehicles, robots, smart medical care, smart customer service, and the like. Artificial Intelligence (AI) is a theory, method, technique and application system that uses a digital computer or a digital computer controlled machine to simulate, extend and expand human Intelligence, sense the environment, acquire knowledge and use the knowledge to obtain the best results, in other words, it is a comprehensive technique of computer science, which attempts to understand the essence of Intelligence and produces a new intelligent machine that can react in a similar way to human Intelligence, i.e. research on the design principles and implementation methods of various intelligent machines, making the machine have the functions of sensing, reasoning and decision making. The artificial intelligence technology is a comprehensive subject and relates to the field, the technology of the existing hardware level and the technology of the software level, the artificial intelligence basic technology generally comprises the technologies such as a sensor, a special artificial intelligence chip, cloud computing, distributed storage, a big data processing technology, an operation/interaction system, electromechanical integration and the like, and the artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The scheme provided by the embodiment of the invention relates to an artificial intelligence image identification technology, the image identification method provided by the embodiment of the invention enables the image identification equipment to obtain different identification configuration information according to the difference of identification scenes, so that the image identification can be carried out according to the identification process indicated by the obtained identification configuration information, the image identification equipment can carry out the image identification according to the indication of different identification processes based on the difference of the identification scenes or the difference of identification requirements, and the image identification can be carried out based on the different identification scenes or the identification requirements by configuring different image identification processes, so that the flexibility of the image identification equipment in the image identification can be effectively improved. In one embodiment, image recognition refers to the processing, analysis and understanding of the image to be recognized by a computer, the technique to identify different patterns of objects and objects included in the image to be identified is a practical application of deep learning algorithms, wherein, the image recognition specifically comprises face recognition, article recognition, distance detection and the like, the face recognition can be applied to the fields of security inspection, identity verification and the like, the article recognition can be applied to the fields of intelligent retail and the like, the distance detection can be applied to the fields of object tracking and the like, the embodiment of the present invention will be described in detail mainly when the image recognition is human face recognition, and when the image recognition is article recognition or distance detection, the embodiment of the present invention can be referred to, and the embodiment of the present invention does not limit the specific algorithm of the face recognition. In an embodiment, the image recognition device may be a terminal device, or may also be a server device, which is not limited in the embodiment of the present invention, but in the embodiment of the present invention, the image recognition device is mainly used as the terminal device for detailed description, and when the image recognition device is the server device, reference may be made to the embodiment of the present invention.
In one embodiment, when the image recognition device is a terminal device, the image recognition method may be applied to an image recognition system as shown in fig. 1a, where the image recognition system includes an image recognition device 10 and a server 11, the image recognition device 10 is configured to receive a recognition trigger operation for an image to be recognized and detect a recognition scene where the image to be recognized is located, and the server 11 is configured to store recognition configuration information matching different recognition scenes, so that the image recognition device 10 may obtain target recognition configuration information matching a target recognition scene obtained by recognition from the server 11 based on the detection of the recognition scene of the image to be recognized, and perform recognition processing on the image to be recognized according to a recognition flow indicated by the target recognition configuration information. In one embodiment, when the image recognition device 10 acquires the target recognition configuration information matching the recognized target recognition scene from the server 11 based on the detection of the recognition scene of the image to be recognized, the image recognition device 10 may transmit the scene identification of the target recognition scene determined by the detection to the server 11 to acquire the target recognition configuration information matching the scene identification of the target recognition scene from the server 11, or the image recognition device 10 may directly transmit the acquired image to be recognized to the server 11, so that the server 11 performs scene recognition on the image to be recognized to determine the target recognition scene in which the image to be recognized is located, and transmit the target recognition configuration information matching the target recognition scene to the image recognition device 10, the image recognition device 10 is caused to acquire target recognition configuration information that matches the target recognition scene.
In an embodiment, the identification configuration information configured for different identification scenes may also be directly stored in the image identification device 10, so that after the image identification device 10 detects the identification scene where the image to be identified is located, the target identification configuration information matched with the identified target identification scene may be directly obtained from a local location, and the image to be identified is identified according to the identification flow indicated by the target identification configuration information. In an embodiment, when the image recognition device 10 is a terminal device, after the image to be recognized is processed by the recognition process indicated by the target recognition configuration information, the obtained image recognition result may be directly displayed in the image recognition device 10, where different recognition scenes correspond to different recognition configuration information.
In one embodiment, when the image recognition device is a server device, the image recognition method may be applied to an image recognition system as shown in fig. 1b, where the image recognition system includes an image recognition device 10 and a user terminal 12, the image recognition device 10 stores different recognition configuration information corresponding to different recognition scenes, and after detecting a recognition trigger operation for an image to be recognized sent by the user terminal 12, obtains the image to be recognized from the user terminal 12 to perform scene recognition on the image to be recognized, so as to determine a target recognition scene of the image to be recognized, further, the image recognition device 10 may obtain target recognition configuration information matching the target recognition scene from local, and perform recognition processing on the image to be recognized according to a recognition procedure indicated by the target recognition configuration information, the image recognition result of the image to be recognized is obtained, and after the image recognition device 10 obtains the image recognition result of the image to be recognized, the image recognition result of the image to be recognized may be sent to the user terminal 12 to display the image recognition result in the user interface of the user terminal 12. In one embodiment, the image recognition device 10 performs scene recognition on the image to be recognized, so that the image recognition device 10 can perform difference recognition on the image to be recognized based on the difference of the recognition scenes, and the flexibility of the image recognition device in the process of performing image recognition is improved.
Referring to fig. 2, a schematic flowchart of an image recognition method according to an embodiment of the present invention is shown, where the method is applicable to the image recognition device, and the image recognition device is a terminal device, as shown in fig. 2, the method may include:
s201, responding to the identification triggering operation aiming at the image to be identified, and detecting the identification scene where the image to be identified is located, wherein different identification scenes correspond to different identification configuration information.
In one embodiment, the image recognition device may determine that a recognition trigger operation for the image to be recognized is detected after the image to be recognized is acquired from the image recognition area after the detection operation for the image to be recognized is detected, wherein the detection operation for the image to be recognized may be, for example, a login operation such as a member login operation, or the detection operation for the image to be recognized may also be a payment operation such as a face brushing payment operation, and after the detection operation for the image to be recognized is detected by the image recognition device, the acquisition of the image to be recognized may be performed from the image recognition area, it may be understood that the image to be recognized acquired from the image recognition area by the image recognition device is a human face image, and the number of the acquired images to be recognized may be one or more, for example, the image recognition device may acquire only a front image of the human face from the image recognition area as the image to be recognized, alternatively, the image recognition device may also obtain facial images of different angles from the image recognition area as the image to be recognized, where the facial images of different angles may be, for example, a front image, a side image, an elevation image, a depression image, and so on. In the embodiment of the present invention, the number of images to be recognized acquired by the image recognition device is not limited, and each image to be recognized acquired by the image recognition device is suitable for the embodiment of the present invention.
In one embodiment, after detecting the detection operation for the image to be recognized, the image recognition device may display an identification window for performing image recognition on the image to be recognized, where the identification window may be, for example, a window marked by 30 in fig. 3a, the identification window 30 includes an image recognition area, the image recognition area may be, for example, an area marked by 301 in fig. 3a, the image recognition device may obtain the image to be recognized from the image recognition area 301, and the obtained image to be recognized may be, for example, an image marked by 31 in fig. 3 a. In addition, when the image recognition device detects the recognition scene in which the image to be recognized is located, the image recognition device may determine the scene in which the image to be recognized is located based on the detection of the recognition window 30, specifically, when the image recognition device detects the recognition window 30 to determine the scene in which the image to be recognized is located, a scene keyword may be obtained from the recognition window 30 first, and the recognition scene in which the image to be recognized is located may be determined based on the scene keyword, for example, if the scene keyword may be "member login" as shown in fig. 3a, the image recognition device determines the recognition scene in which the image to be recognized is located is a member login recognition scene, or if the obtained scene keyword includes "payment", the image recognition device determines the recognition scene in which the image to be recognized is located is a payment recognition scene, or, if the acquired scene keyword includes a "gesture", the image recognition device determines that the recognition scene in which the image to be recognized is located is a gesture recognition scene.
In one embodiment, the image recognition device may further determine an identification scene where the image to be recognized is located based on detecting an identification triggering operation, and in a specific implementation, if the identification triggering operation is a member login operation, the image recognition device may determine that the identification scene for the image to be recognized is a member login scene, where the image recognition device may determine that the identification triggering operation is the member login operation when detecting that a member login key is triggered; or, if the image recognition device detects that the payment key is triggered, and determines that the triggered operation is the payment operation, it may further determine that the recognition scene for the image to be recognized is the payment scene. In one embodiment, a developer configures different identification configuration information for different identification scenes, and the identification scenes and the identification configuration information are in a one-to-one correspondence relationship, so that the image identification device can determine an identification process for performing identification processing on the identification scene where the image to be identified is located based on the identification of the scene of the image to be identified.
S202, if the image to be recognized is in a target recognition scene, acquiring target recognition configuration information matched with the target recognition scene, wherein the target recognition configuration information is used for indicating a recognition process of performing image recognition on the image to be recognized in the target recognition scene.
In an embodiment, the identification configuration information corresponding to the different identification scenes may be directly stored in the image identification device, and specifically, the image identification device may store the identification configuration information and the corresponding relationship between the identification configuration information and the different identification scenes in an associated manner, so that the image identification device may find the corresponding identification configuration information based on the identification scenes from a local location, where if the image identification device detects that the image to be identified is in the target identification scene, the target identification configuration information matching the target identification scene may be obtained. When the image identification device stores different identification configuration information and identification scenes in an associated manner, the image identification device may store a scene number corresponding to an identification scene and a configuration number corresponding to the identification configuration information in an associated manner, and it can be understood that the image identification device may determine a target scene number corresponding to a target identification scene after determining that the image to be identified is in the target identification scene, so as to further determine the target configuration number associated with the target scene number, and may locally acquire the identification configuration information corresponding to the target configuration number and use the identification configuration information as the target identification configuration information.
In one embodiment, in order to reduce the data storage pressure of the image recognition device, only the scene number corresponding to the recognition scene and the configuration number corresponding to the recognition configuration information may be stored in a local memory of the image recognition device in an associated manner, and the recognition configuration information may be stored in a server that establishes a communication connection with the recognition configuration device, so that after the image recognition device determines that the image to be recognized is in the target recognition scene, the image recognition device determines the target scene number corresponding to the target recognition scene, and thus may further determine the target configuration number corresponding to the target scene number, and acquire the recognition configuration information corresponding to the target configuration number from the server as the target recognition configuration information. In one embodiment, in order to further reduce the data storage pressure of the image recognition device, the scene number and the configuration number may also be stored in association with the server, and the recognition configuration information may be stored in the server, so that after determining that the image to be recognized is in the target recognition scene and determining the target scene number corresponding to the target recognition scene, the image recognition device sends the determined target scene number to the server, so that the server determines the target configuration number associated with the target scene number, and sends the target recognition configuration information indicated by the target configuration number to the image recognition device, so that the image recognition device obtains the target recognition configuration information.
In one embodiment, the target identification configuration information is used to indicate an identification process of performing image identification on the image to be identified in the target identification scene, where the target identification configuration information specifically includes a state identifier of at least one identification state and a switching relationship between identification states corresponding to different state identifiers, and one identification state corresponds to one identification processing logic, then the identification process indicated by the target identification configuration information is: and determining the execution sequence of the identification processing logic corresponding to each identification state according to the switching relation. For example, if the state identifiers of the identification states included in the target identification configuration information are respectively: the identification of the face detection state, the identification of the mouth shielding detection state and the identification of the living body detection state, and the switching relationship between the identification states corresponding to the different state identifications is as follows: the identification processing logic corresponding to the face detection state is face detection logic, the identification processing logic corresponding to the mouth shielding detection state is mouth shielding detection logic, and the identification processing logic corresponding to the living body detection state is living body detection logic, so that the identification flow indicated by the target identification configuration information is to perform face detection according to the face detection logic, perform mouth shielding detection according to the mouth shielding detection logic, and perform living body detection according to the living body detection logic.
In one embodiment, the identification configuration information configured for different identification scenarios is determined based on the identification accuracy required by the corresponding identification scenario, and it is understood that the identification configuration information corresponding to the identification scenario with higher identification accuracy includes more status identifications of identification states, i.e. more identification processing logic needs to be executed, and the identification configuration information corresponding to the identification scenario with lower identification accuracy includes less status identifications of identification states, i.e. less identification processing logic needs to be executed. For example, if the target recognition scene is a member login scene, because the recognition accuracy required by the member login scene is low, the number of state identifiers included in the target recognition configuration information matched with the member login scene is less, and for example, the target recognition configuration information may include a face detection state identifier, an eye shielding detection state identifier, a mouth shielding detection state identifier, and a living body detection state identifier; if the target recognition scene payment scene is provided, because the recognition accuracy required by the payment scene is higher, the number of the state identifications included in the target recognition configuration information matched with the payment scene is more, and the state identifications included in the target recognition configuration information can include the identification of a face detection state, the identification of an eye shielding detection state, the identification of a mouth shielding detection state, the identification of a quality detection state, the identification of a living body detection state, the identification of an attention detection state and the like.
In an embodiment, after determining the target recognition configuration information matching the target recognition scene, the image recognition apparatus may perform recognition processing on the image to be recognized according to the recognition procedure for performing image recognition on the image to be recognized, which is indicated by the target recognition configuration information, that is, may perform step S203 instead.
S203, according to the identification process indicated by the target identification configuration information, carrying out identification processing on the image to be identified to obtain an image identification result of the image to be identified.
In an embodiment, the image recognition device performs recognition processing on the image to be recognized according to the recognition flow, that is, according to a switching relationship between recognition states corresponding to different state identifiers included in the target recognition configuration information, sequentially performs image recognition processing on the image to be recognized by using recognition processing logic corresponding to each recognition state, so as to obtain an image recognition result of the image to be recognized. When the image recognition device performs recognition processing on the image to be recognized by using the recognition processing logic corresponding to each recognition state, the embodiment of the present invention does not limit the processing algorithm specifically involved in executing the recognition processing logic corresponding to each recognition state, and in different recognition scenes, the processing algorithms involved in executing the recognition processing logic corresponding to the same recognition state may be the same or different. In one embodiment, when the image to be recognized is subjected to image recognition processing by using the recognition processing logic corresponding to each recognition state in sequence according to the switching relationship, the switching of the recognition processing logic is performed by switching to the recognition processing logic corresponding to the next recognition state of the current recognition state when the image to be recognized is subjected to image recognition processing by using the recognition processing logic corresponding to the current recognition state and the obtained image recognition processing result satisfies the recognition switching condition, and if the obtained processing result does not satisfy the recognition switching condition when the image to be recognized is subjected to image recognition processing by using the recognition processing logic corresponding to the current recognition state, the switching is not performed to the recognition processing logic corresponding to the next recognition state, and the switching is performed to the recognition processing logic corresponding to the previous recognition state of the current recognition state, or keeping executing the identification processing logic corresponding to the current identification state.
In an embodiment, if the switching condition is that an identification result obtained by performing image identification on the image to be identified by using the corresponding identification processing logic indicates that the image to be identified passes image identification in the corresponding identification state, it may be understood that, after the image to be identified is identified by the image identification device according to the identification process indicated by the target identification configuration information, the image identification result of the image to be identified is an identification result obtained by performing image identification processing on the image to be identified by using the identification processing logic corresponding to the identification state indicated by the last state identifier in the target identification configuration information. In one embodiment, the image recognition result for the image to be recognized includes: the image to be recognized is recognized through an image in a target recognition scene, or the image to be recognized is not recognized through the image in the target recognition scene, wherein if the target recognition scene is a member login scene, the image recognition in the target recognition scene means that the member login is successful; or if the target identification scene is a payment scene, the payment is successful through the image identification under the target identification scene; or if the target recognition scene is the scene in which the photographing is triggered if the target gesture is detected, the image recognition in the target recognition scene means that the target gesture is detected and the photographing is triggered.
In one embodiment, if the identification processing logic of any state identifier corresponding to the identification state is used to perform identification processing on the image to be identified in the identification process indicated by the target identification configuration information, the obtained identification result is that the image to be identified does not pass the image identification in the corresponding identification state, it may be determined that the image recognition result of the image to be recognized is that the image to be recognized fails the image recognition in the corresponding recognition state, so that the image recognition apparatus may recognize the image based on the recognition flow indicated by the target recognition configuration information, and the identification result of the image to be identified is quickly determined according to the identification processing result of the image to be identified by the identification processing logic of the identification state corresponding to each state identifier in the identification flow, and the flexibility of identification configuration can be improved based on the flexible setting of identification configuration information under different identification scenes. Moreover, because the identification process of each piece of identification configuration information is clear, and the jumping of the identification process depends on whether the image to be identified meets the identification state or not, different jumping switches can be configured for each identification state separately, and each jumping switch can be managed separately, so that the problem that the jumping switches corresponding to a plurality of identification states are coupled together is avoided.
In one embodiment, after obtaining the image recognition result of the image to be recognized, the image recognition device may display the image recognition result of the image to be recognized in a user interface, and if the image recognition device is a terminal device, the image recognition result may be directly displayed in the image recognition device, or if the image recognition device is a server device, the image recognition device may send the determined image recognition result to a user terminal, so as to display the image recognition result of the image to be recognized in the user interface. In one embodiment, if the image recognition device determines that the target recognition scene in which the image to be recognized is located is a scene related to face (or object) recognition, a user interface displaying the image recognition result of the image to be recognized may be as shown in an interface denoted by 302 in fig. 3b, and based on the image recognition result displayed on the user interface, the user may quickly determine whether the recognition of the image to be recognized in the target recognition scene passes or not. Or, if the image recognition device determines that the target recognition scene in which the image to be recognized is located is a scene related to a gesture, the image recognition device may determine whether a preset gesture is detected according to an image recognition result of the image to be recognized, and trigger execution of a preset operation when the preset gesture is determined to be the preset gesture, where the preset gesture may be, for example, an ok operation or the like compared with the gesture, and the preset operation correspondingly triggered to be executed may be a photographing operation, a recording operation, or an operation of dialing a missed call.
In the embodiment of the invention, the image recognition device can detect the recognition scene of the image to be recognized after detecting the recognition trigger operation aiming at the image to be recognized, so as to obtain the target recognition configuration information matched with the target recognition scene of the image to be recognized from different recognition configuration information corresponding to different recognition scenes, and further carry out recognition processing on the image to be recognized according to the recognition flow indicated by the target recognition configuration information, thereby obtaining the image recognition result aiming at the image to be recognized, based on the difference of the recognition scenes, the image recognition device can adopt different recognition flows to carry out recognition processing on the image to be recognized, compared with the mode of adopting a uniform recognition flow to carry out recognition processing on the image to be processed, the flexibility of carrying out image recognition on the image to be processed can be effectively improved, in addition, the identification flow indicated by the identification configuration information is configured based on the switching relation between the state identifiers of the identification states, so that the image identification device realizes the control of the identification sequence when the image to be identified is identified based on the control of the circulation sequence between the identification states.
Referring to fig. 4, a schematic flowchart of an image recognition method according to an embodiment of the present invention is shown, where the method is applicable to the image recognition device, and the image recognition device is a terminal device, as shown in fig. 2, the method may include:
s401, responding to the identification triggering operation aiming at the image to be identified, and detecting the identification scene where the image to be identified is located, wherein different identification scenes correspond to different identification configuration information.
In an embodiment, the specific implementation of step S401 may refer to the specific implementation of step S201 in the above embodiments, and is not described herein again.
S402, if the image to be recognized is in a target recognition scene, acquiring target recognition configuration information matched with the target recognition scene, wherein the target recognition configuration information is used for indicating a recognition process of performing image recognition on the image to be recognized in the target recognition scene.
In one embodiment, each state identifier included in the target identification configuration information is selected from a preset state identifier set in a state machine, where the state identifiers in the preset state identifier set in the state machine include one or more of the following: identification of a FACE detection (FACE _ DETECT) state, identification of an EYE occlusion (EYE _ MASK _ DETECT) state, identification of a MOUTH occlusion (MOUTH _ MASK _ DETECT) state, identification of a QUALITY detection (QUALITY _ DETECT) state, identification of a LIVE detection (LIVE _ next _ DETECT) state, identification of an ATTENTION detection (ATTENTION _ DETECT) state. Wherein the STATE machine may further comprise a success (success _ STATE) STATE, and/or a failure (failure _ STATE) STATE, such that switching of the recognition STATE of the STATE machine is performed to get an image recognition result for the image to be recognized. In the embodiment of the present invention, the control signal for controlling the State Machine to perform the State transition is a switching relationship between the identification states corresponding to the different State identifiers, and the State Machine may determine to detect the control signal for controlling the State identifier to perform the State transition corresponding to the identification State when detecting that the switching relationship is satisfied. In one embodiment, the status identification may further include: the state identifier included in the state identifier set in the state machine can be deleted, added or modified based on the main requirements (or main users) of image recognition of the image recognition device, and the addition, deletion or modification of the image recognition function corresponding to the image recognition device can be realized based on the addition, deletion or modification of the state identifier, so that the expandability and maintainability of the function when the image recognition device performs image recognition are improved.
In one embodiment, if the identification processing logic of the image to be identified is added, determining the identification state corresponding to the identification processing logic to be added, and judging whether the state identifier set includes the state identifier of the identification state corresponding to the identification processing logic to be added; if not, adding the state identifier of the recognition state corresponding to the to-be-added recognition processing logic into the state identifier set, and adding the specific algorithm executed by the recognition processing logic corresponding to the recognition state after adding the state identifier of the recognition state corresponding to the to-be-added processing logic into the state identifier set, so that when the image recognition device realizes the addition of the recognition processing logic and the corresponding specific algorithm, the specific algorithm executed by the added recognition processing logic is not added into the main image recognition process, the simplicity and convenience of the image recognition algorithm of the image recognition device main body can be ensured, and the problem of bulkiness of the main body algorithm of the image recognition device caused by the addition of the corresponding execution algorithm of the recognition processing logic is avoided.
In one embodiment, the target identification configuration information may be composed of a plurality of state description statements, the image identification device may receive an internal identification state and a state description statement that is issued by configuration and used to describe a switching relationship between identification states, and after the image identification device acquires the state description statement, the image identification device may parse the state description statement to generate a runtime FSM instance. After the image recognition device generates a runtime FSM instance according to a state description statement, it may determine, according to state identifiers of recognition states included in the state description statement, which state identifier in a preset state identifier set participates in FSM state switching, and a front-back dependency order (i.e., a switching relationship) of the recognition state corresponding to each state identifier, so that the image recognition device may determine, when performing image recognition, an execution order of function modules participating in image recognition (such as face detection, gesture detection, and the like) and each function module, where one function module is used to execute a recognition processing logic corresponding to one recognition state.
In one embodiment, the target identification configuration information includes a plurality of state description statements arranged in sequence, each state description statement is used to describe a switching relationship between identification states corresponding to different state identifiers, wherein, if a state identifier included in a bar state description statement is a first state identifier and a second state identifier, the bar state description statement is used to indicate a switching relationship between the identification state corresponding to the first state identifier and the identification state corresponding to the second state identifier, it can be understood that the first state identifier is a starting state identifier of the bar state description statement, the second state identifier is an ending state identifier of the bar state description statement, and in one embodiment, the starting state identifier (i.e. the first state identifier) and the ending state identifier (i.e. the second state identifier) of each state description statement may be the same, or may be different. The image recognition device may determine, according to a plurality of state description sentences of the target recognition configuration information, an initial state identifier that the image recognition device starts to execute a recognition process indicated by the target recognition configuration information, where the image recognition device may use an initial state identifier of a first strip-shaped description sentence of the plurality of state description sentences arranged in sequence as the initial state identifier of the image recognition device that executes the recognition process indicated by the target recognition configuration information, so that the image to be recognized may be recognized according to a recognition processing logic of a recognition state corresponding to the initial state identifier.
In one embodiment, the target identification configuration information composed of a plurality of state description statements may be as shown in fig. 5a, wherein one of the state description statements included is { "present": "face detection", "action": "event pass", "secondary state": the "eye shielding detection" means that the first state identifier in the state description sentence is "face detection", the second state identifier is "eye shielding detection", and the switching relationship between the identification state corresponding to the first state identifier and the identification state corresponding to the second state identifier is: when the event is determined to pass, switching from the first state identifier to the second state identifier, wherein the image recognition device may determine that the event passes when it is determined that the recognition processing logic that determines that the initial state identifier (such as the first state identifier) of each state description sentence corresponds to the recognition state performs recognition processing on the image to be recognized, and the image to be recognized passes the recognition processing in the recognition state.
In an embodiment, the target identification configuration information may also be a state transition diagram, where the state transition diagram includes a plurality of state nodes, each node is configured to store a state identifier, and a pointing relationship between different state nodes is configured to indicate a switching relationship between corresponding identification states, and the state transition diagram may be as shown in fig. 5b, and according to the state description statement or the state transition diagram, the identification state included in the target identification configuration information includes: the image recognition equipment comprises a face detection state, an eye shielding state, a mouth shielding state, a quality component detection state, a living body detection state and an attention detection state, wherein after the image recognition equipment acquires the target recognition configuration information according to a target recognition scene where the image to be recognized is located, the recognition state of a state machine participating in operation can be determined, and a functional module used for executing recognition processing logic corresponding to the recognition state. In one embodiment, in order to improve the image recognition efficiency, the recognition process indicated by the target recognition configuration information may be adjusted to multiple concurrent recognition processes, so as to improve the image recognition efficiency of the image to be recognized, in one embodiment, when the recognition process is adjusted, the state description statement or the direction relationship of the state transition diagram may be modified, so as to achieve the adjustment target of the recognition process without modifying the main algorithm of the image recognition, so as to effectively improve the adjustment efficiency of the recognition process, where the state transition diagram adjusted to multiple concurrencies may be as shown in fig. 5 c.
After the image recognition device determines the target recognition configuration information matched with the target recognition scene where the image to be recognized is located, the image to be recognized may be subjected to recognition processing according to the recognition flow indicated by the target recognition configuration information to obtain an image recognition result of the image to be recognized, and in a specific implementation, if the target recognition configuration information at least includes a first state identifier and a second state identifier, and a first switching relationship that switches from a first recognition state indicated by the first state identifier to a second recognition state indicated by the second state identifier, the image recognition device may perform steps S403 to S405 when performing recognition processing on the image to be recognized according to the recognition flow indicated by the target recognition configuration information.
And S403, performing identification processing on the image to be identified by adopting an identification processing logic corresponding to the first identification state to obtain a first identification result.
S404, if the first recognition result indicates that the image to be recognized passes through the recognition processing in the first recognition state, switching from the first recognition state to a second recognition state according to a first switching relation, and recognizing the image to be recognized by adopting a recognition processing logic corresponding to the second recognition state to obtain a second recognition result.
S405, determining an image recognition result of the image to be recognized according to the second recognition result.
In steps S403 to S405, when performing an identification process on the image to be identified, the image identification device may first perform an identification process on the image to be identified by using the identification processing logic corresponding to the first identification state to obtain a first identification result, and when the first identification result indicates that the image to be identified passes the identification process in the first identification state, switch from the first identification state to a second identification state according to the first switching relationship, and perform an identification process on the image to be identified by using the identification processing logic corresponding to the second identification state to obtain a second identification result, so as to determine the image identification result of the image to be identified according to the second identification result. In one embodiment, if the target identification configuration information only includes the first state identifier and the second state identifier, the image identification device may switch from the first identification state to the second identification state if a first identification result obtained by identifying the image to be identified by the image identification device at the identification processing logic corresponding to the first identification state by using the first state identifier indicates that the image to be identified passes the identification processing in the first identification state, and use a second identification result obtained by identifying the image to be identified by using the identification processing logic corresponding to the second identification state as the image identification result of the image to be identified. If the second recognition result indicates that the image to be recognized passes the recognition processing in the second recognition state, determining that the image recognition result of the image to be recognized is the image recognition passing the target recognition scene; or if the second recognition result indicates that the image to be recognized does not pass the recognition processing in the second recognition state, determining that the image recognition result of the image to be recognized is the image recognition in the scene of failing to pass the target recognition.
In one embodiment, the image recognition device may output result prompt information according to the determined result of whether the image to be recognized passes the image recognition result in the target recognition scene, for example, when the image to be recognized passes the image recognition in the target recognition scene, the prompt information that the image passes the recognition is output, or when the image to be recognized does not pass the image recognition in the target recognition scene, the prompt information that the image does not pass the recognition is output, and a reason of failing the recognition is displayed in the prompt information that the image does not pass the recognition, for example, the reason may be that the glasses have occlusion or the mouth has occlusion. In an embodiment, the image recognition device may further perform a corresponding operation according to the determined image recognition result, for example, when the image recognition device determines that the image to be recognized passes the image recognition in the target recognition scene, perform operations such as photographing, capturing, recording voice, and the like, and when the image recognition device determines that the image to be recognized does not pass the image recognition in the target recognition scene, stop photographing, capturing, recording voice, and the like.
In one embodiment, if the target identification configuration information further comprises a third status flag and a second switching relationship for switching from the first identification status indicated by the first status flag to a third identification status indicated by said third status flag, then, if the first recognition result indicates that the image to be recognized has not passed the recognition processing in the first recognition state, then the first recognition state can be switched to a third recognition state according to the second switching relationship, and the recognition processing logic corresponding to the third recognition state is adopted to perform recognition processing on the image to be recognized to obtain a third recognition result, and further, the image recognition device may then determine an image recognition result of the image to be recognized based on the third recognition result, wherein the third identification state is the first identification state or a previous identification state of the first identification state. As shown in fig. 5b, if the first status flag is the flag of the eye shielding detection status, the first switching relationship is to switch from the flag of the eye shielding detection status to the flag of the mouth shielding detection status, and the second switching relationship is to switch from the flag of the eye shielding detection status to the flag of the face detection status; or, if the first state identifier is an identifier of a face detection state, the first switching relationship is to switch from the identifier of the face detection state to the identifier of an eye shielding detection state, and the second switching relationship is to switch from the identifier of the face detection state to the identifier of the face detection state.
It can be understood that, when the target identification configuration information includes a plurality of state identifiers of the identification states, the image identification device sequentially performs identification processing on the image to be identified by using the identification processing logic of the identification state corresponding to each identification state identifier according to the switching relationship before the identification identifiers correspond to different state identifiers included in the target identification configuration information, and in the identification processing of the image to be identified by sequentially using each identification state corresponding identification processing logic, if there is an image to be identified which is processed by using one identification state corresponding identification processing logic and the obtained identification result indicates that the image to be identified does not pass the identification processing in the corresponding identification state, the image identification result of the image to be identified is determined as the image identification which does not pass the target identification scene, and in the identification processing of the image to be identified which is sequentially used each identification state corresponding identification processing logic, and processing the image to be recognized by adopting the corresponding recognition processing logic of the last recognition state, wherein the obtained recognition result indicates that the image to be recognized passes through the recognition processing of the last recognition state, and then determining the image recognition result of the image to be recognized as the image recognition passing through the target recognition scene.
In one embodiment, the identification processing logic corresponding to each identification state is determined according to state configuration information corresponding to each identification state, the state configuration information including: one or more identification operations involved in a respective identification state, and an operating parameter associated with each identification operation, then the identification processing logic associated with the respective identification state comprises: the execution of the corresponding recognition operation is controlled according to the operation parameters indicated by the state configuration information, and it is understood that the state configuration information is used for controlling the recognition operation, the execution sequence of the recognition operation, and the like when the recognition processing logic corresponding to the recognition state is used for performing the recognition processing on the image to be recognized. In one embodiment, each state identifier in a preset state identifier set in the state machine corresponds to one piece of state configuration information, in the image recognition device, only the state configuration information corresponding to the state identifier that needs to execute FSM state switching is acquired in the state identifier set, and the state identifier that does not execute the state switching does not need to acquire the corresponding state configuration information, so that the data acquisition efficiency of the image recognition device can be effectively improved.
In one embodiment, the status configuration information of the face recognition status, the status configuration information of the eye occlusion detection status, the configuration information of the mouth occlusion recognition status, and the configuration information of the quality detection status may be as shown in fig. 5d, wherein, the state configuration information of the face recognition state comprises the recognition operation (such as face selection operation) related to the face recognition state, and corresponding operating parameters, based on the configuration information of the face detection state as shown in figure 5d, it can be determined that, when face selection is performed in the image to be recognized, the minimum value (e.g., 100) and the maximum value (e.g., 300) of the range of the selected face image, that is, therefore, the recognition processing logic corresponding to the face recognition state is adopted to perform recognition processing on the image to be recognized, after the face selection operation is executed, a face image with the face image range of 100-300 is selected from the image to be recognized. In addition, the state configuration information of the eye shielding state, the state configuration information of the mouth shielding state and the state configuration information of the quality detection state are also used for indicating the image selected after the corresponding operation is executed. It can be understood that, after the state configuration information corresponding to each recognition state is acquired, the image recognition device may analyze the state configuration information in a manner of analyzing lightweight data exchange format (e.g., JavaScript Object notification, json) data, and determine the recognition operation to be executed and the operation parameter corresponding to each recognition operation. In addition, through the adjustment of the identification operation in the state configuration information or the adjustment of the corresponding operation parameter, the image identification process of the image to be identified by the image identification equipment can be adapted to different identification requirements, and the convenience of the adjustment of the identification operation and the corresponding operation parameter is improved.
In one embodiment, if the image recognition device is a terminal device and the image recognition device is used for face detection, the structure diagram of the image recognition device may be as shown in fig. 6, the recognition controller in the image recognition device is configured to determine whether a recognition trigger operation for the image to be recognized is detected, and when it is determined that the recognition trigger operation is detected, detect a recognition scene in which the image to be recognized is located, and when it is detected that the image to be recognized is in a target recognition scene, send a notification message that the image to be recognized is in the target recognition scene to the state machine manager, after receiving the notification message, the state machine manager acquires target recognition configuration information matching the target recognition scene from the configuration management, and if the acquired target recognition configuration information is as shown in fig. 5a, when it is detected that a switching relationship of a recognition state corresponding to a state identifier indicated by the target recognition configuration information arrives, and sequentially adopting the recognition processing logic of the recognition state corresponding to each state identifier included in the target recognition configuration information to perform image recognition processing on the image to be recognized, thereby determining the image recognition result of the image to be recognized.
In the embodiment of the invention, after detecting the identification triggering operation aiming at the image to be identified, the image identification device can detect the identification scene of the image to be identified, thereby acquiring the target identification configuration information matched with the target identification scene of the image to be identified, and carrying out identification processing on the image to be identified according to the identification process indicated by the target identification configuration information, based on different identification configuration information configured for different identification scenes, the requirement of the image identification device for distinguishing the image to be identified under different identification scenes can be met, the problem of inconsistent functions caused by the version difference of the image identification performed by the image identification device can be avoided, and the identification versions caused by adopting the uniform and non-differential image identification processes can be avoided by configuring the identification configuration information for the identification process, the adopted algorithm or coding mode is different, and different problems are presented. Meanwhile, the identification process is configured based on the identification configuration information, the aim of adjusting the image identification process can be fulfilled by adjusting the identification configuration information, and the adjustment of the identification process in the image identification device is more convenient.
Based on the description of the above embodiment of the image recognition method, an embodiment of the present invention further provides an image recognition apparatus, which may be a computer program (including a program code) running in the above image recognition apparatus. The image recognition apparatus can be used to execute the image recognition method as shown in fig. 2 and fig. 4, referring to fig. 7, and the image recognition apparatus includes: a detection unit 701, an acquisition unit 702 and a recognition unit 703.
A detecting unit 701, configured to detect an identification scene where an image to be identified is located in response to an identification trigger operation for the image to be identified, where different identification scenes correspond to different identification configuration information;
an obtaining unit 702, configured to obtain, if the image to be recognized is in a target recognition scene, target recognition configuration information that matches the target recognition scene, where the target recognition configuration information is used to indicate a recognition procedure for performing image recognition on the image to be recognized in the target recognition scene;
the identifying unit 703 is configured to perform identification processing on the image to be identified according to the identification flow indicated by the target identification configuration information, so as to obtain an image identification result of the image to be identified.
In one embodiment, the target identification configuration information includes state identifiers of at least one identification state and switching relations between identification states corresponding to different state identifiers, and one identification state corresponds to one identification processing logic;
the identification process indicated by the target identification configuration information comprises the following steps: and determining the execution sequence of the identification processing logic corresponding to each identification state according to the switching relation.
In one embodiment, the target identification configuration information includes at least a first state identifier and a second state identifier, and a first switching relationship for switching from a first identification state indicated by the first state identifier to a second identification state indicated by the second state identifier;
the identifying unit 703 is specifically configured to:
adopting an identification processing logic corresponding to the first identification state to identify the image to be identified to obtain a first identification result;
if the first recognition result indicates that the image to be recognized passes the recognition processing in the first recognition state, switching from the first recognition state to a second recognition state according to the first switching relation, and recognizing the image to be recognized by adopting recognition processing logic corresponding to the second recognition state to obtain a second recognition result;
and determining the image recognition result of the image to be recognized according to the second recognition result.
In one embodiment, the target identification configuration information further includes a third status identifier, and a second switching relationship switching from the first identification status indicated by the first status identifier to a third identification status indicated by the third status identifier, the apparatus further includes: a switching unit 704 and a determining unit 705.
A switching unit 704, configured to switch from the first identification state to a third identification state according to the second switching relationship if the first identification result indicates that the image to be identified does not pass through the identification processing in the first identification state, and perform identification processing on the image to be identified by using an identification processing logic corresponding to the third identification state to obtain a third identification result;
a determining unit 705, configured to determine an image recognition result of the image to be recognized according to the third recognition result, where the third recognition state is the first recognition state or a previous recognition state of the first recognition state.
In one embodiment, each state identifier included in the target configuration information is selected from a preset state identifier set in a state machine;
the state identities in the set of state identities comprise one or more of: the identification of face detection state, the identification of eye sheltering state, the identification of mouth sheltering state, the identification of quality branch detection state, the identification of live body detection state, the identification of attention detection state.
In one embodiment, the apparatus further comprises: an adding unit 706.
The determining unit 705 is further configured to determine, in response to an adding operation of the recognition processing logic for the image to be recognized, a recognition state corresponding to the recognition processing logic to be added, and determine whether the state identifier set includes a state identifier of the recognition state corresponding to the recognition processing logic to be added;
an adding unit 706, configured to add, if not, the state identifier of the identification state corresponding to the to-be-added identification processing logic to the state identifier set.
In one embodiment, the identification processing logic corresponding to each identification state is determined according to state configuration information corresponding to each identification state, where the state configuration information includes: one or more identification operations related to each identification state, and an operation parameter corresponding to each identification operation;
the identification processing logic corresponding to each identification state comprises: and controlling the execution of the corresponding identification operation according to the operation parameters indicated by the state configuration information.
In one embodiment, the target identification configuration information includes a state transition diagram, the state transition diagram includes a plurality of state nodes, one state node stores one state identifier, and a pointing relationship between different state nodes is used to indicate a switching relationship between corresponding identification states.
In an embodiment, the target identification configuration information includes a plurality of state description statements, the state description statements are arranged in sequence, and each state description statement is used for describing a switching relationship between identification states corresponding to different state identifiers.
In the embodiment of the present invention, the detecting unit 701 may detect the identification scene where the image to be identified is located after detecting the identification triggering operation for the image to be identified, so that the obtaining unit 702 may obtain the target identification configuration information matched with the target identification scene where the image to be identified is located from different identification configuration information corresponding to different identification scenes, the identifying unit 703 may further perform identification processing on the image to be identified according to the identification flow indicated by the target identification configuration information, so as to obtain the image identification result for the image to be identified, based on the difference of the identification scenes, the image to be identified may be identified by using different identification flows, and compared to a manner in which the image to be processed is identified by using a uniform identification flow, the flexibility of performing image identification on the image to be processed may be effectively improved, in addition, since the identification flow indicated by the identification configuration information is configured based on the switching relationship between the state identifiers of the identification states, the control of the identification sequence when the image to be identified is realized based on the control of the circulation sequence between the identification states.
Fig. 8 is a block diagram schematically illustrating a structure of an image recognition device according to an embodiment of the present invention, where the image recognition device may be a terminal device or a server device. The image recognition apparatus in the present embodiment as shown in fig. 8 may include: one or more processors 801; one or more input devices 802, one or more output devices 803, and memory 804. The processor 801, the input device 802, the output device 803, and the memory 804 described above are connected by a bus 805. The memory 804 is used for storing a computer program comprising program instructions, and the processor 801 is used for executing the program instructions stored by the memory 804.
The memory 804 may include a volatile memory (volatile memory), such as a random-access memory (RAM); the memory 804 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a solid-state drive (SSD), etc.; the memory 804 may also comprise a combination of the above-described types of memory.
The processor 801 may be a Central Processing Unit (CPU). The processor 801 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or the like. The PLD may be a field-programmable gate array (FPGA), a General Array Logic (GAL), or the like. The processor 801 may also be a combination of the above structures.
In the embodiment of the present invention, the memory 804 is used for storing a computer program, the computer program includes program instructions, and the processor 801 is used for executing the program instructions stored in the memory 804, so as to implement the steps of the corresponding methods as described above in fig. 2 and fig. 4.
In one embodiment, the processor 801 is configured to call the program instructions for performing:
responding to an identification trigger operation aiming at an image to be identified, and detecting an identification scene where the image to be identified is located, wherein different identification scenes correspond to different identification configuration information;
if the image to be recognized is in a target recognition scene, acquiring target recognition configuration information matched with the target recognition scene, wherein the target recognition configuration information is used for indicating a recognition process of performing image recognition on the image to be recognized in the target recognition scene;
and according to the identification flow indicated by the target identification configuration information, carrying out identification processing on the image to be identified to obtain an image identification result of the image to be identified.
In one embodiment, the target identification configuration information includes state identifiers of at least one identification state and switching relations between identification states corresponding to different state identifiers, and one identification state corresponds to one identification processing logic;
the identification process indicated by the target identification configuration information comprises the following steps: and determining the execution sequence of the identification processing logic corresponding to each identification state according to the switching relation.
In one embodiment, the target identification configuration information includes at least a first state identifier and a second state identifier, and a first switching relationship for switching from a first identification state indicated by the first state identifier to a second identification state indicated by the second state identifier; the processor 801 is configured to call the program instructions for performing:
adopting an identification processing logic corresponding to the first identification state to identify the image to be identified to obtain a first identification result;
if the first recognition result indicates that the image to be recognized passes the recognition processing in the first recognition state, switching from the first recognition state to a second recognition state according to the first switching relation, and recognizing the image to be recognized by adopting recognition processing logic corresponding to the second recognition state to obtain a second recognition result;
and determining the image recognition result of the image to be recognized according to the second recognition result.
In one embodiment, the target identification configuration information further includes a third status identifier and a second switching relationship switching from the first identification status indicated by the first status identifier to a third identification status indicated by the third status identifier, and the processor 801 is configured to call the program instructions to perform:
if the first recognition result indicates that the image to be recognized does not pass the recognition processing in the first recognition state, switching from the first recognition state to a third recognition state according to the second switching relation, and recognizing the image to be recognized by adopting a recognition processing logic corresponding to the third recognition state to obtain a third recognition result;
and determining an image recognition result of the image to be recognized according to the third recognition result, wherein the third recognition state is the first recognition state or a previous recognition state of the first recognition state.
In one embodiment, each state identifier included in the target configuration information is selected from a preset state identifier set in a state machine;
the state identities in the set of state identities comprise one or more of: the identification of face detection state, the identification of eye sheltering state, the identification of mouth sheltering state, the identification of quality branch detection state, the identification of live body detection state, the identification of attention detection state.
In one embodiment, the processor 801 is configured to call the program instructions for performing:
responding to the adding operation of the identification processing logic aiming at the image to be identified, determining the identification state corresponding to the identification processing logic to be added, and judging whether the state identification set comprises the state identification of the identification processing logic to be added corresponding to the identification state;
and if not, adding the state identifier of the identification state corresponding to the identification processing logic to be added into the state identifier set.
In one embodiment, the identification processing logic corresponding to each identification state is determined according to state configuration information corresponding to each identification state, where the state configuration information includes: one or more identification operations related to each identification state, and an operation parameter corresponding to each identification operation;
the identification processing logic corresponding to each identification state comprises: and controlling the execution of the corresponding identification operation according to the operation parameters indicated by the state configuration information.
In one embodiment, the target identification configuration information includes a state transition diagram, the state transition diagram includes a plurality of state nodes, one state node stores one state identifier, and a pointing relationship between different state nodes is used to indicate a switching relationship between corresponding identification states.
In an embodiment, the target identification configuration information includes a plurality of state description statements, the state description statements are arranged in sequence, and each state description statement is used for describing a switching relationship between identification states corresponding to different state identifiers.
Embodiments of the present invention provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method embodiments as shown in fig. 2 or fig. 4. The computer-readable storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a particular embodiment, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (12)

1. An image recognition method, comprising:
responding to an identification trigger operation aiming at an image to be identified, and detecting an identification scene where the image to be identified is located, wherein different identification scenes correspond to different identification configuration information;
if the image to be recognized is in a target recognition scene, acquiring target recognition configuration information matched with the target recognition scene, wherein the target recognition configuration information is used for indicating a recognition process of performing image recognition on the image to be recognized in the target recognition scene;
and according to the identification flow indicated by the target identification configuration information, carrying out identification processing on the image to be identified to obtain an image identification result of the image to be identified.
2. The method according to claim 1, wherein the target identification configuration information includes state identifiers of at least one identification state, and switching relationships between identification states corresponding to different state identifiers, and one identification state corresponds to one identification processing logic;
the identification process indicated by the target identification configuration information comprises the following steps: and determining the execution sequence of the identification processing logic corresponding to each identification state according to the switching relation.
3. The method according to claim 1, wherein the target identification configuration information comprises at least a first status identifier and a second status identifier, and a first switching relationship for switching from a first identification status indicated by the first status identifier to a second identification status indicated by the second status identifier;
the identifying the image to be identified according to the identifying process indicated by the target identifying configuration information to obtain the image identifying result of the image to be identified includes:
adopting an identification processing logic corresponding to the first identification state to identify the image to be identified to obtain a first identification result;
if the first recognition result indicates that the image to be recognized passes the recognition processing in the first recognition state, switching from the first recognition state to a second recognition state according to the first switching relation, and recognizing the image to be recognized by adopting recognition processing logic corresponding to the second recognition state to obtain a second recognition result;
and determining the image recognition result of the image to be recognized according to the second recognition result.
4. The method of claim 3, wherein the target identification configuration information further includes a third status flag, and wherein the target identification configuration information is switched from the first identification status indicated by the first status flag to a second switching relationship indicated by the third status flag, the method further comprising:
if the first recognition result indicates that the image to be recognized does not pass the recognition processing in the first recognition state, switching from the first recognition state to a third recognition state according to the second switching relation, and recognizing the image to be recognized by adopting a recognition processing logic corresponding to the third recognition state to obtain a third recognition result;
and determining an image recognition result of the image to be recognized according to the third recognition result, wherein the third recognition state is the first recognition state or a previous recognition state of the first recognition state.
5. The method of claim 2, wherein the target configuration information comprises each state identifier selected from a set of state identifiers preset in a state machine;
the state identities in the set of state identities comprise one or more of: the identification of face detection state, the identification of eye sheltering state, the identification of mouth sheltering state, the identification of quality branch detection state, the identification of live body detection state, the identification of attention detection state.
6. The method of claim 5, further comprising:
responding to the adding operation of the identification processing logic aiming at the image to be identified, determining the identification state corresponding to the identification processing logic to be added, and judging whether the state identification set comprises the state identification of the identification processing logic to be added corresponding to the identification state;
and if not, adding the state identifier of the identification state corresponding to the identification processing logic to be added into the state identifier set.
7. The method of claim 2, wherein the identification processing logic corresponding to each identification state is determined according to state configuration information corresponding to each identification state, the state configuration information comprising: one or more identification operations related to each identification state, and an operation parameter corresponding to each identification operation;
the identification processing logic corresponding to each identification state comprises: and controlling the execution of the corresponding identification operation according to the operation parameters indicated by the state configuration information.
8. The method of claim 2, wherein the target identification configuration information comprises a state transition graph, the state transition graph comprises a plurality of state nodes, one state node stores one state identifier, and a pointing relationship between different state nodes is used for indicating a switching relationship between corresponding identification states.
9. The method according to claim 2, wherein the target identification configuration information includes a plurality of state description statements, the plurality of state description statements are arranged in sequence, and each state description statement is used for describing a switching relationship between identification states corresponding to different state identifiers.
10. An image recognition apparatus, comprising:
the device comprises a detection unit, a processing unit and a processing unit, wherein the detection unit is used for responding to the identification triggering operation aiming at the image to be identified and detecting the identification scene where the image to be identified is located, wherein different identification scenes correspond to different identification configuration information;
the image recognition device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring target recognition configuration information matched with a target recognition scene if the image to be recognized is in the target recognition scene, and the target recognition configuration information is used for indicating a recognition process of performing image recognition on the image to be recognized in the target recognition scene;
and the identification unit is used for carrying out identification processing on the image to be identified according to the identification flow indicated by the target identification configuration information to obtain an image identification result of the image to be identified.
11. An image recognition device comprising a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory being interconnected, wherein the memory is configured to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any of claims 1 to 9.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, cause the processor to carry out the method according to any one of claims 1 to 9.
CN202011005159.4A 2020-09-22 2020-09-22 Image recognition method, image recognition device, image recognition apparatus, and storage medium Pending CN113392685A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011005159.4A CN113392685A (en) 2020-09-22 2020-09-22 Image recognition method, image recognition device, image recognition apparatus, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011005159.4A CN113392685A (en) 2020-09-22 2020-09-22 Image recognition method, image recognition device, image recognition apparatus, and storage medium

Publications (1)

Publication Number Publication Date
CN113392685A true CN113392685A (en) 2021-09-14

Family

ID=77616470

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011005159.4A Pending CN113392685A (en) 2020-09-22 2020-09-22 Image recognition method, image recognition device, image recognition apparatus, and storage medium

Country Status (1)

Country Link
CN (1) CN113392685A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018099163A1 (en) * 2016-11-30 2018-06-07 西安中兴新软件有限责任公司 Terminal and application control method
CN108919608A (en) * 2018-06-27 2018-11-30 上海联影医疗科技有限公司 Exposure process control method, device, equipment and medium
CN109144665A (en) * 2018-07-27 2019-01-04 平安科技(深圳)有限公司 A kind of simulator recognition methods, identification equipment and computer-readable medium
US20190272425A1 (en) * 2018-03-05 2019-09-05 A9.Com, Inc. Visual feedback of process state
CN110222789A (en) * 2019-06-14 2019-09-10 腾讯科技(深圳)有限公司 Image-recognizing method and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018099163A1 (en) * 2016-11-30 2018-06-07 西安中兴新软件有限责任公司 Terminal and application control method
US20190272425A1 (en) * 2018-03-05 2019-09-05 A9.Com, Inc. Visual feedback of process state
CN108919608A (en) * 2018-06-27 2018-11-30 上海联影医疗科技有限公司 Exposure process control method, device, equipment and medium
CN109144665A (en) * 2018-07-27 2019-01-04 平安科技(深圳)有限公司 A kind of simulator recognition methods, identification equipment and computer-readable medium
WO2020019483A1 (en) * 2018-07-27 2020-01-30 平安科技(深圳)有限公司 Emulator identification method, identification device, and computer readable medium
CN110222789A (en) * 2019-06-14 2019-09-10 腾讯科技(深圳)有限公司 Image-recognizing method and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
台方: "《可编程序控制器应用教程》", 31 December 2001, 中国水利水电出版社, pages: 219 - 224 *

Similar Documents

Publication Publication Date Title
US8166459B2 (en) Apparatus and method of generating self-debugging computer software
CN109635523B (en) Application program detection method and device and computer readable storage medium
KR20190054702A (en) Method and apparatus for detecting action of object in viedio stream
CN104885099A (en) Methods and systems of using boosted decision stumps and joint feature selection and culling algorithms for the efficient classification of mobile device behaviors
JP7104779B2 (en) Target recognition method, device and intelligent terminal
KR20200095076A (en) Apparatus for providing laundry treating information based on artificial intelligence
CN112633159B (en) Human-object interaction relation identification method, model training method and corresponding device
CN110210218A (en) A kind of method and relevant apparatus of viral diagnosis
CN114051116A (en) Video monitoring method, device and system for driving test vehicle
CN113392685A (en) Image recognition method, image recognition device, image recognition apparatus, and storage medium
CN110210215A (en) A kind of method and relevant apparatus of viral diagnosis
CN115328786A (en) Automatic testing method and device based on block chain and storage medium
CN114564286A (en) Rule engine warning method and rule engine warning system
CN109495782B (en) Storage method, system and storage medium for barrage message
CN114596638A (en) Face living body detection method, device and storage medium
CN113590277A (en) Task state switching method and device and electronic system
CN112181535A (en) Interface calling method, device, server and storage medium
CN105227914A (en) Based on recognition methods, the Apparatus and system of the biological information of Cloud Server
WO2020115539A1 (en) System, method and network node for generating at least one classification based on machine learning techniques
CN111368866A (en) Picture classification method, device and system
CN112598323B (en) Cross-business-domain process monitoring method and device, computer equipment and storage medium
CN111602410B (en) Suitability determination device, suitability determination method, and storage medium
CN109413452B (en) Bullet screen checking method and device based on different modes, terminal and storage medium
CN116501176B (en) User action recognition method and system based on artificial intelligence
CN114140851B (en) Image detection method and method for training image detection model

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40052237

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination