Anomaly determination method and apparatus, electronic device, and storage medium
By processing the image of the target object and comparing it with the feature library, the problem of inaccurate anomaly identification caused by high similarity of object appearance in manual verification is solved, and more efficient anomaly identification is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-24
- Publication Date
- 2026-03-17
AI Technical Summary
Because objects of the same type have high similarity in appearance and structure and are numerous, manual verification is difficult to accurately confirm whether the target object has any anomalies, affecting the effectiveness of anomaly identification.
By acquiring the image to be identified, image processing is performed to extract the key parts and key points of the target object, and the feature identifier with the highest similarity to the target image in the feature library is used to determine whether the object is abnormal.
It improves the accuracy and effectiveness of anomaly identification, accurately identifies the true identity of target objects, and reduces errors from manual verification.
Smart Images

Figure CN116580301B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to an anomaly determination method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, the identity of a certain type of object (such as a fishing boat) can be confirmed through manual verification.
[0003] However, in the above methods, the appearance and structure of objects of the same type are highly similar and there are many of them. Manual verification may not be able to accurately confirm whether the identity of the target object is abnormal, which affects the effectiveness of the anomaly determination. Summary of the Invention
[0004] This application provides an anomaly determination method, apparatus, electronic device, and storage medium, which solves the technical problem that when there are many objects of the same type with high similarity in appearance and structure, manual verification may not be able to accurately confirm whether the target object has any anomalies, thus affecting the effectiveness of anomaly determination.
[0005] In a first aspect, this application provides an anomaly determination method, comprising: acquiring an image to be identified, the image to be identified including a target object; performing image processing on the image to be identified to obtain a target image, the target image including key parts of the target object, the position of a target key point in the target image being the same as the position of a preset key point in a preset image, the target key point being a key point included in the key parts of the target object, the preset key point being a key point included in the preset image, the preset image corresponding to the type of the key parts of the target object; determining that the target object is an anomaly if a first identifier and a second identifier are different, the first identifier being an identifier corresponding to a target feature, the target feature being the feature with the highest similarity to the feature of the target image in a feature library, and the second identifier being an identifier included in the image to be identified.
[0006] Optionally, the above-mentioned image processing of the image to be identified to obtain the target image may specifically include: performing image recognition on the image to be identified to obtain the key parts of the target object; cropping the image to be identified based on the key parts of the target object to obtain a key image; performing image recognition on the key image to obtain the position of the target key point in the key image; aligning the position of the target key point in the key image with the position of the preset key point in the preset image to obtain the target image.
[0007] Optionally, the above image processing of the image to be identified to obtain the target image may specifically include: determining the appearance type of key parts of the target object; and determining the preset image based on the appearance type of the key parts of the target object and a preset correspondence, wherein the preset correspondence includes the appearance types of multiple key parts and the images corresponding to each of the multiple key parts.
[0008] Optionally, the above anomaly determination method further includes: acquiring multiple images; inputting the multiple images into a feature extraction network to obtain the features of each image in the multiple images; and generating the feature library based on the features of each image.
[0009] Optionally, the above anomaly determination method further includes: performing image recognition on the image to be identified to obtain the second identifier.
[0010] Secondly, this application provides an anomaly determination device, comprising: an acquisition module, a processing module, and a determination module; the acquisition module is used to acquire an image to be identified, the image to be identified including a target object; the processing module is used to perform image processing on the image to be identified to obtain a target image, the target image including key parts of the target object, the position of the target key point in the target image being the same as the position of the preset key point in the preset image, the target key point being a key point included in the key parts of the target object, the preset key point being a key point included in the preset image, and the preset image corresponding to the type of the key parts of the target object; the determination module is used to determine that the target object is an anomaly when a first identifier and a second identifier are different, the first identifier being an identifier corresponding to a target feature, the target feature being the feature with the highest similarity to the feature of the target image in a feature library, and the second identifier being an identifier included in the image to be identified.
[0011] Optionally, the processing module is specifically used to perform image recognition on the image to be recognized to obtain the key parts of the target object; the processing module is also specifically used to perform cropping processing on the image to be recognized based on the key parts of the target object to obtain a key image; the processing module is also specifically used to perform image recognition on the key image to obtain the position of the target key point in the key image; the processing module is also specifically used to align the position of the target key point in the key image with the position of the preset key point in the preset image to obtain the target image.
[0012] Optionally, the determining module is further configured to determine the appearance type of key parts of the target object; the determining module is further configured to determine the preset image based on the appearance type of the key parts of the target object and a preset correspondence, wherein the preset correspondence includes the appearance types of multiple key parts and the images corresponding to each of the appearance types of the multiple key parts.
[0013] Optionally, the acquisition module is further configured to acquire multiple images; the processing module is further configured to input the multiple images into a feature extraction network to obtain features of each image; and the processing module is further configured to generate the feature library based on the features of each image.
[0014] Optionally, the processing module is also used to perform image recognition on the image to be recognized in order to obtain the second identifier.
[0015] Thirdly, this application provides an electronic device, including: a processor and a memory configured to store processor-executable instructions; wherein the processor is configured to execute the instructions to implement any of the optional exception determination methods in the first aspect described above.
[0016] Fourthly, this application provides a computer-readable storage medium storing instructions that, when executed by an electronic device, enable the electronic device to perform any of the optional anomaly determination methods described in the first aspect above.
[0017] The anomaly determination method, apparatus, electronic device, and storage medium provided in this application allow the electronic device to acquire an image to be identified and then perform image processing on the image to obtain a target image. The target image includes key parts of a target object. If the first identifier and the second identifier are different, it indicates that the identifier of the target object in the image to be identified is different from the identifier of the object corresponding to the feature of the target image. In this case, the electronic device can determine that the target object is anomaly. In this embodiment, the target feature is the feature in the feature library with the highest similarity to the feature of the target image. When the similarity between the target feature and the feature of the target image is the highest, it indicates that the target feature and the feature of the target image are relatively similar. In this case, the electronic device can determine the identifier corresponding to the target feature as the identifier of the target object. Since the first identifier and the second identifier are used to identify the target object, when the first identifier (i.e., the identifier corresponding to the target feature) is different from the second identifier (i.e., the identifier included in the image to be identified), it indicates that the target object corresponds to two identifiers. The electronic device cannot determine the true identifier of the target object. In this case, the electronic device can accurately determine that the identifier of the target object is anomaly, improving the effectiveness of anomaly determination. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0019] Figure 1A flowchart illustrating an anomaly determination method provided in an embodiment of this application;
[0020] Figure 2 A flowchart illustrating another anomaly determination method provided in an embodiment of this application;
[0021] Figure 3 A flowchart illustrating another anomaly determination method provided in an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of the internal structure of an electronic device provided in an embodiment of this application;
[0023] Figure 5 A flowchart illustrating another anomaly determination method provided in an embodiment of this application;
[0024] Figure 6 A flowchart illustrating another anomaly determination method provided in an embodiment of this application;
[0025] Figure 7 This is a schematic diagram of an anomaly determination device provided in an embodiment of this application;
[0026] Figure 8 This is a schematic diagram of another anomaly determination device provided in an embodiment of this application. Detailed Implementation
[0027] The anomaly determination method, apparatus, electronic device, and storage medium provided in the embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0028] The terms "first" and "second," etc., in the specification and drawings of this application are used to distinguish different objects, rather than to describe a specific order of objects. For example, "first identifier" and "second identifier," etc., are used to distinguish different identifiers, rather than to describe a specific order of identifiers.
[0029] Furthermore, the terms “comprising” and “having”, and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.
[0030] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0031] The term "and / or" as used in this application includes using either one of two methods or using both methods simultaneously.
[0032] In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0033] As described in the background art, in related technologies, objects of the same type have high similarity in appearance and structure, and there are many of them. Manual verification may not accurately confirm whether the target object's identity is abnormal, affecting the effectiveness of anomaly determination. Therefore, this application provides an anomaly determination method, apparatus, electronic device, and storage medium. The target feature is the feature in the feature library with the highest similarity to the feature of the target image. When the similarity between the target feature and the feature of the target image is the highest, it indicates that the target feature and the feature of the target image are quite similar. At this time, the electronic device can determine the identifier corresponding to the target feature as the identifier of the target object. Since the first identifier and the second identifier are used to identify the target object, when the first identifier (i.e., the identifier corresponding to the target feature) is different from the second identifier (i.e., the identifier included in the image to be identified), it indicates that the target object corresponds to two identifiers. The electronic device cannot determine the true identifier of the target object. At this time, the electronic device can accurately determine that the identifier of the target object is abnormal, improving the effectiveness of anomaly determination.
[0034] For example, the electronic device executing the anomaly determination method provided in this application embodiment can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device, etc. This application does not impose any special limitations on the specific form of the electronic device. It can interact with the user through one or more methods such as keyboard, touchpad, touch screen, remote control, voice interaction or handwriting device.
[0035] For example, the aforementioned electronic device may also be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN) services, and big data and artificial intelligence platforms.
[0036] The anomaly determination method, apparatus, electronic device, and storage medium provided in this application are applied in anomaly detection scenarios. When the electronic device acquires an image to be identified, it can perform image processing on the image to obtain a target image, and then determine that the target object is in an anomaly if the first identifier and the second identifier are different.
[0037] like Figure 1 As shown, the anomaly determination method provided in this application embodiment may include S101-S103.
[0038] S101, The electronic device acquires the image to be recognized.
[0039] The image to be identified includes the target object.
[0040] S102. The electronic device performs image processing on the image to be recognized to obtain the target image.
[0041] The target image includes key parts of the target object. The position of the target key point in the target image is the same as the position of the preset key point in the preset image. The target key point is a key point included in the key parts of the target object. The preset key point is a key point included in the preset image. The preset image corresponds to the type of the key parts of the target object.
[0042] It is understood that the image to be identified also includes key parts of the target object, which are the parts that can characterize the uniqueness of the target object. The electronic device can determine the target object based on these key parts.
[0043] It should be understood that the target key point is the salient information of the key part, and the target key point is used to locate the salient information of the key part.
[0044] It is understood that the position of the preset key point is the position of the significant information of the key part in the preset image. The electronic device can perform image processing on the image to be identified based on the target key point and the position of the preset key point in the preset image, so that the position of the target key point in the target image is the same as the position of the preset key point in the preset image.
[0045] It should be understood that the position of the target key point in the target image is the same as the position of the preset key point in the preset image, indicating that the viewpoint of the target image is the same as the viewpoint of the preset image.
[0046] In this embodiment of the application, the preset image can also be understood as a preset template. Due to different shooting angles and limited shooting positions, the viewing angle differences of different images of the same target object may be too large. The electronic device performs image processing on the image to be identified based on the preset template, and can obtain the key parts of the target object under the standard viewing angle.
[0047] Optionally, the electronic device may store multiple types of the key part and a template corresponding to each type, and then the electronic device may determine the preset image based on the category of the key part of the target object.
[0048] S103. If the first identifier and the second identifier are different, the electronic device determines that the target object is in an abnormal state.
[0049] Wherein, the first identifier is the identifier corresponding to the target feature, the target feature is the feature in the feature library that has the highest similarity to the feature of the target image, and the second identifier is the identifier included in the image to be identified.
[0050] It is understandable that the feature library stores the identifiers of multiple objects and the features corresponding to the identifiers of each of these multiple objects. When the similarity between the target feature and the feature of the target image is the highest, it means that the target feature and the feature of the target image are relatively similar. The object corresponding to the target feature and the object corresponding to the feature of the target image may be the same object. At this time, the electronic device can determine the identifier of the object corresponding to the target feature (i.e., the first identifier) as the identifier of the object corresponding to the feature of the target image.
[0051] It is understood that the second identifier is the identifier of the target object included in the image to be identified. When the first identifier is different from the second identifier, it means that the identifier of the target object included in the image to be identified is different from the identifier of the object corresponding to the feature of the target image. It is possible that the identifier included in the image to be identified is not the real identifier of the target object, or the identifier of the object corresponding to the feature of the target image is not the real identifier of the target object. At this time, the electronic device cannot determine the real identifier of the target object, but the electronic device can determine that the target object is abnormal and the identifier of the target object is abnormal.
[0052] It should be understood that when the first identifier is the same as the second identifier, it means that the identifier of the target object in the image to be identified is the same as the identifier of the object corresponding to the feature of the target image. At this time, the electronic device can determine that the identifier of the target object in the image to be identified (or the identifier of the object corresponding to the feature of the target image) is the real identifier of the target object, and the electronic device can determine that the target object is normal.
[0053] Optionally, the electronic device can perform recognition processing on the image to be recognized to obtain the second identifier.
[0054] Optionally, the second identifier can be a text sequence.
[0055] In one alternative implementation, the electronic device can input the target image into a feature extraction network to obtain the features of the target image.
[0056] In another alternative implementation, the electronic device can retrieve the feature with the highest feature similarity to the target image from the feature library based on the conjugate gradient decomposition (CGD) algorithm.
[0057] In one implementation of this application, after recognizing the second identifier, the electronic device can determine at least one feature corresponding to the second identifier in the feature library based on the second identifier. When the similarity between one of the at least one features and the features of the target image is greater than or equal to a similarity threshold, the electronic device can determine that the identifier of the target object is the second identifier and determine that the target object is normal.
[0058] The technical solution provided by the above embodiments can bring at least the following beneficial effects: As can be seen from S101-S103, the electronic device can acquire the image to be identified, and then perform image processing on the image to be identified to obtain the target image. The target image includes the key parts of the target object. If the first identifier and the second identifier are different, it indicates that the identifier of the target object in the image to be identified is different from the identifier of the object corresponding to the feature of the target image. At this time, the electronic device can determine that the target object is abnormal. In this embodiment, the target feature is the feature in the feature library that has the highest similarity to the feature of the target image. When the similarity between the target feature and the feature of the target image is the highest, it means that the target feature and the feature of the target image are relatively similar. At this time, the electronic device can determine the identifier corresponding to the target feature as the identifier of the target object. Since the first identifier and the second identifier are used to identify the target object, when the first identifier (i.e., the identifier corresponding to the target feature) is different from the second identifier (i.e., the identifier included in the image to be identified), it means that the target object corresponds to two identifiers. The electronic device cannot determine the true identifier of the target object. At this time, the electronic device can accurately determine that the identifier of the target object is abnormal, thus improving the effectiveness of abnormality determination.
[0059] Combination Figure 1 ,like Figure 2 As shown, the above-mentioned electronic device performs image processing on the image to be identified to obtain the target image, which may specifically include S1021-S1024.
[0060] S1021. The electronic device performs image recognition on the image to be recognized to obtain the key parts of the target object.
[0061] It is understood that the image to be identified includes a target object, which comprises multiple parts, and the electronic device can identify the key parts of the target object included in the image to be identified.
[0062] In one alternative implementation, the electronic device can input the image to be identified into a key part detection model and then obtain the key parts of the target object.
[0063] Optionally, before the electronic device can input the image to be identified into the key part detection model, the electronic device can acquire multiple images to be identified, then manually determine the key parts of each of the multiple images to be identified, and train the key part detection model based on the key parts of each image to be identified, and adjust the parameters of the key part detection model.
[0064] Optionally, the electronic device can build the detection model for the key part based on the YOLOv5 algorithm.
[0065] S1022. The electronic device performs cropping processing on the image to be recognized based on the key parts of the target object to obtain a key image.
[0066] Understandably, this key image only includes the key parts of the target object.
[0067] S1023. The electronic device performs image recognition on the key image to obtain the position of the target key point in the key image.
[0068] Based on the description of the above embodiments, it should be understood that the target key point is the salient information of the key part. The electronic device can pre-set the salient information of the target key point, and then perform image recognition on the key image to obtain the position of the target key point in the key image.
[0069] Specifically, the electronic device can extract key points from the key image to obtain the target key point and its position in the key image.
[0070] In this embodiment of the application, the electronic device can determine the target key point based on the color, shape, etc. of the key part, such as the splicing of different colors of the key part.
[0071] For example, assuming the key part of the target object is a ship cabin, the electronic device can identify the vertices of the ship cabin as target key points, and then the electronic device can identify the position of the vertices of the ship cabin in the key image.
[0072] In one alternative implementation, the electronic device can input a key image into a key point recognition model to obtain the target key points.
[0073] Optionally, the electronic device can construct the key point recognition model based on the mmpose algorithm.
[0074] Optionally, the electronic device can acquire the multiple preset key images, then manually determine the position of the key points included in each preset key image, and then train the key point recognition model based on the position of the key points included in each preset key image.
[0075] S1024. The electronic device aligns the position of the target key point in the key image with the position of the preset key point in the preset image to obtain the target image.
[0076] It should be understood that after the electronic device aligns the position of the target key point in the key image with the position of the preset key point in the preset image, the position of the target key point in the target image is the same as the position of the preset key point in the preset image.
[0077] It should be noted that the number of target key points and the number of preset key points can be one or more, and the embodiments of this application do not specifically limit the number of key points.
[0078] In one optional implementation, when there are multiple preset key points, the electronic device can determine whether the number of target key points is the same as the number of preset key points. If the number of target key points is the same as the number of preset key points, the electronic device can align the position of the target key points in the key image with the position of the preset key points in the preset image based on projection transformation. If the number of target key points is different from the number of preset key points, specifically, if the number of target key points is less than the number of preset key points, the electronic device can align the position of the target key points in the key image with the position of the preset key points in the preset image based on radial transformation to obtain the target image.
[0079] The technical solution provided by the above embodiments can bring at least the following beneficial effects: As can be seen from S1021-S1024, the electronic device can perform image recognition on the image to be recognized to obtain the key parts of the target object, and then perform cropping processing on the image to be recognized based on the key parts of the target object to obtain a key image. After that, image recognition is performed on the key image to obtain the position of the target key point in the key image. The electronic device can align the position of the target key point in the key image with the position of the preset key point in the preset image to obtain the target image. In this embodiment, since the key image is obtained by cropping the image to be identified based on the key parts of the target object by the electronic device, the key image only includes the key parts of the target object. Furthermore, since the electronic device aligns the position of the target key point in the key image with the position of the preset key point in the preset image, the position of the target key point in the target image is the same as the position of the preset key point in the preset image. Therefore, the viewpoints of the target image and the preset image are quite similar. By adjusting the key image to be the target image from the viewpoint of the preset image, the electronic device can reduce the problem of large differences between the features of the image to be identified and the features included in the feature library caused by different viewpoints and image backgrounds, thereby improving the accuracy of the electronic device in determining the similarity between features.
[0080] Combination Figure 2 ,like Figure 3 As shown, the above-mentioned electronic device performs image processing on the image to be identified to obtain the target image, and may further include S1025-S1026.
[0081] S1025. Electronic equipment determines the appearance type of key parts of a target object.
[0082] It is understandable that the appearance of the same part may be different. The electronic device can determine the appearance type of the key parts of the target object based on their appearance.
[0083] In this embodiment of the application, the electronic device can determine the appearance type of the key parts of the target object based on the color, shape, etc. of the key parts of the target object.
[0084] In one alternative implementation, the electronic device can input the aforementioned key images into a classification model to obtain the appearance type of the key parts of the target object.
[0085] Alternatively, the electronic device can build the classification model based on the EfficientNet algorithm.
[0086] Optionally, the electronic device can acquire multiple key images, then manually determine the appearance type of the key image, and then train the classification model based on the manually determined appearance type of the key image.
[0087] In one alternative implementation, the electronic device may also classify the appearance type of the key parts of the target object based on the shooting angle of the key parts in the key image.
[0088] Specifically, the shooting angle can include the front and the side, and the front and the side correspond to multiple appearance types respectively. The electronic device can first determine the multiple appearance types corresponding to the shooting angle of the key parts of the target object, and then determine the appearance type of the key parts of the target object based on the color, shape and other characteristics of the key parts of the target object.
[0089] S1026. The electronic device determines a preset image based on the appearance type of the key parts of the target object and the preset correspondence.
[0090] The preset correspondence includes the appearance types of multiple key parts and the images corresponding to each of the appearance types of the multiple key parts.
[0091] In one implementation of this application, the electronic device may consist of multiple modules, such as... Figure 4 As shown, the electronic device includes an identification detection module, a key part detection module, a key point detection module, a classification module, an alignment module, and a retrieval module.
[0092] Specifically, the identifier detection module is used to identify the identifier of the target object included in the image to be identified; the key part detection module is used to identify the key parts of the target object included in the image to be identified; the key point detection module is used to identify the target key points included in the target key image; the classification module is used to determine the appearance type of the key parts of the target object; the alignment module is used to align the position of the target key point in the key image with the position of the preset key point in the preset image to obtain the target image; and the retrieval module is used to retrieve the feature with the highest feature similarity to the target image from the feature library.
[0093] The technical solution provided by the above embodiments can bring at least the following beneficial effects: As can be seen from S1025-S1026, the electronic device can determine the appearance type of the key part of the target object based on the appearance of the key part of the target object, and then accurately determine a preset image similar to the key part of the target object based on the appearance type of the key part of the target object and the preset correspondence.
[0094] Combination Figure 1 ,like Figure 5 As shown, the anomaly determination method also includes S104-S106.
[0095] S104. The electronic device acquires multiple images.
[0096] It should be understood that each of these multiple images includes an object.
[0097] It should be noted that the objects included in each image may be the same or different.
[0098] S105. The electronic device inputs multiple images into a feature extraction network to obtain the features of each image in the multiple images.
[0099] Alternatively, the electronic device may construct the feature extraction network based on the ResNet50 algorithm.
[0100] S106. The electronic device generates a feature library based on the features of each image.
[0101] Understandably, the electronic device can classify the features of the multiple images, determine the features of the image corresponding to the same object, and then store the identifier of each object and the features corresponding to the identifier of each object.
[0102] In one alternative implementation, the electronic device can perform image processing on each of the multiple images, specifically including recognition processing, cropping processing, and alignment processing. Then, the image obtained after image processing is input into a feature extraction network to obtain the features of each of the multiple images. This eliminates the need for the electronic device to store the features of the same key part in images from different perspectives, reducing the burden of building a feature library.
[0103] In an alternative implementation, the electronic device may also generate a feature library corresponding to the identifier of each object based on the identifier of each object.
[0104] In another alternative implementation, the electronic device can also classify the feature library according to the front and side views of the key part. After determining the shooting angle of the key part of the target object in the target image, the electronic device can reduce the feature library to be searched based on the shooting angle of the key part of the target object in the target image, thereby improving the efficiency and accuracy of similarity retrieval between features.
[0105] The technical solution provided by the above embodiments can bring at least the following beneficial effects: As shown in S104-S106, the electronic device can acquire multiple images, then input the multiple images into a feature extraction network to obtain the features of each image, and then generate a feature library based on the features of each image. In this embodiment, since the electronic device obtains the features of each object based on the image of each object, the accuracy of feature storage in the feature library can be improved. Therefore, the electronic device can accurately determine the feature with the highest feature similarity to the target image based on the feature library.
[0106] Combination Figure 1 ,like Figure 6 As shown, the anomaly determination method also includes S107.
[0107] S107. The electronic device performs image recognition on the image to be recognized to obtain a second identifier.
[0108] It should be understood that the second identifier is an identifier on the surface of the target object, and the electronic device can perform recognition processing on the image to be identified to obtain the second identifier.
[0109] Specifically, the electronic device can first detect the location of the marker, and then identify the marker at that location.
[0110] In one alternative implementation, the electronic device can input the image to be recognized into an identifier recognition model to obtain the identifier of the target object.
[0111] Optionally, the electronic device can build the identifier recognition model based on the paddleOCR algorithm.
[0112] Optionally, the electronic device can acquire multiple images to be identified, then determine the identifier of each image to be identified and the position of the identifier, and train the identifier recognition model based on the identifier of each image to be identified and the position of the identifier.
[0113] In this embodiment of the application, the electronic device performs image recognition on the image to be recognized, and can accurately obtain the identifier of the target object included in the image to be recognized. Then, based on the second identifier, the electronic device can accurately determine whether the identifier of the target object is abnormal.
[0114] The following example, taking a ship as the target object, illustrates an application scenario of the anomaly determination method provided in this application.
[0115] In this technology, after a vessel enters the port, verification personnel board the ship to check if the engine number matches the engine number registered on the corresponding vessel number. If they match, the vessel is considered legally registered; if they do not match, the vessel is considered to be using a counterfeit registration. This process is entirely manual, slow, and typically takes about 40 minutes to release a fishing boat. Furthermore, due to the complex port environment, the high degree of similarity in the appearance and structure of different vessels, and the chaotic registration process among fishermen, verification personnel are prone to making mistakes during the verification process.
[0116] In the anomaly determination method provided in this application, the electronic device can acquire an image of a target vessel, then identify the vessel's nameplate and number included in the image. Simultaneously, the electronic device can extract key parts of the target vessel from the image (taking the cabin as an example below), crop the cabin image, identify target key points of the cabin, such as the four vertices of the cabin, determine the cabin's category based on its appearance, determine a preset image based on the cabin's category, and align the cabin image based on the preset key points and target key points included in the preset image to obtain the target vessel's name and number. The system identifies the target image and then retrieves the target feature with the highest similarity from the feature library. The vessel number corresponding to the target feature is then determined as the vessel number of the target vessel. Next, it is determined whether the vessel number corresponding to the target feature is the same as the vessel number included in the image of the target vessel. If the vessel number corresponding to the target feature is the same as the vessel number included in the image of the target vessel, the vessel number of the target vessel is determined to be normal. If the vessel number corresponding to the target feature is different from the vessel number included in the image of the target vessel, the vessel number of the target vessel is determined to be abnormal, and the target vessel is determined to be a vessel with a fake license plate.
[0117] This application embodiment can divide electronic devices and the like into functional modules according to the above method examples. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0118] When dividing each function into modules according to its corresponding function. Figure 7 A possible structural schematic diagram of the anomaly determination device involved in the above embodiments is shown, such as... Figure 7 As shown, the anomaly determination device 10 may include: an acquisition module 101, a processing module 102, and a determination module 103.
[0119] The acquisition module 101 is used to acquire an image to be identified, which includes a target object.
[0120] The processing module 102 is used to perform image processing on the image to be identified to obtain a target image. The target image includes the key parts of the target object. The position of the target key point in the target image is the same as the position of the preset key point in the preset image. The target key point is the key point included in the key parts of the target object. The preset key point is the key point included in the preset image. The preset image corresponds to the type of the key parts of the target object.
[0121] The determination module 103 is used to determine that the target object is in an abnormal state when the first identifier and the second identifier are different. The first identifier is the identifier corresponding to the target feature, the target feature is the feature with the highest similarity to the feature of the target image in the feature library, and the second identifier is the identifier included in the image to be identified.
[0122] Optionally, the processing module 102 is specifically used to perform image recognition on the image to be recognized to obtain the key parts of the target object.
[0123] The processing module 102 is also specifically used to perform cropping processing on the image to be identified based on the key parts of the target object to obtain a key image.
[0124] The processing module 102 is also specifically used to perform image recognition on the key image to obtain the position of the target key point in the key image.
[0125] The processing module 102 is further configured to align the position of the target key point in the key image with the position of the preset key point in the preset image to obtain the target image.
[0126] Optionally, the determining module 103 is also specifically used to determine the appearance type of key parts of the target object.
[0127] The determining module 103 is also specifically used to determine the preset image based on the appearance type of the key parts of the target object and the preset correspondence, wherein the preset correspondence includes the appearance type of multiple key parts and the image corresponding to each of the appearance types of the multiple key parts.
[0128] Optionally, the acquisition module 101 is also used to acquire multiple images.
[0129] The processing module 102 is also used to input the multiple images into a feature extraction network to obtain the features of each image in the multiple images.
[0130] The processing module 102 is also used to generate the feature library based on the features of each image.
[0131] Optionally, the processing module 102 is also used to perform image recognition on the image to be recognized in order to obtain the second identifier.
[0132] When using integrated units, Figure 8 A possible structural schematic diagram of the anomaly determination device involved in the above embodiments is shown. For example... Figure 8 As shown, the anomaly determination device 20 may include a processing module 201 and a communication module 202. The processing module 201 can be used to control and manage the operation of the anomaly determination device 20. The communication module 202 can be used to support communication between the anomaly determination device 20 and other entities. Optionally, as... Figure 8 As shown, the anomaly determination device 20 may further include a storage module 203 for storing the program code and data of the anomaly determination device 20.
[0133] The processing module 201 can be a processor or a controller. The communication module 202 can be a transceiver, transceiver circuit, or communication interface, etc. The storage module 203 can be a memory.
[0134] In this configuration, when the processing module 201 is a processor, the communication module 202 is a transceiver, and the storage module 203 is a memory, the processor, transceiver, and memory can be connected via a bus. The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc.
[0135] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0136] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0137] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0138] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0139] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
[0140] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An anomaly determination method characterized by comprising: The method comprises: obtaining a to-be-recognized image, the to-be-recognized image comprising a target object, the target object being a ship; performing image processing on the to-be-recognized image to obtain a key part of the target object; performing cropping processing on the to-be-recognized image based on the key part of the target object to obtain a key image; performing image recognition on the key image to obtain a position of a target key point in the key image; aligning the position of the target key point in the key image with a position of a preset key point in a preset image to obtain a target image, the target image comprising the key part of the target object, the target key point being a key point comprised in the key part of the target object, the preset key point being a key point comprised in the preset image, the preset image corresponding to a type of the key part of the target object; in a case where a first identifier and a second identifier are different, determining that the target object is abnormal, the first identifier being an identifier corresponding to a target feature, the target feature being a feature in a feature library that has the greatest similarity to a feature of the target image, the second identifier being an identifier comprised in the to-be-recognized image; in a case where the first identifier and the second identifier are the same, determining at least one feature corresponding to the second identifier in the feature library, and in a case where a similarity between the at least one feature and the feature of the target image is greater than or equal to a preset similarity threshold, determining that an identifier of the target object is the second identifier and that the target object is normal.
2. The abnormality determination method according to claim 1, characterized by, The method further comprises: determining an appearance type of the key part of the target object; based on the appearance type of the key part of the target object and a preset correspondence relationship, determining the preset image, the preset correspondence relationship comprising appearance types of a plurality of key parts and images corresponding to the appearance types of the plurality of key parts respectively.
3. The abnormality determination method according to claim 1, characterized by, The method further comprises: obtaining a plurality of images; inputting the plurality of images into a feature extraction network to obtain a feature of each image in the plurality of images; based on the feature of each image, generating the feature library.
4. The abnormality determination method according to any one of claims 1 to 3, characterized in that, The method further comprises: performing image recognition on the to-be-recognized image to obtain the second identifier.
5. An abnormality determination apparatus characterized by comprising: comprises: an obtaining module, a processing module, and a determining module; the obtaining module is configured to obtain a to-be-recognized image, the to-be-recognized image comprising a target object, the target object being a ship; The processing module is configured to perform image processing on the to-be-recognized image to obtain a key part of the target object, perform cropping processing on the to-be-recognized image based on the key part of the target object to obtain a key image, perform image recognition on the key image to obtain a position of a target key point in the key image, align the position of the target key point in the key image with a position of a preset key point in a preset image to obtain a target image, and the target image includes the key part of the target object, the target key point is a key point included in the key part of the target object, the preset key point is a key point included in the preset image, and the preset image corresponds to a type of the key part of the target object. The determination module is configured to determine that the target object is abnormal when the first identifier is different from the second identifier, the first identifier is an identifier corresponding to a target feature, the target feature is a feature in the feature library that has the greatest similarity to a feature of the target image, and the second identifier is an identifier included in the to-be-recognized image. The determination module is further configured to, when the first identifier is the same as the second identifier, determine at least one feature corresponding to the second identifier in the feature library, and determine that the identifier of the target object is the second identifier and that the target object is normal when a similarity between the at least one feature and the feature of the target image is greater than or equal to a preset similarity threshold.
6. The abnormality determination apparatus according to claim 5, wherein The determination module is further configured to determine an appearance type of the key part of the target object. The determination module is further configured to determine the preset image based on the appearance type of the key part of the target object and a preset correspondence relationship, and the preset correspondence relationship includes appearance types of a plurality of key parts and images corresponding to the appearance types of the plurality of key parts, respectively.
7. The abnormality determination apparatus according to claim 5, wherein The acquisition module is further configured to acquire a plurality of images. The processing module is further configured to input the plurality of images into a feature extraction network to obtain a feature of each image in the plurality of images. The processing module is further configured to generate the feature library based on the feature of each image.
8. The abnormality determination apparatus according to any one of claims 5-7, wherein The processing module is further configured to perform image recognition on the to-be-recognized image to obtain the second identifier.
9. An electronic device, comprising: The electronic device includes: a processor; a memory configured to store instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the abnormality determination method of any one of claims 1-4.
10. A computer-readable storage medium having stored thereon instructions, the instructions comprising, When the instructions in the computer-readable storage medium are executed by the electronic device, the electronic device can perform the abnormality determination method of any one of claims 1-4.
Citation Information
Patent Citations
Training sample generation method and device, image processing method and device, equipment and medium
CN112101257A
Object authentication method, device and system
CN114666142A