A Control Method and System for Multi-Chess Game Robots Based on Behavior and Emotion-Adaptive Game Difficulty Adjustment
By combining deep analysis of hand gestures and facial emotion features with an LSTM model, the difficulty adjustment and robotic arm movement of the game robot are dynamically adjusted, which solves the shortcomings of existing game robots in perception and control, and achieves efficient human-computer interaction experience and safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-30
- Publication Date
- 2026-04-03
AI Technical Summary
Existing game-playing robot systems lack temporal analysis of the hand posture features and facial emotional features of the interactive objects in terms of perception. This makes it impossible to quantify the degree of hesitation and emotional valence during the interaction process. The control parameter adjustment lacks continuity and adaptability, the decision-making logic and execution actions lack coordination, and there is a lack of proactive safety mechanisms based on abnormal states.
By combining deep feature extraction and temporal analysis of hand posture features and facial emotion features, an LSTM temporal state analysis model is used to generate instantaneous state scores, dynamically adjust the parameters of the AlphaZero reinforcement learning model and the kinematic parameters of the robotic arm, and introduce an anti-oscillation smoothing mechanism and a chessboard area heatmap for local difficulty correction, combined with safety detection of the end effector.
It achieves precise quantification of the psychological state of the interactive object, improves the coherence and anthropomorphism of the interactive experience, and ensures the safety and intelligence level of human-computer interaction.
Smart Images

Figure CN121608162B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to robot control technology, and in particular to a control method and system for multi-game robot based on adaptive game difficulty adjustment of behavior and emotion. Background Technology
[0002] In existing human-computer physical interaction systems, game-playing robots are widely used to verify intelligent decision-making algorithms and motion control strategies. Currently, mainstream game-playing robot systems typically consist of three parts: a visual perception module, a game decision engine, and a robotic arm actuator. Their typical workflow is as follows: the visual perception module acquires images of the chessboard and uses image processing algorithms to locate the coordinates of the pieces; the game decision engine outputs move commands based on the chessboard state; and the robotic arm actuator performs point-to-point trajectory planning and grasping actions based on these commands. For example, existing patent CN113127704B discloses a Monte Carlo tree search method, which focuses on improving the robot's chess-playing ability through algorithm optimization.
[0003] However, the existing game-theoretic robot control methods mentioned above have the following limitations:
[0004] First, at the visual perception level, existing technologies suffer from a "single-dimensional perception." Current visual systems focus only on structured "chessboard" information (i.e., changes in piece positions), neglecting unstructured "interactive object behavior" information. Specifically, existing technologies lack the ability to analyze the temporal characteristics of the interactive object's (i.e., the human chess player's) hand gestures and facial expressions. This means the system cannot capture hesitation, anxiety, or abnormal movements during piece placement, resulting in the control system's inability to obtain feedback on the interactive object's psychological state and intentions.
[0005] Secondly, at the decision-making and control level, existing technologies suffer from "strategy decoupling and a lack of adaptability." Current game theory decisions typically only output discrete action commands based on the outcome of the game, failing to coordinate the game decision-making logic with the robotic arm's motion parameters. On one hand, the difficulty adjustment mechanism is rigid: while the aforementioned patent can achieve different levels of game play, its adjustment mechanism cannot establish a dynamic mapping relationship between the real-time state of the interactive object and the core hyperparameters of the algorithm, resulting in the system's inability to achieve smooth performance adjustments. On the other hand, motion planning lacks anthropomorphism and safety: regardless of the decision-making level's state, the execution mechanism always operates with standardized industrial motion parameters, lacking compliant control based on state feedback. This not only leads to a lack of anthropomorphism in the interaction process, but more seriously, when abnormal situations occur, the system cannot trigger proactive safety mechanisms based on abnormal states, posing a safety hazard in human-computer interaction.
[0006] In summary, existing technologies for adaptive control and interactive experience of gaming robots mainly face the following technical challenges that need to be addressed:
[0007] 1. Lack of perceptual ability based on temporal features: It only relies on single-frame image recognition of chessboard state and lacks long and short-term memory temporal analysis of the hand posture features and facial emotional features of the interactive object, making it difficult to effectively quantify the degree of hesitation and emotional valence in the interaction process.
[0008] 2. Lack of continuity and adaptability in control parameter adjustment: The existing difficulty level relies on preset discrete rules, which cannot dynamically adjust the hyperparameters of the algorithm kernel according to the real-time state of the interactive object, resulting in an unsmooth interactive experience.
[0009] 3. Lack of coordination between decision-making logic and execution actions: The adjustment of the game algorithm failed to be synchronously mapped to the kinematic parameters of the robotic arm (such as speed and pause time), resulting in the system lacking human-like characteristics at the physical interaction layer.
[0010] 4. Lack of proactive safety mechanisms based on abnormal states: Existing control systems cannot trigger the robotic arm's flexible buffers or physical safety protection when they detect abnormal or high-risk behavior of the interactive object. Summary of the Invention
[0011] Purpose of the invention: The purpose of this invention is to provide a control method and system for multi-game robot based on adaptive game difficulty adjustment of behavior and emotion, which aims to solve the technical problems existing in the prior art and effectively improve the interactive experience and intelligence level of human-computer game.
[0012] Technical solution: The control method described in this invention is applied to a multi-chess game robot system, and includes the following steps:
[0013] Based on the selected game type, the corresponding game board UI interface and underlying game engine are loaded on the game board touch screen; the system establishes a mapping matrix between the game board touch screen pixel coordinate system and the game robot robotic arm base coordinate system when it is first deployed or the configuration is changed.
[0014] During the game, RGB image sequences containing the hand movements and facial expressions of the interacting objects are acquired in real time;
[0015] Deep feature extraction and temporal analysis are performed on the acquired RGB image sequence to generate hand pose feature vectors and facial emotion feature vectors. The hand pose feature vectors and facial emotion feature vectors are concatenated to construct a multidimensional temporal tensor. The multidimensional temporal tensor is input into an LSTM temporal state analysis model, and the model outputs the current instantaneous state score of the interactive object, which includes behavioral hesitation score and emotional valence score.
[0016] Based on the instantaneous state score, the theoretical difficulty prediction value is calculated using a linear weighting formula. Then, using an anti-oscillation smoothing mechanism, if the absolute value of the slope of the theoretical difficulty prediction value is consistently lower than the preset fluctuation noise threshold, or if the monotonic change trend of the theoretical difficulty prediction value lasts for less than the set time window threshold, it is determined to be an occasional interference, and the global target difficulty coefficient is the global target difficulty coefficient calculated in the previous round. When a monotonic change trend is observed and the duration is greater than or equal to the set time window threshold, the state of the interactive object changes trendwise, and the smoothing update logic is entered. The global target difficulty coefficient is calculated using a weighted moving average formula, and finally, the global target difficulty coefficient is used as the final difficulty coefficient.
[0017] The parameters of the preset AlphaZero reinforcement learning model are dynamically adjusted according to the final difficulty coefficient, and the adjusted parameters are used to perform inference in the current game state to obtain the final move coordinates; then the trajectory planning speed and dwell time before the move are dynamically adjusted according to the final difficulty coefficient.
[0018] The control system drives the robotic arm to perform the placing operation according to the placement coordinates, the planned speed of the robotic arm trajectory, and the dwell time before placing the piece. At the same time, it performs safety detection, including end force detection and human hand interference detection.
[0019] Furthermore, deep feature extraction and temporal analysis are performed on the acquired RGB image sequences to generate hand pose feature vectors and facial emotion feature vectors; including:
[0020] Hand feature extraction: The MediaPipe Hands-based hand keypoint detection model is used to process each frame of the image, extracting the coordinates of 21 2D skeletal keypoints of the interactive object's hand. and will continue The key point information of the frame is used to construct a hand pose feature vector. ;
[0021] Facial feature extraction: A multi-head deep convolutional neural network based on the ResNet50 backbone is used to extract features from the RGB image sequence to obtain facial emotion feature vectors. ;include:
[0022] Image input normalization: cropping the facial ROI region The data is uniformly scaled to a preset size and normalized before being used as network input.
[0023] Shared Feature Extraction: The input image undergoes residual block processing at various stages of a multi-head deep convolutional neural network with a ResNet50 backbone. Through layer-by-layer mapping of convolutional layers, batch normalization layers, and ReLU activation functions, a globally shared feature vector containing high-dimensional facial semantic information is extracted. ;
[0024] Multi-task decoupling output: sharing feature vectors globally. Then, three independent fully connected branches are connected, each executing a different mapping task:
[0025] Basic sentiment probability classification: A fully connected layer combined with the Softmax activation function is used to classify sentiment probabilistically. It is mapped to a multidimensional probability distribution vector, outputting the confidence scores of various emotions, thus forming a basic emotion probability vector;
[0026] Two-dimensional sentiment regression: using fully connected layers in conjunction with the Tanh activation function, Mapping to the valence-arousal two-dimensional continuous emotional space, the specific coordinate values are output to form a two-dimensional emotional vector;
[0027] Facial action unit intensity detection: A fully connected layer combined with a sigmoid activation function is used to identify the independent activation intensity of facial action units and construct a facial action unit intensity vector.
[0028] Feature concatenation: The vectors output from the three branches—basic emotion probability classification, two-dimensional emotion regression, and facial action unit intensity detection—are concatenated along the feature channel dimension to generate a high-dimensional facial emotion feature vector. .
[0029] Furthermore, the multidimensional temporal tensor is input into the LSTM temporal state analysis model, and the model outputs the current instantaneous state score of the interacting object; including:
[0030] Temporal feature encoding: Utilizing the forget gate, input gate, and output gate mechanisms within the LSTM temporal state analysis model network to update cell states. With hidden layer state It is used to capture the dynamic changes of interactive objects over time.
[0031] State Fraction Mapping: Through a pre-defined linear mapping layer, the LSTM time-series state analysis model is mapped... Hidden layer state vector output at time step Mapped to a two-dimensional instantaneous state fraction vector The specific calculation formula is as follows:
[0032] ;
[0033] in, For the preset weight matrix, For the bias term vector, Use the Sigmoid activation function;
[0034] Output definition: The calculated vector ;
[0035] in, The score represents the degree of hesitation in behavior; For emotional valence score, This is the transpose of the matrix.
[0036] Furthermore, based on the instantaneous state score, the theoretical difficulty prediction value is calculated using a linear weighting formula, expressed as:
[0037] ;
[0038] in, This is the theoretical difficulty prediction value at the current moment. For behavioral weighting coefficients, The emotional weighting coefficient, and ; The score represents the degree of hesitation in behavior; For emotional valence score;
[0039] Calculate the global objective difficulty coefficient using the weighted moving average formula , is represented as:
[0040] ;
[0041] in, As a smoothing factor, This is the global objective difficulty coefficient calculated in the previous round.
[0042] Furthermore, the method also includes a step of performing local difficulty correction on the global target difficulty coefficient based on the heatmap of the chessboard area, including:
[0043] Capability Heatmap Construction: The chessboard is divided into grid areas, and the historical win rate and error frequency of interactive objects in each area are statistically analyzed in real time to construct a capability heatmap of the interactive objects. Each grid region is marked with one of the following two attributes: (1) High error region: a region where the historical error rate exceeds the preset threshold or the historical win rate is significantly lower than the average level; (2) Normal region: other regions besides the high error region, including high win rate region, unexplored region and neutral region.
[0044] Candidate move pre-calculation: Employs a pre-defined AlphaZero reinforcement learning model, based on the global objective difficulty coefficient. Perform a preliminary search and output the optimal move position at the current moment. ;
[0045] Local correction logic: Determine the best move position at the current moment. Mapping coordinates to a pre-built heatmap of interactive object capabilities The corresponding region value:
[0046] If the game engine calculates the optimal move position lie in For marked high-error areas of interactive objects, a local attenuation coefficient is introduced for that single move. Forcefully adjust the global objective difficulty coefficient:
[0047] ;
[0048] in, To adjust the difficulty level;
[0049] like If located in a normal area, then maintain ;
[0050] Make the final difficulty level .
[0051] Furthermore, the preset parameters of the AlphaZero reinforcement learning model are dynamically adjusted based on the final difficulty coefficient, and the adjusted parameters are used to perform inference in the current game state to obtain the final move coordinates; including:
[0052] Number of simulations :
[0053] ;
[0054] in, and These represent the minimum and maximum number of simulations for the Monte Carlo tree search, respectively. This represents the Gaussian rounding operation. This represents the final difficulty level.
[0055] Confidence upper limit exploration constant :
[0056] ;
[0057] in, Based on the exploration of constants, Explore the gain coefficient;
[0058] Action sampling temperature coefficient :
[0059] ;
[0060] in, Based on the base temperature parameter, For random gain coefficients;
[0061] Root node Dirichlet noise weight :
[0062] ;
[0063] in, Based on the noise weight, This is the disturbance gain coefficient;
[0064] Using the adjusted AlphaZero reinforcement learning model parameters The AlphaZero reinforcement learning model performs inference under the current game state and outputs the final move coordinates. ;
[0065] The trajectory planning speed of the robotic arm and the time spent before placing the piece The calculation formula is:
[0066] ;
[0067] in, and These are the minimum and maximum planned speeds of the robotic arm's end effector, respectively.
[0068] ;
[0069] in, Basic thinking is time-consuming. Let be the hesitation time gain constant. The score represents the degree of hesitation in behavior.
[0070] Furthermore, the security detection method involves using the coordinates of 21 extracted 2D skeleton key points of the hand. The final coordinates of the robotic arm's placement. The Euclidean distance between them; if the detected Euclidean distance is less than the preset safety threshold, it is determined that there is human interference; when the end force exceeds the set threshold or human interference is detected, the robotic arm immediately decelerates or stops its movement, and absorbs the impact in conjunction with the elastic buffer mechanism; after confirming that the state is safe, it resumes its movement, which is used for both adaptive movement adjustment and safety protection.
[0071] The control system of this invention, used to implement the control method, includes a robotic arm, a chessboard touchscreen, an end effector, an image acquisition unit, and a control unit.
[0072] The robotic arm, as the physical execution end, is used to receive kinematic commands from the control unit and respond in real time;
[0073] The chessboard touchscreen serves as a platform for game interaction, communicating with the control unit to load a preset chessboard UI and display the moves of both sides in real time.
[0074] The end effector is installed at the end of the robotic arm and is used to achieve compliant placement and end force monitoring;
[0075] The image acquisition unit is used to acquire RGB image sequences containing the hand movements and facial expressions of the interactive object in real time.
[0076] The control unit is used to run a hand keypoint detection model based on MediaPipe Hands, a multi-head deep convolutional neural network based on ResNet 50 backbone network, an LSTM temporal state analysis model, and an AlphaZero reinforcement learning model.
[0077] Optionally, the end effector of the robotic arm adopts a tandem compliant structure design, including:
[0078] Rigid flange interface: used for connection to the end effector of a robotic arm;
[0079] Elastic buffer mechanism: connected in series between the rigid flange interface and the execution end, used to provide physical flexible deformation in the Z-axis direction to compensate for visual positioning error and absorb rigid impact when the projectile makes contact;
[0080] A uniaxial pressure sensor is installed on the force transmission path of the elastic buffer mechanism and connected to the control unit. The uniaxial pressure sensor is used to monitor the contact force in real time, provide a confirmation signal that the placement of the piece is completed, and trigger the physical protection mechanism of the system when the contact force exceeds the safety threshold.
[0081] Touch head: Located at the output end of the elastic buffer mechanism, its contacts are used to directly contact the chessboard touch screen to execute the move action.
[0082] The present invention also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the control method described above.
[0083] Beneficial effects: Compared with the prior art, the significant technical effects of the present invention are: (1) Temporal interaction perception, which improves the accuracy of state evaluation; The present invention breaks through the limitation of traditional game robots relying only on chessboard information. By integrating hand posture feature vectors and facial emotion feature vectors containing basic emotions, two-dimensional emotions and facial action units (AU), the system uses LSTM long short-term memory network to capture the temporal correlation of data; The system can accurately output behavioral hesitation score and emotional valence score, thereby achieving keen capture and quantitative evaluation of the instantaneous psychological state of the interactive object in a complex interactive environment. (2) Dynamic difficulty smoothing mapping ensures the continuity of the interactive experience; This invention designs a difficulty mapping function with an anti-oscillation smoothing mechanism, and uses a time window threshold to monitor the slope of the theoretical difficulty prediction value in real time; This mechanism effectively filters out the interference noise caused by the accidental actions of the interactive object, ensures that the update of the difficulty coefficient has monotonic trend and perceptual continuity, avoids frequent jumps in the robot's chess level, and solves the problem of rigid difficulty adjustment; (3) Non-uniform adjustment of spatial dimension realizes targeted local difficulty adaptation; This invention introduces a local difficulty correction step based on the heat map of the chessboard area, By constructing a heatmap of the historical win rate and error frequency of the interactive object, a local attenuation coefficient is introduced to correct the final difficulty coefficient. This enables the robot to actively adjust its aggressiveness in the weak areas of the interactive object's move, achieving non-uniform difficulty adaptation. (4) The anthropomorphic execution of the software and hardware collaboration achieves a high degree of unity between decision-making and execution. Based on the final difficulty coefficient, the invention synchronously adjusts the hyperparameters of the AlphaZero reinforcement learning model algorithm and the kinematic parameters of the robotic arm. When the difficulty is reduced, the robot's chess strength decreases, and its robotic arm movements will also show corresponding physical feedback such as "thinking pause" or "speed slowing down", simulating an anthropomorphic "hesitation" state, achieving a high degree of unity between decision-making logic and physical actions in the anthropomorphic dimension. (5) Active safety protection and physical protection ensure the safety of close-range interaction. The invention adopts a series-type compliant end effector, combined with an elastic buffer mechanism and a single-axis pressure sensor to achieve physical absorption and real-time monitoring of rigid impact on the Z-axis. With the visual-level hand interference detection of the interactive object, the system can immediately trigger deceleration when the end force is abnormal or the hand enters the dangerous area, ensuring the safety of high-frequency, close-range human-machine physical interaction. Attached Figure Description
[0084] Figure 1 This is a flowchart of the control method of the present invention;
[0085] Figure 2 This is a schematic diagram of the control system of the present invention;
[0086] Figure 3 This is a structural diagram of the end effector of the robotic arm used in this invention. Detailed Implementation
[0087] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0088] like Figure 1 As shown, this embodiment provides a control method for a multi-chess game robot based on adaptive game difficulty adjustment according to behavior and emotion. Addressing the technical problems existing in the prior art, this embodiment achieves optimized interactive experience and closed-loop control logic through the following four dimensions of technical improvements:
[0089] First, in terms of perception, a closed-loop perception system for emotions and behaviors is constructed. This embodiment breaks through the limitation of traditional game-playing robots that rely solely on chessboard information. By coupling the hand posture features and facial emotion features of the interactive object through an LSTM temporal analysis model, it achieves accurate quantification and fusion perception of the psychological state of the interactive object.
[0090] Second, in the decision-making and execution dimensions, dynamic difficulty is achieved through hardware and software synergy. This embodiment innovatively establishes a nonlinear mapping relationship between the final difficulty coefficient and the hyperparameters of the AlphaZero reinforcement learning model algorithm (including the number of search attempts, noise weights, etc.) as well as the kinematic parameters of the robotic arm (including end-effector velocity and pause time), realizing a deep anthropomorphic unification from decision-making logic to physical actions.
[0091] Third, in terms of stability control, an anti-oscillation smoothing mechanism is introduced. This embodiment effectively filters out the frequent system optimization problems caused by the instantaneous unconscious actions of the interactive object by introducing a time window to monitor the slope of the difficulty change, thus ensuring the psychological consistency and system control stability during the human-computer game process.
[0092] Fourth, in terms of strategy adaptability, non-uniform difficulty adjustment in the spatial dimension is achieved. This embodiment constructs a capability model of the interactive object based on a capability heatmap, and forcibly corrects the difficulty of specific areas through a local attenuation coefficient, thereby realizing a more accurate game strategy and specifically assisting the interactive object in improving.
[0093] The method described in this invention includes initialization of a multi-game scenario, perception of interactive object behavior and emotions, temporal calculation of the instantaneous state of interactive objects, bidirectional mapping and correction of difficulty coefficients, execution of a human-like strategy through software and hardware collaboration, and execution control and security detection. The system consists of a robotic arm, a chessboard touchscreen, an end effector, an image acquisition unit, and a control unit. This invention perceives the behavior and emotions of interactive objects in real time, achieving adaptive adjustment of game difficulty in both game strategy and physical action dimensions, effectively improving the interactive experience and intelligence level of human-computer interaction.
[0094] like Figure 1 As shown, the control method, applied to a multi-chess game robot system, specifically includes the following steps:
[0095] S1. Initialization of Multi-Game Scenarios: In response to the user's game selection command, the corresponding game board UI and underlying game engine are loaded onto the game board touchscreen. During initial deployment or configuration changes, the system establishes the game board touchscreen pixel coordinate system through planar mapping calibration. coordinate system with the robotic arm base The mapping matrix is obtained, and the stored mapping matrix is directly called during subsequent initialization without repeated calibration;
[0096] S2. Interactive object behavior and emotion perception: During the game, the image acquisition unit acquires RGB image sequences containing the hand movements and facial expressions of the interactive objects in real time.
[0097] S3. Temporal Determination of the Instantaneous State of the Interactive Object: Deep feature extraction and temporal analysis are performed on the RGB image sequence obtained in step S2 to generate hand pose feature vectors and facial emotion feature vectors. The hand pose feature vectors and facial emotion feature vectors are concatenated to construct a multidimensional temporal tensor, which is then input into an LSTM temporal state analysis model to output the current instantaneous state score of the interactive object. The Includes behavioral hesitation score With emotional valence score ;
[0098] The specific steps for generating hand pose feature vectors and facial emotion feature vectors include:
[0099] Hand feature extraction: The MediaPipe Hands-based hand keypoint detection model is used to process each frame of the image, extracting the coordinates of 21 2D skeletal keypoints of the interactive object's hand. and will continue The key point information of the frame is used to construct a hand pose feature vector. ;
[0100] Facial Feature Extraction: To achieve synchronous parsing of facial features of interactive objects, this embodiment utilizes a multi-head deep convolutional neural network architecture based on the ResNet50 backbone network. The specific implementation process of this network is as follows:
[0101] Image input normalization: cropping the facial ROI region Scaling to the preset size uniformly ( The data is then normalized and used as network input.
[0102] Shared Feature Extraction: The input image undergoes five stages of residual block processing using a multi-head deep convolutional neural network architecture with a ResNet50 backbone. Through layer-by-layer mapping of convolutional layers, batch normalization layers, and ReLU activation functions, a globally shared feature vector containing high-dimensional facial semantic information is extracted. (2048 dimensions).
[0103] Multi-task decoupled output: In order to simultaneously acquire features of three different attributes, the system globally shares the feature vector. Then, three independent fully connected branches are connected, each executing a different mapping task:
[0104] Basic sentiment probability classification: A fully connected layer combined with the Softmax activation function is used to classify sentiment probabilistically. The probability distribution is mapped to a 7-dimensional vector, and the confidence scores of seven emotions—happiness, sadness, anger, surprise, fear, disgust, and neutrality—are output, forming the basic emotion probability vector.
[0105] Two-dimensional sentiment regression: A fully connected layer combined with the Tanh activation function (restricting the output to the [-1, 1] interval) is used to... Mapping to the Valence-Arousal two-dimensional continuous emotional space, the specific coordinate values are output to form a two-dimensional emotional vector.
[0106] Facial Action Unit (AU) Intensity Detection: A fully connected layer is used in conjunction with the Sigmoid activation function (for multi-label tasks) to identify the independent activation intensities of facial action units such as eyebrow raising, corner of mouth drooping, and eyelid contraction, and to construct a facial action unit intensity vector (17-34 dimensions).
[0107] Feature concatenation: The vectors output from the three branches above are concatenated along the feature channel dimension to generate a high-dimensional facial emotion feature vector. .
[0108] The specific steps for constructing the multidimensional temporal tensor include:
[0109] To integrate behavioral and emotional features, the hand gesture feature vectors obtained at the same time are... With facial emotion feature vector The features are concatenated along the feature dimension to form a fused feature vector for a single frame. (Continuous...) The fused feature vectors of the frames are stacked in chronological order to construct a multidimensional temporal tensor, which serves as the input to the subsequent LSTM temporal state analysis model. .
[0110] The specific steps of the time-series state analysis model processing include:
[0111] Will Input the preset LSTM timing state analysis model.
[0112] Temporal feature encoding: Utilizing the forget gate, input gate, and output gate mechanisms within the LSTM temporal state analysis model network to update cell states. With hidden layer state This process can effectively capture the dynamic changes of interactive objects over time (such as the back-and-forth motion of a hand when hesitating, and the gradual change of facial expressions).
[0113] State score mapping: The LSTM time-series state analysis model is mapped using a pre-defined linear mapping layer. Hidden layer state vector output at time step Mapped to a two-dimensional instantaneous state fraction vector The specific calculation formula is as follows:
[0114] ;
[0115] in, For the preset weight matrix, For the bias term vector, Use the Sigmoid activation function;
[0116] Output definition: The calculated vector ;
[0117] in, The behavioral hesitation score is calculated by the LSTM time-series state analysis model. The encoding result of the temporal change determines that the higher the value, the more hesitant the interactive object is to place a piece; The emotional valence score is a numerical logic deeply coupled with the basic emotional probability vector, two-dimensional emotion vector and facial action unit (AU) intensity vector captured at the input. Positive values represent positive emotions and negative values represent negative emotions.
[0118] S4. Difficulty coefficient bidirectional mapping calculation and correction: based on the instantaneous state score output in step S3. The theoretical difficulty prediction value is calculated using the linear weighting formula designed in this invention. Then, the global target difficulty coefficient is calculated using the anti-oscillation smoothing mechanism designed in this invention and the weighted moving average formula. The implementation process includes the following logically progressive sub-steps, the specific steps of which are as follows:
[0119] The theoretical difficulty prediction value is calculated based on the linear weighting formula designed in this invention:
[0120] ;
[0121] in, This is the theoretical difficulty prediction value at the current moment. For behavioral weighting coefficients, The emotional weighting coefficient, and This formula establishes a mapping logic between "low hesitation and high positive emotion" and "high game difficulty".
[0122] Anti-oscillation smoothing mechanism trigger logic: In order to prevent frequent changes in difficulty due to unconscious actions of interactive objects, the system introduces a time window mechanism.
[0123] Real-time monitoring of the slope of changes in the theoretical difficulty prediction value Set a time window threshold. (This value is preset based on the average thinking time of each game type, such as 5 seconds for Go).
[0124] When the absolute value of the slope of change The noise level remains consistently below the preset fluctuation threshold (the duration of which must be greater than the system's minimum sampling interval), or the predicted value is monotonic (i.e., the noise level is lower than the preset fluctuation threshold). (The sign of the positive or negative sign remains unchanged) Duration of the trend of change If it is determined to be an occasional interference, then the global target difficulty coefficient is maintained. ; This is the global objective difficulty coefficient calculated in the previous round;
[0125] When the predicted value of theoretical difficulty shows a monotonic trend, and the duration of this trend is... When the system confirms that the state of the interactive object has changed in a trend, it enters the smooth update logic.
[0126] Smooth update logic: When an update is triggered, the global target difficulty coefficient is calculated using the weighted moving average formula designed in this invention. :
[0127] ;
[0128] in, This is a smoothing factor, with a value range of [value range missing]. ; This is the global objective difficulty coefficient calculated in the previous round.
[0129] Difficulty level of the global objective As the final difficulty level ,Right now The final difficulty level will be determined. Output to step S5.
[0130] Building upon this, as a further optimized implementation, the method also includes a local difficulty correction step based on a heatmap of the chessboard region:
[0131] After obtaining the global objective difficulty coefficient Then, non-uniformity correction is further performed by combining the characteristics of the chessboard space:
[0132] Capability Heatmap Construction: The chessboard is divided into grid areas, and the historical win rate and error frequency of interactive objects in each area are statistically analyzed in real time to construct a capability heatmap of the interactive objects. Each grid region is marked as one of the following two attributes: (1) High error region: a region where the historical error rate exceeds a preset threshold (e.g., 40%) or the historical win rate is significantly lower than the average level; (2) Normal region: other regions besides the high error regions mentioned above, including high win rate regions, unexplored regions and neutral regions.
[0133] Candidate move pre-calculation: Invokes the pre-set AlphaZero reinforcement learning model, based on the global objective difficulty coefficient. Perform a preliminary search and output the optimal move position at the current moment. ;
[0134] Local correction logic: Determine the best move position at the current moment. Mapping coordinates to a pre-built heatmap of interactive object capabilities The corresponding region value:
[0135] If the game engine calculates the optimal move position lie in For marked high-error areas of interactive objects, a local attenuation coefficient is introduced for that single move. Forced adjustment of target difficulty:
[0136] ;
[0137] in, To adjust the difficulty level.
[0138] like If located in a normal area, then maintain .
[0139] The difficulty level will be adjusted. As the final difficulty level ,Right now .
[0140] The final difficulty level will be determined. Output to step S5.
[0141] S5, Execution of a software-hardware collaborative anthropomorphic strategy: based on the final difficulty coefficient of the output. The game strategy of the preset AlphaZero reinforcement learning model and the kinematic parameters of the robotic arm are dynamically adjusted to achieve dual anthropomorphism in the robot's game level and action performance.
[0142] Game-theoretic policy regulation in AlphaZero reinforcement learning models The Monte Carlo Tree Search (MCTS) parameters during the AlphaZero model inference process are dynamically adjusted, and these parameters follow the following nonlinear mapping relationship:
[0143] number of simulations :
[0144] ;
[0145] in, and These represent the minimum and maximum number of simulations for Monte Carlo Tree Search (MCTS), respectively, with symbols... This indicates Gaussian rounding, which rounds the value within the parentheses down to ensure that the output simulation result is an integer. ;when When reducing, nonlinear reduction is achieved through squared mapping. This limits the depth and breadth of the search, simulating the computational limitations of human chess players.
[0146] Confidence upper limit exploration constant :
[0147] ;
[0148] in, Based on the exploration of constants, Explore the gain coefficient; when When it decreases, Growth forces models to explore more non-optimal branches with lower prior probabilities, simulating human trial-and-error thinking.
[0149] Action sampling temperature coefficient :
[0150] ;
[0151] in, Based on the base temperature parameter, For random gain coefficients; when When it decreases, The linear increase makes the probability distribution of the smoothing strategy network output more uniform, increasing the randomness and uncertainty of the game selection.
[0152] Root node Dirichlet noise weight :
[0153] ;
[0154] in, Based on the basic noise weight, The disturbance gain coefficient; when When it decreases, Increase the noise by injecting stronger Dirichlet noise into the prior probability of the root node to simulate irrational moves made by human chess players due to intuition bias or mental fluctuations.
[0155] Using the adjusted AlphaZero reinforcement learning model parameters The AlphaZero reinforcement learning model performs inference under the current game state and outputs the final move coordinates. .
[0156] Dynamic adjustment of robotic arm kinematic parameters: determining the coordinates of the drop. Then, using Dynamically adjust the trajectory planning speed of the robotic arm and the time spent before placing the piece This ensures that the physical behavior of the game-playing robot matches the current game difficulty, and the mapping relationship is as follows:
[0157] Trajectory planning speed :
[0158] ;
[0159] in, and These are the minimum and maximum planned speeds of the robotic arm's end effector, respectively. and It exhibits a positively correlated nonlinear mapping; the lower the difficulty, the slower the movement.
[0160] Time to pause before placing a piece :
[0161] ;
[0162] in, Basic thinking is time-consuming. Let be the hesitation time gain constant. The score represents the degree of hesitation in behavior; and It is negatively correlated and modulated by the hesitation factor, simulating the "thinking hesitation" state of humans when the situation is unclear or their level is limited.
[0163] S6. Execution Control and Safety Detection: The control system drives the robotic arm according to the parameters determined in step S5 ( , , The placement operation is performed simultaneously with safety checks, including end-effector force detection and hand interference detection. The specific detection method involves using the coordinates of 21 key points on the hand's 2D skeleton extracted in step S3. The final coordinates of the robotic arm's placement. The Euclidean distance between the two objects is measured; if the measured Euclidean distance is less than a preset safety threshold (e.g., 15cm), it is determined that there is human interference. When the end effector force exceeds the set threshold or human interference is detected, the robotic arm immediately decelerates or stops its movement, and absorbs the impact in conjunction with an elastic buffer mechanism. The movement is only resumed after the state is confirmed to be safe, so as to achieve both adaptive movement adjustment and safety protection.
[0164] Furthermore, such as Figure 1 As shown, the control method described in this invention is a cyclic iterative process:
[0165] After the robotic arm completes the move and passes the safety check in step S6, the system will automatically record the current game state to prepare for the next round and call the AlphaZero reinforcement learning model game engine to determine the current board position:
[0166] If the game is determined not to be over: the logic flow jumps back to step S2. At this time, the image acquisition unit will restart to acquire the hand movements and facial expressions of the interactive object when facing the new round, and enter the closed-loop control of the next round until the game ends.
[0167] If the game is determined to be over (i.e., determined to be a "win", "lose" or "draw"): the system controls the game robot arm to reset to the initial safe posture and ends the current process.
[0168] Simultaneously, after each round, the system will feed back the interaction object's performance in a specific chessboard area to the interaction object's capability heatmap described in step S4, so as to calculate a more suitable heatmap for the interaction object's current state in the next round. .
[0169] like Figure 2 As shown, the present invention also provides a multi-chess game robot control system based on adaptive game difficulty adjustment of behavior and emotion, used to implement the method described in steps S1-S6 above, including a robotic arm, a chessboard touch screen, an end effector, an image acquisition unit, and a control unit:
[0170] The robotic arm is a collaborative robotic arm mounted on one side of the chessboard touchscreen. As the physical execution end for steps S5 and S6, its servo controller receives kinematic commands from the control unit and can respond in real time to the trajectory planning speed calculated in step S5. and length of stay This allows them to exhibit anthropomorphic action characteristics of "hesitation" or "decisiveness";
[0171] The chessboard touchscreen is a horizontal display area located on the system control panel. Serving as the platform for game interaction, the touchscreen is communicatively connected to the control unit and is used to load a preset chessboard UI and display the real-time moves of both players in step S1.
[0172] The end effector, installed at the end flange of the robotic arm, integrates an elastic buffer mechanism and a single-axis pressure sensor to achieve compliant piece placement and end force monitoring as described in step S6.
[0173] The image acquisition unit includes an RGB camera and a bracket installed on the outer edge of the chessboard area, used to acquire RGB image sequences containing the hand movements and facial expressions of the interactive object in real time, as the raw data input for feature extraction in step S3.
[0174] The control unit is equipped with a high-performance computing unit, which internally stores and runs a collaborative hand keypoint detection model based on MediaPipe Hands, a multi-head deep convolutional neural network based on ResNet 50 backbone network, an LSTM temporal state analysis model, and an AlphaZero reinforcement learning model.
[0175] In particular, such as Figure 3 As shown, the end effector of the robotic arm adopts a unique series-type compliant structure design of this invention, specifically including:
[0176] Rigid flange interface: used for rigid connection with the end of the robotic arm;
[0177] Elastic buffer mechanism: connected in series between the rigid flange interface and the execution end, containing a spring or damping element to provide physical flexible deformation in the Z-axis direction to compensate for visual positioning errors and absorb rigid impact when the piece makes contact.
[0178] A uniaxial pressure sensor is installed on the force transmission path of the elastic buffer mechanism and connected to the control unit. The uniaxial pressure sensor is used to monitor the contact force in real time, provide a confirmation signal that the placement of the piece is completed, and trigger the physical protection mechanism of the system when the contact force exceeds the safety threshold.
[0179] Touch head: Located at the output end of the elastic buffer mechanism, its contacts are made of soft conductive material and are used to directly contact the chessboard touch screen to perform the move action.
[0180] The present invention also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the control method described above.
Claims
1. A control method for multi-chess game robots based on adaptive game difficulty adjustment of behavior and emotion, characterized in that, The method, applied to a multi-chess game robot system, includes the following steps: Based on the selected game type, the corresponding game board UI interface and underlying game engine are loaded on the game board touch screen; the system establishes a mapping matrix between the game board touch screen pixel coordinate system and the game robot robotic arm base coordinate system when it is first deployed or the configuration is changed. During the game, RGB image sequences containing the hand movements and facial expressions of the interacting objects are acquired in real time; Deep feature extraction and temporal analysis are performed on the acquired RGB image sequence to generate hand pose feature vectors and facial emotion feature vectors. The hand pose feature vectors and facial emotion feature vectors are concatenated to construct a multidimensional temporal tensor. The multidimensional temporal tensor is input into an LSTM temporal state analysis model, and the model outputs the current instantaneous state score of the interactive object, which includes behavioral hesitation score and emotional valence score. Inputting a multidimensional temporal tensor into an LSTM temporal state analysis model, the model outputs the current instantaneous state score of the interacting object; including: Temporal feature encoding: Utilizing the forget gate, input gate, and output gate mechanisms within the LSTM temporal state analysis model network to update cell states. With hidden layer state It is used to capture the dynamic changes of interactive objects over time. State Fraction Mapping: Through a pre-defined linear mapping layer, the LSTM time-series state analysis model is mapped... Hidden layer state vector output at time step Mapped to a two-dimensional instantaneous state fraction vector The specific calculation formula is as follows: ; in, For the preset weight matrix, For the bias term vector, Use the Sigmoid activation function; Output definition: The calculated vector ; in, The score represents the degree of hesitation in behavior; For emotional valence score, This is the transpose of the matrix; Based on the instantaneous state score, the theoretical difficulty prediction value is calculated using a linear weighting formula. Then, using an anti-oscillation smoothing mechanism, if the absolute value of the slope of the theoretical difficulty prediction value is consistently lower than the preset fluctuation noise threshold, or if the monotonic change trend of the theoretical difficulty prediction value lasts for less than the set time window threshold, it is determined to be an occasional interference, and the global target difficulty coefficient is the global target difficulty coefficient calculated in the previous round. When a monotonic change trend is observed and the duration is greater than or equal to the set time window threshold, the state of the interactive object changes trendwise, and the smoothing update logic is entered. The global target difficulty coefficient is calculated using a weighted moving average formula, and finally, the global target difficulty coefficient is used as the final difficulty coefficient. Based on the instantaneous state score, the predicted theoretical difficulty value is calculated using a linear weighting formula, and is expressed as follows: ; in, This is the theoretical difficulty prediction value at the current moment. For behavioral weighting coefficients, The emotional weighting coefficient, and ; The score represents the degree of hesitation in behavior; Emotional valence score; Calculate the global objective difficulty coefficient using the weighted moving average formula , represented as: ; in, As a smoothing factor, This is the global objective difficulty coefficient calculated in the previous round; The parameters of the preset AlphaZero reinforcement learning model are dynamically adjusted according to the final difficulty coefficient, and the adjusted parameters are used to perform inference in the current game state to obtain the final move coordinates; then the trajectory planning speed and dwell time before the move are dynamically adjusted according to the final difficulty coefficient. The control system drives the robotic arm to perform the placing operation according to the placement coordinates, the planned speed of the robotic arm trajectory, and the dwell time before placing the piece. At the same time, it performs safety detection, including end force detection and human hand interference detection.
2. The control method according to claim 1, characterized in that, Deep feature extraction and temporal analysis are performed on the acquired RGB image sequences to generate hand pose feature vectors and facial emotion feature vectors; including: Hand feature extraction: The MediaPipe Hands-based hand keypoint detection model is used to process each frame of the image, extracting the coordinates of 21 2D skeletal keypoints of the interactive object's hand. and will continue The key point information of the frame is used to construct a hand pose feature vector. ; Facial feature extraction: A multi-head deep convolutional neural network based on the ResNet50 backbone is used to extract features from the RGB image sequence to obtain facial emotion feature vectors. ;include: Image input normalization: cropping the facial ROI region The data is uniformly scaled to a preset size and normalized before being used as network input. Shared Feature Extraction: The input image undergoes residual block processing at various stages of a multi-head deep convolutional neural network with a ResNet50 backbone. Through layer-by-layer mapping of convolutional layers, batch normalization layers, and ReLU activation functions, a globally shared feature vector containing high-dimensional facial semantic information is extracted. ; Multi-task decoupling output: sharing feature vectors globally. Then, three independent fully connected branches are connected, each executing a different mapping task: Basic sentiment probability classification: A fully connected layer combined with the Softmax activation function is used to classify sentiment probabilistically. It is mapped to a multidimensional probability distribution vector, outputting the confidence scores of various emotions, thus forming a basic emotion probability vector; Two-dimensional sentiment regression: using fully connected layers in conjunction with the Tanh activation function, Mapping to the valence-arousal two-dimensional continuous emotional space, the specific coordinate values are output to form a two-dimensional emotional vector; Facial action unit intensity detection: A fully connected layer combined with a sigmoid activation function is used to identify the independent activation intensity of facial action units and construct a facial action unit intensity vector. Feature concatenation: The vectors output from the three branches—basic emotion probability classification, two-dimensional emotion regression, and facial action unit intensity detection—are concatenated along the feature channel dimension to generate a high-dimensional facial emotion feature vector. .
3. The control method according to claim 1, characterized in that, The method further includes a step of locally adjusting the global target difficulty coefficient based on a heatmap of the chessboard region, including: Capability Heatmap Construction: The chessboard is divided into grid areas, and the historical win rate and error frequency of interactive objects in each area are statistically analyzed in real time to construct a capability heatmap of the interactive objects. Each grid region is marked with one of the following two attributes: (1) High error region: a region where the historical error rate exceeds the preset threshold or the historical win rate is significantly lower than the average level; (2) Normal region: other regions besides the high error region, including high win rate region, unexplored region and neutral region. Candidate move pre-calculation: Employs a pre-defined AlphaZero reinforcement learning model, based on the global objective difficulty coefficient. Perform a preliminary search and output the optimal move position at the current moment. ; Local correction logic: Determine the best move position at the current moment. Mapping coordinates to a pre-built heatmap of interactive object capabilities The corresponding region value: If the game engine calculates the optimal move position lie in For marked high-error areas of interactive objects, a local attenuation coefficient is introduced for that single move. Forcefully adjust the global objective difficulty coefficient: ; in, To adjust the difficulty level; like If located in a normal area, then maintain ; Make the final difficulty level .
4. The control method according to claim 1, characterized in that, The parameters of the preset AlphaZero reinforcement learning model are dynamically adjusted according to the final difficulty coefficient, and the adjusted parameters are used to perform inference in the current game state to obtain the final move coordinates. include: Number of simulations : ; in, and These represent the minimum and maximum number of simulations for the Monte Carlo tree search, respectively. This represents the Gaussian rounding operation. This represents the final difficulty level. Confidence upper limit exploration constant : ; in, Based on the exploration of constants, Explore the gain coefficient; Action sampling temperature coefficient : ; in, Based on the base temperature parameter, For random gain coefficients; Root node Dirichlet noise weight : ; in, Based on the noise weight, This is the disturbance gain coefficient; Using the adjusted AlphaZero reinforcement learning model parameters The AlphaZero reinforcement learning model performs inference under the current game state and outputs the final move coordinates. ; The trajectory planning speed of the robotic arm and the time spent before placing the piece The calculation formula is: ; in, and These are the minimum and maximum planned speeds of the robotic arm's end effector, respectively. ; in, Basic thinking is time-consuming. Let be the hesitation time gain constant. The score represents the degree of hesitation in behavior.
5. The control method according to claim 1, characterized in that, The security detection method is as follows: using the coordinates of 21 extracted 2D skeleton key points of the hand. The final coordinates of the robotic arm's placement. The Euclidean distance between them; if the detected Euclidean distance is less than the preset safety threshold, it is determined that there is human interference; when the end force exceeds the set threshold or human interference is detected, the robotic arm immediately decelerates or stops its movement, and absorbs the impact in conjunction with the elastic buffer mechanism; after confirming that the state is safe, it resumes its movement, which is used for both adaptive movement adjustment and safety protection.
6. A multi-chess-like game robot control system based on adaptive game difficulty adjustment according to behavior and emotion, characterized in that, To implement the control method according to any one of claims 1-5, a robotic arm, a chessboard touchscreen, an end effector, an image acquisition unit, and a control unit are included. The robotic arm, as the physical execution end, is used to receive kinematic commands from the control unit and respond in real time; The chessboard touchscreen serves as a platform for game interaction, communicating with the control unit to load a preset chessboard UI and display the moves of both sides in real time. The end effector is installed at the end of the robotic arm and is used to achieve compliant placement and end force monitoring; The image acquisition unit is used to acquire RGB image sequences containing the hand movements and facial expressions of the interactive object in real time. The control unit is used to run a hand keypoint detection model based on MediaPipe Hands, a multi-head deep convolutional neural network based on ResNet50 backbone network, an LSTM temporal state analysis model, and an AlphaZero reinforcement learning model.
7. The control system according to claim 6, characterized in that, The end effector of the robotic arm adopts a tandem compliant structure design, including: Rigid flange interface: used for connection to the end effector of a robotic arm; Elastic buffer mechanism: connected in series between the rigid flange interface and the execution end, used to provide physical flexible deformation in the Z-axis direction to compensate for visual positioning error and absorb rigid impact when the projectile makes contact; A uniaxial pressure sensor is installed on the force transmission path of the elastic buffer mechanism and connected to the control unit. The uniaxial pressure sensor is used to monitor the contact force in real time, provide a confirmation signal that the placement of the piece is completed, and trigger the physical protection mechanism of the system when the contact force exceeds the safety threshold. Touch head: Located at the output end of the elastic buffer mechanism, its contacts are used to directly contact the chessboard touch screen to execute the move action.
8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the control method according to any one of claims 1-5.
Citation Information
Patent Citations
A Monte Carlo Tree Search Method, System, and Application
CN113127704B
Machine examination method for electric power post capability model skill assessment
CN110298015A
Man-machine game system and man-machine game method supporting psychological immediacy sense control
CN115933889A