Image detection method and device

By obtaining the image and model information to be tested, querying the reference image database and comparing the characteristics, the problem of risk of generating screenshots by detecting software simulators in the prior art is solved, and fast and accurate screenshot risk detection is achieved, reducing the cost and work of manual identification quantity.

CN119180970APending Publication Date: 2024-12-24ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411303288.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and accurately detect whether there is a risk in virtual screenshots generated by software simulators, resulting in high labor costs and high costs for manual identification, and it is difficult to determine whether there is a risk in screenshots.

Method used

By obtaining the image to be tested and its corresponding model information, querying the reference image database, obtaining the interface identifier characteristics, and identifying and comparing them based on the characteristics, to determine whether the screenshot meets the pre-set risk detection conditions.

Benefits of technology

It realizes rapid and accurate detection of screenshots whether there is a risk, reduces the workload and cost of manual identification, and improves the accuracy and efficiency of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119180970A_ABST
    Figure CN119180970A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image detection method and device. In the embodiment of the invention, a to-be-detected image and corresponding model information are acquired; querying at least one reference image in a reference image database; obtaining at least one first interface marker of each reference image; performing marker identification on the to-be-detected image according to at least one first interface marker, and determining at least one second interface marker in the to-be-detected image; obtaining a first feature of the at least one first interface marker and a second feature of the at least one second interface marker corresponding to the first feature; and in response to the condition that the first features of all the first markers in any reference image and the second features of all the second markers in the to-be-detected image conform to a preset risk detection condition, determining that the to-be-detected image has no risk. By means of the method, the screenshot provided by the user can be rapidly and accurately detected, and whether the screenshot has risks or not is judged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and more specifically, to an image detection method and device. Background Art

[0002] With the development of technology, online shopping and online payment have been integrated into people's daily lives. Some lawless elements use software simulators to generate virtual screenshots of shopping software, payment software or chat software, and use the above virtual screenshots to defraud compensation from shopping platforms or merchants and illegally obtain economic benefits.

[0003] In the prior art, manual identification is used to determine whether the screenshots provided by users pose risks. However, since the virtual screenshots generated by the software simulator are very similar to the screenshots of the above-mentioned shopping software, payment software or chat software, there may only be detailed error checking, and it may be difficult to determine whether the screenshots pose risks through manual identification. In addition, the number of screenshots is huge, resulting in a large workload for manual identification and high labor costs.

[0004] To sum up, how to quickly and accurately detect the screenshots provided by users and determine whether the screenshots contain risks is a problem that needs to be solved at present. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides an image detection method and device, which can quickly and accurately detect screenshots provided by users and determine whether the screenshots contain risks.

[0006] In a first aspect, an embodiment of the present invention provides an image detection method, the method comprising:

[0007] Obtaining an image to be tested and model information corresponding to the image to be tested;

[0008] Querying at least one reference image in a reference image database according to the image to be tested and the model information, wherein the reference image is a comparison image of the image to be tested;

[0009] Acquire at least one first interface marker of each of the reference images;

[0010] Performing marker recognition on the image to be tested according to the at least one first interface marker to determine at least one second interface marker in the image to be tested;

[0011] Acquire a first feature of the at least one first interface marker and a second feature of the at least one second interface marker corresponding thereto;

[0012] In response to the first features of all first markers in any reference image and the second features of all second markers in the image to be tested meeting a preset risk detection condition, it is determined that the image to be tested is risk-free.

[0013] Optionally, the model information includes a terminal model and / or an application version model.

[0014] Optionally, querying at least one reference image in a reference image database according to the image to be tested and the model information specifically includes:

[0015] Determining the interface type of the image to be tested;

[0016] At least one reference image is queried in the reference image database according to at least one of the interface type, the terminal model, and the application version model.

[0017] Optionally, the method further includes:

[0018] Image preprocessing is performed on the reference image and the image to be tested.

[0019] Optionally, the performing image preprocessing on the reference image and the image to be tested specifically includes:

[0020] Acquire size information of the reference image;

[0021] In response to the size information of the image to be tested being different from the size information of the reference image, the image to be tested is adjusted according to the size information of the reference image to generate an image to be tested having the same size information as the reference image.

[0022] Optionally, the performing image preprocessing on the reference image and the image to be tested specifically includes:

[0023] The reference image and the image to be tested are subjected to color conversion to generate the reference image and the image to be tested after color conversion.

[0024] Optionally, the first features include edge detection features, shape description features, key point features, vector features based on deep learning networks, geometric transformation and normalized image features, color features and texture features.

[0025] Optionally, the risk detection condition includes:

[0026] Euclidean distance threshold, Manhattan distance threshold, cosine similarity threshold, cross entropy threshold, principal component analysis threshold, Hausdorff distance threshold, color histogram distance threshold, keypoint matching threshold, mean absolute error, and feature difference threshold.

[0027] In a second aspect, an embodiment of the present invention provides an image detection device, the device comprising:

[0028] An acquisition unit, used for acquiring an image to be tested and model information corresponding to the image to be tested;

[0029] A query unit, configured to query at least one reference image in a reference image database according to the image to be tested and the model information, wherein the reference image is a comparison image of the image to be tested;

[0030] The acquisition unit is further used to: acquire at least one first interface marker of each reference image;

[0031] an identification unit, configured to perform identification on the image to be tested according to the at least one first interface marker, and determine at least one second interface marker in the image to be tested;

[0032] The acquisition unit is further used to: acquire a first feature of the at least one first interface marker and a second feature of the at least one second interface marker corresponding thereto;

[0033] The detection unit is used to determine that the image to be tested is risk-free in response to the first features of all the first markers in any reference image and the second features of all the second markers in the image to be tested meeting a preset risk detection condition.

[0034] Optionally, the model information includes a terminal model and / or an application version model.

[0035] Optionally, the query unit is specifically used to:

[0036] Determining the interface type of the image to be tested;

[0037] At least one reference image is queried in the reference image database according to at least one of the interface type, the terminal model, and the application version model.

[0038] Optionally, the device further includes a processing unit configured to perform image preprocessing on the reference image and the image to be tested.

[0039] Optionally, the processing unit is specifically used for:

[0040] Acquire size information of the reference image;

[0041] In response to the size information of the image to be tested being different from the size information of the reference image, the image to be tested is adjusted according to the size information of the reference image to generate an image to be tested having the same size information as the reference image.

[0042] Optionally, the processing unit is specifically used for:

[0043] The reference image and the image to be tested are subjected to color conversion to generate the reference image and the image to be tested after color conversion.

[0044] Optionally, the first features include edge detection features, shape description features, key point features, vector features based on deep learning networks, geometric transformation and normalized image features, color features and texture features.

[0045] Optionally, the risk detection condition includes:

[0046] Euclidean distance threshold, Manhattan distance threshold, cosine similarity threshold, cross entropy threshold, principal component analysis threshold, Hausdorff distance threshold, color histogram distance threshold, keypoint matching threshold, mean absolute error, and feature difference threshold.

[0047] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, the memory being used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement a method as described in the first aspect or any possible embodiment of the first aspect.

[0048] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement a method as described in the first aspect or any possible embodiment of the first aspect.

[0049] In an embodiment of the present invention, by obtaining an image to be tested and model information corresponding to the image to be tested; querying at least one reference image in a reference image database according to the image to be tested and the model information, wherein the reference image is a comparison image of the image to be tested; obtaining at least one first interface marker of each reference image; performing marker identification on the image to be tested according to the at least one first interface marker, and determining at least one second interface marker in the image to be tested; obtaining a first feature of the at least one first interface marker and a second feature of the at least one second interface marker corresponding thereto; in response to the first feature of all first markers in any reference image and the second feature of all second markers in the image to be tested meeting a pre-set risk detection condition, determining that the image to be tested is risk-free. Through the above method, the screenshots provided by the user can be quickly and accurately detected to determine whether the screenshots have risks. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:

[0051] Figure 1 is a flow chart of an image detection method in an embodiment of the present invention;

[0052] Figure 2 is a schematic diagram of an image to be tested in an embodiment of the present invention;

[0053] Figure 3 is another schematic diagram of an image to be tested in an embodiment of the present invention;

[0054] Figure 4 is a flow chart of a generation process of a reference image database in an embodiment of the present invention;

[0055] Figure 5 is a schematic diagram of a reference image with a mark in an embodiment of the present invention;

[0056] Figure 6 is another schematic diagram of a reference image with a mark in an embodiment of the present invention;

[0057] Figure 7 is a schematic diagram of another reference image with a mark in an embodiment of the present invention;

[0058] Figure 8 is a schematic diagram of a reference image in an embodiment of the present invention;

[0059] Fig. 9 is a flow chart of another method for image detection in an embodiment of the present invention;

[0060] Fig.10 is a schematic diagram of another image detection device in an embodiment of the present invention;

[0061] Fig.11 is a schematic diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0062] The present application is described below based on embodiments, but the present application is not limited to these embodiments. In the detailed description of the present application below, some specific details are described in detail. It is possible for those skilled in the art to fully understand the present application without the description of these details. In order to avoid confusing the essence of the present application, known methods, processes, flows, components and circuits are not described in detail.

[0063] In addition, persons of ordinary skill in the art will appreciate that the drawings provided herein are for illustration purposes and are not necessarily drawn to scale.

[0064] Unless the context clearly requires otherwise, the words "including", "comprising" and the like throughout the application document should be interpreted as inclusive rather than exclusive or exhaustive; that is, as "including but not limited to". In the description of this application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.

[0065] In the prior art, the main function of a software simulator is to simulate the interface of a specific software by highly emulated means, for example, a shopping software simulator, a payment software simulator or a chat software simulator. The shopping software simulator, the payment software simulator or the chat software simulator can simulate the actual user interface of the shopping software, the payment software or the chat software, and the user can experience its visual and operational effects without actually logging into the shopping software, the payment software or the chat software; the software simulator can be an application, a mini-program, a web page, or a complex algorithm. The original intention of creating the simulator is to provide a convenient way for display, teaching, design or testing purposes, but criminals use software simulators to generate virtual screenshots of shopping software, payment software or chat software, and use the above virtual screenshots to defraud compensation from shopping platforms or merchants, thereby illegally obtaining economic benefits.

[0066] The above-mentioned behavior of defrauding compensation through virtual screenshots not only causes financial losses to the platform or merchants, but also seriously damages the fairness and integrity of the e-commerce industry, causing great troubles to the platform, merchants and consumers; in addition, merchants may also lose their reputation and customers; consumers’ rights may question the management level and legitimacy of the platform, thereby causing distrust of the platform. Since the virtual screenshots generated by the software simulator are very similar to the screenshots of the shopping software, payment software or chat software, there may only be detailed error checking, and it may be difficult to determine whether the screenshots are risky through manual identification. In addition, the number of screenshots is huge, resulting in a relatively large workload for manual identification and high labor costs. Therefore, how to quickly and accurately detect the screenshots provided by users and determine whether the screenshots are risky is a problem that needs to be solved at present.

[0067] In order to solve the above problems, an image detection method is proposed in the embodiment of the present invention. Figure 1 As shown, the method includes:

[0068] Step S101: Acquire an image to be tested and model information corresponding to the image to be tested.

[0069] Specifically, the model information includes the terminal model and / or the application version model.

[0070] In a possible implementation, the terminal is a mobile phone, tablet or computer on which an application is installed; assuming that the terminal is a mobile phone, the terminal model is different models of the mobile phone, for example, model a, model b, model c of brand A; model d, model e, model f of brand B; model g, model h, model i of brand C, etc. This is only an exemplary description and will be determined based on actual conditions.

[0071] In a possible implementation, the application version model is a model corresponding to different versions of each application. For example, the application is a shopping software, and the version model of the shopping software is version 1.0, version 2.0, and version 3.0; the application is a payment software, and the version model of the payment software is version 3.0.1, version 3.0.2, and version 3.0.3; the application is a chat software, and the version model of the chat software is version 8.1.1, version 8.2.1, version 8.3.1, etc. This is only an exemplary description and will be determined based on actual conditions.

[0072] In the embodiment of the present invention, the image to be tested is provided by the user, and may be a screenshot of various interfaces of an application, may be a chat interface, or may be other images that require risk testing.

[0073] For example, assuming that the image to be tested is a payment interface, Figure 2 As shown, it includes time, power display, store, payment amount "-6.00", current status: payment successful, payment time: June 26, 2024 21:09:08, product: parking payment, product name, acquiring institution, payment method, transaction order number, merchant order number, merchant mini program, billing service: doubts about the order, initiating group collection, transactions at this merchant, contacting the merchant, merchant phone number and some identification information, such as merchant identification, signal identification, etc.; assuming that the image to be tested is the chat interface of the chat software, as shown in the figure. Figure 3 As shown, including: time, battery level, chat partner name, user avatar, user chat text "111", "222" and some identification information, such as signal identification, positioning identification, etc. This is only an exemplary description. The schematic diagrams of different interfaces of different terminal models and / or application version models are different, which will be determined based on actual conditions.

[0074] Step S102: query at least one reference image in a reference image database according to the image to be tested and the model information, wherein the reference image is a comparison image of the image to be tested.

[0075] Specifically, the interface type of the image to be tested is determined; and at least one reference image is searched in the reference image database according to at least one of the interface type, the terminal model, and the application version model.

[0076] In an embodiment of the present invention, the reference image database includes multiple reference images, and includes the interface type of each reference image, the terminal model and / or application version model corresponding to the reference image; the reference image is queried in the reference image database according to the interface type of the image to be tested, the terminal model and / or application version model of the image to be tested.

[0077] Specifically, a reference image is queried in a reference image database according to the interface type of the image to be tested; or, a reference image is queried in a reference image database according to the terminal model of the image to be tested; or, a reference image is queried in a reference image database according to the application version model of the image to be tested; or, a reference image is queried in a reference image database according to the interface type and the terminal model of the image to be tested; a reference image is queried in a reference image database according to the interface type and the application version model of the image to be tested; a reference image is queried in a reference image database according to the terminal model and the application version model of the image to be tested; a reference image is queried in a reference image database according to the interface type, the terminal signal and the application version model of the image to be tested; in an extreme case, a reference image is queried in the reference image database only according to the interface to be tested; the queried reference images may be one or more.

[0078] In a possible implementation, the generation process of the reference image database is as follows: Figure 4 As shown, the specific process includes the following:

[0079] Step S401: Acquire multiple reference images of different interface types, different terminal models, and different application version models.

[0080] Wherein, the reference image is a real and reliable screenshot or image.

[0081] Step S402: Determine the interface marker of each reference image.

[0082] Specifically, assuming that the reference image is a payment interface, the interface identifier is as follows: Figure 5As shown in the dotted box, it includes time, power display, store, payment amount "-56.00", current status: payment successful, payment time: August 26, 2024 11:19:28, product: lunch set, product name, acquiring institution, payment method, transaction order number, merchant order number, merchant mini program, billing service: doubts about the order, initiating group collection, transactions at this merchant, contacting the merchant, merchant phone number and some identification information, such as merchant identification, signal identification, etc.; the interface identifiers are "×" and "all bills"; the reference image is a chat interface, and the interface identifiers are as follows: Figure 6 As shown in the dashed box, the interface markers are “<” and “…”; the reference image is another payment interface, and the interface markers are Figure 7 As shown in the dotted box, the interface markers are "<", "All bills" and "Transfer another transaction"; the position and quantity of the interface markers of each reference image are determined according to the actual situation, and the alignment of the embodiment of the present invention is not limited.

[0083] Step S403: save a plurality of the reference images and their corresponding interface identifiers, interface types, terminal models and application version models to generate a reference image database.

[0084] In a possible implementation manner, if only at least one of the interface type, terminal model, and application version model is obtained, only the at least one item is saved in the reference image database.

[0085] In a possible implementation, if the interface type, terminal model, and application version model are not obtained, only the reference image is saved in the reference image database.

[0086] In the embodiment of the present invention, the reference image database is constructed in the above manner for risk identification of the image to be tested.

[0087] Step S103: Acquire at least one first interface marker of each of the reference images.

[0088] Specifically, at least one interface marker of the reference image is obtained in the reference image database. Assume that the reference image is a payment interface. Figure 5 As shown, there are 2 markers.

[0089] Step S104: perform marker recognition on the image to be tested according to the at least one first interface marker, and determine at least one second interface marker in the image to be tested.

[0090] Specifically, the template matching function cv2.matchTemplate or other image matching functions are used to detect the second interface marker from the image to be tested, and the second interface marker is recorded.

[0091] In a possible implementation, the method for detecting the second interface marker is as follows:

[0092] Method 1: Use an interface marker detection method based on key point matching, where the features of the key points include: Oriented FAST and Rotated BRIEF (ORB), Scale-Invariant Feature Transform (SIFT), and Speeded-Up Robust Features (SURF).

[0093] Method 2: Use image matching algorithms, such as watershed algorithm, contour detection, etc.

[0094] Method 3: Use deep learning-based methods, based on convolutional neural network (CNN) object detection, use deep learning frameworks such as TensorFlow, PyTorch, Keras, etc., to train customized object detection models; for example, YOLO (You Only Look Once), Single Shot MultiBox Detector (SSD), Faster R-CNN, etc.

[0095] Method 4: Use existing functions of other computer vision libraries, such as Dlib and scikit-image.

[0096] Method 5: Use an image registration-based method to match templates by aligning images. This method is usually used for medical imaging or remote sensing image analysis and can be implemented in skimage or other scientific computing libraries.

[0097] Method 6: Use the self-compiled implementation version of the above methods 1 to 5.

[0098] In a possible implementation, the corresponding second interface marker is determined in the image to be tested according to the first interface marker of the reference image. Assuming that the interface to be tested is as follows: Figure 2 As shown, according to the Figure 2 , a reference image is determined in the reference database, the reference image is as follows Figure 8 As shown, Figure 8 With the Figure 5The content is the same as Figure 8 There is no dashed box.

[0099] In a possible implementation, if the second interface marker is incomplete, the image to be tested is abnormal, and there is a risk of refusing to detect the image to be tested.

[0100] Step S105: Acquire a first feature of the at least one first interface marker and a second feature of the at least one second interface marker corresponding thereto.

[0101] In one possible implementation, the first feature and the second feature may be coordinate data, for example, the center position coordinates of the first interface marker are obtained, and the length, width, and height features thereof, as well as the position coordinates of the center position thereof in the reference image are determined based on the center position coordinates of the first interface marker; the center position coordinates of the second interface marker are obtained, and the length, width, and height features thereof, as well as the position coordinates of the center position thereof in the reference image are determined based on the center position coordinates of the second interface marker.

[0102] Specifically, the first feature and the second feature also include the following five methods:

[0103] Method 1: Edge detection features and shape description features. For example, Canny edge detection is a classic edge detection algorithm that can be used to identify the boundaries of objects in an image; Hough Transform is an algorithm used to detect specific shapes (e.g., straight lines, circles), which can help identify and locate specific markers.

[0104] Method 2: Key point features. Specifically, key point features are used as interface marker features, including: Oriented Fast and Rotated Simple ORB, which is a fast and effective feature point detection and description algorithm suitable for real-time applications; Scale Invariant Feature Transform SIFT, which is used to detect and describe local feature points and has scale and rotation invariance; Accelerated Robust Feature SURF, which is similar to SIFT and has improvements in computing speed.

[0105] Method 3: Vector features based on deep learning networks. Specifically, deep learning-based methods are used for feature extraction. For example, convolutional neural networks (CNNs) can be used to extract high-level features and perform complex recognition tasks in image classification and object detection. YOLO is a real-time target detection system that can be used to identify and locate multiple objects in an image. Faster R-CNN is a deep learning method based on region proposals for object detection and instance segmentation.

[0106] Method 4: Geometric transformation and normalization of image features. For example, principal component analysis (PCA) reduces the dimensionality of data and extracts the main features, which is often used for image feature description; image normalization scales image features to the same range for subsequent processing and analysis.

[0107] Method 5: color features and texture features, for example, color histogram, which counts the frequency of occurrence of different colors in the image as the color feature; Local Binary Pattern (LBP), which is used to describe the characteristics of image texture and is often used for texture classification; Gabor filter, which is used to extract texture features in the image.

[0108] Step S106: In response to the first features of all first markers in any reference image and the second features of all second markers in the image to be tested meeting a preset risk detection condition, determining that the image to be tested is risk-free.

[0109] In one possible implementation, the risk detection conditions include: Euclidean distance threshold, Manhattan distance threshold, cosine similarity threshold, cross entropy threshold, principal component analysis threshold, Hausdorff distance threshold, color histogram distance threshold, key point matching threshold, mean absolute error and feature difference threshold.

[0110] Specifically, the difference between the first feature and the second feature is calculated through the risk detection condition, and whether the image to be tested is risk-free or not is judged based on the difference; although the software simulator can simulate screenshots of various applications in different interfaces, the interface of the real application will change with the version, and it is difficult for the software simulator to keep up with the version changes, and it is difficult for the software simulator to adapt to all terminal models. Therefore, the interface performance on a specific model may be different from that of the real software. The above reasons will cause detail errors in the image to be tested generated by the software simulator, and the detail errors become the key to revealing false images.

[0111] In a possible implementation, when the first feature and the second feature can be coordinate data, the difference between the first feature and the second feature is determined. Assuming that the difference is a height difference, the ratio of the difference to the side length in the corresponding direction of the reference image is calculated, that is, the ratio of the height difference to the height of the reference image; if the difference is a width difference, the ratio of the difference to the side length in the corresponding direction of the reference image is calculated, that is, the ratio of the width difference to the width of the reference image; in response to the ratio being greater than a first set threshold and less than a second set threshold, it is determined that the consistency test has not passed and there is a risk in the image to be tested; in response to the ratio being less than the first set threshold, it is determined that the consistency test has passed and there is no risk in the image to be tested; in response to the ratio being greater than the second set threshold, it is determined that the consistency test has passed and there is no risk in the image to be tested; in response to the ratio being greater than the second set threshold, it is determined that the consistency test has failed; the threshold or detection condition here is determined according to actual conditions, and the embodiments of the present invention do not limit it.

[0112] In a possible implementation, when other calculation methods are used to calculate feature differences, the details are as follows:

[0113] 1. Euclidean distance threshold, wherein the Euclidean distance can be used to calculate the difference between feature vectors and is suitable for multi-dimensional feature vectors.

[0114] 2. Manhattan distance threshold (Manhattan Distance), wherein the Manhattan distance is also called L1 distance, which calculates the sum of the absolute differences of the feature vector components.

[0115] 3. Cosine Similarity Threshold, wherein the cosine similarity can be used to measure the directional similarity of two vectors instead of the amplitude.

[0116] 4. Cross-Entropy Threshold (Cross-Entropy), wherein the cross-entropy is mostly used for comparison of probability distribution and is suitable for considering the distribution of features.

[0117] 5. Principal Component Analysis (PCA) threshold, wherein the principal component analysis threshold can reduce the dimension of high-dimensional features to facilitate the calculation of differences.

[0118] 6. Hausdorff distance threshold, used to measure the distance between two sets (such as point sets), is suitable for contour matching in images.

[0119] 7. Color Histogram Distance Threshold (Color Histogram), used to calculate and compare the differences in image color distribution. The specific calculation method is to construct the color histogram of the image and calculate the distance between the histograms, such as using the chi-square distance or Bhattacharyya distance.

[0120] 8. Key point matching threshold, in which methods such as SIFT and SURF are used to extract and match feature points of the image.

[0121] 9. Mean Absolute Error

[0122] In the embodiment of the present invention, before step S105 of acquiring the first feature and the second feature, other steps are also included, specifically as follows: Fig. 9 As shown, including:

[0123] Step S107: performing image preprocessing on the reference image and the image to be tested.

[0124] Specifically, the size information of the reference image is obtained; in response to the size information of the image to be tested being different from the size information of the reference image, the image to be tested is adjusted according to the size information of the reference image to generate an image to be tested having the same size information as the reference image.

[0125] In a possible implementation, the reference image and the image to be tested may be partially cropped so that only the image including the interface markers can be compared.

[0126] In a possible implementation manner, the performing image preprocessing on the reference image and the image to be tested specifically further includes: performing color conversion on the reference image and the image to be tested to generate the reference image and the image to be tested after color conversion.

[0127] Specifically, the color conversion includes color inversion (for example, converting a day mode into a night mode), or performing grayscale processing on the image to be tested and the reference image to convert the image to be tested and the reference image into grayscale images.

[0128] In the embodiment of the present invention, the above step S107 can be set at any position after step S102 and before step S105. Fig. 9 This is just one of the possibilities, and other situations are not shown.

[0129] Through the above embodiments, when a screenshot of the image to be tested of a known terminal model and / or the application version model is obtained, the corresponding reference image can be obtained by retrieving the reference image data set, and on this basis, a risk check is performed on the image to be tested to determine whether there is a risk generated by the software simulator. The risk detection can detect slight differences in the images generated by the software simulator, with low computational cost, high operating efficiency, strong interpretability and high accuracy.

[0130] In an embodiment of the present invention, a device for image detection is provided, such as Fig.10 As shown, it specifically includes: an acquisition unit 1001, a query unit 1002, an identification unit 1003 and a detection unit 1004; wherein the acquisition unit 1001 is used to acquire the image to be tested and the model information corresponding to the image to be tested; the query unit 1002 is used to query at least one reference image in the reference image database according to the image to be tested and the model information, wherein the reference image is a comparison image of the image to be tested; the acquisition unit 1001 is also used to: acquire at least one first interface marker of each of the reference images; the identification unit 1003 is used to perform marker identification on the image to be tested according to the at least one first interface marker, and determine at least one second interface marker in the image to be tested; the acquisition unit 1001 is also used to: acquire a first feature of the at least one first interface marker and a second feature of the at least one second interface marker corresponding thereto; the detection unit 1004 is used to determine that the image to be tested is risk-free in response to the first feature of all the first markers in any reference image and the second feature of all the second markers in the image to be tested meeting a preset risk detection condition.

[0131] Furthermore, the model information includes a terminal model and / or an application version model.

[0132] Furthermore, the query unit is specifically used for:

[0133] Determining the interface type of the image to be tested;

[0134] At least one reference image is queried in the reference image database according to at least one of the interface type, the terminal model, and the application version model.

[0135] Furthermore, the device also includes a processing unit, which is used to perform image preprocessing on the reference image and the image to be tested.

[0136] Furthermore, the processing unit is specifically used for:

[0137] Acquire size information of the reference image;

[0138] In response to the size information of the image to be tested being different from the size information of the reference image, the image to be tested is adjusted according to the size information of the reference image to generate an image to be tested having the same size information as the reference image.

[0139] Furthermore, the processing unit is specifically used for:

[0140] The reference image and the image to be tested are subjected to color conversion to generate the reference image and the image to be tested after color conversion.

[0141] Furthermore, the first features include edge detection features, shape description features, key point features, vector features based on deep learning networks, geometric transformation and normalized image features, color features and texture features.

[0142] Furthermore, the risk detection conditions include:

[0143] Euclidean distance threshold, Manhattan distance threshold, cosine similarity threshold, cross entropy threshold, principal component analysis threshold, Hausdorff distance threshold, color histogram distance threshold, keypoint matching threshold, mean absolute error, and feature difference threshold.

[0144] Fig.11 Schematic diagram of the structure of the electronic device in the embodiment of the present invention. Fig.11 As shown, it includes a general computer hardware structure, which at least includes a processor 1101 and a memory 1102. The processor 1101 and the memory 1102 are connected via a bus 1103. The memory 1102 is suitable for storing instructions or programs executable by the processor 1101. The processor 1101 can be an independent microprocessor or a collection of one or more microprocessors. Thus, the processor 1101 executes the instructions stored in the memory 1102, thereby executing the method flow of the embodiment of the present invention as described above to realize the processing of data and the control of other devices. The bus 1103 connects the above-mentioned multiple components together, and at the same time connects the above-mentioned components to the display controller 1104 and the display device and the input / output (I / O) device 1105. The input / output (I / O) device 1105 can be a mouse, a keyboard, a modem, a network interface, a touch input device, a somatosensory input device, a printer, and other devices known in the art. Typically, the input / output device 1105 is connected to the system through an input / output (I / O) controller 1106.

[0145] Among them, the instructions stored in the memory 1102 are executed by at least one processor 1101 to achieve: obtaining the image to be tested and the model information corresponding to the image to be tested; querying at least one reference image in the reference image database according to the image to be tested and the model information, wherein the reference image is a comparison image of the image to be tested; obtaining at least one first interface marker of each of the reference images; performing marker identification on the image to be tested according to the at least one first interface marker, and determining at least one second interface marker in the image to be tested; obtaining a first feature of the at least one first interface marker and a second feature of the at least one second interface marker corresponding thereto; in response to the first feature of all the first markers in any reference image and the second feature of all the second markers in the image to be tested meeting a preset risk detection condition, determining that the image to be tested is risk-free.

[0146] Specifically, the electronic device includes: one or more processors 1101 and a memory 1102, Fig.11 Take a processor 1101 as an example. The processor 1101 and the memory 1102 may be connected via a bus or other means. Fig.11 The bus connection is taken as an example. The memory 1102 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The processor 1101 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory 1102, that is, the above-mentioned method for determining image detection is implemented.

[0147] The memory 1102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store a list of options, etc. In addition, the memory 1102 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 1102 may optionally include a memory remotely arranged relative to the processor 1101, and these remote memories may be connected to an external device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0148] One or more modules are stored in the memory 1102, and when executed by one or more processors 1101, the image detection method in any of the above method embodiments is executed.

[0149] As will be appreciated by those skilled in the art, various aspects of the embodiments of the present invention may be implemented as a system, method or computer program product. Therefore, various aspects of the embodiments of the present invention may take the form of a complete hardware implementation, a complete software implementation (including firmware, resident software, microcode, etc.), or an implementation that combines software aspects with hardware aspects, which may generally be referred to herein as a "circuit," "module," or "system." In addition, various aspects of the embodiments of the present invention may take the form of a computer program product implemented in one or more computer-readable media having a computer-readable program code implemented thereon.

[0150] Any combination of one or more computer-readable media can be utilized. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, (but not limited to) electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or apparatuses, or any suitable combination of the foregoing. More specific examples (non-exhaustive enumeration) of computer-readable storage media will include the following: an electrical connection with one or more wires, a portable computer floppy disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of an embodiment of the present invention, a computer-readable storage medium can be any tangible medium that can contain or store a program used by an instruction execution system, device or apparatus or a program used in conjunction with an instruction execution system, device or apparatus.

[0151] A computer readable signal medium may include a propagated digital signal having a computer readable program code implemented therein, such as in baseband or as part of a carrier wave. Such propagated signals may take any of a variety of forms, including but not limited to electromagnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any of the following computer readable media: not a computer readable storage medium, and may communicate, propagate, or transmit a program used by or in conjunction with an instruction execution system, device, or apparatus.

[0152] Program code embodied on a computer readable medium may be transmitted using any appropriate medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0153] The computer program code for performing operations for various aspects of the embodiments of the present invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, Smalltalk, C++, etc., and conventional process programming languages ​​such as "C" programming language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer as a stand-alone software package; partially on the user's computer and partially on a remote computer; or completely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., by using the Internet of an Internet service provider).

[0154] The flowchart legend and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present invention described above describe various aspects of the embodiment of the present invention.It will be understood that each block of the flowchart legend and / or block diagram and the combination of the blocks in the flowchart legend and / or block diagram can be implemented by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that the instructions (executed by the processor of the computer or other programmable data processing device) create a device for implementing the function / action specified in the flowchart and / or block diagram block or block.

[0155] These computer program instructions may also be stored in a computer-readable medium that can direct a computer, other programmable data processing device, or other apparatus to operate in a particular manner, so that the instructions stored in the computer-readable medium produce an article of manufacture including instructions for implementing the functions / actions specified in the flowchart and / or block diagram blocks or blocks.

[0156] The computer program instructions may also be loaded onto a computer, other programmable data processing device or other apparatus so that a series of operable steps are performed on the computer, other programmable device or other apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide a process for implementing the functions / actions specified in the flowchart and / or block diagram block or blocks.

[0157] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

[0158] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portals for users to choose to authorize or refuse. Users' refusal to process personal information other than the necessary information required for basic functions will not affect the user's use of basic functions.

Claims

1. A method for image detection, characterized in that: The method comprises: Obtaining an image to be tested and model information corresponding to the image to be tested; Querying at least one reference image in a reference image database according to the image to be tested and the model information, wherein the reference image is a comparison image of the image to be tested; Acquire at least one first interface marker of each of the reference images; Performing marker recognition on the image to be tested according to the at least one first interface marker to determine at least one second interface marker in the image to be tested; Acquire a first feature of the at least one first interface marker and a second feature of the at least one second interface marker corresponding thereto; In response to the first features of all first markers in any reference image and the second features of all second markers in the image to be tested meeting a preset risk detection condition, it is determined that the image to be tested is risk-free.

2. The method according to claim 1, characterized in that: The model information includes the terminal model and / or the application version model.

3. The method according to claim 2, characterized in that The step of searching at least one reference image in a reference image database according to the image to be tested and the model information specifically includes: Determining the interface type of the image to be tested; At least one reference image is queried in the reference image database according to at least one of the interface type, the terminal model, and the application version model.

4. The method according to claim 1, characterized in that The method further comprises: Image preprocessing is performed on the reference image and the image to be tested.

5. The method according to claim 4, characterized in that The performing image preprocessing on the reference image and the image to be tested specifically includes: Acquire size information of the reference image; In response to the size information of the image to be tested being different from the size information of the reference image, the image to be tested is adjusted according to the size information of the reference image to generate an image to be tested having the same size information as the reference image.

6. The method according to claim 4, characterized in that The performing image preprocessing on the reference image and the image to be tested specifically includes: The reference image and the image to be tested are subjected to color conversion to generate the reference image and the image to be tested after color conversion.

7. The method according to claim 1, characterized in that The first features include edge detection features, shape description features, key point features, vector features based on deep learning networks, geometric transformation and normalized image features, color features and texture features.

8. The method according to claim 1, characterized in that: The risk detection conditions include: Euclidean distance threshold, Manhattan distance threshold, cosine similarity threshold, cross entropy threshold, principal component analysis threshold, Hausdorff distance threshold, color histogram distance threshold, keypoint matching threshold, mean absolute error, and feature difference threshold.

9. An image detection device, characterized in that: The device comprises: An acquisition unit, used for acquiring an image to be tested and model information corresponding to the image to be tested; A query unit, configured to query at least one reference image in a reference image database according to the image to be tested and the model information, wherein the reference image is a comparison image of the image to be tested; The acquisition unit is further used to: acquire at least one first interface marker of each reference image; an identification unit, configured to perform identification on the image to be tested according to the at least one first interface marker, and determine at least one second interface marker in the image to be tested; The acquisition unit is further used to: acquire a first feature of the at least one first interface marker and a second feature of the at least one second interface marker corresponding thereto; The detection unit is used to determine that the image to be tested is risk-free in response to the first features of all the first markers in any reference image and the second features of all the second markers in the image to be tested meeting a preset risk detection condition.

10. An electronic device comprising a memory and a processor, characterized in that: The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer readable storage The medium stores a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.