Training methods, devices, equipment and media for cheating detection models

Through the multi-stage training method, the performance of the cheat detection model is gradually improved by using general models and sample expansion technology, solving the problems of long training time and poor detection results in the existing technology, and achieving rapid response and efficient cheat detection.

CN118675018BActive Publication Date: 2024-11-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411165129.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-11-15
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

During the training of existing cheat detection models, the client needs to accumulate a large number of screenshots, which makes it take a long time and makes it difficult to achieve rapid response. Especially when the recall rate is not high during cold start, the detection effect is poor.

Method used

Using a multi-stage training method, first pre-training is performed based on a general model, and combining the sample expansion method to construct the data in the field, fine-tuning is obtained to obtain the first-stage cheat detection model; then a small amount of manual labeling data and construction data are used for mixed weighting to obtain the second Stage model; finally, after accumulating enough labeled data, fine-tuning is performed to obtain the third stage model, and gradually improve the coverage and accuracy of cheat detection.

Benefits of technology

Through the progressive training process, the time-consuming accumulation of sample images is reduced, the modeling efficiency of cheat detection models is improved, fast response and efficient operation are achieved, and the coverage and accuracy of cheat detection are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118675018B_ABST
    Figure CN118675018B_ABST
Patent Text Reader

Abstract

The present application discloses a training method, device, equipment and medium for a cheating detection model, which is applied to the field of artificial intelligence. The method includes: obtaining a sample image of the i-th stage, the sample image of the i-th stage includes a normal image and at least one cheating image, the at least one cheating image includes at least one of a first cheating image annotated when the sample client is running and a second cheating image constructed based on a normal image, i is greater than or equal to 1; based on the i-th stage cheating detection model and the i-th stage sample image, determining the i-th stage loss for balancing the normal image and at least one cheating image in the i-th stage sample image; with the goal of reducing the i-th stage loss, fine-tuning the i-th stage cheating detection model, and obtaining the i-th stage cheating detection model. This solution can improve the efficiency of modeling at each stage, reduce training time, and achieve rapid response.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to a training method, device, equipment and medium for a cheating detection model. Background Art

[0002] The cheat detection model can detect whether the client is cheating. For example, in the fight against cheating in the gaming field, the cheat detection model can detect whether the client is using cheating or modifying images based on game screenshots. If cheating exists, direct punishment will be imposed or manual review will be continued.

[0003] In the related art, during the operation of the client, screenshots of the actual operation of the client are accumulated and manual marking is performed, and then a cheating detection model is trained. As the client continues to run, when enough screenshots are accumulated, the cheating detection model is updated to detect whether the client is cheating.

[0004] However, the client needs to run for a while to accumulate enough screenshots, which results in a long time for modeling at each stage, making the training of the cheating detection model time-consuming and difficult to achieve quick response. Summary of the invention

[0005] The present application provides a cheating detection model training method, device, equipment and medium. The technical solution is as follows:

[0006] In one aspect, a method for training a cheating detection model is provided, the method comprising:

[0007] Acquire a sample image of the i-th stage, wherein the sample image of the i-th stage includes a normal image and at least one cheating image, wherein the at least one cheating image includes at least one of a first cheating image marked when the sample client is running and a second cheating image constructed based on the normal image, and i is greater than or equal to 1;

[0008] Determining, based on an i-1-th stage cheating detection model and the i-th stage sample images, an i-th stage loss for balancing the normal image and the at least one cheating image in the i-th stage sample images, wherein the i-1-th stage cheating detection model is obtained by training based on the i-1-th stage sample images;

[0009] With the goal of reducing the loss in the i-th stage, the i-1-th stage cheating detection model is fine-tuned to obtain the i-th stage cheating detection model.

[0010] On the other hand, a training device for a cheating detection model is provided, the device comprising:

[0011] an acquisition module, configured to acquire a sample image of the i-th stage, wherein the sample image of the i-th stage includes a normal image and at least one cheating image, wherein the at least one cheating image includes at least one of a first cheating image annotated when the sample client is running and a second cheating image constructed based on the normal image, wherein i is greater than or equal to 1;

[0012] a processing module, configured to determine an i-th stage loss for balancing the normal image and the at least one cheating image in the i-th stage sample images based on an i-th stage cheating detection model and the i-th stage sample images, wherein the i-th stage cheating detection model is obtained by training based on the i-th stage sample images;

[0013] The training module is used to fine-tune the cheating detection model of the i-1th stage with the goal of reducing the loss of the i-th stage to obtain the cheating detection model of the i-th stage.

[0014] On the other hand, a computer device is provided, comprising: a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the above-mentioned cheating detection model training method.

[0015] On the other hand, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the cheating detection model training method as described above.

[0016] On the other hand, a computer program product is provided, the computer program product comprising computer instructions, the computer instructions being stored in a computer-readable storage medium, a processor acquiring the computer instructions from the computer-readable storage medium, so that the processor loads and executes the computer instructions to implement the cheating detection model training method as described above.

[0017] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:

[0018] On the one hand, the sample images at each stage in the training process of the cheating detection model include at least one of annotated sample images and constructed sample images, so that the sample images required for training at each stage can be obtained in a short time; on the other hand, the cheating detection model at each stage is obtained by fine-tuning the cheating detection model at the previous stage, and the cheating detection model at each stage can be put online. This progressive training process can also accumulate more sample images for the next stage, and start the training of the next stage in a shorter time. Compared with the related technology, the time spent on accumulating sample images is reduced, and the modeling efficiency of the cheating detection model at each stage is improved, thereby reducing the training time and achieving rapid response. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 is a structural block diagram of a computer system provided by an exemplary embodiment of the present application;

[0021] Figure 2 is a schematic diagram of a cheating detection model training method provided by an exemplary embodiment of the present application;

[0022] Figure 3 is a flow chart of a method for training a cheating detection model provided by an exemplary embodiment of the present application;

[0023] Figure 4 is a schematic diagram of cheating detection automated modeling provided by an exemplary embodiment of the present application;

[0024] Figure 5 It is a schematic diagram of a layered system of a general model for cheating detection provided by an exemplary embodiment of the present application;

[0025] Figure 6 is a schematic diagram of model automation iteration at different stages provided by an exemplary embodiment of the present application;

[0026] Figure 7 is a schematic diagram of sample generation and construction provided by an exemplary embodiment of the present application;

[0027] Figure 8 is a prediction flow chart of a cold start general classification model provided by an exemplary embodiment of the present application;

[0028] Fig. 9 is a schematic diagram of sample construction and model training provided by an exemplary embodiment of the present application;

[0029] Fig.10 is a prediction flow chart of a hybrid fine-tuning classification model provided by an exemplary embodiment of the present application;

[0030] Fig.11 is a schematic diagram of a unified training framework provided by an exemplary embodiment of the present application;

[0031] Fig.12 is a schematic diagram of a background program framework provided by an exemplary embodiment of the present application;

[0032] Fig.13is a schematic diagram of a secondary fine-tuning process provided by an exemplary embodiment of the present application;

[0033] Fig.14 is a flowchart of game screenshot cheating detection provided by an exemplary embodiment of the present application;

[0034] Fig.15 is a schematic diagram of a multi-model parallel automatic penalty method provided by an exemplary embodiment of the present application;

[0035] Fig.16 is a block diagram of a training device for a cheating detection model provided by an exemplary embodiment of the present application;

[0036] Fig.17 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0038] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0039] The terms used in this application are only for the purpose of describing specific embodiments, but are not intended to limit the application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more associated listed items. It should be understood that although the terms first, second, etc. may be used in this application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the application, the first parameter may also be referred to as the second parameter, and similarly, the second parameter may also be referred to as the first parameter. Depending on the context, the word "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0040] It should be noted that this application can display a prompt interface, pop-up window or output voice prompt information before collecting relevant user data (such as normal images, screenshots, videos when using the sample client or client normally, and various scene images, screenshots, and videos in the sample client or client) and during the process of collecting relevant user data. The prompt interface, pop-up window or voice prompt information is used to prompt the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining user-related data after obtaining the user's confirmation operation on the prompt interface or pop-up window, otherwise (that is, when the user's confirmation operation on the prompt interface or pop-up window is not obtained), the relevant steps of obtaining user-related data are terminated, that is, the user's relevant data is not obtained. In other words, all user data collected by this application are collected with the user's consent and authorization, and the collection, use and processing of relevant user data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0041] Figure 1 1 is a block diagram of a computer system 100 provided by an exemplary embodiment of the present application. The computer system 100 can be implemented as a system architecture of a training method for a cheating detection model. The computer system 100 includes: a terminal 120 and a server 140.

[0042] The terminal 120 can be an electronic device such as a mobile phone, a tablet computer, a vehicle-mounted terminal (vehicle computer), a wearable device, a PC (Personal Computer), an unmanned reservation terminal, etc. The terminal 120 stores a cheating detection model for providing a cheating detection function. The terminal 120 can also install a client that runs a target application. The target application can be a game application, a live broadcast application, or a social application. It has the function of cheating detection or image detection for game applications, live broadcast applications, and social applications. It can also be other applications that provide cheating detection functions. This application does not limit this. In addition, this application does not limit the form of the target application, including but not limited to App (Application, application), mini-programs, etc. installed in the terminal 120, and can also be in the form of a web page.

[0043] Server 140 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms. Server 140 can be the background server of the above-mentioned target application, used to provide background services for the client of the target application. In some optional embodiments, server 140 can also be implemented as a node in a blockchain system.

[0044] The terminal 120 and the server 140 may communicate with each other via a network, such as a wired or wireless network.

[0045] In the cheating detection model training method provided in the embodiment of the present application, the execution subject of each step may be a computer device, which refers to an electronic device with data calculation, processing and storage capabilities. Figure 1 Taking the implementation environment of the scheme shown as an example, the training method of the cheating detection model can be executed by the terminal 120, such as the client of the target application installed and run by the terminal 120 executes the training method of the cheating detection model, or the training method of the cheating detection model can be executed by the server 140, or the terminal 120 and the server 140 interact and cooperate to execute it, and this application does not limit this.

[0046] Those skilled in the art will appreciate that the number of terminals 120 may be more or less. For example, there may be only one terminal 120, or there may be dozens or hundreds of terminals 120, or more. The embodiment of the present application does not limit the number and device type of the terminals 120.

[0047] In the related art, the cheating detection model can detect whether there is cheating anomaly on the client. For example, in the game plug-in confrontation, cheating detection based on the client data of the game client is one of the core means. There are generally two methods: one is to solve cheating types such as memory tampering through expert rule strategies. The other is to extract client features based on client data and establish a machine learning model to distinguish. In addition to numerical and character data, it also includes a method of performing cheating detection based on images. For example, capture game screenshots of the game client, detect whether there are signs of cheating on the game screenshots based on the visual model, screen out suspicious game screenshots, and finally manually review and judge them as black. For teams that have no game screenshot business accumulation, they will first annotate a large number of game screenshots, and then train the visual model. Furthermore, during the operation process, it is only until there are enough manually annotated game screenshots that the visual model will continue to be trained and updated. Furthermore, after accumulating a large number of manually annotated game screenshots, the pre-trained general model will also be launched.

[0048] The related art method may have the following disadvantages.

[0049] (1) When there is no cold start model, it takes a long time to accumulate a large number of manually annotated game screenshots, making it difficult to respond quickly. When there is a cold start model, since there are no game screenshots of the current game scene, the cheat detection recall rate is low and the cheat detection effect is poor. Furthermore, a larger number of manual sampling reviews are required to review more game screenshots. In general, cold start cannot be well supported for new games.

[0050] (2) During the operation of the game client, it takes a period of time to accumulate a certain amount of cheating images for fine-tuning training, and it takes a long time to obtain a good cheating detection effect.

[0051] Figure 2 This is a schematic diagram of a cheating detection model training method provided by an exemplary embodiment of the present application. In this embodiment, based on a general model and an automated training framework, combined with a sample expansion method and a fine-tuning strategy, the modeling efficiency and cheating detection effect at each stage are improved to achieve a faster screenshot cheating coverage response.

[0052] The training method of the cheating detection model is Figure 1 As an example, the server 140 shown in FIG. Figure 2 The training method of the cheating detection model mainly includes at least three stages: the first day of launch11, within the first week of launch12, and two or several weeks of launch13.

[0053] (1) First day of launch 11: For the general model of a new game, the general model can use multiple models to ensure coverage, and use a large amount of general data to pre-train the general model to obtain a general cheating detection model 101. General data is general data that includes multiple game clients, multiple game scenes, and multiple cheating types. The general model is also called a base model or a general base model. Next, a small amount of construction data of the game scene is constructed in combination with the sample expansion method, also called in-domain construction data. Among them, the game scene here includes at least one of a large map, a small map, and a scene in a game match. For example, by program simulation, cheating traces are drawn, classic cheating templates are mapped, and a cheating image constructed by a generation model is generated, and the general cheating detection model 101 is further fine-tuned and trained to obtain the first-stage cheating detection model 102, which is better adapted to the game and ensures that the first-stage cheating detection model 102 has a higher coverage rate of cheating detection during cold start. For example, the general model may include a whole-image classification model, where the whole-image classification model may be at least two model structures, and the general model is a dual-model integration of whole-image classification models of at least two model structures; for the whole-image classification model, pre-training is also performed based on general data to obtain a general whole-image classification model, and then based on the sample expansion method, a cheating image of the game scene is constructed for further fine-tuning training to obtain a dedicated whole-image classification model, which is the first-stage cheating detection model 102.

[0054] (2) Within the first week of launch 12: During the short-term operation of the game client within one week, a small amount of manually labeled data and a medium amount of constructed data are combined to form a mixed sample image, and the first-stage cheating detection model 102 is subjected to mixed weighted fine-tuning to obtain the second-stage cheating detection model 103. The small amount of manually labeled data includes daily audit data, suspicious data recommendation annotations, cheating template cutouts and mapping, image enhancement and other data. The constructed data includes cheating images constructed by program simulation of cheating traces, classic cheating template mapping, and generation model generation of cheating traces. Furthermore, in addition to automatically constructing sample images, the sample generation method can also support users to flexibly choose and construct an expert version of the sample image set. For example, using mixed sample images, the exclusive whole-image classification model is subjected to mixed weighted fine-tuning to obtain an exclusive whole-image mixed fine-tuning classification model, which is the second-stage cheating detection model 103. Here, the first-stage cheating detection model 102 is replaced by dual-model integrated prediction to ensure better cheating detection results.

[0055] (3) Online for two or several weeks 13: When the accumulated manually annotated data meets the quantity requirement, the second-stage cheating detection model 103 will continue to be automatically trained and updated to obtain the third-stage cheating detection model 104. A medium or large amount of manually annotated data includes daily review data, suspicious data recommendation annotations, cheating template cutouts and pastings, image enhancement and other data. For example, a medium or large amount of manually annotated data is used to fine-tune the exclusive whole-image hybrid fine-tuning classification model to obtain an exclusive whole-image fine-tuning classification model, which is the third-stage cheating detection model 104. The automated training framework can be used for automatic training in each of the above stages.

[0056] In summary, the cheating detection model training method provided in the embodiment of the present application provides a data method based on an automated model training and evaluation framework, a front-end and back-end model system, and efficient construction, which can continuously and automatically train and update the model, and achieve fast cold start and efficient operation of new game screenshot cheating detection. Among them, supervised pre-training is performed based on general data to obtain a general cheating detection model, and the general cheating detection model is fine-tuned with in-domain constructed data obtained by combining sample expansion methods, such as classic cheating template mapping, program simulation drawing of cheating traces, image enhancement, etc., to obtain the first-stage cheating detection model, which can alleviate the cold start problem after being quickly launched online; then, after a period of operation, a small amount of manually labeled data is accumulated, such as cheating images of manual daily review and suspicious sampling review, and these small amounts of manually labeled data and a certain amount of in-domain constructed data are combined to form a mixed sample image, and hybrid weighted fine-tuning is performed based on the first-stage cheating detection model to obtain the second-stage cheating detection model, which can further improve the cheating detection effect after being launched online; furthermore, after accumulating a certain amount of manually labeled data, based on the second-stage cheating detection model, only these higher-quality manually labeled data are fine-tuned to obtain the third-stage cheating detection model, which can ensure high-accuracy and high-recall cheating detection effects for game screenshots.

[0057] Figure 3 is a flowchart of a cheating detection model training method provided by an exemplary embodiment of the present application. The method is executed by a computer device, which may be Figure 1 The terminal 120 and / or the server 140 are shown. The method includes at least part of steps 220, 240 and 260.

[0058] Step 220, obtaining a sample image of the i-th stage, wherein the sample image of the i-th stage includes a normal image and at least one cheating image, wherein the at least one cheating image includes at least one of a first cheating image annotated when the sample client is running and a second cheating image constructed based on the normal image, and i is greater than or equal to 1.

[0059] The cheating detection model is used to implement cheating detection on the client side.

[0060] In some embodiments, the cheating detection model is a visual model for implementing cheating detection based on the client image of the client, and image detection can also be implemented. Optionally, the client includes at least one of a game client, a video client, an instant messaging client, a live client, and a social client. Taking the game client as an example, the client image is a game image (game screenshot), and possible cheating traces in the game image include: solid lines, boxes, skeletons, function catalogs, character perspectives, thermal perspectives, and artificial intelligence (AI) plug-in perspectives.

[0061] The training process of the cheating detection model includes multiple stages. For the i-th stage in the multiple stages, i is greater than or equal to 1, and the i-th stage will obtain an i-th stage cheating detection model. The i-th stage cheating detection model is trained based on the sample images of the i-th stage and the i-1-th stage cheating detection model. Specifically, the model parameters of the i-1-th stage cheating detection model are fine-tuned, such as weight parameters and hyperparameters. Each i-th stage cheating detection model can be put online after training is completed, and cheating detection of the client can be realized after going online.

[0062] It is understandable that when the i+1 stage cheating detection model training is completed, the i+1 stage cheating detection model directly replaces the i stage cheating detection model after it is launched. Optionally, taking the i stage as an example, before the trained i+1 stage cheating detection model is launched, the i+1 stage cheating detection model is also evaluated, and when the performance meets the performance requirements of the i+1 stage, the i+1 stage cheating detection model is launched.

[0063] When i is equal to 1, the i-1 stage cheating detection model includes a universal cheating detection model, which is obtained by pre-training the universal model based on the universal image set. The universal model is also called the base model or universal base model. The universal model can use multiple models to ensure coverage, thereby ensuring that the universal model can identify multiple cheating types in multiple scenarios of multiple clients and has a certain degree of generalization.

[0064] For example, the general model may include a whole-image classification model, where the whole-image classification model may be at least two model structures. For example, the model structure of the whole-image classification model is ResnetMultiGate and MobileNet series models, then the general model is a dual-model integration of whole-image classification models of at least two model structures, to achieve coverage of cheating detection. Optionally, the general model may also include a local image classification model, a function directory model, and the like. The general image set includes normal images of multiple clients of the same type of sample clients when running, cheating images containing a variety of scenes and a variety of cheating types, and the data volume of the general image set is in the millions, which is rich and varied. The general image set may be obtained from a shared database or a public database, and this embodiment does not limit this.

[0065] As an example, the training process of the cheating detection model includes at least three stages. At least one of the general model, the general cheating detection model obtained by pre-training the general model, or the first-stage cheating detection model obtained by fast training in the first stage can be used as the initial cold start model. The first stage is the first day of the launch, and the first stage training process is executed after the first day of the launch. The second stage is within one week of the launch, and the second stage training process is executed within the first week of the launch. The third stage is two weeks or several weeks of the launch, and the third stage training process is executed two weeks or several weeks of the launch. In other examples, the fourth stage and the fifth stage are also included. The fourth and fifth stages are executed regularly, and their execution method can be consistent with the third stage.

[0066] Exemplarily, a computer device obtains a sample image of the i-th stage, wherein the sample image of the i-th stage includes a normal image and at least one cheating image, wherein the at least one cheating image includes at least one of a first cheating image annotated when the sample client is running and a second cheating image constructed based on the normal image. The image types contained in the sample images of different stages are not exactly the same, and the required data amounts are not exactly the same. Each normal image, each first cheating image, and each second cheating image in the sample image of the i-th stage also include label information respectively, which constitute the i-th stage label information of the sample image of the i-th stage. Specifically, the first cheating image refers to some cheating images annotated manually, which are accumulated continuously as the running process of the sample client. The second cheating image is some cheating images constructed based on the normal data of the sample client, which is equivalent to sample expansion, and the purpose is to better adapt to various scenes of the sample client and better distinguish normal images from multiple cheating types. There is at least one normal image corresponding to the first cheating image and the second cheating image respectively.

[0067] In an optional example, after acquiring the sample images of the i-th stage, the computer device also divides the sample images of the i-th stage into a training set and a validation set (test set) by stratified sampling, and then executes subsequent steps.

[0068] Optionally, the normal image includes at least one of the following: a normal image when the sample client is running, a normal image that has been reviewed or uploaded, and a normal image obtained by performing image enhancement on the normal image; wherein the normal image is obtained by taking a screenshot when a whitelist account uses the sample client, and the screenshot includes a real-time screenshot when the sample client is used, or a video frame extracted from a screen recording video using the sample client. In some examples, the normal image is also referred to as a white sample. The normal image also includes label information, the label information includes a normal label, and optionally includes the first cheating image or the second cheating image corresponding to the normal image.

[0069] Optionally, the first cheating image includes at least one of the following: a cheating image when the sample client is running, a cheating image that has been reviewed or uploaded, a sampled cheating image, or a cheating image obtained by performing data enhancement on a cheating image that has been reviewed, uploaded, or sampled; wherein the review, uploading, and sampling here may be performed manually, or performed by a manually controlled computer device; the second cheating image includes at least one of the following: an abnormal image constructed by adding a cheating template map to a normal image, a cheating image constructed by adding a cheating template map to a local normal image, a cheating image constructed by a program drawing cheating traces in a normal image, a cheating image constructed by a program drawing cheating traces in a local normal image, a cheating image with cheating traces constructed by a generation model, or a cheating image obtained by performing image enhancement on a constructed cheating image.

[0070] Exemplarily, the generative model is a pre-trained visual model for generating cheating images, or the generative model is a large language model. For example, a normal image and a prompt are input into the large language model, and the large language model is used to generate a cheating image with cheating traces based on the normal image and the prompt. The first cheating image and the second cheating image also include label information, respectively, and the label information includes a cheating label, and may also include a cheating type, a cheating location, a normal image corresponding to the first cheating image, or a normal image corresponding to the second cheating image. It should also be noted that the first cheating image and its corresponding normal image are the aforementioned manually annotated data, and the second cheating image and its corresponding normal image are the aforementioned constructed data.

[0071] Among them, image enhancement includes at least one of horizontal flipping, brightness, color, saturation adjustment, sharpening, noise addition, and mosaic, and cheating traces or cheating template maps include at least one of solid lines, boxes, skeletons, function directories, character perspectives, thermal perspectives, and AI plug-in perspectives. Among them, cheating traces can also be understood as elements that are not the sample client itself, which are additionally superimposed on the client images of various scenes of the sample client, and can assist user account operations. Cheating template maps can be some classic cheating template maps or accumulated cheating template maps, such as function directories and thermal perspectives.

[0072] In some examples, the first cheating image and the second cheating image are also collectively referred to as black samples, and the second cheating image is also referred to as domain-constructed data, which is particularly suitable for the sample client. In some embodiments, for the i-th stage sample image, the ratio of the black sample to the white sample is usually a preset ratio, or the current ratio of the two is within a set range. As an example, the preset ratio of the black sample to the white sample can be set to 1:2, and the maximum ratio of the black sample to the white sample in the set range can be 1:5 or 1:10.

[0073] Step 240, determining an i-th stage loss for balancing normal images and at least one cheating image in the i-th stage sample images based on the i-th stage cheating detection model and the i-th stage sample images, wherein the i-th stage cheating detection model is obtained by training based on the i-th stage sample images.

[0074] The i-1 stage cheating detection model is trained based on the i-1 stage sample images. Exemplarily, the computer device determines the i-1 stage loss for balancing the normal image and at least one cheating image in the i-1 stage sample images based on the i-1 stage cheating detection model and the i-1 stage sample images.

[0075] Specifically, the normal images and at least one cheating image in the sample images of the i-th stage are balanced, with the purpose of adjusting the degree of learning for different types of images, so that the cheating detection model of the i-th stage focuses on learning a certain type of cheating image, for example, focusing on learning the first cheating image, thereby improving the cheating detection effect of the trained cheating detection model of the i-th stage for this type of cheating image.

[0076] Step 260, with the goal of reducing the loss in the i-th stage, fine-tune the cheating detection model in the i-1th stage to obtain the cheating detection model in the i-th stage.

[0077] Exemplarily, the computer device takes reducing the loss of the i-th stage as the goal, fine-tunes the cheating detection model of the i-1th stage, and obtains the cheating detection model of the i-th stage. Specifically, taking reducing the loss of the i-th stage as the goal, fine-tunes the weight parameters of the cheating detection model of the i-1th stage, and obtains the cheating detection model of the i-th stage when the training end condition is met. The training end condition includes at least one of reaching a set number of iterations and reaching a minimum loss. Optionally, after obtaining the cheating detection model of the i-th stage, the cheating detection model of the i-th stage is launched online to perform cheating detection on the client image of the client. And, after obtaining the cheating detection model of the i-th stage, i is also updated to i+1, and execution starts again from step 220 until all multiple stages of the training process of the cheating detection model are trained and completed, and the final cheating detection model is obtained.

[0078] In some embodiments, the cheating detection model may be a binary classification model. The loss function of the i-th stage loss may adopt at least one of a cross entropy loss function, a hinge loss function, and an exponential loss function. In different cases of i, the loss function corresponding to the i-th stage loss may be the same or different. In the subsequent embodiments, the loss function used in each stage is taken as an example to illustrate.

[0079] In summary, the training method of the cheating detection model provided in the embodiment of the present application, on the one hand, the sample images at each stage in the training process of the cheating detection model include at least one of the labeled sample images and the constructed sample images, so that the sample images required for the training at each stage can be obtained in a short time; on the other hand, the cheating detection model at each stage is obtained by fine-tuning the cheating detection model at the previous stage, and the cheating detection model at each stage can be put online. This progressive training process can also accumulate more sample images for the next stage, and start the training of the next stage in a shorter time. Compared with the method of the related technology, it reduces the time consumption of accumulating sample images, improves the modeling efficiency of the cheating detection model at each stage, thereby reducing the time consumption of training and achieving rapid response. It can also improve the coverage of cheating detection and improve the effect and accuracy of cheating detection.

[0080] In some embodiments, for the i-th stage, it corresponds to the i-th stage loss. Then step 240 is specifically implemented as step 242 and step 244.

[0081] Step 242: Based on the i-1 stage cheating detection model and the i-stage sample image, prediction is performed on the i-stage sample image to obtain i-stage prediction information.

[0082] Step 244, determining the i-th stage loss based on the i-th stage label information and the i-th stage prediction information of the i-th stage sample image, as well as the first weight of the first cheating image and the corresponding normal image, and the second weight of the second cheating image and the corresponding normal image; wherein the first weight is greater than the second weight, and the first weight is used to enhance the degree of learning for the labeled first cheating image and the corresponding normal image.

[0083] Exemplarily, the computer device performs prediction on the i-th stage sample image based on the i-th stage cheating detection model and the i-th stage sample image to obtain the i-th stage prediction information. Specifically, each normal image in the i-th stage sample image and each cheating image in at least one cheating image are respectively input into the i-th stage cheating detection model, and the i-th stage sample image is predicted to obtain the i-th stage prediction information.

[0084] In this embodiment, the first cheating image and the corresponding normal image are set to the first weight, and the second cheating image and the corresponding normal image are set to the second weight, wherein the first weight is greater than the second weight, and the first weight is used to enhance the learning degree of the marked first cheating image and the corresponding normal image. Optionally, the first weight and the second weight are fixed values, for example, the first weight is set to a fixed value of 2, and the second weight is set to a fixed value of 1. Alternatively, the first weight and the second weight are determined based on the current ratio of black samples and white samples in the i-th stage sample image at this time, and the value range of the first weight is 2-5, and the condition that the first weight is greater than the second weight also needs to be satisfied. For example, based on the current ratio, the first weight is set to 3 and the second weight is set to 1.

[0085] Exemplarily, the computer device determines the i-th stage loss based on the i-th stage label information and the i-th stage prediction information of the i-th stage sample image, as well as the first weight of the first cheating image and the corresponding normal image, and the second weight of the second cheating image and the corresponding normal image. The loss function corresponding to the i-th stage loss is a cross entropy loss function.

[0086] In this embodiment, a method for determining the i-th stage loss for the i-th stage is provided. The loss can enable the i-th stage cheating detection model to focus on learning the first cheating image manually labeled, thereby improving the cheating detection accuracy for the first cheating image.

[0087] Exemplarily, step 244 specifically includes step 2442 and step 2444 .

[0088] Step 2442, based on the i-th stage label information and the i-th stage prediction information of the i-th stage sample images, determine the first sub-loss of each first cheating image, the second sub-loss of each second cheating image, and the third sub-loss of each normal image in the i-th stage sample images.

[0089] Step 2444, based on the first weight of the first cheating image and the corresponding normal image, and the second weight of the second cheating image and the corresponding normal image, the first sub-loss, the second sub-loss and the third sub-loss are weighted summed to obtain the i-th stage loss.

[0090] The i-th stage label information is composed of label information of each normal image and each cheating image in at least one cheating image, and the i-th stage prediction information includes prediction information for each normal image and each cheating image in at least one cheating image. Exemplarily, the computer device determines the first sub-loss of each first cheating image, the second sub-loss of each second cheating image, and the third sub-loss of each normal image in the i-th stage sample image based on the i-th stage label information and the i-th stage prediction information of the i-th stage sample image. And, based on the first weight of the first cheating image and the corresponding normal image, and the second weight of the second cheating image and the corresponding normal image, the first sub-loss, the second sub-loss, and the third sub-loss are weighted summed to obtain the i-th stage loss.

[0091] Exemplarily, step 2444 is specifically implemented as step 2444-1, step 2444-2, and step 2444-3.

[0092] Step 2444-1, multiplying the first weight of the first cheating image by the first sub-loss to obtain a first weighted sub-loss, and multiplying the second weight of the second cheating image by the second sub-loss to obtain a second weighted sub-loss.

[0093] Step 2444-2, for the third sub-loss of the normal image corresponding to the first cheating image, multiply the first weight by the third sub-loss, and, for the third sub-loss of the normal image corresponding to the second cheating image, multiply the second weight by the third sub-loss, to obtain a third weighted sub-loss.

[0094] Step 2444-3, add the first weighted sub-loss, the second weighted sub-loss and the third weighted sub-loss to obtain the i-th stage loss.

[0095] Exemplarily, when the computer device performs weighted summation, for the first sub-loss belonging to the first cheating image, it is multiplied by the first weight to obtain the first weighted sub-loss; for the second sub-loss belonging to the second cheating image, it is multiplied by the second weight to obtain the second weighted sub-loss; for the third sub-loss of the normal image corresponding to the first cheating image, this part of the third sub-loss is multiplied by the first weight of the normal image corresponding to the first cheating image, and for the third sub-loss of the normal image corresponding to the second cheating image, this part of the third sub-loss is multiplied by the second weight of the normal image corresponding to the second cheating image, and then summed to obtain the third weighted sub-loss. The first weighted sub-loss, the second weighted sub-loss and the third weighted sub-loss are added together to obtain the i-th stage loss. It can be understood that for at least one cheating image in the i-th stage sample image, it may be only the first cheating image, or only the second cheating image, or a mixture of the first cheating image and the second cheating image. In this case, when solving the i-th stage loss, if it does not exist, there is no need to solve it. For example, when only the first cheating image is included but not the second cheating image, only the first sub-loss and the third sub-loss need to be solved.

[0096] In the above embodiment, a specific method for calculating the loss of the i-th stage is provided, which can improve the data processing efficiency when calculating the loss of the i-th stage.

[0097] Next, we will take the example that the training process of the cheating detection model includes at least three stages. The first stage is the first day of the launch, the second stage is within one week of the launch, and the third stage is two weeks or several weeks of the launch.

[0098] For the first stage.

[0099] In the case where i is equal to 1, the i-th stage includes the first stage, the i-th stage loss includes the first stage loss, the i-1-th stage cheating detection model includes a universal cheating detection model, the universal cheating detection model is obtained by pre-training the universal model based on a universal image set, the universal image set includes normal images of multiple clients of the same type of sample clients when running, cheating images containing multiple scenes and multiple cheating types, the first stage sample images include normal images and second cheating images, then for the first stage, the first stage loss is determined based on the third sub-loss and the second sub-loss. Exemplarily, step 240 is specifically implemented as steps 320, 340, and 360.

[0100] Step 320 , based on the universal cheating detection model and the first stage sample images, prediction is performed on the first stage sample images to obtain first stage prediction information.

[0101] Step 340: Determine the second sub-loss of each second cheating image and the third sub-loss of each normal image in the first stage sample images based on the first stage label information and the first stage prediction information of the first stage sample images.

[0102] Step 360: multiply the second weight of the second cheating image and the corresponding normal image by the second sub-loss and the third sub-loss, and sum them up to obtain the first stage loss; wherein the first stage loss is used to guide the fine-tuning of the universal cheating detection model.

[0103] The first-stage cheating detection model is trained by fine-tuning the model parameters of the general cheating detection model, such as the weight parameters, so that the first-stage cheating detection model can better apply to the scenario of the sample client and identify whether there is cheating. The loss function corresponding to the first-stage loss is the cross entropy loss function.

[0104] Exemplarily, the computer device inputs the first-stage sample image into the universal cheating detection model, performs prediction on the first-stage sample image based on the universal cheating detection model, and obtains the first-stage prediction information. Based on the first-stage label information and the first-stage prediction information of the first-stage sample image, the second sub-loss of each second cheating image and the third sub-loss of each normal image in the first-stage sample image are determined. Next, the second weight of the second cheating image and the corresponding normal image is multiplied by the second sub-loss and the third sub-loss, and the second weighted sub-loss and the third weighted sub-loss are summed to obtain the first-stage loss; wherein the first-stage loss is used to guide the fine-tuning of the universal cheating detection model. In this embodiment, the second weight can be a fixed value, and the second weight is set to 1. After obtaining the first-stage cheating detection model, it can be put online for use.

[0105] In one example, the general model may specifically include a whole-image classification model, where the whole-image classification model may be at least two model structures. For example, the model structure of the whole-image classification model is ResnetMultiGate and MobileNet series models, and the general model is a dual-model integration of whole-image classification models of at least two model structures, to achieve guaranteed coverage of cheating detection. The general cheating detection model is a general whole-image classification model, which is obtained by training each whole-image classification model in at least two model structures based on a general image set and then integrating them. The first-stage cheating detection model is an exclusive whole-image classification model, which is obtained by training each general whole-image classification model in at least two model structures based on the first-stage sample images and then integrating them. Exclusive here refers to the type that is exclusive to the sample client. In another example, the general model may also specifically include a function directory model, and the general cheating detection model is a general function directory model, and the first-stage cheating detection model also includes an exclusive function directory model.

[0106] In this embodiment, a training method for the first stage cheating detection model is provided, which can not only support cold start, but also cover multiple cheating types, thereby improving the coverage and accuracy of cheating detection. Furthermore, more sample images can be accumulated for the second stage, so that the training of the second stage can be started faster.

[0107] For the second stage.

[0108] In the case where i is equal to 2, the i-th stage includes the second stage, the i-th stage loss includes the second stage loss, the i-1-th stage cheating detection model includes the first stage cheating detection model obtained by training in the first stage, and the second stage sample image includes a normal image, a first cheating image, and a second cheating image; the second stage sample image is also called a mixed sample image, then for the second stage, the second stage loss is determined based on the third sub-loss, the second sub-loss, and the first sub-loss. Exemplarily, step 240 is specifically implemented as steps 420, 440, and 460.

[0109] Step 420 , based on the first stage cheating detection model and the second stage sample images, prediction is performed on the second stage sample images to obtain second stage prediction information.

[0110] Step 440: Determine a first sub-loss of each first cheating image, a second sub-loss of each second cheating image, and a third sub-loss of each normal image in the second stage sample images based on the second stage label information and the second stage prediction information of the second stage sample images.

[0111] Step 460: Based on the first weight and the second weight, perform weighted summation on the first sub-loss, the second sub-loss and the third sub-loss to obtain the second-stage loss; wherein the second-stage loss is used to guide the hybrid weighted fine-tuning of the first-stage cheating detection model.

[0112] The second-stage cheating detection model is trained by performing hybrid weighted fine-tuning on the model parameters of the first-stage cheating detection model, such as weight parameters, so that the second-stage cheating detection model can better focus on identifying the first manually labeled cheating image, thereby being able to identify whether cheating exists. The loss function corresponding to the second-stage loss is the cross entropy loss function.

[0113] Exemplarily, the computer device inputs the second-stage sample image into the first-stage cheating detection model, performs prediction on the second-stage sample image based on the first-stage cheating detection model, and obtains the second-stage prediction information. Based on the second-stage label information and the second-stage prediction information of the second-stage sample image, the first sub-loss of each first cheating image, the second sub-loss of each second cheating image, and the third sub-loss of each normal image in the second-stage sample image are determined. Next, based on the first weight and the second weight, the first sub-loss, the second sub-loss, and the third sub-loss are weighted summed to obtain the second-stage loss. Specifically, for the third sub-loss of the normal image corresponding to the first cheating image, this part of the third sub-loss is multiplied by the first weight of the normal image corresponding to the first cheating image, and for the third sub-loss of the normal image corresponding to the second cheating image, this part of the third sub-loss is multiplied by the second weight of the normal image corresponding to the second cheating image, and then summed to obtain the third weighted sub-loss. The first weighted sub-loss, the second weighted sub-loss, and the third weighted sub-loss are added together to obtain the second-stage loss. Among them, the second-stage loss is used to guide the hybrid weighted fine-tuning of the first-stage cheating detection model. In this embodiment, the first weight and the second weight may be fixed values, and the first weight is set to 2 and the second weight is set to 1. After the second stage cheating detection model is obtained, it can be put online for use, and the first stage cheating detection model can be directly replaced when it is put online.

[0114] In some embodiments, the first-stage cheating detection model is an exclusive whole-image classification model, and the second-stage cheating detection model is an exclusive whole-image hybrid fine-tuning classification model, which is obtained by training each exclusive whole-image classification model in at least two model structures based on the second-stage sample images and then integrating them. In other embodiments, the first-stage cheating detection model also includes an exclusive function catalog model, and the second-stage cheating detection model is an exclusive function catalog hybrid fine-tuning classification model.

[0115] In this embodiment, a training method for the second-stage cheating detection model is provided, which can not only cover multiple cheating types and improve the coverage and accuracy of cheating detection, but also combine more constructed second cheating images to further improve the accuracy of cheating detection. In addition, more sample images can be accumulated for the third stage, and the training of the third stage can be started faster. By setting different weights for the first cheating image and the second cheating image, the learning degree of the first cheating image and the accuracy of cheating detection can also be improved.

[0116] For the third stage.

[0117] In the case where i is equal to 3, the i-th stage includes the third stage, the i-th stage loss includes the third stage loss, the i-1-th stage cheating detection model includes the second stage cheating detection model obtained by training in the second stage, and the third stage sample image includes a normal image and a first cheating image, then for the third stage, the third stage loss is determined based on the first sub-loss and the third sub-loss. Exemplarily, step 240 is specifically implemented as steps 520, 540, and 560.

[0118] Step 520 , based on the second stage cheating detection model and the third stage sample image, perform prediction on the third stage sample image to obtain third stage prediction information.

[0119] Step 540: Determine a first sub-loss of each first cheating image and a third sub-loss of each normal image in the third stage sample images based on the third stage label information and the third stage prediction information of the third stage sample images.

[0120] Step 560: multiply the first weight of the first cheating image and the corresponding normal image by the first sub-loss and the third sub-loss, and sum them up to obtain a third-stage loss; wherein the third-stage loss is used to guide the fine-tuning of the second-stage cheating detection model.

[0121] The third stage cheating detection model is trained by fine-tuning the model parameters of the second stage cheating detection model, such as weight parameters. The third stage cheating detection model can further enhance the recognition of the first manually labeled cheating image, so as to identify whether cheating exists. The loss function corresponding to the third stage loss is the cross entropy loss function.

[0122] Exemplarily, the computer device inputs the third-stage sample image into the second-stage cheating detection model, performs prediction on the third-stage sample image based on the second-stage cheating detection model, and obtains the third-stage prediction information. Based on the third-stage label information and the third-stage prediction information of the third-stage sample image, based on the third-stage label information and the third-stage prediction information of the third-stage sample image, the first sub-loss of each first cheating image and the third sub-loss of each normal image in the third-stage sample image are determined. Next, the first weight of the first cheating image and the corresponding normal image is multiplied by the second sub-loss and the third sub-loss, and the second weighted sub-loss and the third weighted sub-loss are summed to obtain the third-stage loss; wherein the third-stage loss is used to guide the fine-tuning of the second-stage cheating detection model, or is called fine tuning. In this embodiment, the first weight can be a fixed value, and the first weight is set to 1. After obtaining the third-stage cheating detection model, it can be put online for use, and the second-stage cheating detection model can be directly replaced when it is put online.

[0123] In some embodiments, the second-stage cheating detection model is an exclusive whole-image hybrid fine-tuning classification model, and the third-stage cheating detection model is an exclusive whole-image fine-tuning classification model, which is obtained by training each exclusive whole-image hybrid fine-tuning classification model in at least two model structures based on the third-stage sample image and then integrating them. In other embodiments, the second-stage cheating detection model also includes an exclusive function directory hybrid fine-tuning classification model, and the third-stage cheating detection model is an exclusive function directory fine-tuning classification model. When the function directory model is involved, its training process and training method can adopt the method of this embodiment, and the constructed second cheating image contains the function directory.

[0124] In this embodiment, a training method for the third stage cheating detection model is provided. On the basis of the first two stages, it can not only cover multiple cheating types and improve the coverage of cheating detection, but also further improve the accuracy of cheating detection through fine-tuning.

[0125] Sample generation and construction.

[0126] In some embodiments, the second cheating image of the structure is required to be used in both the first stage and the second stage. Since the cheating traces contained in the second cheating image generated by the structure may overlap with the scene background in the image, resulting in a situation where the cheating traces are blurred, and the second cheating image of the structure is of a large magnitude, in order to avoid the second cheating image from bringing label noise, it is necessary to perform data cleaning and filtering on the second cheating image. It should also be noted that the following embodiments are applicable to any stage where the second cheating image needs to be used, that is, applicable to the first stage and also applicable to the second stage, and only the first stage is used as an example here for explanation. Exemplarily, for the first stage sample image used in the first stage, the first stage sample image includes a normal image and a second cheating image. The method also includes steps 610, 620, 630, and 640.

[0127] Step 610, obtaining a normal image.

[0128] Step 620: construct a second cheating image based on the normal image.

[0129] Step 630: input the image pair into the filtering model to obtain a prediction result of the image pair, where the image pair includes a normal image and a correspondingly constructed second cheating image.

[0130] Step 640: Based on the prediction result, image redistribution is performed on the normal image and the second cheating image to obtain a first-stage sample image used in the first stage.

[0131] The normal image is obtained by taking a screenshot of a whitelist account using a sample client. The second cheating image can be constructed by a program automatically simulating the drawing of cheating traces, based on a generative model, or by image enhancement, including at least one of the following: a cheating image constructed by a program drawing cheating traces in a normal image; a cheating image constructed by a program drawing cheating traces in a local normal image; a normal image and prompt information are input into a large language model to obtain a cheating image with cheating traces; image enhancement is performed on the aforementioned constructed cheating image to obtain a cheating image.

[0132] Exemplarily, a computer device obtains a normal image; based on the normal image, a second cheating image is constructed, and at this time, the number of second cheating images to be constructed can be set to a preset number, for example, the preset number is 3-5k; multiple image pairs are determined, each image pair includes a normal image and a correspondingly constructed second cheating image; next, the image pair is input into a filtering model to obtain a prediction result of the image pair, and finally, based on the prediction result, image redistribution is performed on the normal image and the second cheating image to obtain a first-stage sample image used in the first stage. The purpose of image redistribution is, first, to avoid excessive label noise, and second, to make the ratio of black samples to white samples a preset ratio, or the current ratio of the two is within a set range, so as to facilitate better fine-tuning.

[0133] In some embodiments, when this embodiment is applied to the fine-tuning of the first stage, the filtering model may select a model consistent with the general cheating detection model, so as to characterize the possible prediction results when these normal images and the constructed second cheating images are used as the sample images of the first stage as much as possible. When this embodiment is applied to the fine-tuning of the second stage, the filtering model may select a model consistent with the first stage cheating detection model, so as to characterize the possible prediction results when these normal images and the constructed second cheating images are used as the sample images of the second stage as much as possible.

[0134] For each image pair, the prediction result may be one of the following four types, as shown in Table 1.

[0135] The first prediction result includes that both the normal image and the second cheating image in the image pair are predicted correctly.

[0136] The second prediction result includes that the normal image in the image pair is predicted correctly and the second cheating image is predicted incorrectly.

[0137] The third prediction result includes that the normal image in the image pair is predicted incorrectly, and the second cheating image is predicted correctly.

[0138] The fourth prediction result includes a normal image prediction error and a second cheating image prediction error in the image pair.

[0139] Table 1 Prediction results

[0140]

[0141] Correspondingly, step 640 is specifically implemented as at least one of the following situations.

[0142] Case 1: For the image pairs whose prediction results are the first prediction results, at least a portion of the image pairs is extracted. For the first prediction result, the filtering model can predict correctly, and at least a portion is randomly extracted as a sample image.

[0143] Case 2: For the image pairs whose prediction results are the second prediction results, all image pairs are retained. For the second prediction result, all are retained and used as sample images.

[0144] Case 3: For an image pair whose prediction result is the third prediction result, all normal images and at least a portion of the second cheating image in the image pair are retained. For the third prediction result, the filtering model randomly discards a portion of the second cheating image and retains all normal images and a portion of the constructed second cheating image.

[0145] Case 4: For the image pair whose prediction result is the fourth prediction result, all normal images in the image pair are retained. The fourth prediction result rarely appears in practice. It should also be noted that when it is 100% certain that the normal image in the image pair is normal, case 4 is executed, otherwise only cases 1-3 are executed.

[0146] Optionally, after step 640, the remaining normal images may be randomly screened so that the current ratio of the current black samples to the white samples is a preset ratio, or the current ratio of the two is within a set range.

[0147] The above embodiment provides a construction and cleaning method of the second cheating image, which can prevent the second cheating image from bringing too much label noise, and can also improve the quality of the sample image and the training accuracy.

[0148] In some embodiments, the second cheating image of the structure is required to be used in both the first stage and the second stage. Since the ratio of black samples and white samples needs to be as preset as possible during fine-tuning, or the current ratio of the two is within a set range, so as to facilitate better fine-tuning. Then data integration needs to be performed. It should also be noted that the following embodiments are applicable to any stage where the second cheating image needs to be used, that is, applicable to the first stage and also applicable to the second stage, and only the second stage is used as an example here for explanation. Exemplarily, for the second stage sample image used in the second stage, the second stage sample image includes a normal image, a first cheating image and a second cheating image. The method also includes steps 650, 660, and 670.

[0149] Step 650: Integrate and count the number of white samples of the current normal image and the number of black samples of the cheating image, where the cheating image includes the first cheating image and the second cheating image.

[0150] Step 660: based on the size relationship between the number of white samples and the number of black samples, extract normal images and cheating images of a preset ratio.

[0151] Step 670: Use the normal image and the cheating image with a preset ratio as the second-stage sample images used in the second stage.

[0152] In the step of integration and statistics, the cheating image includes a first cheating image and a second cheating image, wherein, when the present embodiment is applied to the first stage, since the first cheating image is not needed, the cheating image at this time is only the second cheating image; when the present embodiment is applied to the second stage, since a mixed sample image is needed, the cheating image at this time includes both the first cheating image and the second cheating image. Exemplarily, the computer device integrates and counts the number of white samples of the current normal image and the number of black samples of the cheating image, and the cheating image includes the first cheating image and the second cheating image; in one example, the second cheating image may not include the second cheating image constructed by the program automatic simulation drawing. Next, based on the size relationship between the number of white samples and the number of black samples, a preset ratio of normal images and cheating images is extracted. Finally, the preset ratio of normal images and cheating images are used as the second stage sample images used in the second stage.

[0153] In some embodiments, step 660 is implemented as case one or case two, wherein case one includes step 661 , step 662 , and step 663 , and case two includes step 664 , step 665 , step 666 , and step 667 .

[0154] Case 1: When the number of black samples is greater than the number of white samples.

[0155] Step 661: randomly sample the current normal image to obtain a new normal image, so that the current total number of cheating images and normal images is the same.

[0156] Step 662: construct a preset number of second cheating images based on the current normal images, and generate the same number of normal images at the same time, and copy or perform image enhancement on the same number of normal images to obtain twice the number of normal images, so that the current ratio of normal images to cheating images reaches a preset ratio.

[0157] Step 663: When the current ratio does not reach the preset ratio, a normal image is randomly added to make the current ratio reach the preset ratio.

[0158] Exemplary, when the number of black samples is greater than the number of white samples, the computer device first randomly samples the current normal image to obtain a new normal image, and increases the number of the current normal image so that the cheating image is the same as the current total number of normal images, and the current ratio of the black sample and the white sample is 1:1. Next, based on the current normal image, a preset number of second cheating images is constructed, and the preset number is default or user-defined, for example, the preset number is 3k. During the construction process, each second cheating image generated will generate a normal image, so the same number of normal images will be generated at the same time, that is, 3k normal images are generated at the same time. Here, the same number of normal images are also copied once or image enhancement is performed once to obtain twice the number of normal images, that is, the normal image at this time is 6k, so that the current ratio of the normal image to the cheating image reaches the preset ratio, that is, the preset ratio of the black sample and the white sample is set to 1:2. Finally, when the current ratio does not reach the preset ratio, the normal image is randomly supplemented so that the current ratio reaches the preset ratio, and finally the black sample and the white sample reach 1:2.

[0159] Optionally, in the process of constructing a preset number of second cheating images based on the current normal image in step 662, when the normal images are exhausted and the constructed second cheating images do not reach the preset number, and the current ratio does not reach the preset ratio, normal images are randomly supplemented from the normal images of the image pairs whose prediction results are the first prediction results and have not been extracted, so that the current ratio reaches the preset ratio.

[0160] For example, in the case where there are more black samples than white samples, first randomly sample white samples so that the ratio of black and white samples reaches 1:1. Then construct a quantitative 3k black samples, and continue constructing until it reaches 3k. At the same time, since there will be a white sample for every black sample generated, 3k white images are generated at the same time. At this time, the white sample is copied once or the image is enhanced once. Finally, white samples are randomly supplemented so that the final black and white sample ratio reaches 1:2. When the white samples used for construction are exhausted, and 3k black samples have not been constructed, the current black and white sample ratio is greater than 1:1. When it does not reach 1:2, some of the white samples that were discarded in the first prediction result in Table 1 can be added to make the upper limit of the ratio reach 1:2.

[0161] Case 2: When the number of black samples is less than the number of white samples.

[0162] Step 664, based on the current normal image, construct a preset number of second cheating images, and at the same time generate the same number of normal images, copy the same number of normal images or perform image enhancement to obtain twice the number of normal images, so that the current ratio of normal images to cheating images reaches a preset ratio.

[0163] Exemplarily, when the number of black samples is less than the number of white samples, for example, the ratio of black samples to white samples is 1:5, the computer device constructs a preset number of second cheating images based on the current normal image, the preset number is default or user-defined, for example, the preset number is 3k. During the construction process, each time a second cheating image is generated, a normal image will be generated, so the same number of normal images will be generated at the same time, that is, 3k normal images are generated at the same time. Here, the same number of normal images are also copied once or image enhancement is performed once to obtain twice the number of normal images, that is, the normal images at this time are 6k, so that the current ratio of normal images to cheating images reaches the preset ratio, that is, the preset ratio of black samples to white samples is set to 1:2.

[0164] Optionally, in the process of constructing a preset number of second cheating images based on the current normal image in step 664, at least one of step 665, step 666 and step 667 is also included.

[0165] Step 665: When the number of constructed second cheating images reaches a preset number and the current ratio does not reach the preset ratio and is not within a set range, a portion of normal images is randomly discarded so that the current ratio reaches the preset ratio.

[0166] Step 666, when the number of constructed second cheating images reaches the preset number, and the current ratio does not reach the preset ratio, and the current ratio is within the set range, the normal image and the cheating image of the current ratio are used as the second stage sample images used in the second stage.

[0167] Step 667: when the current normal images are exhausted and the constructed second cheating images do not reach the preset number, and the current ratio is not within the set range, a portion of the normal images is randomly discarded so that the current ratio reaches the preset ratio.

[0168] Exemplarily, when the number of the second cheating images constructed reaches a preset number, for example, 3k, and the current ratio does not reach the preset ratio, and the current ratio is not within the set range, the maximum ratio of the black sample to the white sample in the set range can be 1:5, and at this time, a portion of the normal images is randomly discarded so that the current ratio reaches the preset ratio. When the number of the second cheating images constructed reaches a preset number, for example, 3k, and the current ratio does not reach the preset ratio, and the current ratio is within the set range, the construction of the second cheating image is stopped, and the normal image and the cheating image of the current ratio are used as the second stage sample images used in the second stage. When the current normal image is exhausted and the second cheating image constructed does not reach the preset number, and the current ratio is not within the set range, a portion of the normal image is randomly discarded so that the current ratio reaches the preset ratio.

[0169] For example, in the case where there are more white samples than black samples, for example, the ratio of black samples to white samples is 1:5. First, construct black samples according to the set 3k, and continue to construct until 3k is reached. Since there will be 1 white sample for every black sample generated, 3k white images are generated at the same time. At this time, the white sample is copied once or the image is enhanced once. At this time, the current black and white sample ratio is counted. When it does not reach 1:2, continue to extract the remaining white samples to make the black and white sample ratio reach 1:2. If the white samples are exhausted and 3k black samples cannot be constructed, the current black and white sample ratio is counted. When it does not reach 1:2, continue to extract the remaining white samples to make the black and white ratio reach 1:2. If the current black and white sample ratio exceeds the maximum ratio of 1:5, the white samples are downsampled.

[0170] The above embodiment provides a method for constructing a second cheating image and setting a ratio of black and white samples, which can ensure the quality of sample images and improve training accuracy.

[0171] The model is online.

[0172] In some embodiments, for the i-th stage of the multiple stages of the cheating detection model, after the i-th stage cheating detection model is obtained after fine-tuning, the i-th stage cheating detection model can be launched online to perform cheating detection on the client based on the client image. Then, after step 260, the method further includes steps 710, 720, and 730.

[0173] Step 710: Launch the i-th stage cheating detection model.

[0174] Step 720, obtaining the client image when the client is running.

[0175] Step 730: Input the client image into the i-th stage cheating detection model to obtain a prediction result; wherein the prediction result is used to indicate whether the client is cheating.

[0176] Going online means that the model is online, and the i-th stage cheating detection model can be used to implement cheating detection when the client is running. Exemplarily, after obtaining the i-th stage cheating detection model, the computer device also goes online with the i-th stage cheating detection model. Next, the client image when the client is running is obtained; the client image is input into the i-th stage cheating detection model to obtain a prediction result; wherein the prediction result is used to characterize whether the client is cheating. In a possible implementation method, the prediction result is the possibility of cheating that the client is cheating.

[0177] In some embodiments, after the i-th stage cheating detection model is launched, the client image detected by the i-th stage cheating detection model can continue to be used as the i+1-th stage sample image. That is, the i-th stage cheating detection model is also used to assist in obtaining the i+1-th stage sample image after it is launched.

[0178] In this embodiment, a prediction method is provided after the cheating detection model of the i-th stage is put online, so that cheating detection is performed on the client. Since the cheating detection models of each stage can be put online, a rapid response is achieved.

[0179] In some embodiments, for client images that are predicted to be black and may contain cheating, text detection technology, such as optical character recognition (OCR) technology, is further combined to determine the final penalty result for the client. Optionally, after step 730, steps 740, 750, 760, and 770 are also included.

[0180] Step 740: When the cheating possibility in the prediction result is greater than the threshold, the client image is input into a text detection model to detect and obtain text.

[0181] Step 750, perform keyword matching on the text to obtain matching results.

[0182] Step 760: If the matching result is successful, a penalty result is imposed on the client.

[0183] Step 770: If the matching result is a failure, the client image is sent to the review end for review.

[0184] The text detection model is used to detect text with any shape, content, and size. The text detection model can be at least one of a convolutional neural network (CNN), a bidirectional long short-term memory network (LSTM), a natural language processing model, and an OCR detection model. Keywords are some keywords related to cheating, including plug-ins, function catalogs, and other keywords.

[0185] If the text contains keywords, or the text and keywords have the same semantics or the semantic similarity is greater than the threshold, the match result is a successful match, and the computer device directly imposes a penalty on the client. The more keywords the text contains, or the closer the semantics of the text and keywords are, the greater the penalty.

[0186] When the text does not contain keywords, or the semantics of the text and the keywords are not exactly the same or the semantic similarity is less than a threshold, the matching result is a matching failure, and the computer device sends the client image to the review end for review, which can be manual review or review by other means.

[0187] In this embodiment, a method for judging fraud by the cheating detection model in the i-th stage is provided, which can be further combined with text detection technology to make direct penalties or send it to manual review, further improving the accuracy of cheating detection.

[0188] In some embodiments, when i is equal to 2 or 3, that is, after the second-stage cheating detection model is launched, or after the third-stage cheating detection model is launched, the operator can further perform secondary fine-tuning on the second-stage cheating detection model and / or the third-stage cheating detection model according to the situation of performing cheating detection on the client image, or when some missed or misjudged client images are found. Exemplarily, the method further includes steps 780 and 790.

[0189] Step 780: construct an incremental data set based on the normal images and cheating images that failed to be predicted in the current stage.

[0190] Step 790: fine-tune the current cheating detection model for a second time based on the incremental data set.

[0191] The normal image that failed to be predicted includes the normal image that was misjudged. The cheating image that failed to be predicted includes the normal image that was missed. In this embodiment, the cheating image that failed to be predicted can be a first cheating image or a second cheating image. The current stage can be the second stage or the third stage. Optionally, the computer device constructs an incremental data set based on the normal images that failed to be predicted and the cheating images that failed to be predicted in the current stage; based on the incremental data set, the cheating detection model of the current stage is fine-tuned for the second time. Among them, the method of the second fine-tuning is consistent with the method of the above-mentioned fine-tuning. Optionally, the second fine-tuning can be repeated for 1-2 times.

[0192] In this embodiment, a secondary fine-tuning method is provided, which can further improve the accuracy of cheating detection performed by the cheating detection model at each stage. At the same time, some misjudged or missed client images can be learned through the incremental data set, so that the model after the secondary fine-tuning can avoid misjudgment or missed judgment as much as possible.

[0193] In some embodiments, with respect to the construction method of the incremental data set, step 780 is specifically implemented as step 781 , step 782 , step 783 , step 784 , and step 785 .

[0194] Step 781, obtaining the normal image and the cheating image that failed to be predicted at the current stage.

[0195] Step 782: perform retrieval based on the semantic vector of the cheating image that failed to be predicted, and obtain the top N matching normal images with the highest similarity to the cheating image that failed to be predicted, where N is greater than 0.

[0196] Step 783, extract the cheating traces in the cheating image for which the prediction fails, and extract the misjudgment area that causes the prediction failure in the normal image for which the prediction fails.

[0197] Step 784, in the matched normal image and the randomly selected normal image, the extracted cheating traces are pasted to construct an incremental cheating image, or the extracted misjudged area is pasted to construct an incremental normal image.

[0198] Step 785, obtaining an incremental data set based on the normal image that failed to be predicted and the corresponding original normal image and the normal image after image enhancement, the cheating image that failed to be predicted, the incremental normal image, the incremental cheating image, the matched normal image and the randomly selected normal image.

[0199] Optionally, for each normal image in the sample images of each stage and each cheating image in at least one cheating image, a corresponding semantic vector is stored, and the semantic vector is obtained by extracting the penultimate full layer of the cheating detection model of each stage. Exemplarily, the computer device performs retrieval based on the semantic vector of the cheating image that failed to be predicted, and obtains the top N matching normal images with the highest similarity to the cheating image that failed to be predicted, where N is greater than 0. Among them, the scene background of the matching normal image is similar to that of the cheating image that failed to be predicted. N can be set according to actual technical needs, for example, N is set to 5.

[0200] In a possible implementation, the computer device extracts cheating traces in the cheating image with failed prediction in response to a clipping operation, and the computer device mines and extracts the misjudged area that causes the prediction failure in the normal image with failed prediction based on an improved visual interpretation method, such as an improved gradient-weighted class activation mapping (Grad-CAM++).

[0201] Exemplarily, the computer device pastes the extracted cheating traces in the matching normal image and the randomly selected normal image to construct an incremental cheating image, or pastes the extracted misjudged area to construct an incremental normal image. For example, the randomly selected normal images can be 5. Finally, the computer device combines all the normal images that failed to be predicted and the corresponding original normal images and normal images after image enhancement, the cheating images that failed to be predicted, the incremental normal images, the incremental cheating images, the matching normal images and the randomly selected normal images to obtain an incremental data set.

[0202] In this embodiment, a method for constructing an incremental data set is provided, so that the incremental data set can cover all the misjudged or missed client images as much as possible, thereby improving the coverage and accuracy of the cheating detection model.

[0203] Next, as an example, taking the application in the game field, the client is a game client, the client image is a game screenshot, and the cheating detection model performs cheating detection on the game screenshot as an example, the following embodiment describes in detail the training method of the cheating detection model in conjunction with the schematic diagram.

[0204] Product examples.

[0205] Figure 4 This is a schematic diagram of automated modeling for cheating detection provided by an exemplary embodiment of the present application. This solution can automatically complete the construction of sample images, training and evaluation of models with one click. It also supports users to provide additional data and automatically expand the data, and merge them together for training. Exemplarily, users can cold-start and update the model when the game screenshots are just online, or they can manually update the model during any period of operation, or the system can automatically update the model regularly to ensure coverage of various types of cheating in game screenshots, improve the accuracy of cheating detection, and reduce the amount of review of game screenshots. In addition, based on a unified training framework, it can flexibly support different types of model training, including front-end and back-end coverage and accurate automatic punishment model training. Figure 4 In the example shown in step 1, a "Run" button is displayed around the model. After clicking the "Run" button, the computer device generates sample images suitable for model training based on the sample images (training samples) automatically pulled every day and the sample images uploaded manually, and performs training. For example, as shown in step 2, the user can view the progress of the training steps by clicking "Sample". After the model training is completed, as shown in step 3, a "Go Online" button is also displayed. After the user clicks the "Go Online" button, the model goes online.

[0206] Implementation method.

[0207] For the automatic modeling part that can adapt to cold start, fast mixed weighted fine-tuning and fine-tuning, it includes a three-stage model iterative optimization process. Figure 5 It is a schematic diagram of a layered system of a general model for cheating detection provided by an exemplary embodiment of the present application; Figure 6 It is a schematic diagram of automated iteration of models at different stages provided by an exemplary embodiment of the present application.

[0208] refer to Figure 5, a hierarchical system of a general model for detecting cheating in game screenshots, involving a base model 20, an algorithm layer 26, and a data layer 32. The base model 20 includes at least one of the following: a general model for pre-filtering 21, a general model for multi-type coverage preservation 22, a dedicated model for function catalog and box skeleton 23, a dedicated model for local image box skeleton 24, and a dedicated detection model for game plug-in text 25. The algorithm layer 26 includes at least one of the following: a pre-filtering classification algorithm 27, a classification algorithm for coverage preservation 28, a penalty classification algorithm 29, a local penalty classification algorithm 30, and an OCR detection algorithm 31. The data layer 32 includes multiple games, multiple cheating, and normal screenshots 33, multiple game function catalogs, box skeleton whole pictures 34, multiple game function catalogs, box skeleton local pictures 35, and text screenshots 36 (for example: function catalogs).

[0209] refer to Figure 6 , for the first day of launch 40: This stage is the first stage, also known as the cold start phase. Based on the weights of the multi-type general classification model 43 obtained from the pre-trained general model and the construction data of this game, the multi-type general classification model 43 is fine-tuned to obtain a specific game fine-tuning classification model 44 to better adapt to the game scene and cheating type. Among them, combined with Figure 5 The various algorithms use the screenshot data of multiple games accumulated in the historical knowledge sharing library to determine the general image set, and pre-train the general model based on the general image set to obtain a multi-type general classification model 43, which is a dual-model integration of models with two model structures. The model structure can be: ResnetMultiGate and MobileNet.

[0210] There are millions of normal screenshots of various scenes and cheating screenshots of various cheating types in the historical knowledge sharing library. For example, cheating types include solid lines, boxes, rays, skeletons, function catalogs, character perspectives, thermal perspectives, AI plug-in perspectives, etc. These cheating types are cheating traces superimposed on the scene to facilitate user operations. Cheating traces are non-game elements, mainly perspective types. The multi-type general classification model 43 is equivalent to a generalist. As an initialization model for a new game, it can cover a variety of cheating types and has a certain degree of generalization.

[0211] Optionally, the multi-type general classification model 43 can specifically be a general whole-picture classification model. Due to some small cheating traces in the whole picture, the general whole-picture classification model is easy to miss, and most of the small cheating traces are distributed near the center area of ​​the whole picture. Therefore, in addition to the general whole-picture classification model, a local picture general classification model with a fixed size in the center area of ​​the whole picture can also be used. At the same time, the function directory contains all the functions of the plug-in, including perspective, self-aiming, flying, etc., and users will also check the function directory of the plug-in when playing games, so as to use related functions, so the probability of including the function directory in the game screenshot is also relatively large. For the general whole-picture classification model, it is also easy to miss these function directories, so the function directory model can also be used. In the cold start environment, the multi-type general classification model 43 integrated by the above three models and pre-trained can be launched. These three models are all trained using a general image set containing multiple terminals, mobile games, multiple scene pictures, and multiple cheating types.

[0212] In order to better adapt to the scene screen of this game, better distinguish normal screenshots (called white samples) from cheating images (called black samples), cheating images are constructed based on normal screenshots of this game to form the construction data of this game, and further fine-tuning is performed.

[0213] First, for the general whole-image classification model in the multi-type general classification model 43, the sample expansion method includes: the program simulates drawing cheating traces (for example, solid lines, dotted boxes, skeletons, rays, function catalogs) in the normal screenshot to obtain cheating images, and based on the accumulated cheating template maps (for example, function catalogs, thermal perspectives), maps are mapped in the normal screenshot to generate cheating images. The ratio of black and white samples is between 1:2 and 1:3.

[0214] Second, for the function catalog model in the multi-type general classification model 43, the sample expansion method includes: program simulation drawing of cheating images containing function catalogs, and pasting the accumulated function catalog template maps on the normal screenshots to generate cheating images. The ratio of black and white samples is between 1:5 and 1:10.

[0215] Since the cheating images automatically constructed by the program may have cheating traces overlapping with the scene background, resulting in blurred cheating traces. Moreover, the cheating images automatically constructed by the program are large in magnitude. In order to avoid label noise brought by the cheating images automatically constructed by the program, it is necessary to clean these constructed cheating images.

[0216] Figure 7It is a schematic diagram of sample generation and construction provided by an exemplary embodiment of the present application. Briefly described as follows: 7-1. Get a normal image of the game, specifically a random screenshot of the game when a whitelist account plays the game normally; 7-2. The program automatically constructs a cheating image based on the normal image; 7-3. Get the cheating image and input it into the filtering model labeled 7-5 to get a prediction result. Among them, the filtering model is pre-trained based on the general image set labeled 7-4. The prediction results include four types, as shown in Table 1 of the aforementioned embodiment. Next, 7-6. Based on the prediction results, perform image redistribution on the constructed cheating images and normal images, and construct a new sample image set of preset proportions for fine-tuning in order to better fine-tune the model.

[0217] Specifically, for the first prediction result, the filtering model can predict completely correctly, and randomly sample a part as a sample image. For the second prediction result, the corresponding normal image and the cheating image will be used as sample images. For the third prediction combination, a part of the constructed cheating images are randomly discarded, and all normal images and a part of the constructed cheating images are retained. For the fourth prediction result, it rarely appears, and only the normal image is retained. It should also be noted that if the constructed cheating image is used as a sample image, it must be equipped with a corresponding normal image, which can emphasize the difference in cheating traces, so that the model can pay attention to the normal scene picture and cheating trace features. Next, it is also necessary to determine whether the constructed cheating image reaches a preset number, for example, 3-5k, until a preset number of cheating images are constructed, or until the normal images used in the cheating image process during construction are exhausted. Finally, according to all the cheating images obtained by construction and the existing normal aftertaste, the remaining normal images are randomly screened to form a sample image set with a preset black and white sample ratio, and fine-tune the multi-type general classification model 43 to obtain a specific game fine-tuning classification model 44.

[0218] Figure 8This is a prediction flow chart of a cold start general classification model provided by an exemplary embodiment of the present application. After the specific game fine-tuning classification model 44 that has been fine-tuned by the domain-constructed data is launched on the cold start, it can cover more cheating images and can be directly punished. The prediction process is briefly described as follows: 8-1. Get the game screenshots at this time; next, 8-2. Input the game screenshots into the multi-type general classification model 1, specifically MobileNet-V3; at the same time, 8-3. Input the game screenshots into the multi-type general classification model 2, specifically MultiGate-XTSE; at the same time, 8-4. Input the game screenshots into the function directory model; 8-5. When the multi-type general classification model 1 and the multi-type general classification model 2 are judged as highly suspicious game screenshots, continue to execute 8-7. Merge and remove duplicates; 8-6. When the function directory model is judged to be black, input it to the OCR detection model, continue to execute 8-8. Keyword matching, when the match fails, continue to execute 8-7. Merge and remove duplicates, and then execute 8-9. Continue manual review, when the match is successful, execute 8-10. Directly punish the client.

[0219] Continue to refer Figure 6 , for the first week of launch 41: This stage is the second stage, which can be started with one click within a week. Specifically, it uses constructed data and manually annotated data to perform hybrid weighted fine-tuning. After the second stage of training, a specific game hybrid fine-tuning classification model 45 integrating two models will be launched. The model structure can be a ResnetMultiGate and MobileNet series model. The specific game hybrid fine-tuning classification model 45 is based on the weights of the specific game fine-tuning classification model 44 in the first stage, combined with manually annotated data and constructed data to perform hybrid weighted fine-tuning.

[0220] Fig. 9 This is a schematic diagram of sample construction and model training provided by an exemplary embodiment of the present application, which is an overall process framework for sample image construction and cleaning as well as model training and evaluation. Fig. 9 , there are four branches from top to bottom.

[0221] The first branch: through the image enhancement module labeled 9-2, the screenshots that have been found to be frequently misjudged and missed are expanded through image enhancement to ensure that specific plug-in screenshots are covered. Image enhancement includes horizontal flipping, brightness, color, saturation adjustment, sharpening, noise addition and mosaic. The above-mentioned black and white samples labeled 9-1 that need to perform image enhancement used in the first branch can be provided by manual upload.

[0222] The second branch is the manually reviewed sample numbered 9-3. This second branch can be obtained from the daily blacklist screenshots of the review model during the operation process.

[0223] The third branch: is based on the cheating template texture in the texture library labeled 9-5. Through the texture module labeled 9-6, the cheating template texture is pasted on the white sample labeled 9-4 to generate a cheating image. The white sample is a normal image randomly selected.

[0224] The fourth branch: is to use a program for simulating the drawing of cheating traces to automatically construct a cheating image for the white sample labeled 9-7. For example, based on drawing a 20% solid line and 15% dotted line square box white image, a black box image labeled 9-8 is obtained; based on drawing a 30% skeleton white image, a black skeleton image labeled 9-9 is obtained; based on drawing a 5% line white image, a black line image labeled 9-10 is obtained; based on drawing a 30% text box white image, a black text box image labeled 9-11 is obtained. Here, for the above-mentioned various constructed cheating images, use Figure 7 The filtering method introduced performs cleaning, that is, inputs into the general model numbered 9-12 to perform prediction. The generalized model here is the aforementioned filtering model. The model structure can be MobilenetV4, in which the normal image (white sample) can be obtained by taking random screenshots of the game played by the whitelist account.

[0225] For the above four branches, all black and white samples are cleaned and merged according to steps 9-13 to achieve integration. Specifically, based on image enhancement, manual review data (manually labeled data) and cheating template maps, existing black and white samples are obtained, and according to the current number of black and white samples, the program simulates the drawing of black samples.

[0226] First, in the case where there are more black samples than white samples, first randomly sample white samples so that the ratio of black and white samples reaches 1:1. Then construct a quantitative 3k black samples, and continue constructing until it reaches 3k. At the same time, since there will be a white sample for every black sample generated, 3k white images are generated at the same time. At this time, the white sample is copied once or the image is enhanced once. Finally, white samples are randomly supplemented so that the final black and white sample ratio reaches 1:2. When the white samples used for construction are exhausted and 3k black samples have not been constructed, the current black and white sample ratio is greater than 1:1. When it does not reach 1:2, some of the white samples that were discarded in the first prediction result in Table 1 can be added to make the upper limit of the ratio reach 1:2.

[0227] Secondly, for example, for the case where there are more white samples than black samples, for example, the ratio of black samples to white samples is 1:5. First, construct black samples according to the set 3k, and continue to construct until 3k is reached. Since there will be 1 white sample for every black sample generated, 3k white images are generated at the same time. At this time, the white sample is copied once or the image is enhanced once. At this time, the current black and white sample ratio is counted. When it does not reach 1:2, continue to extract the remaining white samples so that the black and white sample ratio reaches 1:2. If the white samples are exhausted and 3k black samples cannot be constructed, the current black and white sample ratio is counted. When it does not reach 1:2, continue to extract the remaining white samples so that the black and white ratio reaches 1:2. If the current black and white sample ratio exceeds the maximum ratio of 1:5, the white samples are downsampled.

[0228] After the data cleaning and merging of label 9-13 are completed, stratified sampling is performed into the training set of 9-14 and the validation set of 9-15 (corresponding to the aforementioned test set) to ensure the uniformity of the sample image and reduce label noise. Next, hybrid weighted fine-tuning is performed through the training module of label 9-16. Optionally, the training module here has the ability to perform training for 1601. large image and small image pre-model, 1602. large image coverage model, 1603. large image direct penalty model, 1604. local image direct penalty model, 1605. small image coverage model, 1606. small image direct penalty model. Finally, after performing the model evaluation of 9-17 based on the validation set, it can be put online.

[0229] In the second stage, hybrid weighted fine-tuning is performed based on manually annotated data and constructed data, and the weight of the constructed data is different from that of the manually annotated data. When optimizing the loss in this stage, the weight of the cheating template map and the cheating images constructed by program simulation and their corresponding normal images is 1, and the weight of the cheating images manually reviewed, manually uploaded and enhanced and their corresponding normal images is 2. At the same time, when calculating the accuracy and coverage of the validation set and saving the optimal model, the weight logic for different images is consistent with the loss optimization logic.

[0230] Fig.10It is a prediction flow chart of a hybrid fine-tuning classification model provided by an exemplary embodiment of the present application. After the hybrid fine-tuning classification model 45 for specific games obtained in the second stage is launched, the cheating detection effect is better than that of the first stage, achieving higher cheating detection coverage in a shorter time. At the same time, due to the use of more game scene pictures, the accuracy of cheating detection is also improved. For game screenshots that are judged to be black, direct penalties can be imposed in combination with OCR detection and keyword matching. At the same time, when the amount of manually annotated data of the hybrid fine-tuning classification model 45 for specific games in the second stage does not reach the level required in the third stage, secondary fine-tuning or regular fine-tuning can be continued. For game screenshots with only dozens of cheaters, the amount of pictures manually reviewed in the second stage will generally be controlled within 300, covering 90%+.

[0231] The prediction process is briefly described as follows: 10-1. Get the game screenshot at this time; next, 10-2. Input the game screenshot into the multi-type exclusive classification model 1, specifically MobileNet-V3; at the same time, 10-3. Input the game screenshot into the multi-type exclusive classification model 2, specifically MultiGate-XTSE; 10-4. When the multi-type exclusive classification model 1 and the multi-type exclusive classification model 2 determine that the game screenshot is highly suspicious, continue to execute 10-6. Merge and remove duplicates, and execute 10-5. Input to the OCR detection model, continue to execute 10-7. Keyword matching, when the match fails, continue to execute 10-6. Merge and remove duplicates, and then execute 10-8. Continue manual review, when the match is successful, execute 10-9. Directly punish the client. In the second stage, compared with the fine-tuning method based only on manually reviewed data (manually labeled data), under the condition of the same review volume, the specific game hybrid fine-tuning classification model 45 obtained by hybrid weighted fine-tuning can detect more cheating images every day. Therefore, more cheating images can be accumulated every day, and combined with the regularly reviewed cheating images, the third stage can be carried out faster.

[0232] Continue to refer Figure 6 , for the two weeks or weeks online 42: This stage is the third stage. Based on the weights of the specific game hybrid fine-tuning classification model 45 obtained in the second stage, combined with manually annotated data, some normal images and cheating images that are misjudged and missed and require image enhancement, and a small number of small cheating templates that may exist and require mapping, the specific game fine-tuning classification model 46 of the third stage can be fine-tuned based on such manually annotated data. Its cheating detection accuracy will be higher and the coverage will be better. For game screenshots with only a few dozen people cheating, the number of images reviewed will be controlled below 100, and the coverage will be 90%+. Furthermore, after the specific game hybrid fine-tuning classification model 45 goes online, it can also be combined with OCR detection and keyword matching for direct punishment. Its prediction process can continue to refer to Fig.10 .

[0233] Fig.11 is a schematic diagram of a unified training framework provided by an exemplary embodiment of the present application. The above three stages are all based on Fig.11 The training is performed using a unified training framework. Among them, the training framework includes an algorithm structure library labeled 11-2, a base model labeled 11-3, a data parallel reading module labeled 11-4, and a model training and optimization module labeled 11-5. The data parallel reading module labeled 11-4 can read various images labeled 11-1, for example, large and small images common to single and multiple games or specific cheating types. It also supports any amount of data and can flexibly add data. The model training and optimization module labeled 11-5 supports TensorFlow and pytorch frameworks, and outputs the model file labeled 11-6 when the training is completed. The prediction module labeled 11-7 is used to implement the online and perform predictions. The prediction module supports the TensorFlow onnx format. The functions of the above modules are separated, and the versatility is stronger, which can reduce the tedious work of developing new algorithms and facilitate the addition of new algorithms. For non-technical personnel, it is only necessary to obtain a sample image set based on the above-mentioned embodiment, select a suitable algorithm or use the default algorithm, and the three-stage model can be quickly trained. This embodiment supports manual and regular automatic operation of the above three stages, and quickly and flexibly adapts to various operational needs. Furthermore, it can not only support model training of the above multiple cheating types, but also support model training of specific cheating types, and only needs to provide corresponding sample images.

[0234] Fig.12 is a schematic diagram of a background program framework provided by an exemplary embodiment of the present application, which is a background program framework for sample construction and model self-service training and pre-evaluation. Fig.12, the background program framework mainly includes: open the directory 1. Cfs / ids / , which is divided into 2. Data / gameid and 3. Ibox; for 2. Data / gameid, it further includes 2-1. Resources, 2-2. Models, 2-3. Samples, 2-4. Configuration; for 2-1. Resources, including 2-10. After the task is started, the daily scheduled task pulls the corresponding black and white samples and stores them in the directory; for 2-2. Models, including 2-20. Model files, specifically at least one of the following: Backup_model model backup, online_model online model, pre_model pre-trained model, sys_model base model, vs_model Compare models; for 2-3. Samples, including 2-30. Generate samples / train samples / training results; for 2-4. Configuration, including 2-40. Configuration file (pull sample images, generate sample images, and configuration of input required for training models); for 3. Ibox, further including 3-1. Common, 3-2. Configuration; for 3-1. Common, including 3-11. Sample generation program, 3-12. Common functions, 3-13. Training framework; for 3-2. Configuration, including 3-21. Initialization task configuration, 3-22. Initialization configuration. The front-end page can be referenced Figure 4 , for the background program framework, after configuring the game id, click the run button to automatically train the model and evaluate it with one click, including the automatic construction of sample images in the above embodiments, automatic training of the model and evaluation of the verification set. In addition to one-click automatic modeling, it also supports manual uploading of specific cheating template maps and important misjudged or missed cheating images and normal images that require image enhancement, to achieve automatic expansion of sample images, and to combine with existing automatic pull review screenshots, program automatic generation of cheating images and classic cheating template maps to generate cheating images, image enhancement, etc., to construct a more comprehensive sample image, and then automatically train the model. Among them, whether to use automatically constructed sample images or only use manually annotated sample images to perform model training is also an optional operation. Finally, it also supports uploading test data for model evaluation. During model evaluation, it can generate a receiver operating characteristic curve (ROC curve), a precision-recall curve (PR curve) and a confusion matrix.

[0235] In some embodiments, in addition to automatic and regular operation of the three stages, operators can also manually operate according to the confrontation situation of the game screenshots. In particular, for the third stage, special adaptation can be made to some urgent, missed or wrongly judged game screenshots found during the operation. Among them, the missed game screenshots are cheating images, and the wrongly judged game screenshots are normal images. Fig.13This is a flowchart of secondary fine-tuning provided by an exemplary embodiment of the present application. 13-1. For a small number of game screenshots that are misjudged or missed during operation, 13-2. Perform image enhancement, and at the same time, 13-3. For the cheating images in these game screenshots, extract the cheating template map, and add the cheating template map to the normal image to construct the cheating image, thereby obtaining the incremental data set of 13-4; based on the currently online model of 13-5, use the incremental data set to perform secondary fine-tuning to obtain 13-6 a new model; combine the game screenshots in the test set of 13-7 to evaluate the new model, execute 13-12 to determine whether the cheating detection effect is better, if so, execute 13-13 to put the model online, if not, it is necessary to reconstruct the incremental data set to repeat the secondary fine-tuning.

[0236] For the game screenshot that was missed in the 13-8 test set, which is a cheating image, we first retrieve the top 5 normal images with similar scene backgrounds from a large number of normal images based on the semantic vector of the game screenshot, where the semantic vector is obtained by extracting the second-to-last full layer of the general classification model. Next, we extract the cheating template map of the game screenshot and paste it on 5 randomly selected normal images and the 5 normal images retrieved above to construct the 13-9 incremental cheating images. These incremental cheating images and their corresponding normal images are added to the 13-4 incremental data set, and secondary fine-tuning is performed iteratively.

[0237] For the game screenshot that was misjudged in the 13-10 test set, which is a normal image, first retrieve the top 5 normal images with similar scene backgrounds from a large number of normal images based on the semantic vector of the game screenshot, where the semantic vector is obtained by extracting the penultimate full layer of the general classification model. Next, use Grad-CAM++ to dig out the misjudged areas that may cause misjudgment, extract the misjudged areas, and map them in 5 randomly selected normal images and the 5 normal images retrieved above to construct 13-11 incremental normal images. Add these incremental normal images and their corresponding normal images to the 13-4 incremental data set, and iterate to perform secondary fine-tuning. The above secondary fine-tuning process is generally repeated 1-2 times, and operators can also directly participate in the adjustment. This secondary fine-tuning process can not only be used to update the classification model of multiple cheating types, but also to update the classification model of specific cheating types.

[0238] In summary, the three-stage automated modeling process of this embodiment can be used not only for background model updates of game screenshots, but also for front-end model updates, which can better support the cold start of each model in the whole process and the model iteration update during the operation confrontation, and can achieve excellent detection results more quickly, and can save more than double the audit and operation manpower. Among them, in the first stage, the cheating coverage of the cheating detection model in the first stage will be 10%-20% higher than the solution of the general model directly launched, and the OCR direct punishment can be partially opened. Compared with the relevant technical methods, since more cheating images can be audited in a shorter time and more data can be accumulated, the hybrid weighted fine-tuning of the second stage can be opened in a shorter time. Compared with the method based on a small amount of audit data combined with the general model weight execution fine-tuning, its cheating coverage rate will increase by about 5%-10%, because the model judges more cheating images as black, and the amount of data directly punished by OCR is also higher. Furthermore, in the same period of time, the second stage judges black images and can accumulate more cheating images in combination with the review. Compared with the method of updating the model by accumulating review data in the related art, the related art cannot retrieve some black images due to the low cheating coverage, and needs to review more gray samples or even white samples to find the same amount of cheating images. However, the second stage of this embodiment accumulates more cheating images, so the cheating detection effect is better. The fine adjustment in the third stage further improves the cheating detection effect.

[0239] Since each stage can achieve better results than the method of updating the model in the related art, the optimal cheating detection effect can be achieved faster through accumulation. The entire training process of the three stages of this embodiment has a progressive relationship. The output of the first stage is better, so that more high-quality data can be provided for the second stage faster, shortening the time to start the second stage modeling. Similarly, the time to start the third stage modeling can be shortened. The entire automated modeling process can be set to run automatically or manually, with high flexibility.

[0240] At the same time, during the operation period, based on Fig.13 The process can update the model with better results within half a day to ensure the stability of the model. Moreover, the process does not require the participation of technical personnel, and operators can choose to participate in the adjustment, which reduces labor costs and reduces the difficulty of learning. Fig.14It is a flowchart of game screenshot cheating detection provided by an exemplary embodiment of the present application. In this embodiment, through the screenshot strategy of full-screen screenshot and / or partial screenshot, 14-1 large picture (whole picture) and / or 14-2 small picture (partial picture) are obtained, the large picture is input into 14-3 lightweight general large picture classification model, and the small picture is input into 14-4 lightweight general small picture classification model, and cheating detection coverage is achieved through pre-model filtering, and then, based on 14-5 large picture cheating detection background general framework and 14-6 small picture cheating detection background general framework, cheating detection accuracy can be achieved through these background frameworks, and finally, 14-7 manual review can be combined to further ensure the accuracy of cheating detection. Therefore, the scheme of this embodiment can obtain better cheating detection effect more quickly, reduce the threshold of game screenshot confrontation, and is a game security solution for fast confrontation of game screenshots. At the same time, it can save audit manpower and operation manpower, improve modeling efficiency, quickly suppress plug-ins, and help improve player experience. Due to the fast response speed, it can further win continuous praise from players and external service providers, and enhance the reputation of the department's game security resistance capabilities.

[0241] Fig.15It is a schematic diagram of a multi-model parallel automatic penalty method provided by an exemplary embodiment of the present application. In addition to combining OCR detection, automatic penalties can also be made based on the whole picture box, skeleton classification model, local picture box, skeleton classification model, and function directory exclusive classification model. It only needs to provide the corresponding exclusive type sample image, and the aforementioned embodiment can be used to perform sample expansion, for example, image enhancement, program simulation of cheating traces, classic template mapping, and random capture of normal images. The unified training framework based on the aforementioned embodiment can also quickly fine-tune the model to achieve real-time automatic penalties for most cheating images, and a small amount of manual review to supplement the coverage of application scenarios. The prediction process is briefly described as follows: 15-1. Get the game screenshot at this time; next, execute 15-2. Input the game screenshot into the multi-type exclusive classification model 1, specifically MobileNet-V3; at the same time, execute 15-3. Input the game screenshot into the multi-type exclusive classification model 2, specifically MultiGate-XTSE; at the same time, execute 15-4. Input the game screenshot into the function directory exclusive classification model; when 15-2, 15-3 and 15-4 are all judged as 15-5. Highly suspicious game screenshots, three branches are executed: First, execute 15-6. Cut out a local game screenshot from the highly suspicious game screenshot, then execute 15-8. Input the local game screenshot into the local graph skeleton classification model, specifically MobileNet-V3, and at the same time execute 15-9. Input the local game screenshot into the local graph box classification model, specifically MobileNet-V3, and continue to execute 15-14. Probabilistic strategy, as cheating If the possibility is greater than the threshold, execute 15-17. Make direct punishment. If the possibility of cheating is less than the threshold, execute 15-15. Merge and remove duplicates. Second, execute 15-10. Input the highly suspicious game screenshots into the whole-image skeleton classification model, specifically MobileNet-V3, and execute 15-11. Input the highly suspicious game screenshots into the whole-image box classification model, specifically MobileNet-V3, and continue to execute 15-12. Multiple hit strategies. If both hit, it is a hit success. Continue to execute 15-13. Make direct punishment. If both do not hit, it is a hit failure. Continue to execute 15-15. Merge and remove duplicates, and then execute 15-18. Send to manual review. Third, execute 15-7. Input the highly suspicious game screenshots into the OCR detection model, and continue to execute 15-16. Keyword matching. If the match is successful, execute 15-15. Merge and remove duplicates. If the match fails, execute 15-19. Make direct punishment.

[0242] In other scenarios, the three-stage model update and rapid operation confrontation method of this embodiment can be used not only in the confrontation with plug-ins in game screenshots, but also in other image anomaly detection scenarios, for example, in image detection in social and live broadcast scenarios, and can also be extended to text anomaly detection.

[0243] In summary, the cheating detection model training method provided in the embodiment of the present application can realize automatic modeling and automatic training in multiple stages. The cheating detection model in each stage can be put online to realize cheating detection for the client. Due to the use of manually labeled data and constructed data, the sample images required for training in each stage can be obtained in a short time. Moreover, this progressive training process can also provide more high-quality sample images for the next stage, shortening the time consumption of modeling in each stage, improving the modeling efficiency in each stage, thereby reducing the training time consumption and achieving rapid response.

[0244] Fig.16 800 is a block diagram of a cheating detection model training device provided by an exemplary embodiment of the present application. The cheating detection model training device 800 includes at least part of an acquisition module 820 , a processing module 840 , and a training module 860 .

[0245] An acquisition module 820 is used to acquire a sample image of the i-th stage, wherein the sample image of the i-th stage includes a normal image and at least one cheating image, wherein the at least one cheating image includes at least one of a first cheating image annotated when the sample client is running and a second cheating image constructed based on the normal image, wherein i is greater than or equal to 1;

[0246] a processing module 840, configured to determine an i-th stage loss for balancing the normal image and the at least one cheating image in the i-th stage sample images based on an i-th stage cheating detection model and the i-th stage sample images, wherein the i-th stage cheating detection model is obtained by training based on the i-th stage sample images;

[0247] The training module 860 is used to fine-tune the cheating detection model of the i-1th stage with the goal of reducing the loss of the i-th stage to obtain the cheating detection model of the i-th stage.

[0248] In some embodiments, the processing module 840 is configured to:

[0249] Based on the i-1th stage cheating detection model and the i-th stage sample image, predict the i-th stage sample image to obtain i-th stage prediction information;

[0250] Determine the i-th stage loss based on the i-th stage label information of the i-th stage sample image and the i-th stage prediction information, as well as the first weight of the first cheating image and the corresponding normal image, and the second weight of the second cheating image and the corresponding normal image;

[0251] The first weight is greater than the second weight, and the first weight is used to enhance the learning degree of the marked first cheating image and the corresponding normal image.

[0252] In some embodiments, the processing module 840 is configured to:

[0253] Based on the i-th stage label information and the i-th stage prediction information of the i-th stage sample images, determine a first sub-loss of each of the first cheating images, a second sub-loss of each of the second cheating images, and a third sub-loss of each of the normal images in the i-th stage sample images;

[0254] Based on the first weight of the first cheating image and the corresponding normal image, and the second weight of the second cheating image and the corresponding normal image, the first sub-loss, the second sub-loss, and the third sub-loss are weightedly summed to obtain the i-th stage loss.

[0255] In some embodiments, the processing module 840 is configured to:

[0256] multiplying the first weight of the first cheating image by the first sub-loss to obtain a first weighted sub-loss, and multiplying the second weight of the second cheating image by the second sub-loss to obtain a second weighted sub-loss;

[0257] For the third sub-loss of the normal image corresponding to the first cheating image, multiply the first weight by the third sub-loss; and, for the third sub-loss of the normal image corresponding to the second cheating image, multiply the second weight by the third sub-loss to obtain a third weighted sub-loss;

[0258] The first weighted sub-loss, the second weighted sub-loss and the third weighted sub-loss are added together to obtain the i-th stage loss.

[0259] In some embodiments, when i is equal to 1, the i-th stage includes the first stage, the i-th stage loss includes the first stage loss, the i-1-th stage cheating detection model includes a universal cheating detection model, the universal cheating detection model is obtained by pre-training a universal model based on a universal image set, the universal image set includes normal images of multiple clients of the same type of the sample client when running, cheating images including multiple scenes and multiple cheating types, and the first stage sample images include the normal images and the second cheating images; the processing module 840 is used to:

[0260] Based on the universal cheating detection model and the first-stage sample images, performing prediction on the first-stage sample images to obtain first-stage prediction information;

[0261] Based on the first-stage label information of the first-stage sample images and the first-stage prediction information, determining a second sub-loss of each of the second cheating images and a third sub-loss of each of the normal images in the first-stage sample images;

[0262] Multiplying the second weight of the second cheating image and the corresponding normal image by the second sub-loss and the third sub-loss and summing the results to obtain the first stage loss;

[0263] The first-stage loss is used to guide the fine-tuning of the universal cheating detection model.

[0264] In some embodiments, when i is equal to 2, the i-th stage includes the second stage, the i-th stage loss includes the second stage loss, the i-th stage cheating detection model includes the first stage cheating detection model trained in the first stage, and the second stage sample image includes the normal image, the first cheating image and the second cheating image; the processing module 840 is used to:

[0265] Based on the first-stage cheating detection model and the second-stage sample images, performing prediction on the second-stage sample images to obtain second-stage prediction information;

[0266] Determine, based on the second-stage label information and the second-stage prediction information of the second-stage sample images, a first sub-loss of each of the first cheating images, a second sub-loss of each of the second cheating images, and a third sub-loss of each of the normal images in the second-stage sample images;

[0267] Based on the first weight and the second weight, performing weighted summation on the first sub-loss, the second sub-loss and the third sub-loss to obtain the second stage loss;

[0268] The second-stage loss is used to guide the hybrid weighted fine-tuning of the first-stage cheating detection model.

[0269] In some embodiments, when i is equal to 3, the i-th stage includes the third stage, the i-th stage loss includes the third stage loss, the i-1-th stage cheating detection model includes the second stage cheating detection model trained in the second stage, and the third stage sample image includes the normal image and the first cheating image; the processing module 840 is used to:

[0270] Based on the second-stage cheating detection model and the third-stage sample image, performing prediction on the third-stage sample image to obtain third-stage prediction information;

[0271] Determine, based on the third-stage label information and the third-stage prediction information of the third-stage sample images, a first sub-loss of each of the first cheating images and a third sub-loss of each of the normal images in the third-stage sample images;

[0272] Multiplying the first weight of the first cheating image and the corresponding normal image by the first sub-loss and the third sub-loss and summing the results to obtain the third stage loss;

[0273] The third-stage loss is used to guide the fine-tuning of the second-stage cheating detection model.

[0274] In some embodiments, the normal image includes at least one of the following: a normal image when the sample client is running, a normal image that is reviewed or uploaded, and a normal image obtained by performing image enhancement on the normal image; wherein the normal image is obtained by taking a screenshot when a whitelist account uses the sample client;

[0275] The first cheating image includes at least one of the following: a cheating image when the sample client is running, a reviewed or uploaded cheating image, a sampled cheating image, or a cheating image obtained by performing data enhancement on a reviewed, uploaded or sampled cheating image;

[0276] The second cheating image includes at least one of the following: an abnormal image constructed by adding a cheating template map to the normal image, a cheating image constructed by adding the cheating template map to a part of the normal image, a cheating image constructed by a program drawing cheating traces in the normal image, a cheating image constructed by the program drawing cheating traces in a part of the normal image, a cheating image with cheating traces constructed by a generative model, and a cheating image obtained by performing image enhancement on a constructed cheating image;

[0277] Among them, the image enhancement includes at least one of horizontal flipping, brightness, color, saturation adjustment, sharpening, noise addition, and mosaic, and the cheating traces or the cheating template maps include at least one of solid lines, boxes, skeletons, function catalogs, character perspectives, thermal perspectives, and artificial intelligence plug-in perspectives.

[0278] In some embodiments, for the first stage sample image used in the first stage, the first stage sample image includes the normal image and the second cheating image, the acquisition module 820 is used to:

[0279] Acquire the normal image;

[0280] Based on the normal image, construct the second cheating image;

[0281] Inputting an image pair into a filtering model to obtain a prediction result of the image pair, wherein the image pair includes the normal image and the correspondingly constructed second cheating image;

[0282] Based on the prediction result, image redistribution is performed on the normal image and the second cheating image to obtain the first-stage sample image used in the first stage.

[0283] In some embodiments, the acquisition module 820 is used to:

[0284] For the image pair whose prediction result is the first prediction result, extracting at least a part of the image pair;

[0285] For the image pairs whose prediction results are the second prediction results, retain all the image pairs;

[0286] For the image pair whose prediction result is the third prediction result, retaining all normal images and at least a portion of the second cheating image in the image pair;

[0287] For the image pair whose prediction result is the fourth prediction result, retaining all normal images in the image pair;

[0288] Among them, the first prediction result includes that the normal image and the second cheating image in the image pair are both predicted correctly; the second prediction result includes that the normal image in the image pair is predicted correctly and the second cheating image is predicted incorrectly; the third prediction result includes that the normal image in the image pair is predicted incorrectly and the second cheating image is predicted correctly; the fourth prediction result includes that the normal image in the image pair is predicted incorrectly and the second cheating image is predicted incorrectly.

[0289] In some embodiments, for the second stage sample images used in the second stage, the second stage sample images include the normal image, the first cheating image and the second cheating image; the acquisition module 820 is used to:

[0290] Integrate and count the number of white samples of the current normal image and the number of black samples of the cheating image, where the cheating image includes the first cheating image and the second cheating image;

[0291] Based on the size relationship between the number of white samples and the number of black samples, extracting the normal image and the cheating image in a preset ratio;

[0292] The normal image and the cheating image in the preset ratio are used as the second-stage sample images used in the second stage.

[0293] In some embodiments, the acquisition module 820 is used to:

[0294] In the case where the number of black samples is greater than the number of white samples, randomly sampling the current normal image to obtain a new normal image, so that the current total number of the cheating image and the normal image is the same;

[0295] Based on the current normal image, construct a preset number of second cheating images, and generate the same number of normal images at the same time, and copy or perform image enhancement on the same number of normal images to obtain twice the number of normal images, so that the current ratio of the normal image to the cheating image reaches the preset ratio;

[0296] When the current ratio does not reach the preset ratio, randomly supplement the normal image so that the current ratio reaches the preset ratio;

[0297] In the process of constructing a preset number of the second cheating images based on the current normal image, when the current normal image is exhausted and the constructed second cheating images do not reach the preset number, and the current ratio does not reach the preset ratio, the normal images are randomly supplemented from the normal images of the image pairs whose prediction results are the first prediction results and have not been extracted, so that the current ratio reaches the preset ratio;

[0298] or,

[0299] In the case where the number of black samples is less than the number of white samples, constructing the preset number of the second cheating images based on the current normal image, generating the same number of normal images at the same time, and duplicating or performing image enhancement on the same number of normal images to obtain twice the number of normal images, so that the current ratio of the normal image to the cheating image reaches the preset ratio;

[0300] The process of constructing the preset number of the second cheating images based on the current normal image further includes at least one of the following:

[0301] When the number of the second cheating images constructed reaches the preset number, and the current ratio does not reach the preset ratio, and the current ratio is not within a set range, randomly discarding a portion of the normal images so that the current ratio reaches the preset ratio;

[0302] When the number of the constructed second cheating images reaches the preset number, the current ratio does not reach the preset ratio, and the current ratio is within the set range, the normal image and the cheating image of the current ratio are used as the second stage sample images used in the second stage;

[0303] When the current normal images are exhausted and the constructed second cheating images do not reach the preset number, and the current ratio is not within the set range, a portion of the normal images is randomly discarded so that the current ratio reaches the preset ratio.

[0304] In some embodiments, the apparatus further comprises a prediction module; the prediction module is configured to:

[0305] Launch the i-th stage cheating detection model;

[0306] Obtaining a client image when the client is running;

[0307] Inputting the client image into the i-th stage cheating detection model to obtain a prediction result;

[0308] The prediction result is used to indicate whether the client is cheating.

[0309] In some embodiments, the prediction module is used to:

[0310] When the cheating possibility in the prediction result is greater than a threshold, inputting the client image into a text detection model to detect and obtain text;

[0311] Perform keyword matching on the text to obtain matching results;

[0312] If the matching result is successful, a penalty result is imposed on the client;

[0313] In the case where the matching result is a failure, the client image is sent to the review end for review.

[0314] In some embodiments, after the second-stage cheating detection model is launched, or after the third-stage cheating detection model is launched, the processing module 840 is further configured to:

[0315] Based on the normal images and cheating images that failed to be predicted in the current stage, an incremental dataset is constructed;

[0316] Based on the incremental data set, the cheating detection model at the current stage is fine-tuned for a second time.

[0317] In some embodiments, the processing module 840 is configured to:

[0318] Acquire the normal image with failed prediction and the cheating image with failed prediction at the current stage;

[0319] Performing a search based on the semantic vector of the cheating image that failed to be predicted, obtaining top N matching normal images with the highest similarity to the cheating image that failed to be predicted, where N is greater than 0;

[0320] Extracting cheating traces from the cheating image that failed to be predicted, and extracting misjudgment areas that caused the prediction failure from the normal image that failed to be predicted;

[0321] Pasting the extracted cheating traces in the matched normal image and the randomly selected normal image to construct an incremental cheating image, or pasting the extracted misjudged area to construct an incremental normal image;

[0322] The incremental data set is obtained based on the normal image that failed to be predicted and the corresponding original normal image and the normal image after image enhancement, the cheating image that failed to be predicted, the incremental normal image, the incremental cheating image, the matching normal image and the randomly selected normal image.

[0323] It should be noted that the specific definition of the embodiment of the training device 800 for one or more cheating detection models provided above can refer to the definition of the training method for cheating detection models above, which will not be repeated here. Each module of the above device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in the processor of the computer device in the form of hardware or independent of it, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operation of each module.

[0324] An embodiment of the present application further provides a computer device, which includes: a processor and a memory, wherein a computer program is stored in the memory; and the processor is configured to execute the computer program in the memory to implement the cheating detection model training method provided in the above-mentioned method embodiments.

[0325] For example, Fig.17 1 is a structural block diagram of a computer device provided by an exemplary embodiment of the present application. Optionally, the computer device is a server 1000.

[0326] Typically, the server 1000 includes: a processor 1001 and a memory 1002 .

[0327] The processor 1001 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1001 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 1001 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1001 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1001 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0328] The memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1002 is used to store at least one instruction, which is used to be executed by the processor 1001 to implement the training method of the cheating detection model provided in the method embodiment of the present application.

[0329] In some embodiments, the server 1000 may further optionally include: an input interface 1003 and an output interface 1004. The processor 1001, the memory 1002, and the input interface 1003 and the output interface 1004 may be connected via a bus or a signal line. Each peripheral device may be connected to the input interface 1003 and the output interface 1004 via a bus, a signal line or a circuit board. The input interface 1003 and the output interface 1004 may be used to connect at least one peripheral device related to input / output (I / O) to the processor 1001 and the memory 1002. In some embodiments, the processor 1001, the memory 1002, the input interface 1003, and the output interface 1004 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1001, the memory 1002, the input interface 1003, and the output interface 1004 may be implemented on a separate chip or circuit board, which is not limited in the embodiments of the present application.

[0330] Those skilled in the art will understand that Fig.17 The structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine some components, or adopt a different component arrangement.

[0331] In an exemplary embodiment, the present application provides a chip, which includes a programmable logic circuit and / or program instructions. When the chip runs on a computer device, it is used to implement the training method of the cheating detection model provided by the above method embodiment.

[0332] The present application provides a computer-readable storage medium, which stores a computer program. The computer program is loaded and executed by a processor to implement the cheating detection model training method provided by the above method embodiment.

[0333] The present application provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the processor of the computer device loads and executes the training method of the cheating detection model provided in the above method embodiment.

[0334] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0335] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned computer-readable storage medium may be a read-only memory, a disk or an optical disk, etc.

[0336] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0337] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A cheating detection model training method, characterized in that: The method comprises: Acquire a sample image of the i-th stage, wherein the sample image of the i-th stage includes a normal image and at least one cheating image, wherein the at least one cheating image includes at least one of a first cheating image marked when the sample client is running and a second cheating image constructed based on the normal image, and i is greater than or equal to 1; Based on the i-1 stage cheating detection model and the i-1 stage sample image, performing prediction on the i-stage sample image to obtain i-stage prediction information; the i-1 stage cheating detection model is obtained by training based on the i-1 stage sample image; Based on the i-th stage label information of the i-th stage sample image and the i-th stage prediction information, determine a first sub-loss of each of the first cheating images, a second sub-loss of each of the second cheating images, and a third sub-loss of each of the normal images in the i-th stage sample image; Based on the first weight of the first cheating image and the corresponding normal image, and the second weight of the second cheating image and the corresponding normal image, the first sub-loss, the second sub-loss and the third sub-loss are weighted and summed to obtain the i-th stage loss; the first weight is greater than the second weight, and the first weight is used to enhance the learning degree of the marked first cheating image and the corresponding normal image; the first weight and the second weight are determined based on the current ratio of the first cheating image, the second cheating image and the normal image in the i-th stage sample image; With the goal of reducing the loss in the i-th stage, the i-1-th stage cheating detection model is fine-tuned to obtain the i-th stage cheating detection model.

2. The method according to claim 1, characterized in that The first sub-loss, the second sub-loss and the third sub-loss are weighted summed based on the first weight of the first cheating image and the corresponding normal image, and the second weight of the second cheating image and the corresponding normal image to obtain the i-th stage loss, including: multiplying the first weight of the first cheating image by the first sub-loss to obtain a first weighted sub-loss, and multiplying the second weight of the second cheating image by the second sub-loss to obtain a second weighted sub-loss; For the third sub-loss of the normal image corresponding to the first cheating image, multiply the first weight by the third sub-loss; and, for the third sub-loss of the normal image corresponding to the second cheating image, multiply the second weight by the third sub-loss to obtain a third weighted sub-loss; The first weighted sub-loss, the second weighted sub-loss and the third weighted sub-loss are added together to obtain the i-th stage loss.

3. The method according to claim 1 or 2, characterized in that: In the case where i is equal to 1, the i-th stage includes the first stage, the i-th stage loss includes the first stage loss, the i-1-th stage cheating detection model includes a universal cheating detection model, the universal cheating detection model is obtained by pre-training a universal model based on a universal image set, the universal image set includes normal images of multiple clients of the same type of the sample client when running, cheating images including multiple scenes and multiple cheating types, and the first stage sample images include the normal image and the second cheating image; The method further comprises: Based on the universal cheating detection model and the first-stage sample images, performing prediction on the first-stage sample images to obtain first-stage prediction information; Based on the first-stage label information of the first-stage sample images and the first-stage prediction information, determining a second sub-loss of each of the second cheating images and a third sub-loss of each of the normal images in the first-stage sample images; Multiplying the second weight of the second cheating image and the corresponding normal image by the second sub-loss and the third sub-loss and summing the results to obtain the first stage loss; The first-stage loss is used to guide the fine-tuning of the universal cheating detection model.

4. The method according to claim 3, characterized in that: In the case where i is equal to 2, the i-th stage includes the second stage, the i-th stage loss includes the second stage loss, the i-1-th stage cheating detection model includes the first stage cheating detection model trained in the first stage, and the second stage sample image includes the normal image, the first cheating image, and the second cheating image; The method further comprises: Based on the first-stage cheating detection model and the second-stage sample images, performing prediction on the second-stage sample images to obtain second-stage prediction information; Determine, based on the second-stage label information and the second-stage prediction information of the second-stage sample images, a first sub-loss of each of the first cheating images, a second sub-loss of each of the second cheating images, and a third sub-loss of each of the normal images in the second-stage sample images; Based on the first weight and the second weight, performing weighted summation on the first sub-loss, the second sub-loss and the third sub-loss to obtain the second stage loss; The second-stage loss is used to guide the hybrid weighted fine-tuning of the first-stage cheating detection model.

5. The method according to claim 4, characterized in that In the case where i is equal to 3, the i-th stage includes the third stage, the i-th stage loss includes the third stage loss, the i-1-th stage cheating detection model includes the second stage cheating detection model trained in the second stage, and the third stage sample image includes the normal image and the first cheating image; The method further comprises: Based on the second-stage cheating detection model and the third-stage sample image, performing prediction on the third-stage sample image to obtain third-stage prediction information; Determine, based on the third-stage label information and the third-stage prediction information of the third-stage sample images, a first sub-loss of each of the first cheating images and a third sub-loss of each of the normal images in the third-stage sample images; Multiplying the first weight of the first cheating image and the corresponding normal image by the first sub-loss and the third sub-loss and summing the results to obtain the third stage loss; The third-stage loss is used to guide the fine-tuning of the second-stage cheating detection model.

6. The method according to claim 1 or 2, characterized in that: The normal image includes at least one of the following: a normal image when the sample client is running, a normal image that is reviewed or uploaded, and a normal image obtained by performing image enhancement on the normal image; wherein the normal image is obtained by taking a screenshot when a whitelist account uses the sample client; The first cheating image includes at least one of the following: a cheating image when the sample client is running, a reviewed or uploaded cheating image, a sampled cheating image, or a cheating image obtained by performing data enhancement on a reviewed, uploaded or sampled cheating image; The second cheating image includes at least one of the following: an abnormal image constructed by adding a cheating template map to the normal image, a cheating image constructed by adding the cheating template map to a part of the normal image, a cheating image constructed by a program drawing cheating traces in the normal image, a cheating image constructed by the program drawing cheating traces in a part of the normal image, a cheating image with cheating traces constructed by a generative model, and a cheating image obtained by performing image enhancement on a constructed cheating image; Among them, the image enhancement includes at least one of horizontal flipping, brightness, color, saturation adjustment, sharpening, noise addition, and mosaic, and the cheating traces or the cheating template maps include at least one of solid lines, boxes, skeletons, function catalogs, character perspectives, thermal perspectives, and artificial intelligence plug-in perspectives.

7. The method according to claim 6, characterized in that For a first-stage sample image used in the first stage, the first-stage sample image includes the normal image and the second cheating image, and the method further includes: Acquire the normal image; Based on the normal image, construct the second cheating image; Inputting an image pair into a filtering model to obtain a prediction result of the image pair, wherein the image pair includes the normal image and the correspondingly constructed second cheating image; Based on the prediction result, image redistribution is performed on the normal image and the second cheating image to obtain the first-stage sample image used in the first stage.

8. The method according to claim 7, characterized in that The performing image redistribution on the normal image and the second cheating image based on the prediction result to obtain the first-stage sample image used in the first stage includes: For the image pair whose prediction result is the first prediction result, extracting at least a part of the image pair; For the image pairs whose prediction results are the second prediction results, retain all the image pairs; For the image pair whose prediction result is the third prediction result, retaining all normal images and at least a portion of the second cheating image in the image pair; For the image pair whose prediction result is the fourth prediction result, retaining all normal images in the image pair; Among them, the first prediction result includes that the normal image and the second cheating image in the image pair are both predicted correctly; the second prediction result includes that the normal image in the image pair is predicted correctly and the second cheating image is predicted incorrectly; the third prediction result includes that the normal image in the image pair is predicted incorrectly and the second cheating image is predicted correctly; the fourth prediction result includes that the normal image in the image pair is predicted incorrectly and the second cheating image is predicted incorrectly.

9. The method according to claim 8, characterized in that For the second-stage sample images used in the second stage, the second-stage sample images include the normal image, the first cheating image and the second cheating image, and the method further includes: Integrate and count the number of white samples of the current normal image and the number of black samples of the cheating image, where the cheating image includes the first cheating image and the second cheating image; Based on the size relationship between the number of white samples and the number of black samples, extracting the normal image and the cheating image in a preset ratio; The normal image and the cheating image in the preset ratio are used as the second-stage sample images used in the second stage.

10. The method according to claim 9, characterized in that The extracting the normal image and the cheating image of a preset ratio based on the size relationship between the number of white samples and the number of black samples comprises: In the case where the number of black samples is greater than the number of white samples, randomly sampling the current normal image to obtain a new normal image, so that the current total number of the cheating image and the normal image is the same; Based on the current normal image, construct a preset number of the second cheating images, and generate the same number of normal images at the same time, and copy or perform image enhancement on the same number of normal images to obtain twice the number of normal images, so that the current ratio of the normal image to the cheating image reaches the preset ratio; When the current ratio does not reach the preset ratio, randomly supplement the normal image so that the current ratio reaches the preset ratio; In the process of constructing a preset number of the second cheating images based on the current normal image, when the current normal image is exhausted and the constructed second cheating images do not reach the preset number, and the current ratio does not reach the preset ratio, the normal images are randomly supplemented from the normal images of the image pairs whose prediction results are the first prediction results and have not been extracted, so that the current ratio reaches the preset ratio; or, In the case where the number of black samples is less than the number of white samples, constructing the preset number of the second cheating images based on the current normal image, generating the same number of normal images at the same time, and duplicating or performing image enhancement on the same number of normal images to obtain twice the number of normal images, so that the current ratio of the normal image to the cheating image reaches the preset ratio; The process of constructing the preset number of the second cheating images based on the current normal image further includes at least one of the following: When the number of the second cheating images constructed reaches the preset number, and the current ratio does not reach the preset ratio, and the current ratio is not within a set range, randomly discarding a portion of the normal images so that the current ratio reaches the preset ratio; When the number of the constructed second cheating images reaches the preset number, the current ratio does not reach the preset ratio, and the current ratio is within the set range, the normal image and the cheating image of the current ratio are used as the second stage sample images used in the second stage; When the current normal images are exhausted and the constructed second cheating images do not reach the preset number, and the current ratio is not within the set range, a portion of the normal images is randomly discarded so that the current ratio reaches the preset ratio.

11. The method according to claim 1 or 2, characterized in that: The method further comprises: Launch the i-th stage cheating detection model; Get the client image of the client runtime; Inputting the client image into the i-th stage cheating detection model to obtain a prediction result; The prediction result is used to indicate whether the client is cheating.

12. The method according to claim 11, characterized in that The method further comprises: When the cheating possibility in the prediction result is greater than a threshold, inputting the client image into a text detection model to detect and obtain text; Perform keyword matching on the text to obtain matching results; If the matching result is successful, a penalty result is imposed on the client; In the case where the matching result is a failure, the client image is sent to the review end for review.

13. The method according to claim 11, characterized in that After the second-stage cheating detection model is launched, or after the third-stage cheating detection model is launched, the method further includes: Based on the normal images and cheating images that failed to be predicted in the current stage, an incremental dataset is constructed; Based on the incremental data set, the cheating detection model at the current stage is fine-tuned for a second time.

14. The method according to claim 13, characterized in that The step of constructing an incremental data set based on normal images and cheating images that failed to be predicted in the current stage includes: Acquire the normal image with failed prediction and the cheating image with failed prediction at the current stage; Performing a search based on the semantic vector of the cheating image that failed to be predicted, obtaining top N matching normal images with the highest similarity to the cheating image that failed to be predicted, where N is greater than 0; Extracting cheating traces from the cheating image that failed to be predicted, and extracting misjudgment areas that caused the prediction failure from the normal image that failed to be predicted; Pasting the extracted cheating traces in the matched normal image and the randomly selected normal image to construct an incremental cheating image, or pasting the extracted misjudged area to construct an incremental normal image; The incremental data set is obtained based on the normal image that failed to be predicted and the corresponding original normal image and the normal image after image enhancement, the cheating image that failed to be predicted, the incremental normal image, the incremental cheating image, the matching normal image and the randomly selected normal image.

15. A training device for a cheating detection model, characterized in that: The device comprises: an acquisition module, configured to acquire a sample image of the i-th stage, wherein the sample image of the i-th stage includes a normal image and at least one cheating image, wherein the at least one cheating image includes at least one of a first cheating image annotated when the sample client is running and a second cheating image constructed based on the normal image, wherein i is greater than or equal to 1; a processing module, configured to perform prediction on the i-th stage sample image based on the i-th stage cheating detection model and the i-th stage sample image to obtain i-th stage prediction information; the i-th stage cheating detection model is obtained by training based on the i-th stage sample image; based on the i-th stage label information of the i-th stage sample image and the i-th stage prediction information, determine the first sub-loss of each first cheating image, the second sub-loss of each second cheating image, and the third sub-loss of each normal image in the i-th stage sample image; based on the first weight of the first cheating image and the corresponding normal image, and the second weight of the second cheating image and the corresponding normal image, perform weighted summation on the first sub-loss, the second sub-loss, and the third sub-loss to obtain the i-th stage loss; the first weight is greater than the second weight, and the first weight is used to enhance the learning degree of the labeled first cheating image and the corresponding normal image; the first weight and the second weight are determined based on the current ratio of the first cheating image, the second cheating image, and the normal image in the i-th stage sample image; The training module is used to fine-tune the cheating detection model of the i-1th stage with the goal of reducing the loss of the i-th stage to obtain the cheating detection model of the i-th stage.

16. A computer device, characterized in that: The computer device comprises: a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the cheating detection model training method according to any one of claims 1 to 14.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the cheating detection model training method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Intelligent camera model self-training method and device, equipment and medium

    CN112434680A

  • Cheating detection and model training method and device for shooting game and storage medium

    CN112642161A

  • Intelligent camera model terminal training method and device, equipment and medium

    CN113139475A

  • Training method and application of image classification model based on meta-learning

    CN115564987A

  • Target detection model training method and device, equipment, medium and program product

    CN117218478A