Door lock identification method, device and electronic equipment
Through the door lock recognition method combined with two-layer network model, the target detection model and the two-classification model are used to identify the door lock image, which solves the problem of low door lock recognition accuracy in the existing technology and achieves high accuracy and improved user experience. .
Patent Information
- Application Number
- CN202010544362.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-15
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2040-06-15
AI Technical Summary
The accuracy of existing door lock recognition technology is low, and users cannot accurately confirm the door lock type, resulting in poor user experience.
A two-layer network model recognition method is adopted. First, the target detection model is used to conduct preliminary recognition of the image to be recognized. The corresponding two-classification model is determined based on the preliminary recognition results, and the image is further recognized. The final door lock recognition result is output by matching the preliminary and two-classification results. .
The accuracy of door lock identification has been improved to 99.53%, reducing the need for manual review and enhancing identification accuracy and user experience.
Smart Images

Figure CN113807146B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of smart door locks, and more specifically, to a door lock identification method, device and electronic equipment. Background Art
[0002] With the continuous development of artificial intelligence, people have higher and higher requirements for image recognition technology. Image recognition is the recognition of objects in images, which can recognize targets or objects of various different modes. At present, the application fields of machine image recognition technology are very wide, for example, autonomous robots used in military reconnaissance and dangerous environments, and intelligent robots used in postal services, hospitals and home services. In addition, machine image recognition technology can also be used for work identification in industrial production and automatic positioning of space robots, so how to accurately and effectively identify targets in images is an urgent problem to be solved. Summary of the invention
[0003] In view of this, the present application proposes a door lock identification method, device and electronic device to improve the above-mentioned defects.
[0004] In a first aspect, an embodiment of the present application provides a door lock identification method, the method comprising: obtaining an image to be identified, and inputting the image to be identified into a first network model; using the first network model to identify the image to be identified to obtain a first identification result; determining a second network model based on the first identification result, and using the second network model to identify the image to be identified to obtain a second identification result, the image recognition algorithms of the first network model and the second network model are different; if the first identification result matches the second identification result, obtaining a door lock identification result based on the first identification result or the second identification result, and outputting the door lock identification result.
[0005] In a second aspect, an embodiment of the present application provides a door lock recognition device, the device comprising: an image acquisition module, a first recognition module, a second recognition module and a result output module. The image acquisition module is used to acquire an image to be recognized and input the image to be recognized into a first network model. The first recognition module is used to recognize the image to be recognized using the first network model to obtain a first recognition result. The second recognition module is used to determine a second network model based on the first recognition result, and recognize the image to be recognized using the second network model to obtain a second recognition result, the image recognition algorithms of the first network model and the second network model are different. The result output module is used to obtain a door lock recognition result based on the first recognition result or the second recognition result if the first recognition result matches the second recognition result, and output the door lock recognition result.
[0006] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; one or more applications; wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the door lock identification method provided in any embodiment of the present application.
[0007] In a fourth aspect, an embodiment of the present application provides a computer system, in which a computer-readable storage medium stores program code, and the program code can be called by a processor to execute the door lock identification method provided by any embodiment of the present application.
[0008] Compared with the prior art, the embodiments of the present application propose a door lock recognition method, device and electronic device. The door lock recognition method can first obtain an image to be recognized, and input the obtained image to be recognized into a first network model, use the first network model to recognize the image to be recognized, and obtain a first recognition result, and then determine the second network model according to the first recognition result, and use the second network model to recognize the image to be recognized to obtain a second recognition result, wherein the image recognition algorithms of the first network model and the second network model are different, and then the first recognition result can be compared with the second recognition result. If the first recognition result matches the second recognition result, the door lock recognition result is obtained according to the first recognition result or the second recognition result, and finally the obtained door lock recognition result is output. The present application can more accurately and effectively recognize the door lock in the image to be recognized by combining the first network model and the second network model.
[0009] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the following specifically cites preferred embodiments and describes them in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0011] Figure 1 A flow chart of a door lock identification method proposed in one embodiment of the present application is shown;
[0012] Figure 2 A flow chart of a door lock identification method proposed in another embodiment of the present application is shown;
[0013] Figure 3A flowchart of step S240 in a door lock identification method proposed in another embodiment of the present application is shown;
[0014] Figure 4 A flow chart of a door lock identification method proposed in another embodiment of the present application is shown;
[0015] Figure 5 A flowchart of step S330 in a door lock identification method proposed in another embodiment of the present application is shown;
[0016] Figure 6 A structural block diagram of a door lock identification device proposed in an embodiment of the present application is shown;
[0017] Figure 7 A structural block diagram of a second identification module 430 in a door lock identification device proposed in an embodiment of the present application is shown.
[0018] Figure 8 A structural block diagram of an electronic device proposed in an embodiment of the present application for executing a door lock identification method according to an embodiment of the present application is shown.
[0019] Fig. 9 A schematic diagram of the hardware structure of a user terminal in a door lock identification method proposed in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0021] It should be noted that similar reference numerals or letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in the subsequent drawings.
[0022] At present, after purchasing a door lock, users usually cannot confirm whether the door lock they purchased is a smart door lock, let alone what type of door lock they purchased. In order to solve this problem, people have introduced artificial intelligence, that is, artificial intelligence is used to recognize the image or photo containing the door lock input by the user, and then determine whether the door lock purchased by the user is a smart door lock. However, the existing door lock recognition technology only uses a machine recognition algorithm to recognize the door lock image, resulting in low accuracy of door lock recognition and poor user experience.
[0023] Therefore, in order to overcome the above-mentioned defects, Figure 1 , an embodiment of the present application provides a door lock identification method, which includes steps S110 to S140.
[0024] Step S110: Acquire an image to be identified, and input the image to be identified into a first network model.
[0025] In one embodiment, the image to be identified may or may not include a door lock image. The image to be identified may be obtained by a user through a camera of a mobile terminal, or may be obtained by a user through a website query. After the user obtains the image to be identified, it can be input into the first network model, wherein the first network model can be a target detection model. In this application, the target detection model can be Mobilenet SSD, SSD (Single Shot Multibox Detector, single-stage multi-target detection) algorithm, YOLO (You only look once, a single-stage target detection model) algorithm, RCNN, fast-RCNN, faster-RCNN, R-RCN or mask-RCNN, etc. After determining the target detection model, this application can use the door lock data set to train the target detection model to obtain the first network model. Among them, the door lock data set can include a door lock training data set and a door lock test data set. The door lock training data set is mainly used to train the target detection model, and the door lock test data set is mainly used to test the performance of the first network model.
[0026] In the embodiment of the present application, the door lock data set can come from the door lock identification page, or can be obtained by manual shooting, or can use a web crawler to obtain front pictures of different types of door locks from the Internet. When the first network model is tested using the door lock test data set, the location of the lock body and the category and score of the door lock can be obtained, where the location of the door lock refers to the coordinate position of the door lock image, which can be the four coordinate points of the door lock image. In order to more clearly illustrate the test results of the door lock test data set, this application provides Table 1.
[0027] Table 1
[0028]
[0029]
[0030] It can be seen from Table 1 that the door lock types can include four types: standard lock, overlord lock, other locks and no lock. Among them, the accuracy of standard lock is 93.83%, the missed detection rate is 1.27% and the false detection rate is 4.90%; the accuracy of overlord lock is 98.72%, the missed detection rate is 0.54% and the false detection rate is 0.74%; the accuracy of other locks is 95.90%, the missed detection rate is 3.08% and the false detection rate is 1.47%; the accuracy of no lock is 32.52%, the missed detection rate is 67.84% and the false detection rate is 67.84%. This application has statistically analyzed the overall results of the test data set, and its accuracy is 92.11%, the missed detection rate is 1.20% and the false detection rate is 6.76%.
[0031] Step S120: using the first network model to identify the image to be identified, to obtain a first identification result.
[0032] In the present application, the image to be identified may be obtained by the user using the camera of the mobile terminal, that is, after the user obtains the image to be identified using the mobile terminal, the image to be identified may be input into the first network model, and the image to be identified may be identified using the first network model, that is, the first network model extracts features, classifies and identifies the image to be identified through the convolution layer, the pooling layer and the fully connected layer, and obtains the first identification result. In one embodiment, the first identification result may include the type of door lock, the position of the door lock and the score, wherein the type of door lock may include standard lock, overlord lock, other lock and no lock. The position of the door lock refers to the position of the door lock in the image to be identified, which may include the positions of the four coordinate points of the door lock image. In the embodiment of the present application, the coordinate point of the door lock may be relative to the center point of the image to be identified, that is, the four coordinate points of the door lock image may be based on the center of the image to be identified, or the upper left corner of the image to be identified, or the lower right corner of the image to be identified. The specific point of the image to be identified is not explicitly limited here, and can be selected according to actual conditions. In addition, the score refers to the accuracy of identifying the door lock. For example, for the image A to be identified that contains a king lock, the output door lock type is the king lock, and the door lock positions are [[261, 121], [261, 294], [401, 294], [401, 121]], with a score of 99.53%.
[0033] Step S130: determining a second network model according to the first recognition result, and using the second network model to recognize the image to be recognized to obtain a second recognition result.
[0034] In one embodiment, after the first recognition result is obtained, the second network model can be obtained using the first recognition result, and the second network model corresponds to the first recognition result. For example, if the first recognition result is a standard lock, the second network model can be a standard lock network model, and the standard lock network model can be a binary classification model for identifying a standard lock; if the first recognition result is a king lock, the second network model can be a king lock network model, and the king lock network model can be a binary classification model for identifying a king lock; if the first recognition result is other locks, the second network model can be other lock network models, and the other lock network model can be a binary classification model for identifying other locks; if the first recognition result is no lock, the second network model can be a no lock network model, and the no lock network model can be a binary classification model for identifying no lock.
[0035] In the embodiment of the present application, the image recognition algorithms of the first network model and the second network model are different. The first network model is a target detection model, while the second network model is mainly a binary classification model. In order to more accurately identify the door lock, the second network model of the present application may include a standard lock model, a king lock model, other lock models, and a no lock model. After determining the second network model using the first recognition result, the image to be identified can be input into the second network model, and the second network model is used to identify the image to be identified to obtain a second recognition result. The second recognition result is similar to the first recognition result, and may also include the type of door lock, the location of the door lock, and the score. The type of door lock may include a standard lock, a king lock, other locks, and no lock.
[0036] Step S140: If the first recognition result matches the second recognition result, a door lock recognition result is obtained according to the first recognition result or the second recognition result, and the door lock recognition result is output.
[0037] In one embodiment, after obtaining the second identification result, the electronic device can determine whether the first identification result and the second identification result it obtained match. If the first identification result and the second identification result match, the door lock identification result is determined according to the first identification result or the second identification result. Specifically, the present application can determine the door lock identification result according to the first identification result, that is, the door lock identification result can be obtained by using the first identification result, or can determine the door lock identification result according to the second identification result, that is, the door lock identification result can be obtained by using the second identification result, or can determine the door lock identification result according to the first identification result and the second identification result, that is, the door lock identification result can be obtained by combining the first identification result and the second identification result.
[0038] An embodiment of the present application proposes a door lock recognition method, which recognizes an image to be recognized by combining a first network model and a second network model, wherein the second network model is determined based on the recognition result of the first network model. After obtaining the first recognition result and the second recognition result, the present application will match the two recognition results, and only when the two recognition results match will the door lock recognition result be output. That is, the present application can make the recognition of door lock images more accurate and effective by combining the first network model and the second network model.
[0039] Another embodiment of the present application proposes a door lock identification method. Figure 2 ,from Figure 2 It can be seen that the method includes steps S210 to S260.
[0040] Step S210: Acquire an image to be identified, and input the image to be identified into a first network model.
[0041] Step S220: using the first network model to identify the image to be identified, to obtain a first identification result.
[0042] Step S230: acquiring position information of a preset shooting frame, and using the position information of the preset shooting frame as second position information.
[0043] In one embodiment, the image to be identified is identified according to the first network model to obtain a first identification result, and the first identification result may include the position information of the door lock candidate frame, and the position information of the door lock candidate frame may be used as the first position information. The position of the door lock candidate frame is the position information of the door lock contained in the image to be identified. In the embodiment of the present application, the position information of the door lock candidate frame may include the coordinate information of four points of the door lock, which are the coordinates of the lower left corner, the upper left corner, the upper right corner, and the lower right corner of the candidate frame. In addition, the first position information may also include the coordinates of other pixel points of the door lock image, and the specific coordinates of the pixel points will not be described one by one here.
[0044] In the present application, the preset shooting frame may also be referred to as the front-end shooting frame, which is mainly used to assist in the acquisition of the image to be identified. The door lock candidate frame can only be used as a standard image if it falls into the preset shooting frame, or the image to be identified can only be used as a standard image if the overlap between the door lock candidate frame and the preset candidate shooting frame is greater than a preset threshold. Therefore, the area of the preset shooting frame may be larger than that of the door lock candidate frame. In one embodiment, the size of the preset shooting frame is pre-set, that is, the position information of the preset shooting frame may be fixed. After obtaining the first position information, the electronic device may obtain the second position information corresponding to the preset shooting frame by searching.
[0045] Step S240: Determine whether the image to be identified is a standard image according to the first position information and the second position information.
[0046] After obtaining the first position information corresponding to the door lock candidate frame and the second position information of the preset shooting frame, the electronic device can compare the coordinates of the two position information to determine whether the image to be identified is a standard image. Figure 3 As shown, from Figure 3 It can be seen that step S240 may include steps S241 to S248.
[0047] Step S241: obtaining the degree of overlap between the door lock candidate frame and the preset shooting frame according to the first position information and the second position information.
[0048] In one implementation, the area of the door lock candidate frame may be acquired according to the first position information, the area of the preset shooting frame may be acquired according to the second position information, and then the overlap degree A of the door lock candidate frame and the preset shooting frame may be acquired. The overlap degree A may be the ratio of the overlapping area of the door lock candidate frame and the preset shooting frame to the area of the union of the door lock candidate frame and the preset shooting frame.
[0049] Step S242: Determine whether the degree of overlap between the door lock candidate frame and the preset shooting frame is greater than a preset threshold.
[0050] After obtaining the overlap between the door lock candidate frame and the preset shooting frame, it can be determined whether the overlap is greater than the preset threshold. If the overlap is greater than the preset threshold, the image to be identified is determined to be a standard image, that is, entering step S243. When the overlap between the door lock candidate frame and the preset shooting frame is less than the preset threshold, the image to be identified is determined to be a non-standard image, that is, entering step S244. For example, by calculation, the overlap between the door lock candidate frame and the preset shooting frame is 0.9, and the preset threshold is 0.7. The overlap between the door lock candidate frame and the preset shooting frame is greater than the preset threshold 0.7, and at this time, the image to be identified can be determined to be a standard image.
[0051] In another embodiment, it is also possible to determine whether the four coordinate points of the door lock candidate frame all fall into the preset shooting frame. If the four coordinate points of the door lock candidate frame all fall into the preset candidate frame, the image to be identified is determined to be a standard image. For example, the coordinate points of the four points of the door lock candidate frame are [[261, 121], [261, 294], [401, 294], [401, 121]], and the coordinate points of the four points of the preset shooting frame are [[231, 105], [231, 344], [433, 344], [433, 105]], and it is obvious that the four coordinate points of the door lock candidate frame all fall into the coordinate range of the preset candidate frame. At this time, it can be determined that the image to be identified is a standard image. For another example, the coordinate points of the four points of the door lock candidate frame are [[261, 121], [261, 294], [401, 294], [401, 121]], while the coordinate points of the four points of the preset shooting frame are [[255, 153], [255, 221], [351, 221], [351, 153]], it can be seen that some coordinate points of the door lock candidate frame fall within the coordinate range of the preset candidate frame, but some coordinate points do not fall within the coordinate range of the preset candidate frame. At this time, it can be determined that the image to be identified is a non-standard image.
[0052] Step S243: determining whether the image to be identified is a standard image.
[0053] In an embodiment of the present application, the standard image refers to an image to be identified that contains a complete door lock image. When the user uses a mobile terminal to take a picture of the door lock image, if the shooting angle is incorrect or the hand shakes during shooting, the door lock image will not fall within the range of the camera. At this time, the image to be identified taken by the mobile terminal does not contain the door lock image, or the door lock image is blurred and cannot be used for image recognition.
[0054] Step S244: determining whether the image to be identified is a non-standard image.
[0055] From the above introduction, it can be known that when the overlap between the door lock candidate frame and the preset shooting frame is less than the preset threshold, the image to be identified is determined to be a non-standard image. When the overlap between the door lock candidate frame and the preset shooting frame is very small, and the four coordinate points of the door lock candidate frame do not all fall into the preset shooting frame, the image to be identified is a non-standard image, indicating that the door lock position offset does not meet the requirements, the user's photo quality is poor, and direct identification may cause errors in the identification results. At this time, the user can be notified to re-acquire the image to be identified. It should be noted that the user can be notified by text message, voice or vibration that the image to be identified is inaccurate and needs to be re-photographed. In another embodiment, the electronic device can also notify the user whether to enter the manual review procedure. If the user decides to re-acquire the image to be identified, the electronic device will obtain the re-photographing instruction, that is, enter step S245; if the user decides to enter the manual review procedure, it enters step S247.
[0056] Step S245: Detect whether a re-photographing instruction is obtained.
[0057] After the user obtains the non-standard information, he can decide whether to take the photo again. If he chooses to take the photo again, he enters step S246. If the user decides to conduct a manual review, a manual review instruction is sent and he enters step S247.
[0058] In another embodiment, after determining that the image to be identified is a non-standard image, the electronic device can directly send a prompt message to the user to take the photo again, and record the number of times the prompt message is sent. When the number of times the prompt message is sent is greater than N times, the electronic device sends a manual review instruction to the user to prompt the user that the image to be identified cannot be correctly obtained and please perform a manual review.
[0059] Step S246: reacquire the image to be identified.
[0060] Step S247: Determine whether a manual review instruction is obtained.
[0061] In one embodiment, when the electronic device detects that the instruction it has obtained is not a re-photographing instruction, it can further determine whether it has obtained a manual review instruction. If the user obtains a manual review instruction, it obtains the review result corresponding to the manual review instruction, that is, enters step S248. When the electronic device has not obtained a re-photographing instruction or a manual review instruction, the electronic device can notify the user to input an operation instruction in the form of vibration or voice. If the electronic device does not receive any operation instruction within a preset time, the door lock recognition operation is terminated, or the recognition result of the non-standard image is directly output to the user. At this time, the user can be reminded that the accuracy of the door lock recognition result is low because he did not enter an operation instruction.
[0062] Step S248: obtaining the audit result corresponding to the manual audit instruction, and storing the audit result and the image to be identified in a one-to-one correspondence.
[0063] In one embodiment, if a manual review instruction is obtained, the review result corresponding to the manual review instruction can be obtained, and the review result and the image to be identified are stored in a one-to-one correspondence. Then, the first network model can be optimized using the review result and the image to be identified, that is, the image to be identified and the review result are input into the first network model in a one-to-one correspondence, and the first network model is trained so that the first network model can more accurately identify non-standard images.
[0064] Step S250: When the image to be identified is a standard image, a second network model is determined according to the first recognition result, and the image to be identified is identified using the second network model to obtain a second recognition result.
[0065] Step S260: If the first recognition result matches the second recognition result, a door lock recognition result is obtained according to the first recognition result or the second recognition result, and the door lock recognition result is output.
[0066] An embodiment of the present application proposes a door lock recognition method, which can more accurately and effectively recognize a door lock image by combining a first network model and a second network model. In addition, the present application makes the acquisition of the image to be recognized more accurate by comparing the position information of a preset shooting frame with the position information of a door lock candidate frame, thereby further improving the accuracy of door lock recognition. At the same time, the introduction of manual review can make door lock recognition more intelligent.
[0067] Another embodiment of the present application proposes a door lock identification method. Figure 4 ,pass Figure 4 It can be seen that the method includes steps S310 to S350.
[0068] Step S310: Acquire an image to be identified, and input the image to be identified into a first network model.
[0069] Step S320: using the first network model to identify the image to be identified, to obtain a first identification result.
[0070] In one embodiment, the first recognition result may include first position information and first door lock classification information, wherein the first position information mainly refers to the coordinate information of the target to be identified in the image to be identified after the image to be identified is identified using the first network model. In addition, the first door lock classification information refers to the category of the target to be identified after the image to be identified is identified using the first network model. In the embodiment of the present application, the target to be identified is a door lock, and the first door lock classification information refers to different categories of door locks, that is, the first door lock classification information may include four types: standard lock, overlord lock, other locks, and no lock.
[0071] Step S330: searching for a door lock classification model corresponding to the first door lock classification information, using the door lock classification model as a second network model, and using the second network model to identify the image to be identified to obtain a second identification result.
[0072] In the embodiment of the present application, different types of door locks have different corresponding door lock classification models, that is, each type of door lock corresponds to a door lock classification model, so the first door lock classification information and the door lock classification model are one-to-one corresponding. Specifically, when the first door lock classification information is a standard lock, the corresponding door lock classification model is a standard lock classification model; when the first door lock classification information is a king lock, the corresponding door lock classification model is a king lock classification model; when the first door lock classification information is other locks, the corresponding door lock classification model is other lock classification model; when the first door lock classification information is no lock, the corresponding door lock classification model is a no lock classification model.
[0073] In a specific implementation, four classification models can be pre-trained, and these four classification models are classification model A, classification model B, classification model C and classification model D. In the embodiment of the present application, classification model A, classification model B, classification model C and classification model D can all be used as the second network model. These four classification models optimize the targeted identification of a certain lock body, that is, the target classification model A can be used specifically to identify standard locks, classification model B can be used specifically to identify overlord locks, classification model C can be used specifically to identify other locks, and classification model D can be used specifically to identify the situation where there is no lock. Among them, the data sets of classification model A, classification model B, classification model C and classification model D are different, that is, when training classification model A, classification model B, classification model C and classification model D, this application uses different types of data sets. For example, when training classification model A, the data set corresponding to the standard lock can be labeled as a positive sample, while the data sets corresponding to the overlord lock, other locks, and no lock can all be labeled as negative samples; when training classification model B, the data set of the overlord lock can be labeled as a positive sample, while the data sets corresponding to the standard lock, other locks, and no lock can all be labeled as negative samples; when training classification model C, the data sets of other locks can be labeled as positive samples, while the data sets corresponding to the standard lock, overlord lock, and no lock can all be labeled as negative samples; when training classification model D, the data set of no lock can be labeled as a positive sample, while the data sets corresponding to the standard lock, overlord lock, and other locks can all be labeled as negative samples. Therefore, the present application can train four binary classification models respectively according to different data sets obtained by the above-mentioned labeling method.
[0074] In addition, this application can use ResNet as a binary classification model. ResNet (Residual Neural Network) improves the accuracy of classification by introducing the Residual Network residual network, because the structure of ResNet can accelerate the training of neural networks very quickly, and the accuracy of the model is also greatly improved. At the same time, ResNet is very generalizable and can even be directly used in the InceptioNNet network, so this application uses it as a binary classification model.
[0075] like Figure 5 As shown, step S330 may include steps S331 to S332.
[0076] Step S331: determining whether the image to be recognized includes a door lock image according to the first recognition result.
[0077] In one embodiment, the first recognition result can be obtained by using the first network model to recognize the image to be recognized, wherein the first recognition result may include the first door lock classification information and the first location information, and the first door lock classification information may be a standard lock, a king lock, other locks or no lock. After the first network model detects the first recognition result, it can first determine whether the first door lock classification information in the first recognition result is no lock. If it is no lock, it means that there is no door lock image in the image to be recognized. At this time, the electronic device can send the result to the user to notify the user that the door lock was not photographed when the image to be recognized was photographed. Then, the electronic device can notify the user to re-photograph the image to be recognized, or the electronic device can notify the user to perform a manual review operation, that is, the user can determine whether the door lock is a smart door lock through his accumulated knowledge. In another embodiment, if the first door lock classification information in the first recognition result is a standard lock, a king lock or other lock, the second network model is determined according to the first door lock classification information, that is, step S332 is entered.
[0078] Step S332: When the image to be recognized includes a door lock image, determining a second network model according to the first recognition result.
[0079] The image to be identified is identified using the second network model to obtain a second identification result, wherein the second identification result includes second door lock classification information and second position information. The second door lock classification information refers to the type of door lock, which may be a standard lock, a king lock, or other locks, and may also include a situation where there is no lock. In other words, when the image to be identified is identified using the second network model, if there is no door lock in the image to be identified, it means that the door lock was not captured when the image to be identified was captured, and the second door lock classification information in the second identification result is no door lock.
[0080] Step S340: Determine whether the first door lock classification information is the same as the second door lock classification information.
[0081] From the above introduction, it can be known that the first door lock classification information can be standard lock, overlord lock, other locks and no lock, and the second door lock classification information can also be standard lock, overlord lock, other locks and no lock. Judging whether the first door lock classification information is the same as the second door lock classification information refers to judging whether the first door lock classification information and the second door lock classification information are the same door lock. If the first door lock classification information and the second door lock classification information are the same, then enter step S350. If the first door lock classification information and the second door lock classification information are not the same, then send a prompt message to the user, and prompt the user to re-acquire the image to be identified or prompt the user to perform a manual review operation.
[0082] In one embodiment, by determining whether the first door lock classification information is the same as the second door lock classification information, it can be determined whether the output results of the first network model target detection model and the second network model classification model are the same or mutually exclusive. The same situations include: the first door lock classification information is a standard lock, and the second door lock classification information is a standard lock; the first door lock classification information is an overlord lock, and the second door lock classification information is an overlord lock; the first door lock classification information is other locks, and the second door lock classification information is other locks. From the above introduction, it can be known that when the first door lock classification information is unlocked or the second door lock classification information is unlocked, a notification prompt message needs to be sent to the user. Therefore, the same situation does not include the situation where the first door lock classification information is unlocked and the second door lock classification information is unlocked. Different situations include: the first door lock classification information is standard lock, and the second door lock classification information is overlord lock; the first door lock classification information is standard lock, and the second door lock classification information is other locks; the first door lock classification information is overlord lock, and the second door lock classification information is standard lock; the first door lock classification information is overlord lock, and the second door lock classification information is other locks; the first door lock classification information is other locks, and the second door lock classification information is standard lock; the first door lock classification information is other locks, and the second door lock classification information is overlord lock. For example, the first network model outputs a "standard lock" after recognizing the image to be recognized, while the second network model outputs a "overlord lock" after recognizing the same image to be recognized. Obviously, the first door lock classification information and the second door lock classification information are inconsistent.
[0083] In one implementation, if the output results of the first network model and the second network model are inconsistent, it means that the door lock may be between a standard lock and a domineering lock, which is difficult to judge and requires manual review.
[0084] Step S350: If the first door lock classification information is the same as the second door lock classification information, determine that the first recognition result matches the second recognition result, obtain a door lock recognition result according to the first recognition result or the second recognition result, and output the door lock recognition result.
[0085] In one embodiment, when the first door lock classification information and the second door lock classification information are the same, it is determined that the first identification result matches the second identification result. At this time, the door lock identification result can be obtained according to the first identification result or the second identification result, that is, the first identification result can be used as the door lock identification result, the second identification result can be used as the door lock identification result, or the first identification result and the second identification result can be combined to obtain the door lock identification result. Experiments have shown that the final accuracy of the door lock identification of this application reaches 99.533%, and only 7.364% require manual review.
[0086] An embodiment of the present application proposes a door lock identification method, which determines the final door lock identification result by combining a first door lock identification result and a second door lock identification result. Specifically, the identification of the door lock image is made more accurate by comparing the first door lock classification information of the first door lock identification result and the second door lock classification information of the second door lock identification result. At the same time, when the first door lock classification information and the second door lock classification information are different, the present application can use manual review to make a judgment. Therefore, the present application can not only improve the accuracy of door lock identification, but also process data that cannot be judged by the network model through manual review, thereby making door lock identification more intelligent.
[0087] See also Figure 6 , a door lock recognition device 400 proposed in an embodiment of the present application includes an image acquisition module 410, a first recognition module 420, a second recognition module 430 and a result output module 440.
[0088] The image acquisition module 410 is used to acquire the image to be identified and input the image to be identified into the first network model.
[0089] The first recognition module 420 is used to recognize the image to be recognized by using the first network model to obtain a first recognition result.
[0090] The second recognition module 430 is used to determine a second network model according to the first recognition result, and use the second network model to recognize the image to be recognized to obtain a second recognition result. The image recognition algorithms of the first network model and the second network model are different.
[0091] like Figure 7 As shown, the second recognition module 430 may include a second information acquisition unit 431 , a standard image determination unit 432 , and a second model determination unit 433 .
[0092] The second information acquisition unit 431 is used to acquire the position information of the preset shooting frame, and use the position information of the preset shooting frame as the second position information.
[0093] The standard image determining unit 432 is configured to determine whether the image to be identified is a standard image according to the first position information and the second position information.
[0094] Furthermore, the standard image determination unit 432 is also used to obtain the overlap between the door lock candidate frame and the preset shooting frame according to the first position information and the second position information, and determine whether the overlap between the door lock candidate frame and the preset shooting frame is greater than a preset threshold. When the overlap between the door lock candidate frame and the preset shooting frame is greater than the preset threshold, the image to be identified is determined to be a standard image. When the overlap between the door lock candidate frame and the preset shooting frame is less than the preset threshold, the image to be identified is determined to be a non-standard image, and it is detected whether a re-photographing instruction is obtained. If a re-photographing instruction is obtained, the image to be identified is re-acquired. When a re-photographing instruction is not obtained, it is determined whether a manual review instruction is obtained. If a manual review instruction is obtained, the review result corresponding to the manual review instruction is obtained, and the review result and the image to be identified are stored in a one-to-one correspondence.
[0095] The second model determining unit 433 is used to determine a second network model according to the first recognition result when the image to be recognized is a standard image.
[0096] Furthermore, the second recognition module 430 is also used to determine whether the image to be recognized contains a door lock image according to the first recognition result, and when the image to be recognized contains a door lock image, determine the second network model according to the first recognition result.
[0097] The result output module 440 is used to obtain a door lock identification result according to the first identification result or the second identification result if the first identification result matches the second identification result, and output the door lock identification result.
[0098] Furthermore, the result output module 440 is also used to find a door lock classification model corresponding to the first door lock classification information, and use the door lock classification model as a second network model to determine whether the first door lock classification information is the same as the second door lock classification information. If the first door lock classification information is the same as the second door lock classification information, it is determined that the first recognition result matches the second recognition result.
[0099] Furthermore, the door lock identification result is the first door lock classification information or the second door lock classification information.
[0100] An embodiment of the present invention provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the door lock identification method provided in the above method embodiment.
[0101] The memory can be used to store software programs and modules. The processor executes various functional applications and door lock identification methods by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.
[0102] Figure 8 FIG. 1 is a hardware structure block diagram of an electronic device for a door lock identification method provided by an embodiment of the present invention. Figure 8 As shown, the electronic device 1100 may have relatively large differences due to different configurations or performances, and may include one or more processors (Processing Units, CPU) 1110 (the processor 1110 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1130 for storing data, and one or more storage media 1120 (such as one or more mass storage devices) for storing application programs 1123 or data 1122. Among them, the memory 1130 and the storage medium 1120 can be short-term storage or persistent storage. The program stored in the storage medium 1120 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the processor 1110 can be configured to communicate with the storage medium 1120 and execute a series of instruction operations in the storage medium 1120 on the electronic device 1100. The electronic device 1100 may also include one or more power supplies 1160, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1140, and / or one or more operating systems 1121, such as WindowsserverTM, MacOSXTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0103] The input / output interface 1140 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the electronic device 1100. In one example, the input / output interface 1140 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 1140 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0104] It can be understood by those skilled in the art that Figure 8 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 8 More or fewer components as shown, or with Figure 8 Different configurations are shown.
[0105] Fig. 9 A schematic diagram of the hardware structure of a user terminal for implementing various embodiments of the present invention.
[0106] The user terminal 1200 includes but is not limited to: a radio frequency unit 1210, a network module 1220, an audio output unit 1230, an input unit 1240, a sensor 1250, a display unit 1260, a user input unit 1270, a user input unit 1280, a memory 1290, a processor 1300, and a power supply 1310. Those skilled in the art will appreciate that Fig. 9 The user terminal structure shown in the figure does not constitute a limitation on the user terminal, and the mobile terminal may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiment of the present invention, the user terminal includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted user terminal, a wearable device, and a pedometer.
[0107] Among them, the processor 1300 is used to obtain an image to be identified, and input the image to be identified into a first network model, use the first network model to identify the image to be identified to obtain a first recognition result, determine the second network model according to the first recognition result, and use the second network model to identify the image to be identified to obtain a second recognition result. The image recognition algorithms of the first network model and the second network model are different. If the first recognition result matches the second recognition result, the door lock recognition result is obtained according to the first recognition result or the second recognition result, and the door lock recognition result is output.
[0108] It should be understood that in the embodiment of the present invention, 1210 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 1300 for processing; in addition, uplink data is sent to the base station. Generally, 1210 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, 1210 can also communicate with the network and other devices through a wireless communication system.
[0109] The user terminal provides users with wireless broadband Internet access through the network module 1220, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0110] The audio output unit 1230 can convert the audio data received by the user terminal 1210 or the network module 1220 or stored in the memory 1290 into an audio signal and output it as sound. In addition, the audio output unit 1230 can also provide audio output related to a specific function performed by the user terminal 1200 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 1230 includes a speaker, a buzzer, a receiver, etc.
[0111] The input unit 1240 is used to receive audio or video signals. The input unit 1240 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1242, and the graphics processor 1241 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 1260. The image frame processed by the graphics processor 1241 can be stored in the memory 1290 (or other storage medium) or sent via 1210 or the network module 1220. The microphone 1242 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via 1210 in the case of a telephone call mode.
[0112] The user terminal 1200 also includes at least one sensor 1250, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1261 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1261 and / or the backlight when the user terminal 1200 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the user terminal posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 1250 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0113] The display unit 1260 is used to display information input by the user or information provided to the user. The display unit 1260 may include a display panel 1261, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0114] The user input unit 1270 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the user terminal. Specifically, the user input unit 1270 includes a touch panel 1271 and other input devices 1272. The touch panel 1271, also known as a touch screen, can collect the user's touch operations on or near it (such as the user's operation on the touch panel 1271 or near the touch panel 1271 using any suitable object or accessory such as a finger or stylus). The touch panel 1271 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the coordinates of the contact point, and then sends it to the processor 1300, receives the command sent by the processor 1300 and executes it. In addition, the touch panel 1271 can be implemented in various types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 1271, the user input unit 1270 may also include other input devices 1272. Specifically, other input devices 1272 may include but are not limited to physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which are not described in detail here.
[0115] Furthermore, the touch panel 1271 may be overlaid on the display panel 1261. When the touch panel 1271 detects a touch operation on or near it, it transmits the information to the processor 1300 to determine the type of the touch event. Then, the processor 1300 provides a corresponding visual output on the display panel 1261 according to the type of the touch event. Fig. 9 In the figure, the touch panel 1271 and the display panel 1261 are used as two independent components to realize the input and output functions of the user terminal. However, in some embodiments, the touch panel 1271 and the display panel 1261 can be integrated to realize the input and output functions of the user terminal, which is not limited here.
[0116] The user input unit 1280 is an interface for connecting an external device to the user terminal 1200. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, an earphone port, etc. The user input unit 1280 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the user terminal 1200 or may be used to transmit data between the user terminal 1200 and an external device.
[0117] The memory 1290 can be used to store software programs and various data. The memory 1290 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1290 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0118] The processor 1300 is the control center of the user terminal. It uses various interfaces and lines to connect various parts of the entire user terminal. By running or executing software programs and / or modules stored in the memory 1290 and calling data stored in the memory 1290, it executes various functions of the user terminal and processes data, thereby monitoring the user terminal as a whole. The processor 1300 may include one or more processing units; preferably, the processor 1300 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1300.
[0119] The user terminal 1200 may also include a power supply 1310 (such as a battery) for supplying power to various components. Preferably, the power supply 1310 may be logically connected to the processor 1300 via a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0120] In addition, the user terminal 1200 includes some functional modules not shown, which will not be described here.
[0121] An embodiment of the present invention also provides a user terminal, including a processor 1300, a memory 1290, and a computer program stored in the memory 409 and executable on the processor 1300. When the computer program is executed by the processor 410, the various processes of the above-mentioned information method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0122] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned door lock identification method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0123] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0125] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A door lock identification method, characterized in that: The method includes: Acquire an image to be identified, and input the image to be identified into a first network model; Using the first network model to identify the image to be identified, to obtain a first identification result, wherein the first identification result includes first door lock classification information; Determine a second network model according to the first recognition result, and use the second network model to recognize the image to be recognized to obtain a second recognition result, the first network model and the second network model have different image recognition algorithms, the second recognition result includes second door lock classification information, the first network model includes a target detection model, and the second network model includes a classification model; If the first recognition result matches the second recognition result, a door lock recognition result is obtained according to the first recognition result or the second recognition result, and the door lock recognition result is output, where the door lock recognition result is the first door lock classification information or the second door lock classification information.
2. The method according to claim 1, characterized in that The first recognition result further includes position information of the door lock candidate frame, and the position information of the door lock candidate frame is used as the first position information; The determining the second network model according to the first recognition result includes: Acquire position information of a preset shooting frame, and use the position information of the preset shooting frame as second position information; Determining whether the image to be identified is a standard image according to the first position information and the second position information; When the image to be recognized is a standard image, a second network model is determined according to the first recognition result.
3. The method according to claim 2, characterized in that The determining, according to the first position information and the second position information, whether the image to be identified is a standard image includes: Acquire the overlap degree between the door lock candidate frame and the preset shooting frame according to the first position information and the second position information; Determine whether the overlap between the door lock candidate frame and the preset shooting frame is greater than a preset threshold; When the degree of overlap between the door lock candidate frame and the preset shooting frame is greater than a preset threshold, the image to be identified is determined to be a standard image.
4. The method according to claim 3, characterized in that The method further comprises: When the overlap between the door lock candidate frame and the preset shooting frame is less than a preset threshold, the image to be identified is determined to be a non-standard image; Check whether the re-photographing instruction is obtained; If a re-photographing instruction is obtained, the image to be recognized is obtained again.
5. The method according to claim 4, characterized in that The method further comprises: When no re-photographing instruction is obtained, determining whether a manual review instruction is obtained; If a manual review instruction is obtained, the review result corresponding to the manual review instruction is obtained, and the review result and the image to be identified are stored in a one-to-one correspondence.
6. The method according to claim 1, characterized in that The determining the second network model according to the first recognition result includes: A door lock classification model corresponding to the first door lock classification information is searched, and the door lock classification model is used as the second network model.
7. The method according to claim 6, characterized in that After the image to be identified is identified by using the second network model to obtain a second identification result, the method includes: determining whether the first door lock classification information is the same as the second door lock classification information; If the first door lock classification information is the same as the second door lock classification information, it is determined that the first recognition result matches the second recognition result.
8. The method according to any one of claims 1 to 7, characterized in that: The determining the second network model according to the first recognition result includes: Determining whether the image to be identified includes a door lock image according to the first recognition result; When the image to be recognized includes a door lock image, a second network model is determined according to the first recognition result.
9. A door lock identification device, characterized in that: The device comprises: An image acquisition module, used for acquiring an image to be identified and inputting the image to be identified into a first network model; A first recognition module, configured to recognize the image to be recognized by using the first network model to obtain a first recognition result, wherein the first recognition result includes first door lock classification information; a second recognition module, configured to determine a second network model according to the first recognition result, and recognize the image to be recognized by using the second network model to obtain a second recognition result, wherein the first network model and the second network model have different image recognition algorithms, the second recognition result includes second door lock classification information, the first network model includes a target detection model, and the second network model includes a classification model; A result output module is used to obtain a door lock identification result according to the first identification result or the second identification result if the first identification result matches the second identification result, and output the door lock identification result, wherein the door lock identification result is the first door lock classification information or the second door lock classification information.
10. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the door lock identification method as claimed in any one of claims 1 to 8 when executed by the processor.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the door lock identification method according to any one of claims 1 to 8 are implemented.
