Game running method and device, storage medium and electronic device
Through the target network model, the target object of predetermined type in the game screen is detected and control instructions are generated, which solves the problems of algorithm complexity and convergence difficulties in the game operation method, real-time detection and low computing resource consumption are achieved.
Patent Information
- Application Number
- CN201811419502.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-11-26
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2039-11-19
AI Technical Summary
Due to the complexity of the interface, existing game operation methods are difficult to converge to the correct processing logic, resulting in high algorithm complexity and computing resource consumption, making it difficult to achieve real-time detection and control.
The target network model is used to detect the game screen, and only target objects of a predetermined type are detected. Control instructions are generated through the AI control model to reduce the impact of useless elements on decision-making, reduce the complexity of algorithms, and improve detection speed and computing efficiency.
It has achieved the reduction of the computational complexity of the AI control model, improve the algorithm convergence speed, achieve real-time detection effect, and reduce the consumption of computing resources, solving the problems of algorithm complexity and convergence difficulties in the game running methods.
Smart Images

Figure CN110152290B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a game running method and device, a storage medium and an electronic device. Background Art
[0002] At present, when the game needs to be run automatically, the original game screen is captured from the moment the game is determined to be run automatically, and the screen is reduced by a certain proportion and grayed out. The processed image is used as the input of the reinforcement learning algorithm, and the output of the reinforcement learning algorithm is used to control the action of the game. The game responds to the new action and updates the game interface. The updated interface (new image) is used as the input of the reinforcement learning algorithm again, and the cycle continues, so that the game can be run automatically.
[0003] However, the information elements contained in the game interface are generally complex, with rich and colorful backgrounds and a variety of props. This information increases the complexity of the learning algorithm, making it difficult or even impossible for the deep learning algorithm to converge to a correct processing logic.
[0004] Therefore, the game running method in the related art has the problem that the algorithm is complex and it is difficult or even impossible to converge to a correct processing logic. Summary of the invention
[0005] The embodiments of the present invention provide a game running method and device, a storage medium and an electronic device, so as to at least solve the problem that the game running method in the related art has a complex algorithm and is difficult or even impossible to converge to a correct processing logic.
[0006] According to one aspect of an embodiment of the present invention, a game running method is provided, comprising: acquiring a game screen of a target game currently running on a target terminal; detecting the game screen using a target network model to obtain a detection result of the game screen, wherein the target network model is used to detect a target object contained in the game screen, the object type of the target object is a predetermined type, and the detection result includes: the target object represented by first attribute information of a target attribute of the target object; inputting the game screen and the detection result into an artificial intelligence (AI) control model to obtain a control instruction, wherein the AI control model is used to control the running of the target game according to the game screen and the detection result, and the control instruction is used to control the target game to perform a target operation; using the control instruction to control the target game to perform the target operation.
[0007] According to another aspect of an embodiment of the present invention, a game running device is also provided, including: a first acquisition unit, used to acquire a game screen of a target game currently running on a target terminal; a detection unit, used to detect the game screen using a target network model to obtain a detection result of the game screen, wherein the target network model is used to detect a target object contained in the game screen, the object type of the target object is a predetermined type, and the detection result includes: the target object represented by first attribute information of a target attribute of the target object; an input unit, used to input the game screen and the detection result into an artificial intelligence (AI) control model to obtain a control instruction, wherein the AI control model is used to control the running of the target game according to the game screen and the detection result, and the control instruction is used to control the target game to perform a target operation; a control unit, used to control the target game to perform the target operation using the control instruction.
[0008] According to another aspect of an embodiment of the present invention, a storage medium is further provided, wherein the storage medium includes a stored program, wherein the game running method is executed when the program is run.
[0009] According to another aspect of an embodiment of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the game running method through the computer program.
[0010] In an embodiment of the present invention, after acquiring the game screen of the target game currently running on the target terminal, the target network model used to detect the target object of a predetermined type contained in the game screen is used to detect the game screen to obtain the detection result of the game screen, wherein the detection result includes: the target object represented by the first attribute information of the target attribute of the target object; the game screen and the detection result are input into the AI control model to obtain the control instruction for controlling the target game to perform the target operation, and the control instruction is used to control the target game to perform the target operation. In addition to the game screen, the target object detected by the target network model is also input into the game AI to provide a reference for the game AI to make game decisions. , reducing the impact of useless game elements on decision-making results, reducing the complexity of the game AI algorithm, and improving the speed of algorithm convergence. At the same time, since the target network model only detects target objects of predetermined types, the computational complexity is small compared to other network models, and the network scale (for example, the number of neural network layers) is small. Under the condition that the detection effect is basically the same, the detection speed can be improved to achieve the effect of real-time detection, and the consumption of computing resources is reduced, thereby achieving the technical effect of reducing the computational complexity of the AI control model and improving the speed at which the AI control model converges to the correct processing logic, thereby solving the problem that the game operation method in the related technology has a complex algorithm and it is difficult or even impossible to converge to a correct processing logic. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0012] Figure 1 is a schematic diagram of a hardware environment of a game running method according to an embodiment of the present invention;
[0013] Figure 2 is a flowchart of an optional game running method according to an embodiment of the present invention;
[0014] Figure 3 is a schematic diagram of an optional game running method according to an embodiment of the present application;
[0015] Figure 4 is a schematic diagram of an optional image sample label according to an embodiment of the present application;
[0016] Figure 5 is a schematic diagram of an optional anchor strategy of Faster RCNN according to an embodiment of the present application;
[0017] Figure 6is a schematic diagram of an optional target area image according to an embodiment of the present application;
[0018] Figure 7 is a schematic diagram of an optional test result according to an embodiment of the present application;
[0019] Figure 8 is a schematic diagram of an optional detection result according to an embodiment of the present application;
[0020] Fig. 9 is a flowchart of another optional game running method according to an embodiment of the present application;
[0021] Fig.10 is a schematic structural diagram of an optional game running device according to an embodiment of the present invention;
[0022] Fig.11 is a schematic structural diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] In order to facilitate the understanding of the present invention, the technical terms involved in the present invention are as follows:
[0026] 1) AI: Artificial Intelligence;
[0027] 2) API: Application Programming Interface, application programming interface;
[0028] 3)CNN: Convolutional Neural Network;
[0029] 4) COCO: Common Objects in Context, an image dataset provided by the Microsoft team;
[0030] 5)CPU, Central Processing Unit, central processing unit;
[0031] 6) DQN: Deep Q-Learning Network, deep Q-learning network;
[0032] 7) ImageNet is the name of a computer vision system recognition project. It is currently the world's largest image recognition database, established by computer scientists at Stanford University in the United States to simulate the human recognition system.
[0033] 8) GPU, Graphic Processing Unit, Graphics Processing Unit;
[0034] 9) NMS: Non Maximum Suppression, non-maximum suppression;
[0035] 10) PASCAL: Pattern Analysis, Statistical Modelling and Computational Learning; VOC: Visual Object Classes. The PASCAL VOC competition provides its own image dataset.
[0036] 11) VGGNet: A network model proposed by the Visual Geometry Group of the University of Oxford.
[0037] 12) YOLO: You Only Look Once, Real Time Object Detection. You only need to look once for real-time object detection.
[0038] In an embodiment of the present invention, an embodiment of the above-mentioned game running method is provided. As an optional implementation, the game running method can be but is not limited to being applied to Figure 1In the application environment shown, a target game is running on a terminal 102 (target terminal), and the terminal 102 is connected to a server 106 via a network 104, to obtain a game screen of the currently running target game, and to send the game screen to the server 106. The server 106 responds to the received game screen, and uses a target network model to detect the game screen to obtain a detection result of the game screen, wherein the target network model is used to detect a target object contained in the game screen, and the object type of the target object is a predetermined type, and the detection result includes: a target object represented by first attribute information of a target attribute of the target object; the game screen and the detection result are input into an AI control model to obtain a control instruction, wherein the AI control model is used to control the operation of the target game according to the game screen and the detection result, and the control instruction is used to control the target game to perform a target operation; and the control instruction is used to control the target game to perform a target operation.
[0039] It should be noted that, in the above example, the use of control instructions to control the target game to perform the target operation can be completed by the server 106 sending the control instruction to the terminal 102 through the network 104, and the terminal 102 executing the target operation on the target game. It can also be completed by the server 106 sending the control instruction to the server of the target game through the network 104, and the server of the target game executing the target operation. The above is only an example and no limitation is made here.
[0040] Optionally, in this embodiment, the terminal 102 may include but is not limited to at least one of the following: a mobile phone, a tablet computer, a laptop computer, a desktop PC, a digital television, and other terminal devices that can run the target game. The network 104 may include but is not limited to a wired network and a wireless network, wherein the wired network may include: a local area network, a metropolitan area network, and a wide area network, and the wireless network may include: Bluetooth, WIFI, and other networks that implement wireless communication. The server may include but is not limited to at least one of the following: a PC and other devices for game control. The above is only an example, and this embodiment does not make any limitation to this.
[0041] According to one aspect of an embodiment of the present invention, a game running method is provided. Figure 2 As shown, the method includes:
[0042] S202, obtaining a game screen of a target game currently running on a target terminal.
[0043] S204, using the target network model to detect the game screen to obtain a detection result of the game screen, wherein the target network model is used to detect a target object included in the game screen, the object type of the target object is a predetermined type, and the detection result includes: the target object represented by first attribute information of a target attribute of the target object;
[0044] S206, inputting the game screen and the detection result into the AI control model to obtain a control instruction, wherein the AI control model is used to control the operation of the target game according to the game screen and the detection result, and the control instruction is used to control the target game to perform a target operation;
[0045] S208, using the control instruction to control the target game to perform the target operation.
[0046] Optionally, in this embodiment, the game running method can be applied to, but not limited to, the process of automatically running the target game, and can also be applied to other scenarios in which the target game is controlled according to game elements. The target game can be a multiplayer online tactical competitive game (Multiplayer Online Battle Arena, referred to as MOBA) or a single-player game (Single-Player Game, referred to as SPG) and other game applications that require automatic operation.
[0047] The above-mentioned game running method can be applied to the testing stage of the game to simulate the player's operation so as to detect the performance of the game, such as stability. It can also be applied to the process of the game player running the game on the user terminal after the game is launched to complete a specific task.
[0048] For example, Figure 3 As shown, after the game interface (game screen) is captured by a mobile phone or other device (target device), the position of the hero and the door (the "door" can be a teleportation array, and clicking the "door" can trigger the entrance to a copy, enter another map, etc.) in the game interface are identified through the target network model, and the original image and the category and position information of the hero and the door are sent to the game AI. The game AI controls the hero to move toward the door based on these results to complete an interactive operation.
[0049] The following is combined with Figure 2 The embodiments of the present application are described.
[0050] In step S202, a game screen of a target game currently running on the target terminal is acquired.
[0051] The game development platform can provide an API for obtaining game information. The game's built-in AI can call these APIs to obtain game element information (including the survival status of each element, position relationship, etc.). The game AI integrates this information as input to the game AI, and the game AI outputs action strategies based on certain algorithms. The action feedback drives the game, allowing the game to be played automatically without user interaction.
[0052] However, the above-mentioned game operation method depends on the interface functions provided by the game development platform. However, many games do not provide these API interfaces, or do not choose to make these API interfaces public for further development, resulting in poor versatility of the above-mentioned game operation method.
[0053] In this application, the current interface of the game is obtained, and the original interface of the game is used as the processing source and input for processing, which has stronger versatility.
[0054] The target terminal is currently running a target game. After the acquisition instruction for automatically running the game is triggered, the target terminal starts a acquisition program (the acquisition program can be stored in the memory of the target terminal, and the processor calls and runs the acquisition program) to acquire the current game screen (i.e., game interface) of the target game in real time, and sends the acquired game screen to the server, so that the server can obtain the game screen.
[0055] The above-mentioned acquisition instruction may be triggered by the occurrence of a target event, and the above-mentioned target event may include but is not limited to one of the following: the target button ("Auto" button) in the target game is clicked, the target game or a game is started, the target scene (such as a specific copy) is entered, the automatic run command sent by the server is received, etc.
[0056] The target terminal can use screenshots to obtain the game image of the target game running on the current device in real time.
[0057] In step S204, the target network model is used to detect the game screen to obtain a detection result of the game screen, wherein the target network model is used to detect a target object contained in the game screen, the object type of the target object is a predetermined type, and the detection result includes: the target object represented by the first attribute information of the target attribute of the target object.
[0058] The game screen may include a variety of game objects (game elements), including but not limited to: foreground elements, background elements, among which the foreground elements may include but are not limited to: player characters (game characters controlled by this terminal, game characters of the same team, game characters of different teams, etc.), health bars, soldiers, cannon carts, super soldiers, defense towers, and background elements may include but are not limited to: stones, boxes, grass, etc.
[0059] After acquiring the game screen, multi-object detection can be performed on the game screen (detecting objects contained in the game screen, that is, objects) to obtain attribute information of the game objects contained in the game screen.
[0060] Traditional multi-object detection methods require manually designed features and use a sliding window method to screen and compare the entire image to find the target object. Manually designed features have poor robustness, and the sliding window solution has high computational and time complexity.
[0061] In this application, a target network model (the target network model can be a CNN) is used to perform multi-object detection on the game screen. The features of the game image are automatically extracted through the target network model. Compared with the traditional method of manual feature extraction, the extracted semantic level is deeper.
[0062] Based on CNN to automatically extract image features and detect multiple objects based on different feature scales, better multi-object detection results can be obtained.
[0063] In the related art, the network model of CNN generally adopts a public database of natural scenes, such as ImageNet (22,000 categories), PASCAL VOC (20 categories), COCO (91 categories), etc. In order to extract deeper features and be applicable to a large number of object detections, the above network models are generally large. For example, the network model VGGNet for extracting features generally has 16-19 layers, and Darkent-53 has 53 layers. In addition, many models have some techniques, which will add more layers for feature layer fusion and other processing. In the end, the total network model will be larger. However, a large network model requires more computing resources. High-performance graphics cards can speed up parallel computing. However, many machines now do not have high-performance GPU resources, and the computing speed is very slow in CPU mode, making it difficult to achieve real-time computing.
[0064] In order to improve the speed of extracting objects from the game screen, this application designs a small network model (i.e., a target network model) based on a specific type of target object (predetermined type of game element) contained in the game screen, and based on this small network model, identifies the target object and determines the attribute information of the target attribute of the target type. The small network model is used to detect a predetermined type of target object in the game screen, and the detected target object is represented by the attribute information of the target attribute of the target object.
[0065] It should be noted that the "smallness" of the small network model is mainly reflected in the number of network layers. Since only the target objects of the predetermined type in the game screen are detected, the detection targets of the network model are reduced, thereby reducing the number of neural network layers in the network model. Using a small network model instead of a large network model to detect specific objects can greatly improve the speed under the condition of basically the same effect, achieving real-time detection effects and reducing computing resources. The above-mentioned effects are basically the same, which means that the detection effects are basically the same, for example, the same number of health bars, health bar positions, etc. can be detected.
[0066] The target object may be a game element of a predetermined type, which may refer to an object type corresponding to a game object contained in the game foreground, and the target attributes may be an object type, an object position, or a color attribute of the target object. Different objects may be identified by different attribute values of the target attributes.
[0067] For example, the target attributes are object type and object position. For a monster (humanoid monster) in the game, its object type is: monster, and the object position is: the coordinates of the four vertices of the rectangular box containing the monster. Character elements (heroes), health bars, and task props in the game can be identified in the same way.
[0068] Optionally, before using the target network model to detect the game screen and obtaining the detection result of the game screen, a training image set can be obtained, wherein the training image set includes training images and first data (label data of the training images), and the first data includes third attribute information of the target attribute of the first object, and the first object is an object of a predetermined type contained in the training image; the initial network model is trained using the training images and the first data to obtain the target network model.
[0069] In order to obtain the target network model, it is necessary to first design the initial network model according to the application requirements, including the number of neural network layers. After obtaining the initial network model, the initial network model can be trained and tested to obtain the target network model.
[0070] For example, as shown in Table 1, the initial network model includes N neural network layers, the number of convolution kernels (filters) and the size and step size of each neural network layer can be different, and the scale and number of feature images of the network input (input) and the network output (output) can also be different, where size can be expressed as X×Y, where X is the convolution kernel size and Y is the step size, and input and output can be expressed as A×B×C, where A×B is the size of a feature image (in pixels) and C is the number of feature images.
[0071] Table 1 Initial network model
[0072] layer filters size input output 0conv 16 3×3 / 2 640×360×3 -> 320×180×16 1conv 32 3×3 / 2 320×180×16 -> 160×90×32 2conv 64 3×3 / 2 160×90×32 -> 80×45×64 3conv 128 3×3 / 2 80×45×64 -> 40×23×128 4conv 256 3×3 / 2 40×23×128 -> 20×12×256 5conv 8 1×1 / 1 20×12×256 -> 20×12×8 6detection
[0073] When training the initial network model, a large number of game sample images can be collected, and the position categories and coordinate positions (unit pixels) of the game elements to be identified in the sample images can be manually marked. The marked label data can be considered as individual target objects represented by the attribute information of the target attributes of the target objects.
[0074] A training set (training image set) and a test set (test image set) are set according to sample images: a first target number of sample images can be selected from the sample images as a training set, and a second target number of sample images can be selected as a test set. The first target number and the second target number can be the same or different. The first target number can be greater than the second target number.
[0075] Different samples can be collected according to the objects to be identified. For example, if you need to identify the health bar in the game, you need to collect and calibrate the image samples of the health bar (such as Figure 4 If you need to identify heroes in the game, you need to collect and calibrate image samples of the heroes.
[0076] When training the model, you can set the total number of training times, use the gradient descent algorithm, set parameters such as the learning rate, etc. The labeled sample data is used as the input of the initial network model.
[0077] Optionally, in this embodiment, the initial network model is trained using the training image and the first data to obtain the target network model, which may include: obtaining the training result of the first network model after the Mth training is completed, wherein the first network model is the network model obtained after the initial network model is trained for the first M-1 times, M is a positive integer greater than or equal to 1, and the training results include: a first offset between a first real box and a first candidate box, the first real box is a first rectangular box containing a first object indicated by the first data (the real box of the first object identified by the label data), and the first candidate box is a second rectangular box containing the first object detected by the first network model (the predicted box of the first object predicted by the network model); using the training results, the model parameters of the first network model are adjusted.
[0078] The design of the initial network model can adopt the anchor strategy in Faster-RCNN (such as Figure 5 That is, the size of the candidate box is pre-set, and the output parameter of the network is the offset between the real box and the candidate box, rather than directly outputting the position of the predicted box. Experiments have shown that the anchor strategy can improve the accuracy of detection). When designing the size of the candidate box, the length and width values of the candidate box close to the target object can be set according to the aspect ratio characteristics of the detection target. For example, Figure 6 As shown in the figure, the length and width of the "health bar" are close to 60×6, the anchor is set to (2,0.2), and the tasks in the game can be set to (1.5,2.3), (2.3, 1.5). The candidate boxes of other game elements can be set in a similar way.
[0079] Optionally, in this embodiment, in the process of training the initial network model using the training image and the first data to obtain the target network model, a test image set can be obtained, wherein the test image set includes the test image and the second data (label data of the test image), the second data includes the fourth attribute information of the target attribute of the second object, and the second object is an object of a predetermined type contained in the test image; the second network model is tested using the test image to obtain a test result, wherein the second network model is a network model obtained after training the initial network model N times, N is a positive integer greater than or equal to 1, and the test result includes: a second offset between the second real box and the second candidate box, the second real box is a third rectangular box containing the second object indicated by the second data, and the second candidate box is a fourth rectangular box containing the second object detected by the second network model; when the second offset is less than or equal to the target offset, the target network model is determined to be the second network model; when the second offset is greater than the target offset, the second network model continues to be trained using the training image and the first data to obtain the target network model.
[0080] After the network has been trained for a period of time, the accuracy of the network model can be tested with a test set to monitor the training process. When testing, a test image can be input based on the trained network weight file and the custom network description file. After a forward operation, the location and category information of the target object can be output. Based on the trained model, the test image is input for model testing. The output test result example can be as follows: Figure 7 As shown, Figure 7 The left half of is the test image. Figure 7 The right half is the test result.
[0081] The training of the initial network model is to adjust the model parameters through multiple model trainings, so as to output a network model with the expected recognition effect. The expected effect is that the offset between the real box and the candidate box is within the predetermined offset range.
[0082] After obtaining the target network model, the target network model can be deployed on the server. The server for training the model and the server for using the model can be the same or different. The server for training the model can be a single server or a server cluster. After deployment, the target network model can be used to detect the game screen and obtain the detection results of the game screen.
[0083] Optionally, in this embodiment, the target network model is used to detect the game screen, and obtaining the detection result of the game screen may include: using the convolutional neural network contained in the target network model to perform convolution processing on the game screen, and extracting the target feature image corresponding to the game screen; searching on the target feature image to obtain second attribute information of the target attribute of the candidate target object; using the target algorithm to process the second attribute information, filter out the target object from the candidate target objects, and obtain the detection result, wherein the target algorithm is used to filter out the target object that meets the filtering conditions from the candidate target objects according to the second attribute information.
[0084] The target network model can be used to perform forward operations to detect the position of the foreground object (target object) in the game screen and the category information of the foreground object.
[0085] When performing forward operations, due to the small model size and fast calculation speed, real-time operation can be achieved. For example, in the 1070 GPU environment, the forward network time is about 2ms, and in the i7-4790 CPU environment, the forward network time is about 10ms.
[0086] After the CNN convolution processing of the convolutional neural network in the target network model, the image features of the game screen are extracted, and the second attribute information of the candidate target object (for example, category and position (rectangular box in pixels)) is regressed on the feature map. The second attribute information is processed by the target algorithm to screen out the target object from the candidate target objects, thereby obtaining the detection result.
[0087] In order to adapt to the situation where target objects are large and small in multi-target detection, the target objects can be detected on feature maps of different scales (feature images of different scales are obtained after convolution of different layers of the convolutional neural network).
[0088] Optionally, in this embodiment, searching on the target feature image to obtain the second attribute information of the target attribute of the candidate target object may include: when the convolutional neural network includes multiple neural network layers, selecting at least two feature images from multiple feature images output by the multiple neural network layers as target feature images, wherein different neural network layers in the multiple neural network layers output feature images of different scales; and searching on the at least two feature images respectively to obtain the second attribute information on the feature images of different scales.
[0089] The positions of candidate target objects can be extracted on feature maps of different scales to adapt to detection scenarios where foreground objects vary greatly in size.
[0090] For example, the position of the target object is extracted on feature maps of different scales, and finally 240 candidate results are generated. The candidate boxes with overlap (referring to the overlap degree of the prediction box) less than 0.4 and confidence greater than the threshold confidence of this category are selected through the non-maximum suppression algorithm. The candidate boxes finally selected mark the category and position of the valid objects (target objects) required by the game interface. Figure 8 The detection results of three colors of health bars in the game screen are shown.
[0091] In steps S206-208, the game screen and detection results are input into the AI control model to obtain control instructions, wherein the AI control model is used to control the operation of the target game according to the game screen and detection results, and the control instructions are used to control the target game to perform target operations; the control instructions are used to control the target game to perform target operations.
[0092] After obtaining the detection results (identifying the categories and location information of these game elements in the interface) through the target network model, the game AI is notified of the detection results and the game screen. The game AI outputs corresponding actions based on the detection results and the original game screen, combined with its own AI algorithm (logical rules, reinforcement learning, etc.), and acts on the current game screen to complete an interaction.
[0093] For example, after detecting important elements in the game interface, the image detection results and the corresponding original images are simultaneously output to the game AI. Based on this information, the game AI combines some rule algorithms (such as behavior trees) or reinforcement learning algorithms (such as DQN) to make action outputs and complete an overall action interaction process.
[0094] The above-mentioned game operation method is described below with reference to specific examples. Fig. 9 As shown, the game running method provided in this example includes the following steps:
[0095] S902-S904, the game runs and the original game screen is obtained.
[0096] First, use a mobile phone or other device to capture the game interface in real time. The image capture program can use screenshots to obtain the real-time image of the game on the current device.
[0097] S906-S908, small network model forward operation, detect key objects in the game.
[0098] Through the forward operation of the predefined small network model, the position of the foreground object in the image and the category information of the foreground object are detected.
[0099] S910-S912, the detection result and the original image are input into AI, and AI outputs actions to feed back into the game.
[0100] The recognition result data and the original image data are output to the game AI, and the game AI outputs actions for interacting with the game interface, simulating the interaction between the player and the game, thereby automatically controlling the operation of the game.
[0101] Through this embodiment, after obtaining the game screen of the target game currently running on the target terminal, the game screen is detected using a target network model for detecting a predetermined type of target object contained in the game screen to obtain a detection result of the game screen, wherein the detection result includes: the target object represented by the first attribute information of the target attribute of the target object; the game screen and the detection result are input into the AI control model to obtain a control instruction for controlling the target game to perform a target operation, and the control instruction is used to control the target game to perform the target operation, thereby solving the problem that the game running method in the related art has a complex algorithm and is difficult or even impossible to converge to a correct processing logic, thereby achieving the technical effect of reducing the computational complexity of the AI control model and improving the efficiency of the AI control model converging to the correct processing logic.
[0102] As an optional implementation scheme, the game screen is detected using the target network model, and the detection result of the game screen includes:
[0103] S1, using the convolutional neural network included in the target network model to perform convolution processing on the game screen, and extracting the target feature image corresponding to the game screen;
[0104] S2, searching on the target feature image to obtain second attribute information of the target attribute of the candidate target object;
[0105] S3, using a target algorithm to process the second attribute information, screen out target objects from candidate target objects, and obtain a detection result, wherein the target algorithm is used to screen out target objects that meet the screening conditions from candidate target objects according to the second attribute information.
[0106] Optionally, searching on the target feature image to obtain the second attribute information of the target attribute of the candidate target object includes:
[0107] S21, when the convolutional neural network includes multiple neural network layers, selecting at least two feature images from multiple feature images output by the multiple neural network layers as target feature images, wherein different neural network layers in the multiple neural network layers output feature images of different scales;
[0108] S22, searching respectively on at least two feature images to obtain second attribute information on feature images of different scales.
[0109] Through this embodiment, by searching for candidate target objects on the feature image, the attribute information of the target attribute of the candidate target object is obtained, and the target algorithm is used to process the second attribute information, the target object is screened out from the candidate target objects, and the search is performed on the feature image, thereby ensuring the integrity of the search result, and by screening the candidate target objects, the accuracy of the detection result is ensured. Furthermore, detecting the target object on the feature map of different scales adapts to the situation where the target objects are large and small in the process of detecting multiple target objects.
[0110] As an optional implementation scheme, before using the target network model to detect the game screen and obtaining the detection result of the game screen, the method further includes:
[0111] S1, acquiring a training image set, wherein the training image set includes training images and first data, the first data includes third attribute information of a target attribute of a first object, and the first object is an object of a predetermined type contained in the training image;
[0112] S2: Use the training image and the first data to train the initial network model to obtain a target network model.
[0113] Optionally, training the initial network model using the training image and the first data to obtain the target network model includes:
[0114] S21, obtaining a training result of the first network model after the M-th training is completed, wherein the first network model is a network model obtained after the initial network model is trained for the first M-1 times, M is a positive integer greater than or equal to 1, and the training result includes: a first offset between a first true box and a first candidate box, the first true box is a first rectangular box containing a first object indicated by the first data, and the first candidate box is a second rectangular box containing the first object detected by the first network model;
[0115] S21, using the training results, adjusting the model parameters of the first network model.
[0116] Optionally, in the process of training the initial network model using the training image and the first data to obtain the target network model, the method further includes:
[0117] S3, acquiring a test image set, wherein the test image set includes a test image and second data, the second data includes fourth attribute information of a target attribute of a second object, and the second object is an object of a predetermined type included in the test image;
[0118] S4, testing the second network model using the test image to obtain a test result, wherein the second network model is a network model obtained after training the initial network model N times, N is a positive integer greater than or equal to 1, and the test result includes: a second offset between the second real box and the second candidate box, the second real box is a third rectangular box containing the second object indicated by the second data, and the second candidate box is a fourth rectangular box containing the second object detected by the second network model;
[0119] S5, when the second offset is less than or equal to the target offset, determining the target network model to be the second network model;
[0120] S6: When the second offset is greater than the target offset, continue to train the second network model using the training image and the first data to obtain the target network model.
[0121] Through this embodiment, the initial network model is trained using training images and label data of the training images to obtain the target network model, thereby ensuring the reliability of the target network model in detecting the target object. Furthermore, during training, the output parameter of the network model is the offset between the real box and the candidate box, rather than directly outputting the position of the predicted box, thereby improving the accuracy of detection. Furthermore, the training process is monitored by test images and label data of the test images, thereby ensuring the accuracy of network model detection and shortening the training process (if the detection effect of the intermediate network model in the training process meets expectations, the training can be terminated).
[0122] As an optional implementation scheme, the target object includes a predetermined type of game element, and the target attribute includes an object type and an object position, wherein the predetermined type includes at least one of the following: a monster in the game, a character element in the game, a health bar, and a task prop.
[0123] Through this embodiment, by setting the game foreground object as the target object for target network model detection, the scale of the network model can be reduced, and the detection speed can be improved while ensuring the detection effect, thereby achieving real-time detection effect and reducing computing resources.
[0124] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0125] According to another aspect of an embodiment of the present invention, a game running device is also provided, as shown in FIG10 , the device includes:
[0126] (1) A first acquisition unit 1002, configured to acquire a game screen of a target game currently running on a target terminal;
[0127] (2) a detection unit 1004, configured to detect the game screen using the target network model to obtain a detection result of the game screen, wherein the target network model is used to detect a target object included in the game screen, the object type of the target object is a predetermined type, and the detection result includes: the target object represented by first attribute information of a target attribute of the target object;
[0128] (3) an input unit 1006, which is used to input the game screen and the detection result into the artificial intelligence AI control model to obtain a control instruction, wherein the AI control model is used to control the operation of the target game according to the game screen and the detection result, and the control instruction is used to control the target game to perform a target operation;
[0129] (4) A control unit 1008, which is used to use control instructions to control the target game to perform target operations.
[0130] Optionally, in this embodiment, the game running device can be applied to, but not limited to, the process of automatically running the target game, and can also be applied to other scenarios where the target game is controlled according to game elements. The target game can be a MOBA or SPG game application that requires automatic operation.
[0131] The game running device can be applied to the game testing phase to simulate the player's operation so as to detect the performance of the game, such as stability. It can also be applied to the process of the game player running the game on the user terminal after the game is launched to complete a specific task.
[0132] It should be noted that the first acquisition unit 1002 in this embodiment can be used to execute step S202 in the embodiment of the present application, the detection unit 1004 in this embodiment can be used to execute step S204 in the embodiment of the present application, the input unit 1006 in this embodiment can be used to execute step S206 in the embodiment of the present application, and the control unit 1008 in this embodiment can be used to execute step S208 in the embodiment of the present application.
[0133] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware.
[0134] Through this embodiment, after obtaining the game screen of the target game currently running on the target terminal, the game screen is detected using a target network model for detecting a predetermined type of target object contained in the game screen to obtain a detection result of the game screen, wherein the detection result includes: the target object represented by the first attribute information of the target attribute of the target object; the game screen and the detection result are input into the AI control model to obtain a control instruction for controlling the target game to perform a target operation, and the control instruction is used to control the target game to perform the target operation, thereby solving the problem that the game running method in the related art has a complex algorithm and is difficult or even impossible to converge to a correct processing logic, thereby achieving the technical effect of reducing the computational complexity of the AI control model and improving the efficiency of the AI control model converging to the correct processing logic.
[0135] As an optional implementation scheme, the detection unit 1004 includes:
[0136] (1) an extraction module, used to perform convolution processing on the game screen using the convolutional neural network included in the target network model to extract a target feature image corresponding to the game screen;
[0137] (2) a search module, used to search on the target feature image to obtain second attribute information of the target attribute of the candidate target object;
[0138] (3) A selection module, which is used to process the second attribute information using a target algorithm, filter out target objects from candidate target objects, and obtain a detection result, wherein the target algorithm is used to filter out target objects that meet the filtering conditions from candidate target objects based on the second attribute information.
[0139] Optionally, the search module includes:
[0140] (1) a selection submodule, for selecting at least two feature images from a plurality of feature images output by the plurality of neural network layers as target feature images when the convolutional neural network includes a plurality of neural network layers, wherein different neural network layers in the plurality of neural network layers output feature images of different scales;
[0141] (2) A search submodule, used to search on at least two feature images respectively to obtain second attribute information on feature images of different scales.
[0142] Optionally, the above device further includes:
[0143] (1) a second acquisition unit, configured to acquire a training image set before using the target network model to detect the game screen and obtaining the detection result of the game screen, wherein the training image set includes the training image and first data, the first data includes third attribute information of the target attribute of the first object, and the first object is an object of a predetermined type contained in the training image;
[0144] (2) A training unit, used to train the initial network model using the training image and the first data to obtain a target network model.
[0145] Through this embodiment, by searching for candidate target objects on the feature image, the attribute information of the target attribute of the candidate target object is obtained, and the target algorithm is used to process the second attribute information, the target object is screened out from the candidate target objects, and the search is performed on the feature image, thereby ensuring the integrity of the search result, and by screening the candidate target objects, the accuracy of the detection result is ensured. Furthermore, detecting the target object on the feature map of different scales adapts to the situation where the target objects are large and small in the process of detecting multiple target objects.
[0146] As an optional implementation scheme, the training unit includes:
[0147] (1) an acquisition module, configured to acquire a training result of the first network model after the Mth training is completed, wherein the first network model is a network model obtained after the initial network model is trained for the first M-1 times, M is a positive integer greater than or equal to 1, and the training result includes: a first offset between a first true box and a first candidate box, the first true box is a first rectangular box containing a first object indicated by the first data, and the first candidate box is a second rectangular box containing the first object detected by the first network model;
[0148] (2) An adjustment module, used to adjust the model parameters of the first network model using the training results.
[0149] Optionally, the above device further includes:
[0150] (1) a third acquisition unit, configured to acquire a test image set in a process of training the initial network model using the training image and the first data to obtain the target network model, wherein the test image set includes the test image and the second data, the second data includes fourth attribute information of the target attribute of the second object, and the second object is an object of a predetermined type contained in the test image;
[0151] (2) a testing unit, configured to test the second network model using a test image to obtain a test result, wherein the second network model is a network model obtained after training the initial network model N times, N is a positive integer greater than or equal to 1, and the test result includes: a second offset between the second true box and the second candidate box, the second true box is a third rectangular box containing the second object indicated by the second data, and the second candidate box is a fourth rectangular box containing the second object detected by the second network model; when the second offset is less than or equal to the target offset, determining that the target network model is the second network model;
[0152] (3) A training unit is further used to continue to train the second network model using the training image and the first data to obtain a target network model when the second offset is greater than the target offset.
[0153] Through this embodiment, the initial network model is trained using training images and label data of the training images to obtain the target network model, thereby ensuring the reliability of the target network model in detecting the target object. Furthermore, during training, the output parameter of the network model is the offset between the real box and the candidate box, rather than directly outputting the position of the predicted box, thereby improving the accuracy of detection. Furthermore, the training process is monitored by test images and label data of the test images, thereby ensuring the accuracy of network model detection and shortening the training process (if the detection effect of the intermediate network model in the training process meets expectations, the training can be terminated).
[0154] As an optional implementation scheme, the target object includes a predetermined type of game element, and the target attribute includes an object type and an object position, wherein the predetermined type includes at least one of the following: a monster in the game, a character element in the game, a health bar, and a task prop.
[0155] Through this embodiment, by setting the game foreground object as the target object for target network model detection, the scale of the network model can be reduced, and the detection speed can be improved while ensuring the detection effect, thereby achieving real-time detection effect and reducing computing resources.
[0156] According to another aspect of the embodiments of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0157] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0158] S1, obtaining the game screen of the target game currently running on the target terminal;
[0159] S2, using the target network model to detect the game screen to obtain a detection result of the game screen, wherein the target network model is used to detect a target object contained in the game screen, the object type of the target object is a predetermined type, and the detection result includes: the target object represented by first attribute information of a target attribute of the target object;
[0160] S3, inputting the game screen and the detection result into the artificial intelligence AI control model to obtain a control instruction, wherein the AI control model is used to control the operation of the target game according to the game screen and the detection result, and the control instruction is used to control the target game to perform a target operation;
[0161] S4, using control instructions to control the target game to perform target operations.
[0162] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0163] S1, using the convolutional neural network included in the target network model to perform convolution processing on the game screen, and extracting the target feature image corresponding to the game screen;
[0164] S2, searching on the target feature image to obtain second attribute information of the target attribute of the candidate target object;
[0165] S3, using a target algorithm to process the second attribute information, screen out target objects from candidate target objects, and obtain a detection result, wherein the target algorithm is used to screen out target objects that meet the screening conditions from candidate target objects according to the second attribute information.
[0166] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0167] S1, when the convolutional neural network includes multiple neural network layers, selecting at least two feature images from multiple feature images output by the multiple neural network layers as target feature images, wherein different neural network layers in the multiple neural network layers output feature images of different scales;
[0168] S2, searching respectively on at least two feature images to obtain second attribute information on feature images of different scales.
[0169] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0170] S1, before using the target network model to detect the game screen and obtaining the detection result of the game screen, obtaining a training image set, wherein the training image set includes training images and first data, the first data includes third attribute information of a target attribute of a first object, and the first object is an object of a predetermined type contained in the training image;
[0171] S2: Use the training image and the first data to train the initial network model to obtain a target network model.
[0172] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0173] S1, obtaining the training result of the first network model after the M-th training is completed, wherein the first network model is a network model obtained after the initial network model is trained for the first M-1 times, M is a positive integer greater than or equal to 1, and the training result includes: a first offset between a first true box and a first candidate box, the first true box is a first rectangular box containing a first object indicated by the first data, and the first candidate box is a second rectangular box containing the first object detected by the first network model;
[0174] S2: using the training results, adjusting the model parameters of the first network model.
[0175] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0176] S1, in the process of training the initial network model using the training image and the first data to obtain the target network model, a test image set is obtained, wherein the test image set includes the test image and the second data, the second data includes fourth attribute information of the target attribute of the second object, and the second object is an object of a predetermined type contained in the test image;
[0177] S2, using the test image to test the second network model to obtain a test result, wherein the second network model is a network model obtained after training the initial network model N times, N is a positive integer greater than or equal to 1, and the test result includes: a second offset between the second real box and the second candidate box, the second real box is a third rectangular box containing the second object indicated by the second data, and the second candidate box is a fourth rectangular box containing the second object detected by the second network model;
[0178] S3, when the second offset is less than or equal to the target offset, determining the target network model to be the second network model;
[0179] S4: When the second offset is greater than the target offset, continue to train the second network model using the training image and the first data to obtain the target network model.
[0180] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0181] According to another aspect of the embodiment of the present invention, an electronic device for implementing the above-mentioned game running method is also provided. Fig.11 As shown, the electronic device includes: a processor 1102, a memory 1104, a data bus 1106, and a transmission device 1108. The above components can be connected through the data bus 1106 or other lines for data transmission. The memory stores a computer program, and the processor is configured to execute the steps of any of the above method embodiments through the computer program.
[0182] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0183] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0184] S1, obtaining the game screen of the target game currently running on the target terminal;
[0185] S2, using the target network model to detect the game screen to obtain a detection result of the game screen, wherein the target network model is used to detect a target object contained in the game screen, the object type of the target object is a predetermined type, and the detection result includes: the target object represented by first attribute information of a target attribute of the target object;
[0186] S3, inputting the game screen and the detection result into the artificial intelligence AI control model to obtain a control instruction, wherein the AI control model is used to control the operation of the target game according to the game screen and the detection result, and the control instruction is used to control the target game to perform a target operation;
[0187] S4, using control instructions to control the target game to perform target operations.
[0188] Alternatively, a person skilled in the art may understand that: Fig.11The structure shown is for illustration only, and the electronic device may also be a smart device, a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID for short), a PAD, and other terminal devices. Fig.11 The structure of the electronic device is not limited. Fig.11 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.11 Different configurations are shown.
[0189] Among them, the memory 1104 can be used to store software programs and modules, such as program instructions / modules corresponding to the game running method and device in the embodiment of the present invention. The processor 1102 executes various functional applications and data processing by running the software programs and modules stored in the memory 1104, that is, realizing the above-mentioned game running method. The memory 1104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1104 may further include a memory remotely arranged relative to the processor 1102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0190] The transmission device 1108 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 1108 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1108 is a radio frequency (RF) module or Bluetooth, which is used to communicate with the Internet wirelessly.
[0191] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0192] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
[0193] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0194] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0195] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0196] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0197] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A game running method, characterized in that: include: Get the game screen of the target game currently running on the target terminal; Using a target network model to detect the game screen, to obtain a detection result of the game screen, wherein the target network model is used to detect a target object contained in the game screen, the object type of the target object is a predetermined type, and the detection result includes: the target object represented by first attribute information of a target attribute of the target object; Inputting the game screen and the detection result into an artificial intelligence AI control model to obtain a control instruction, wherein the AI control model is used to control the operation of the target game according to the game screen and the detection result, and the control instruction is used to control the target game to perform a target operation; Using the control instruction, controlling the target game to perform the target operation; Before using the target network model to detect the game screen and obtain the detection result of the game screen, the method also includes: acquiring a training image set, wherein the training image set includes training images and first data, the first data includes third attribute information of a target attribute of a first object, and the first object is an object of the predetermined type contained in the training image; using the training image and the first data to train the initial network model to obtain the target network model; obtaining the training result of the first network model after the Mth training is completed, wherein the first network model is a network model obtained after the initial network model is trained for the first M-1 times, M is a positive integer greater than or equal to 1, and the training result includes: a first offset between a first real box and a first candidate box, the first real box is a first rectangular box containing the first object indicated by the first data, and the first candidate box is a second rectangular box containing the first object detected by the first network model; using the training result, adjusting the model parameters of the first network model, wherein the size of the first candidate box is determined by the aspect ratio feature of the first object.
2. The method according to claim 1, characterized in that The game screen is detected using the target network model, and the detection result of the game screen is obtained including: Using the convolutional neural network included in the target network model to perform convolution processing on the game screen, and extracting a target feature image corresponding to the game screen; Searching on the target feature image to obtain second attribute information of the target attribute of the candidate target object; The second attribute information is processed using a target algorithm to filter out the target object from the candidate target objects to obtain the detection result, wherein the target algorithm is used to filter out the target object that meets the filtering condition from the candidate target objects based on the second attribute information.
3. The method according to claim 2, characterized in that Searching on the target feature image to obtain the second attribute information of the target attribute of the candidate target object includes: In the case where the convolutional neural network includes multiple neural network layers, selecting at least two feature images from multiple feature images output by the multiple neural network layers as the target feature images, wherein different neural network layers in the multiple neural network layers output feature images of different scales; Searching is performed on the at least two feature images respectively to obtain the second attribute information on feature images of different scales.
4. The method according to claim 1, characterized in that: In the process of training the initial network model using the training image and the first data to obtain the target network model, the method further includes: A test image set is acquired, wherein the test image set includes a test image and second data, the second data includes fourth attribute information of a target attribute of a second object, and the second object is an object of the predetermined type included in the test image; Using the test image to test the second network model, to obtain a test result, wherein the second network model is a network model obtained after training the initial network model N times, N is a positive integer greater than or equal to 1, and the test result includes: a second offset between a second real box and a second candidate box, the second real box is a third rectangular box indicated by the second data and containing the second object, and the second candidate box is a fourth rectangular box detected by the second network model and containing the second object; When the second offset is less than or equal to the target offset, determining that the target network model is the second network model; When the second offset is greater than the target offset, the second network model is continuously trained using the training image and the first data to obtain the target network model.
5. The method according to any one of claims 1 to 4, characterized in that The target object includes the predetermined type of game element, and the target attribute includes the object type and the object position, wherein the predetermined type includes at least one of the following: a monster in the game, a character element in the game, a health bar, and a task prop.
6. A game running device, characterized in that: include: A first acquisition unit, used to acquire a game screen of a target game currently running on a target terminal; a detection unit, configured to detect the game screen using a target network model to obtain a detection result of the game screen, wherein the target network model is used to detect a target object contained in the game screen, the object type of the target object is a predetermined type, and the detection result includes: the target object represented by first attribute information of a target attribute of the target object; An input unit, used to input the game screen and the detection result into an artificial intelligence AI control model to obtain a control instruction, wherein the AI control model is used to control the operation of the target game according to the game screen and the detection result, and the control instruction is used to control the target game to perform a target operation; A control unit, configured to use the control instruction to control the target game to perform the target operation; The device also includes: a second acquisition unit, used to acquire a training image set before using the target network model to detect the game screen and obtain the detection result of the game screen, wherein the training image set includes training images and first data, and the first data includes third attribute information of the target attribute of a first object, and the first object is the object of the predetermined type contained in the training image; a training unit, used to train the initial network model using the training image and the first data to obtain the target network model; the training unit includes: an acquisition module, used to acquire the training result of the first network model after the Mth training is completed, wherein the first network model is a network model obtained after the initial network model is trained for the first M-1 times, M is a positive integer greater than or equal to 1, and the training result includes: a first offset between a first real box and a first candidate box, the first real box is a first rectangular box containing the first object indicated by the first data, and the first candidate box is a second rectangular box containing the first object detected by the first network model; an adjustment module, used to adjust the model parameters of the first network model using the training result, wherein the size of the first candidate box is determined by the aspect ratio feature of the first object.
7. The device according to claim 6, characterized in that The detection unit comprises: An extraction module, used to perform convolution processing on the game screen using the convolutional neural network included in the target network model, and extract a target feature image corresponding to the game screen; A search module, used for searching on the target feature image to obtain second attribute information of the target attribute of the candidate target object; A selection module is used to process the second attribute information using a target algorithm, filter out the target object from the candidate target objects, and obtain the detection result, wherein the target algorithm is used to filter out the target object that meets the filtering conditions from the candidate target objects based on the second attribute information.
8. The device according to claim 7, characterized in that The search module includes: A selection submodule, used for selecting at least two feature images from a plurality of feature images output by the plurality of neural network layers as the target feature images when the convolutional neural network includes a plurality of neural network layers, wherein different neural network layers in the plurality of neural network layers output feature images of different scales; The search submodule is used to search respectively on the at least two feature images to obtain the second attribute information on feature images of different scales.
9. The device according to claim 6, characterized in that The device also includes: A third acquisition unit is configured to acquire a test image set in a process of training the initial network model using the training image and the first data to obtain the target network model, wherein the test image set includes a test image and second data, the second data includes fourth attribute information of a target attribute of a second object, and the second object is an object of the predetermined type contained in the test image; A testing unit, configured to test a second network model using the test image to obtain a test result, wherein the second network model is a network model obtained after training the initial network model N times, N is a positive integer greater than or equal to 1, and the test result includes: a second offset between a second real box and a second candidate box, the second real box is a third rectangular box containing the second object indicated by the second data, and the second candidate box is a fourth rectangular box containing the second object detected by the second network model; when the second offset is less than or equal to the target offset, determining that the target network model is the second network model; The training unit is further used to continue to train the second network model using the training image and the first data to obtain the target network model when the second offset is greater than the target offset.
10. A storage medium, characterized in that: The storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 5 when executed.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor executes the method described in any one of claims 1 to 5 through the computer program.
