Financial scenario legality verification method and device

By performing face segmentation and pixel block removal during facial recognition and calculating background image similarity, the problem of financial crime gangs being unable to prevent crimes before they are committed is solved, and the legitimacy of financial scenarios is verified.

CN116189090BActive Publication Date: 2026-02-27ZHAOLIAN CONSUMER FINANCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310162300.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-15
Publication Date
2026-02-27
Estimated Expiration
2043-02-15

AI Technical Summary

Technical Problem

Financial crime gangs cannot be identified in time before committing crimes. Current technology can only track the illegal operations of the targets, but cannot prevent them.

Method used

During face recognition, a semantic segmentation model is used to segment the face and remove pixel blocks, calculate the similarity of the background image, and determine whether multiple people are operating in the same location.

Benefits of technology

This enables the early identification of potential financial crime risks during facial recognition, thereby improving prevention capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116189090B_ABST
    Figure CN116189090B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a financial scene legality verification method and device, the method comprising: obtaining a first target image and a plurality of first comparison images, the first target image comprising at least one portrait; performing portrait segmentation processing on the first target image to obtain a second target image; performing pixel block removal on a position of at least one first pixel block in the second target image to obtain a third target image; calculating the similarity between the third target image and each of the plurality of first comparison images, and determining a second comparison image from the plurality of first comparison images that has a similarity greater than a first preset threshold value with the third target image; and if the number of second comparison images is not greater than a second preset threshold value, determining that the first target image is a legal scene. The foregoing method can directly match the similarity of background images according to portrait images.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of general image data processing, in particular to a financial scenario legality verification method and device. BACKGROUND

[0002] At present, financial crimes have been emerging in an endless stream, and most of the financial crimes are gang crimes, and most people in a gang will commit crimes at a unified location. The financial company cannot determine the abnormal account of the target person before the target person commits a crime, and can only determine whether the target person has risks through the irregular operation of the target person. However, even if the irregular operation of the target person is tracked down, the target person has already completed the crime and fled, and it is impossible to prevent the target person from committing a crime in advance. SUMMARY

[0003] The embodiments of the present application provide a financial scenario legality verification method and device. The portrait background of a target person can be recognized when the target person performs face recognition, and it is determined whether the portrait background of the target person is similar to the portrait backgrounds of other target persons according to the portrait background of the target person, whether the multiple target persons perform financial operations at the same location is determined, and the target person is prevented in advance.

[0004] In a first aspect, the embodiments of the present application provide a financial scenario legality verification method, which comprises the following steps:

[0005] Obtaining a first target image and a plurality of first comparison images, the first target image comprising at least one portrait;

[0006] Performing portrait segmentation processing on the first target image to obtain a second target image;

[0007] Performing pixel block removal on a position where at least one first pixel block in the second target image is located to obtain a third target image;

[0008] Calculating the similarity between the third target image and each of the plurality of first comparison images to determine a second comparison image in the plurality of first comparison images, the similarity between the third target image and the second comparison image being greater than a first preset threshold;

[0009] If the number of the second comparison images is not greater than a second preset threshold, determining that the first target image is a legal scenario.

[0010] It can be seen that in the embodiment of the present application, the first target image and the plurality of first contrast images are obtained, the first target image includes at least one portrait; the second target image is obtained by performing portrait segmentation processing on the first target image; the third target image is obtained by performing pixel block removal on the position of at least one first pixel block in the second target image; the similarity of the third target image and each first contrast image in the plurality of first contrast images is calculated, and the second contrast image in the plurality of first contrast images with a similarity greater than a first preset threshold to the third target image is determined; if the number of the second contrast image is not greater than a second preset threshold, it is determined that the first target image is a legal scene. By using the foregoing method, the similarity matching of the background image can be directly performed according to the portrait image, and the legality of the background is determined based on the number of similar background images, so that the customer corresponding to the portrait image can be prevented in advance.

[0011] In a feasible embodiment, the second target image is obtained by performing portrait segmentation on the first target image, including: performing portrait segmentation on the first target image according to a semantic segmentation model to obtain a first target sub-image after removing the portrait, the semantic segmentation model performing portrait segmentation through a semantic segmentation network; and filling the removed portrait part in the first target sub-image as first pixel points to obtain the second target image, the pixel value of the first pixel point being an average pixel value of other pixel points in the row where the first pixel point is located.

[0012] In the embodiment of the present application, the first target image is segmented by the semantic segmentation model, and the missing part of the segmented portrait is filled with the first pixel point. By using the foregoing method, a complete background image can be obtained, and the interference of the portrait part on the image similarity calculation is removed.

[0013] In a feasible embodiment, before the third target image is obtained by performing pixel block removal on the position of at least one first pixel block in the second target image, the method further includes: determining the number of pixel points and the size of the image in the second target image, and determining the first number and the first size of the first pixel block according to the number of pixel points in the second target image; determining the first average pixel value of all pixel points in the second target image; determining a plurality of second pixel blocks in the second target image according to the first size, the number of the plurality of second pixel blocks being greater than the first number; and taking the position of the first number of second pixel blocks with the closest average pixel value of the pixel points in each second pixel block in the plurality of second pixel blocks to the first average pixel value as the position of the at least one first pixel block.

[0014] In the embodiment of the present application, the first quantity and the first size of the first pixel block are determined according to the quantity of the pixel points in the second target image and the image size, and the position of the first pixel block is determined according to the first average pixel value of all the pixel points in the second target image. Since the second target image is an image after the portrait segmentation and the image filling processing, although the portrait segmentation and the image filling can eliminate the influence of the portrait on the background image similarity matching, the image background features of the second target image are also reduced based on the portrait segmentation and the image filling processing, and the embodiment can reduce the influence on the second target image after the portrait segmentation and the image filling processing on the basis of highlighting the local features of the second target image.

[0015] In a feasible embodiment, the first quantity and the first size of the first pixel block are determined according to the quantity of the pixel points in the second target image and the image size, including: judging whether the quantity of the pixel points in the second target image exceeds a second quantity.

[0016] If the quantity of the pixel points in the second target image does not exceed the second quantity, the first quantity and the first size of the first pixel block are determined according to the quantity of the pixel points in the second target image and the image size, so that the ratio between the quantity of the pixel points in the second target image and the first quantity is less than a first quantity ratio, the ratio between the image size of the second target image and the first size is less than a first size ratio, and the ratio between the image size of the second target image and the sum of the first sizes of all the first pixel blocks is less than a second size ratio.

[0017] If the quantity of the pixel points in the second target image exceeds the second quantity, the first quantity and the first size of the first pixel block are determined according to the quantity of the pixel points in the second target image and the image size, so that the ratio between the quantity of the pixel points in the second target image and the first quantity is less than a second quantity ratio, and the ratio between the image size of the second target image and the first size is less than a third size ratio; wherein the first quantity ratio is less than the second quantity ratio, and the first size ratio is less than the third size ratio.

[0018] In the embodiment of the present application, different determination conditions are set for the first quantity and the first size of the first pixel block by judging the quantity of the pixel points in the second target image, and the determination range set for the first quantity and the first size when the quantity of the pixel points in the second target image is greater than the second quantity is greater than the determination range set for the first quantity and the first size when the quantity of the pixel points in the second target image is not greater than the second quantity. It can be ensured that the proportion of the first pixel block in the second target image is not too large, and the negative influence of the first pixel block on the second target image in the image similarity calculation is avoided.

[0019] In one possible implementation, before obtaining the third target image by performing the pixel block removal on the position of the at least one first pixel block in the second target image, the method further includes: determining the number of pixels and the image size in the second target image, and determining the first number and the first size of the first pixel block according to the number of pixels in the second target image; determining a plurality of smooth regions in the second target image according to the pixel values of the pixels in the second target image, the smooth region being used to represent that the pixel value difference between adjacent pixels in the region is less than the first difference value;

[0020] If it is determined that the number of the plurality of smooth regions is greater than the first number, and the size of the smooth region in the plurality of smooth regions that is in the first number range after being sorted according to the size is greater than the first size, then the first number of smooth regions is selected according to the size of each smooth region in the plurality of smooth regions, and the center region of each region in the first number of smooth regions is selected as the position of the at least one first pixel block.

[0021] If it is determined that the number of the plurality of smooth regions is greater than the first number, and the size of the smooth region in the plurality of smooth regions that is in the first number position after being sorted according to the size is not greater than the first size, then the size of the smooth region in the plurality of smooth regions that is in the first number is determined as a new first size, and the first number of smooth regions is selected according to the size of each smooth region in the plurality of smooth regions, and the center region of each region in the first number of smooth regions is selected as the position of the at least one first pixel block.

[0022] If it is determined that the number of the plurality of smooth regions is not greater than the first number, then the first number of pixel blocks is selected as the position of the at least one first pixel block in the second target image in a scattered manner, so that the distance between adjacent pixel blocks in the at least one first pixel block is equal.

[0023] In the embodiments of the present application, after the first number and the first size of the first pixel block are determined according to the number of pixels and the image size in the second target image, the smooth regions in the second target image are determined, and the position of the first pixel block is selected according to the number and size of the smooth regions. By using the foregoing method, it can be ensured that the position of the first pixel block does not affect the prominent features in the image, highlights the local features of the image, and reduces the influence of the portrait segmentation and image filling processing on the second target image.

[0024] In an example, the similarity between the third target image and each of the plurality of first comparison images is calculated by: inputting the third target image and the plurality of first comparison images into the autoencoder, extracting features of the third target image and the plurality of first comparison images by an encoder in the autoencoder, taking the last layer of neurons of the encoder as feature vectors of the third target image and the plurality of first comparison images, and outputting the feature vectors of the third target image and the plurality of first comparison images by a decoder in the autoencoder; and calculating Euclidean distances based on the feature vectors of the third target image and the plurality of first comparison images, and determining the similarity between the third target image and each of the plurality of first comparison images based on the Euclidean distance calculation results, wherein the greater the Euclidean distance calculation result is, the smaller the similarity is.

[0025] In the example, the feature vectors of the third target image and the plurality of first comparison images are determined by the autoencoder, the Euclidean distance is calculated based on the feature vectors of each image, and the similarity between the third target image and each of the plurality of first comparison images is determined based on the Euclidean distance result. By using the foregoing method, the autoencoder can learn local features in the process of reconstructing the pixel blocks after the target image is input into the autoencoder, and the accuracy of image similarity calculation is improved. The similarity between images can be determined intuitively by the Euclidean distance calculation.

[0026] In an example, if the number of the second comparison images is greater than a second preset threshold, the method further includes: obtaining a second target comparison image with the highest similarity to the third target image from the second comparison images, wherein the second target comparison image does not include a human image; calculating Euclidean distances based on the feature vectors of the second target comparison image and the third comparison images, determining the similarity between the second target comparison image and the third comparison images, and the third comparison images are images other than the second target comparison image in the plurality of first comparison images; determining fourth comparison images with a similarity greater than a first preset threshold to the second target comparison image from the third comparison images; if the number of the fourth comparison images is greater than the second preset threshold, determining that the first target image is an illegal scene; and if the number of the fourth comparison images is not greater than the second preset threshold, determining that the first target image is a legal scene.

[0027] In the example, if the number of the second comparison images is greater than the second preset threshold, a second target comparison image with the highest similarity to the third target image is determined from the second comparison images, and the similarity between the first target image and the illegal scene is determined based on the similarity between the second target comparison image and the third comparison images other than the second target comparison image in the plurality of first comparison images. By using the foregoing method, the influence of image processing of the first target image on image similarity matching can be avoided.

[0028] In a second aspect, an embodiment of the present application provides a financial scene legality verification device, which comprises:

[0029] An acquisition unit is configured to acquire a first target image and a plurality of first comparison images, and the first target image comprises at least one portrait;

[0030] A processing unit is configured to obtain a second target image by performing portrait segmentation processing on the first target image;

[0031] The processing unit is further configured to obtain a third target image by removing a position of at least one first pixel block in the second target image;

[0032] A calculation unit is configured to calculate a similarity between the third target image and each of the plurality of first comparison images, and determine a second comparison image from the plurality of first comparison images, which has a similarity greater than a first preset threshold with the third target image;

[0033] A determination unit is configured to determine that the first target image is a legal scene if a number of the second comparison images is not greater than a second preset threshold.

[0034] In a third aspect, an embodiment of the present application provides an electronic device, which comprises a processor, a memory and a communication interface, the processor, the memory and the communication interface are connected to each other and complete communication work between each other, the memory stores executable program codes, the communication interface is configured to perform wireless communication, and the processor is configured to call the executable program codes stored in the memory and execute part or all of the steps described in any of the methods of the first aspect.

[0035] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores electronic data, and the electronic data is used to execute the electronic data to realize part or all of the steps described in the first aspect of the present application when the electronic data is executed by a processor.

[0036] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform part or all of the steps described in the first aspect of the present application. The computer program product can be a software installation package. BRIEF DESCRIPTION OF DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced. Obviously, the accompanying drawings in the following description only represent some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0038] Figure 1 A structural schematic diagram of a financial scenario legality verification system provided by an embodiment of the present application;

[0039] Figure 2 A flowchart of a financial scenario legality verification method provided by an embodiment of the present application;

[0040] Figure 3 A flowchart of a portrait segmentation method provided by an embodiment of the present application;

[0041] Figure 4 A structural schematic diagram of an image pixel block provided by an embodiment of the present application;

[0042] Figure 5 A structural schematic diagram of an image smooth region provided by an embodiment of the present application;

[0043] Figure 6a A functional unit component block diagram of a financial scenario legality verification device provided by an embodiment of the present application;

[0044] Figure 6b A functional unit component block diagram of another financial scenario legality verification device provided by an embodiment of the present application;

[0045] Figure 7 A structural block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to make the personnel in the technical field better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments only represent some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative labor fall within the scope of the present application.

[0047] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps is not limited to the steps listed, but may optionally include steps not listed, or may optionally include other steps inherent to these processes, methods, products, or apparatuses.

[0048] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0049] Please see Figure 1 , Figure 1 This is a schematic diagram of the structure of a financial scenario legality verification system provided in an embodiment of this application, such as... Figure 1 As shown, the financial scenario legality verification system 100 includes an image acquisition server 101, an image processing server 102, an image matching server 103, and a legality verification server 104. The image acquisition server 101 is used to acquire the target image of the target person. The image processing server 102 is used to perform image processing on the target image, specifically including portrait segmentation and image filling. The image matching server 103 is used to perform image matching between the processed target image and other comparison images to determine the similarity between the target image and other comparison images. The legality verification server 104 is used to determine whether the scenario of the target image belongs to a legal scenario based on the similarity between the target image and other comparison images.

[0050] Based on this, the embodiments of this application provide a method for verifying the legality of financial scenarios. The embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0051] Please see Figure 2 , Figure 2 This is a flowchart illustrating a financial scenario legality verification method provided in an embodiment of this application. Figure 2 As shown, the method includes the following steps:

[0052] Step 201: Obtain the first target image and multiple first comparison images.

[0053] The first target image mainly refers to an image saved by a customer during face recognition in a financial operation process, and thus the first target image includes at least one portrait. The first comparison image mainly refers to a historical background image, i.e., a background image saved by a historical customer during a financial operation process, and is used for similarity matching with a background corresponding to the first target image.

[0054] In step 202, a second target image is obtained by performing portrait segmentation on the first target image.

[0055] The first target image is an image including a portrait, and the embodiment is directed to image matching of a background. Therefore, the first target image needs to be subjected to portrait segmentation before image matching, so as to obtain a background image in the first target image and exclude interference of the portrait on image matching.

[0056] In a feasible embodiment, the second target image is obtained by performing portrait segmentation on the first target image, and the obtaining includes: performing portrait segmentation on the first target image according to a semantic segmentation model to obtain a first target sub-image after removing the portrait, the semantic segmentation model performing the portrait segmentation through a semantic segmentation network; and filling a portion of the first target sub-image removing the portrait as a first pixel point to obtain the second target image, a pixel value of the first pixel point being an average pixel value of other pixel points in a row where the first pixel point is located.

[0057] The semantic segmentation model mainly refers to portrait segmentation through a semantic segmentation network. Semantic segmentation mainly refers to end-to-end segmentation results through a neural network, so as to label a corresponding class for each pixel in an image, so as to segment part of content in the image. The semantic segmentation network mentioned in the embodiment mainly refers to label classification of a pixel point through a combination of a convolutional neural network and a conditional random field, such as Deeplab, Mask Rcnn, and the like. After portrait segmentation according to the semantic segmentation model, a background image without a portrait, i.e., the first target sub-image, is obtained. The embodiment fills the first pixel point in a portion of the first target sub-image without the portrait, and thus obtains a complete background image. The pixel value of the first pixel point is determined according to an average pixel value of other pixel points in a row where the first pixel point is located, or is determined according to an average pixel value of other pixel points in a column where the first pixel point is located, or is determined according to an average pixel value of pixel points within a certain range.

[0058] Exemplarily, please refer to Figure 3 , Figure 3 A flowchart of a portrait segmentation method provided by the embodiment is shown in Figure 3 , Figure 3The portrait image 301 includes a portrait part and a background part. After the portrait segmentation of the portrait image 301, a missing background image 302 is obtained. The pixel points of the portrait part in the missing background image 302 have a pixel value of zero. Then, the image filling is performed on the missing portrait part in the missing background image 302 to obtain a background image 303.

[0059] In the embodiment of the present application, the semantic segmentation model is used to perform the portrait segmentation on the first target image, and the first pixel point is filled in the missing part of the segmented portrait. By using the foregoing method, the complete background image can be obtained, and the interference of the portrait part on the image similarity calculation is removed.

[0060] In step 203, the third target image is obtained by removing at least one first pixel block in the second target image.

[0061] In the embodiment of the present application, the second target image is obtained by performing the portrait segmentation and the image filling on the first target image. The foregoing processing will affect the image similarity matching. In order to reduce the influence, the at least one first pixel block in the second target image is removed before the image similarity calculation, so as to highlight the local features in the second target image. The position, number and size of the first pixel block can be random or determined by the following method, but the size of the first pixel block cannot be too large.

[0062] For example, refer to Figure 4 , Figure 4 A structure diagram of an image pixel block provided in the embodiment of the present application is shown in Figure 4 , Figure 4 The target image 400 includes a plurality of selected pixel blocks 401. The pixel block 401 includes a plurality of pixel points. After the plurality of pixel blocks 401 are removed, the pixel values of the pixel points in the positions of the plurality of pixel blocks 401 are zero.

[0063] In a feasible embodiment, before the third target image is obtained by removing at least one first pixel block in the second target image, the method further includes: determining the number of pixel points and the size of the image in the second target image, and determining the first number and the first size of the first pixel block according to the number of pixel points in the second target image; determining the first average pixel value of all pixel points in the second target image; determining a plurality of second pixel blocks in the second target image according to the first size, and the number of the plurality of second pixel blocks is greater than the first number; and determining the positions of the first number of second pixel blocks in which the average pixel values of the pixel points of the second pixel blocks are closest to the first average pixel value as the positions of the at least one first pixel block.

[0064] The first quantity and the first size of the first pixel blocks are mainly determined by the quantity of the pixels in the second target image and the size of the image. The greater the quantity of the pixels in the second target image and the size of the image, the greater the first quantity and the first size of the first pixel blocks. The first pixel blocks are used to increase local features, and therefore, the proportion of the first pixel blocks in the second target image is very small.

[0065] Specifically, in one possible embodiment, the first quantity and the first size of the first pixel blocks are determined according to the quantity of the pixels in the second target image and the size of the image, comprising: judging whether the quantity of the pixels in the second target image exceeds a second quantity.

[0066] If the quantity of the pixels in the second target image does not exceed the second quantity, the first quantity and the first size of the first pixel blocks are determined according to the quantity of the pixels in the second target image and the size of the image, so that the proportion between the quantity of the pixels in the second target image and the first quantity is less than a first quantity proportion, the proportion between the size of the image of the second target image and the first size is less than a first size proportion, and the proportion between the size of the image of the second target image and the sum of the first sizes of all the first pixel blocks is less than a second size proportion.

[0067] If the quantity of the pixels in the second target image exceeds the second quantity, the first quantity and the first size of the first pixel blocks are determined according to the quantity of the pixels in the second target image and the size of the image, so that the proportion between the quantity of the pixels in the second target image and the first quantity is less than a second quantity proportion, and the proportion between the size of the image of the second target image and the first size is less than a third size proportion; wherein the first quantity proportion is less than the second quantity proportion, and the first size proportion is less than the third size proportion.

[0068] In the determination of the first quantity and the first size of the first pixel blocks according to the quantity of the pixels in the second target image and the size of the image, the quantity of the pixels in the second target image is considered first. If the quantity of the pixels in the second target image is large, the upper limit of the first quantity and the first size in the selection of the pixel blocks can also be high, and if the quantity of the pixels in the second target image is not large, the upper limit of the first quantity and the first size in the selection of the pixel blocks can also be low. Specifically, if the quantity of the pixels in the second target image does not exceed the second quantity, the determination of the first quantity needs to satisfy that the proportion between the quantity of the pixels in the second target image and the first quantity is less than the first quantity proportion, and the determination of the first size needs to satisfy two conditions, one is that the proportion between the size of the image of the second target image and the first size is less than the first size proportion, and the other is that the proportion between the size of the image of the second target image and the sum of the first sizes of all the first pixel blocks is less than the second size proportion.

[0069] If the number of pixel points in the second target image exceeds the second number, only one condition needs to be met for the selection of the first size, i.e., the ratio between the image size of the second target image and the first size is less than the third size ratio. This is because the number of pixel points in the second target image is too small, and it can be determined that the image size thereof will not be too large, and the first pixel block can only occupy a very small proportion of the second target image, and therefore it is necessary to consider whether the sum of the first sizes of all the first pixel blocks is too large and whether it occupies a very large proportion of the second target image.

[0070] In the embodiments of the present application, different determination conditions are set for the first number and the first size of the first pixel block by judging the number of pixel points in the second target image, and the determination range set for the first number and the first size when the number of pixel points in the second target image is greater than the second number is greater than the determination range set for the first number and the first size when the number of pixel points in the second target image is not greater than the second number. It can be ensured that the proportion of the first pixel block in the second target image will not be too large, and the negative influence of the first pixel block on the second target image in image similarity calculation is avoided.

[0071] After the first number and the first size of the first pixel block are confirmed by the number of pixel points and the image size of the second target image, since the pixel block removal is to increase the local features, and the increase of the local features can be the pixel block removal of the unobtrusive part in the image to retain the more prominent detailed features. Based on this, the first average pixel value of all pixel points in the second target image is obtained, a plurality of second pixel blocks are randomly selected in the second target image based on the first size of the first pixel block, the second pixel block can be all pixel blocks satisfying the first size in the second target image, and there can be the same pixel points between the second pixel blocks. The average pixel value of each second pixel block in the plurality of second pixel blocks is obtained, and the positions of the first number of second pixel blocks closest to the first average pixel value in the plurality of second pixel blocks are determined as the positions of the first pixel block. It can also be understood that the difference between the first average pixel value and the average pixel value of each second pixel block in the plurality of second pixel blocks is determined, the second pixel blocks corresponding to the first number of differences are selected from small to large according to the difference, and the positions corresponding to the determined second pixel blocks are taken as the positions of the first pixel block. Since the second pixel block is selected according to the size of the first pixel block, the determined second pixel block can also be understood as the first pixel block. Since the first pixel block is selected from the plurality of second pixel blocks, the number of the plurality of second pixel blocks is greater than the first number, and since the proportion of the first pixel block in the second target image is very small, it can be determined that the number of the plurality of second pixel blocks selected based on the first size in the second target image is greater than the first number.

[0072] In the embodiment of the present application, the first number and the first size of the first pixel blocks are determined according to the number of the pixel points and the image size in the second target image, and the positions of the first pixel blocks are determined according to the first average pixel value of all the pixel points in the second target image. Since the second target image is an image after the portrait segmentation and the image filling processing, although the portrait segmentation and the image filling can eliminate the influence of the portrait on the background image similarity matching, the image background features of the second target image will also be reduced based on the portrait segmentation and the image filling processing. The embodiment can reduce the influence on the second target image after the portrait segmentation and the image filling processing on the basis of highlighting the local features of the second target image.

[0073] In addition, in a feasible embodiment, before obtaining the third target image by removing the pixel blocks in the positions of the at least one first pixel block in the second target image, the method further comprises: determining the number of the pixel points and the image size in the second target image, and determining the first number and the first size of the first pixel blocks according to the number of the pixel points in the second target image; determining a plurality of smooth regions in the second target image according to the pixel values of the pixel points in the second target image, the smooth region being used to represent that the pixel value difference between the adjacent pixel points in the region is less than a first difference value;

[0074] If it is determined that the number of the plurality of smooth regions is greater than the first number, and the size of the smooth region in the plurality of smooth regions which is in the first number range after being sorted according to the size is greater than the first size, then the first number of the smooth regions are selected according to the size of each smooth region in the plurality of smooth regions, and the center region of each region in the first number of the selected smooth regions is taken as the position of the at least one first pixel block;

[0075] If it is determined that the number of the plurality of smooth regions is greater than the first number, and the size of the smooth region in the plurality of smooth regions which is in the first number position after being sorted according to the size is not greater than the first size, then the size of the smooth region in the plurality of smooth regions which is in the first number after being sorted according to the size is determined as a new first size, and the first number of the smooth regions are selected according to the size of each smooth region in the plurality of smooth regions, and the center region of each region in the first number of the selected smooth regions is taken as the position of the at least one first pixel block;

[0076] If it is determined that the number of the plurality of smooth regions is not greater than the first number, then the first number of the pixel blocks are selected as the positions of the at least one first pixel block in the second target image in a scattered manner, so that the distance between the adjacent pixel blocks in the at least one first pixel block is equal.

[0077] In the above embodiment, after the first number and the first size of the first pixel block are determined, the position of the first pixel block can also be determined by the method shown in the embodiment. That is, the position of the first pixel block is determined based on the smooth region in the second target image. The difference between the pixel values of adjacent pixels in the smooth region is less than the first difference, and it can also be considered that there is no prominent pattern in the region from a visual point of view. The smooth region can also be selected by gradient value calculation.

[0078] After the plurality of smooth regions are determined, the number of the plurality of smooth regions and the size of the plurality of smooth regions need to be determined. That is, whether the number of the plurality of smooth regions is greater than the first number, and whether the size of the plurality of smooth regions is greater than the first size of the smooth region in the first number of smooth regions according to the size sorting. If both conditions are met, the first number of smooth regions can be selected according to the size of the smooth region from large to small, and the position of the first size in the center of the first number of smooth regions is selected as the position of the first pixel block. If only the former condition is met, the size of the smooth region in the first number of smooth regions is determined as the new first size, and the position of the first pixel block is selected by the foregoing method. If neither condition is met, the position of the first pixel block is selected uniformly in the second target image.

[0079] Exemplarily, refer to Figure 5 , Figure 5 A structural diagram of a smooth region of an image provided by an embodiment of the present application is shown in Figure 5 , and Figure 5 includes a target image 500, and the target image includes a gradient line 501, which is used to indicate a position with a large gradient value, that is, a position with a large gray value change. The gradient line 501 divides the target image 500 into five smooth regions 502. A pixel block 503 of the first size can be selected as the position of the first pixel block at the center of the smooth region 502.

[0080] In addition, the number and size of the first pixel block can also be directly determined according to the smooth region, and then the position of the first pixel block is selected. Specifically, a plurality of smooth regions in the second target image can be determined first. The number of target smooth regions in the plurality of smooth regions with a region size greater than a second size is determined. The first number of the first pixel block is determined according to the number of the target smooth region, and the first size of the first pixel block is determined according to the total size of the target smooth region. It is determined that the first size is less than the second size. The first number of smooth regions is selected in the target smooth region, and a pixel block of the first size is selected as the position of the first pixel block at the center of the first number of smooth regions.

[0081] In the embodiment of the present application, after the first number and the first size of the first pixel block are determined according to the number of pixel points in the second target image and the image size, the smooth region in the second target image is determined, and the position of the first pixel block is selected according to the number and size of the smooth region. By using the foregoing method, it can be ensured that the position of the first pixel block does not affect the prominent features in the image, highlights the local features of the image, and reduces the influence on the second target image after the portrait segmentation and image filling processing.

[0082] In step 204, the similarity of the third target image and each first contrast image in the plurality of first contrast images is calculated, and a second contrast image in the plurality of first contrast images with a similarity greater than a first preset threshold to the third target image is determined.

[0083] In the embodiment, the third target image and the first contrast image are both background images without portraits, and by calculating the similarity of the third target image and each first contrast image in the plurality of first contrast images, it can be determined whether there is a background similar to the background where the target customer is located, and the legality of the scene where the target customer is located can be judged.

[0084] In one possible embodiment, calculating the similarity of the third target image and each first contrast image in the plurality of first contrast images includes: inputting the third target image and the plurality of first contrast images into a self-encoder, performing feature extraction on the third target image and the plurality of first contrast images by an encoder in the self-encoder, taking the last layer of the neuron layer of the encoder as a feature vector of the third target image and the plurality of first contrast images, and outputting the feature vector of the third target image and the plurality of first contrast images by a decoder in the self-encoder; calculating the Euclidean distance according to the feature vectors of the third target image and the plurality of first contrast images, and determining the similarity of the third target image and each first contrast image in the plurality of first contrast images according to the Euclidean distance calculation result, wherein the greater the Euclidean distance calculation result, the smaller the similarity.

[0085] In the embodiment, the similarity of the third target image and each first contrast image in the plurality of first contrast images is calculated by using the self-encoder, the self-encoder is a neural network composed of the encoder and the decoder, and the model training of the self-encoder is a process of designing the encoding and decoding to make the input and output more and more close, which is an unsupervised learning process. After the pixel block removal is performed in the manner described in the foregoing embodiment, the decoder part of the self-encoder will be more inclined to learn the local features, and the background information extraction is multiple and complex, which increases the local feature attention mechanism compared with the global feature extraction, so that the similarity matching of the background image is more accurate.

[0086] Before the Euclidean distance calculation is performed, the feature vectors of the images need to be extracted. In this embodiment, after the third target image and the plurality of first comparison images are input into the autoencoder, the features of the last layer of the neuron layer of the encoder are taken as the feature vectors of the third target image and the plurality of first comparison images when the encoder is passed through, and the Euclidean distance calculation of the images is performed according to the feature vectors. The last layer of the neuron layer of the encoder can be a hidden layer. The similarity of the third target image to each of the plurality of first comparison images is determined according to the Euclidean distance calculation result. The Euclidean distance refers to the Euclidean distance or Euclidean metric, which refers to the "ordinary" distance between two points in Euclidean space.

[0087] In this embodiment, the feature vectors of the third target image and the plurality of first comparison images are determined by the autoencoder, the Euclidean distance calculation is performed according to the feature vectors of each image, and the similarity of the third target image to each of the plurality of first comparison images is determined according to the Euclidean distance result. By using the foregoing method, after the target image is input into the autoencoder after the pixel blocks are removed, the autoencoder can learn the local features in the process of reconstructing the pixel blocks, and the accuracy of the image similarity calculation is increased. The similarity between the images can be determined intuitively by the Euclidean distance calculation.

[0088] In step 205, if the number of the second comparison images is not greater than the second preset threshold, it is determined that the first target image is a legal scene.

[0089] In this embodiment, since many financial irregular operations are gang operations, if it is determined that the background in which the target customer is located is similar to the backgrounds in which a plurality of other customers are located, it can be preliminarily determined that a large number of customers perform financial operations in the same place, and it can be determined that the background is an illegal scene, so that the possible irregular operation of the customer can be prevented.

[0090] In a feasible embodiment, if the number of the second comparison images is greater than the second preset threshold, the method further includes: obtaining a second target comparison image with the highest similarity between the second comparison image and the third target image, wherein the second target comparison image does not include a portrait; performing Euclidean distance calculation on the feature vectors of the second target comparison image and the third comparison image to determine the similarity between the second target comparison image and the third comparison image, the third comparison image being an image other than the second target comparison image in the plurality of first comparison images; determining a fourth comparison image with a similarity greater than a first preset threshold to the second target comparison image in the third comparison image; if the number of the fourth comparison images is greater than the second preset threshold, determining that the first target image is an illegal scene; and if the number of the fourth comparison images is not greater than the second preset threshold, determining that the first target image is a legal scene.

[0091] If the number of the second comparison images is greater than the second preset threshold, it can be preliminarily determined that there are multiple backgrounds similar to the background shown in the third target image, but since the third target image is an image after portrait segmentation, image filling and pixel block removal, that is, the background of the image has been processed in other ways, there will be certain errors when the image similarity is calculated between the third target image and the multiple first comparison images. Therefore, the embodiment selects the second target comparison image with the highest similarity between the third target image from the second comparison images, and judges whether the first target image is a legal scene according to the similarity between the second target comparison image and the third comparison images other than the second target comparison image in the multiple first comparison images.

[0092] In the embodiment of the application, if the number of the second comparison images is greater than the second preset threshold, the second target comparison image with the highest similarity to the third target image is determined from the second comparison images, and whether the first target image is an illegal scene is judged according to the similarity between the second target comparison image and the third comparison images other than the second target comparison image in the multiple first comparison images. By using the foregoing method, the influence of image processing of the first target image on image similarity matching can be avoided.

[0093] It can be seen that in the embodiment of the application, the first target image and the multiple first comparison images are obtained, and the first target image includes at least one portrait; the second target image is obtained by performing portrait segmentation on the first target image; the third target image is obtained by removing the position of at least one first pixel block in the second target image; the similarity between the third target image and each of the multiple first comparison images is calculated, and the second comparison image with a similarity greater than a first preset threshold to the third target image is determined from the multiple first comparison images; if the number of the second comparison images is not greater than a second preset threshold, the first target image is determined to be a legal scene. By using the foregoing method, the similarity of the background image can be matched directly according to the portrait image, and the legality of the background can be determined based on the number of similar background images, which facilitates the prevention of the customer corresponding to the portrait image in advance.

[0094] Consistent with the above-mentioned embodiment, please refer to Figure 6a , Figure 6a is a functional unit composition block diagram of a financial scene legality verification device provided by the embodiment of the application, as Figure 6a shown, the financial scene legality verification device 60 includes:

[0095] The acquisition unit 601 is configured to acquire a first target image and multiple first comparison images, and the first target image includes at least one portrait.

[0096] The processing unit 602 is configured to perform portrait segmentation on the first target image to obtain a second target image.

[0097] The processing unit 602 is further configured to remove at least one first pixel block in the second target image to obtain a third target image.

[0098] The calculation unit 603 is configured to calculate the similarity between the third target image and each of a plurality of first contrast images, and determine a second contrast image from the plurality of first contrast images, which has a similarity greater than a first preset threshold to the third target image.

[0099] The determination unit 604 is configured to determine that the first target image is a legal scene if the number of the second contrast images is not greater than a second preset threshold.

[0100] In an embodiment, the processing unit 602 is configured to perform portrait segmentation on the first target image to obtain a second target image, including: performing portrait segmentation on the first target image according to a semantic segmentation model to obtain a first target sub-image after removing a portrait, the semantic segmentation model performing portrait segmentation through a semantic segmentation network; and filling the removed portrait part in the first target sub-image as first pixel points to obtain the second target image, a pixel value of the first pixel points being an average pixel value of other pixel points in a row where the first pixel points are located.

[0101] In an embodiment, before the processing unit 602 removes at least one first pixel block in the second target image to obtain a third target image, the device further includes a determination unit 604 configured to determine the number of pixel points and the image size in the second target image, and determine the first number and the first size of the first pixel block according to the number of pixel points in the second target image; determine a first average pixel value of all pixel points in the second target image; determine a plurality of second pixel blocks in the second target image according to the first size, the number of the plurality of second pixel blocks being greater than the first number; and determine, as the position of the at least one first pixel block, the position of a first number of second pixel blocks in the plurality of second pixel blocks, which have the average pixel value of the pixel points in each second pixel block closest to the first average pixel value.

[0102] In an embodiment, the determination unit 604 is configured to determine the first number and the first size of the first pixel block according to the number of pixel points and the image size in the second target image, including: judging whether the number of pixel points in the second target image exceeds a second number.

[0103] If the number of pixel points in the second target image is not more than the second number, the first number and the first size of the first pixel block are determined according to the number of pixel points in the second target image and the image size, so that the ratio between the number of pixel points in the second target image and the first number is less than the first number ratio, the ratio between the image size of the second target image and the first size is less than the first size ratio, and the ratio between the image size of the second target image and the sum of the first sizes of all the first pixel blocks is less than the second size ratio.

[0104] If the number of pixel points in the second target image is more than the second number, the first number and the first size of the first pixel block are determined according to the number of pixel points in the second target image and the image size, so that the ratio between the number of pixel points in the second target image and the first number is less than the second number ratio, and the ratio between the image size of the second target image and the first size is less than the third size ratio; wherein the first number ratio is less than the second number ratio, and the first size ratio is less than the third size ratio.

[0105] In a feasible embodiment, the processing unit 602, before obtaining the third target image by performing pixel block removal on the positions of the at least one first pixel block in the second target image, the device further comprises a determination unit 604 configured to determine the number of pixel points in the second target image and the image size, and determine the first number and the first size of the first pixel block according to the number of pixel points in the second target image; determine a plurality of smooth regions in the second target image according to the pixel values of the pixel points in the second target image, and the smooth region is used to represent that the difference between the pixel values of adjacent pixel points in the region is less than a first difference value.

[0106] If it is determined that the number of the plurality of smooth regions is greater than the first number, and the size of the smooth region in the first number range after being sorted according to the size in the plurality of smooth regions is greater than the first size, then the first number of smooth regions is selected according to the size of each smooth region in the plurality of smooth regions, and the center region of each region in the first number of smooth regions is selected as the position of the at least one first pixel block.

[0107] If it is determined that the number of the plurality of smooth regions is greater than the first number, and the size of the smooth region at the first number position after being sorted according to the size in the plurality of smooth regions is not greater than the first size, then the size of the smooth region at the first number position in the plurality of smooth regions is determined as a new first size, and the first number of smooth regions is selected according to the size of each smooth region in the plurality of smooth regions, and the center region of each region in the first number of smooth regions is selected as the position of the at least one first pixel block.

[0108] If it is determined that the number of the plurality of smooth regions is not greater than the first number, the positions of the first number of the pixel blocks are dispersed in the second target image, so that the distances between adjacent pixel blocks in the at least one first pixel block are equal.

[0109] In an implementable embodiment, the calculating unit 603 is configured to calculate the similarity between the third target image and each of the plurality of first comparison images, including: inputting the third target image and the plurality of first comparison images into a self-encoder, performing feature extraction on the third target image and the plurality of first comparison images by an encoder in the self-encoder, taking the last layer of neurons of the encoder as a feature vector of the third target image and the plurality of first comparison images, and outputting the feature vector of the third target image and the plurality of first comparison images by a decoder in the self-encoder; performing Euclidean distance calculation according to the feature vector of the third target image and the plurality of first comparison images, and determining the similarity between the third target image and each of the plurality of first comparison images according to the Euclidean distance calculation result, wherein the greater the Euclidean distance calculation result is, the smaller the similarity is.

[0110] In an implementable embodiment, if the determining unit 604 determines that the number of the second comparison images is greater than the second preset threshold, the device further includes: an obtaining unit 601 configured to obtain a second target comparison image with the highest similarity between the second comparison images and the third target image, wherein the second target comparison image does not include a human image; the calculating unit 603 is configured to perform Euclidean distance calculation on the feature vector of the second target comparison image and the feature vector of the third comparison image, and the determining unit 604 is configured to determine the similarity between the second target comparison image and the third comparison image, the third comparison image being an image other than the second target comparison image in the plurality of first comparison images; determining a fourth comparison image with a similarity greater than a first preset threshold to the second target comparison image in the third comparison image; if the number of the fourth comparison images is greater than the second preset threshold, determining that the first target image is an illegal scene; if the number of the fourth comparison images is not greater than the second preset threshold, determining that the first target image is a legal scene.

[0111] It can be understood that, since the method embodiment and the device embodiment are different presentation forms of the same technical concept, the content of the method embodiment part in the present application should be synchronously adapted to the device embodiment part, which will not be described here.

[0112] In the case of using integrated units, as shown in Figure 6b , the device 600 includes the following units: Figure 6b is a functional unit composition block diagram of another financial scene legality verification device provided by the embodiments of the present application. In the Figure 6bIn specific embodiments, the financial scenario legitimacy verification apparatus 61 comprises a processing module 612 and a communication module 611. The processing module 612 is configured to control and manage actions of the financial scenario legitimacy verification apparatus, such as the steps of the obtaining unit 601, the processing unit 602, the calculating unit 603 and the determining unit 604, and / or other processes for implementing the techniques described herein. The communication module 611 is configured to support interactions between the financial scenario legitimacy verification apparatus and other devices. As Figure 6b shown in FIG. 6, the financial scenario legitimacy verification apparatus 61 can further comprise a storage module 613 configured to store program codes and data of the financial scenario legitimacy verification apparatus.

[0113] The processing module 612 can be a processor or a controller, such as a Central Processing Unit (CPU), a general-purpose processor, a Digital Signal Processor (DSP), an ASIC, an FPGA, or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in connection with the disclosure. The processor can also be a combination of computing functions, such as one or more microprocessor combinations, combinations of DSP and microprocessor, etc. The communication module 611 can be a transceiver, RF circuit, communication interface, etc. The storage module 613 can be a memory.

[0114] All related content of each scenario involved in the above method embodiments can be cited to the functional description of the corresponding functional module, which will not be described here. The above financial scenario legitimacy verification apparatus 61 can perform the above Figure 2 financial scenario legitimacy verification method shown in FIG. 6.

[0115] The above-described embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, the above-described embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions according to the embodiments of the present application are wholly or partially generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center through a wired or wireless manner. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, or the like including one or more available medium collections. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state disk.

[0116] Figure 7 is a structural block diagram of an electronic device provided by an embodiment of the present application. As shown in Figure 7 the electronic device 700 can include one or more of the following components: a processor 701, a memory 702 coupled with the processor 701, wherein the memory 702 can store one or more computer programs, and the one or more computer programs can be configured to be executed by the one or more processors 701 to implement the method described in the above embodiments.

[0117] The processor 701 can include one or more processing cores. The processor 701 connects various parts within the entire electronic device 700 with various interfaces and lines, performs various functions of the electronic device 700 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 702, and calling data stored in the memory 702. Alternatively, the processor 701 can be implemented in at least one of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), a programmable logic array (PLA). The processor 701 can integrate a combination of one or several of a central processing unit (CPU), a graphics processor (GPU), and a modem. It can be understood that the above-mentioned modem can also not be integrated into the processor 701, but can be implemented by a separate communication chip.

[0118] The memory 702 can include a random access memory (RAM) and can also include a read-only memory (ROM). The memory 702 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 702 can include a program storage area and a data storage area, wherein the program storage area can store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area can also store data created by the electronic device 700 in use, etc.

[0119] It can be understood that the electronic device 700 can include more or fewer structural elements than those in the above-mentioned structural block diagram, for example, a power module, a physical key, a WiFi (Wireless Fidelity) module, a speaker, a Bluetooth module, a sensor, etc., which are not limited herein.

[0120] The embodiments of the present application provide a computer readable storage medium, wherein the computer readable storage medium stores program data, and the program data, when executed by a processor, is used to execute part or all steps of any one of the financial scenario legality verification methods described in the above-mentioned method embodiments.

[0121] The embodiment of the present application further provides a computer program product, which comprises a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps of any one of the financial scenario legitimacy verification methods described in the above method embodiments. The computer program product can be a software installation package.

[0122] It should be noted that, for any one of the above financial scenario legitimacy verification method embodiments, in order to simply describe, it is expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the action sequence described, because according to the present application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions involved are not necessarily necessary for the present application.

[0123] Although the present application is described herein in conjunction with various embodiments, other variations of the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed application, from an inspection of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and the indefinite article "a" or "an" does not exclude a plurality. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.

[0124] Those skilled in the art can understand that all or part of the steps in any one of the above financial scenario legitimacy verification method embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer-readable memory, which can include a flash disk, a read-only memory (English: Read-Only Memory, abbreviated: ROM), a random access memory (English: Random Access Memory, abbreviated: RAM), a magnetic disk or an optical disk, etc.

[0125] The above has introduced the embodiments of the present application in detail, and in this paper, specific examples are applied to describe the principle and implementation manner of the financial scenario legitimacy verification method and device of the present application. The above embodiment description is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the financial scenario legitimacy verification method and device of the present application, the specific implementation manner and application range will be changed, and the above description should not be understood as a limitation of the present application.

[0126] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 one or more flowcharts and / or blocks

[0127] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 one or more flowcharts and / or blocks

[0128] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 Figure 1 one or more flowcharts and / or blocks

[0129] It can be understood that the products, such as the terminal and the computer program product of the above flowcharts, which are controlled or configured to execute the processing method of the flowcharts described in the method embodiments of the financial scenario legitimacy verification method, all belong to the related products described in the present application.

[0130] Obviously, those skilled in the art can make various modifications and variations to the financial scenario legitimacy verification method and device provided in the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these modifications and variations.

Claims

1. A method for checking the legality of a financial scenario, characterized in that, The method comprises: obtaining a first target image and a plurality of first contrast images, wherein the first target image comprises at least one portrait; performing portrait segmentation on the first target image to obtain a second target image; performing pixel block removal on a position of at least one first pixel block in the second target image to obtain a third target image; calculating a similarity between the third target image and each of the plurality of first contrast images, and determining a second contrast image from the plurality of first contrast images that has a similarity greater than a first preset threshold with the third target image; if the number of the second contrast image is not greater than a second preset threshold, determining that the first target image is a legal scene; before performing pixel block removal on a position of at least one first pixel block in the second target image to obtain a third target image, the method further comprises: determining a number of pixel points and an image size in the second target image, and determining a first number and a first size of the first pixel block according to the number of pixel points in the second target image; determining a first average pixel value of all pixel points in the second target image; determining a plurality of second pixel blocks in the second target image according to the first size, wherein the number of the plurality of second pixel blocks is greater than the first number; determining, as the position of the at least one first pixel block, a position of a first number of second pixel blocks in the plurality of second pixel blocks that have an average pixel value of pixel points closest to the first average pixel value.

2. The method of claim 1, wherein, The method of performing portrait segmentation on the first target image to obtain a second target image comprises: performing portrait segmentation on the first target image according to a semantic segmentation model to obtain a first target sub-image after removing the portrait, wherein the semantic segmentation model performs portrait segmentation through a semantic segmentation network; filling a portion removed from the portrait in the first target sub-image with first pixel points to obtain the second target image, wherein a pixel value of the first pixel points is an average pixel value of other pixel points in a row where the first pixel points are located.

3. The method of claim 1, wherein, Before performing pixel block removal on a position of at least one first pixel block in the second target image to obtain a third target image, the method further comprises: determining a number of pixel points and an image size in the second target image, and determining a first number and a first size of the first pixel block according to the number of pixel points in the second target image; determining a plurality of smooth regions in the second target image according to pixel values of the pixel points in the second target image, wherein the smooth regions are used to represent that a difference between pixel values of adjacent pixel points in a region is less than a first difference; if it is determined that the number of the plurality of smooth regions is greater than the first number, and a size of a smooth region in the plurality of smooth regions that is within a first number range according to a size sorting is greater than the first size, selecting a first number of smooth regions according to the size of each smooth region in the plurality of smooth regions, and selecting a center region of each of the first number of smooth regions as the position of the at least one first pixel block; If it is determined that the number of the plurality of smooth regions is greater than the first number, and a size of a smooth region in the plurality of smooth regions that is in a position of the first number according to size order is not greater than the first size, then the size of the smooth region in the plurality of smooth regions that is in the position of the first number according to size order is determined as a new first size, and the first number of smooth regions is selected according to the size of each smooth region in the plurality of smooth regions, and a center region of each of the first number of smooth regions is selected as a position of the at least one first pixel block; If it is determined that the number of the plurality of smooth regions is not greater than the first number, then the first number of pixel blocks is selected as the position of the at least one first pixel block in the second target image in a scattered manner, so that the distance between adjacent pixel blocks in the at least one first pixel block is equal.

4. The method according to claim 1 or 3, characterized in that, The first number and the first size of the first pixel block are determined according to the number of pixel points and the image size in the second target image, including: determining whether the number of pixel points in the second target image exceeds a second number; If the number of pixel points in the second target image does not exceed the second number, then the first number and the first size of the first pixel block are determined according to the number of pixel points and the image size in the second target image, so that the ratio between the number of pixel points in the second target image and the first number is less than a first number ratio, the ratio between the image size of the second target image and the first size is less than a first size ratio, and the ratio between the image size of the second target image and the sum of the first sizes of all the first pixel blocks is less than a second size ratio; If the number of pixel points in the second target image exceeds the second number, then the first number and the first size of the first pixel block are determined according to the number of pixel points and the image size in the second target image, so that the ratio between the number of pixel points in the second target image and the first number is less than a second number ratio, and the ratio between the image size of the second target image and the first size is less than a third size ratio; The first number ratio is less than the second number ratio, and the first size ratio is less than the third size ratio.

5. The method of claim 1, wherein, The similarity of the third target image and each of the plurality of first contrast images is calculated, including: the third target image and the plurality of first contrast images are input into a self-encoder, the features of the third target image and the plurality of first contrast images are extracted by an encoder in the self-encoder, the last layer features of the neuron layer of the encoder are taken as the feature vectors of the third target image and the plurality of first contrast images, and the feature vectors of the third target image and the plurality of first contrast images are output by a decoder in the self-encoder; According to the third target image and the feature vectors of the plurality of first contrast images, Euclidean distance calculation is performed, and according to the Euclidean distance calculation result, the similarity between the third target image and each of the plurality of first contrast images is determined, wherein the greater the Euclidean distance calculation result is, the smaller the similarity is.

6. The method of claim 5, wherein, If the number of the second contrast images is greater than a second preset threshold, the method further comprises: obtaining a second target contrast image with the highest similarity between the third target image from the second contrast images, wherein the second target contrast image does not include a portrait; performing Euclidean distance calculation on the feature vector of the second target contrast image and the feature vector of a third contrast image to determine the similarity between the second target contrast image and the third contrast image, wherein the third contrast image is an image other than the second target contrast image in the plurality of first contrast images; determining a fourth contrast image with a similarity greater than the first preset threshold between the second target contrast image in the third contrast image; if the number of the fourth contrast images is greater than the second preset threshold, determining that the first target image is an illegal scene; if the number of the fourth contrast images is not greater than the second preset threshold, determining that the first target image is a legal scene.

7. A financial scenario legitimacy verification apparatus, characterized by, The device comprises: an acquisition unit configured to acquire a first target image and a plurality of first contrast images, wherein the first target image includes at least one portrait; a processing unit configured to perform portrait segmentation processing on the first target image to obtain a second target image; the processing unit is further configured to remove at least one first pixel block in the second target image to obtain a third target image; a calculation unit configured to calculate the similarity between the third target image and each of the plurality of first contrast images, and determine a second contrast image with a similarity greater than a first preset threshold between the third target image in the plurality of first contrast images; a determination unit configured to determine that the first target image is a legal scene if the number of the second contrast images is not greater than a second preset threshold; the determination unit is further configured to: determine the number of pixel points and the image size in the second target image, and determine the first number and the first size of the first pixel block according to the number of pixel points in the second target image; determine the first average pixel value of all pixel points in the second target image; determine a plurality of second pixel blocks in the second target image according to the first size, wherein the number of the plurality of second pixel blocks is greater than the first number; determine the position of the first number of second pixel blocks with the closest average pixel value of pixel points to the first average pixel value as the position of the at least one first pixel block.

8. An electronic device, comprising: The device comprises: a processor, a memory, and a communication interface, which are connected to each other and complete communication work with each other; the memory stores executable program codes, and the communication interface is configured to perform wireless communication; The processor is configured to invoke the executable program code stored on the memory to perform the method of any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, A computer program for electronic data interchange, wherein the computer program causes a computer to perform the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Online financial gang fraud identification method based on image analysis

    CN114926725A