Intelligent agent behavior conversion method and device, computer equipment and storage medium

By performing image processing and data fusion on physical card images, a parameterized card model is constructed, and its attributes are mapped into agent behavior, the problem of inefficient mapping interaction between physical card attributes and digital agent behavior is solved, and efficient interaction between physical card and digital agent is achieved.

CN120147154AInactive Publication Date: 2025-06-13SHENZHEN BOYUE DOMESTIC GOODS

Patent Information

Application Number
CN202510622716.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2025-06-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, efficient mapping interactions cannot be performed between physical card attributes and digital agent behavior.

Method used

By obtaining physical card images, image edge detection and content recognition, image structure features and content labels are obtained, data fusion and multi-dimensional anti-counterfeiting verification are performed, style parameter mapping is used to build a parameterized card model, and its attributes are mapped as agent behavior.

Benefits of technology

It realizes efficient mapping interaction between physical card attributes and agent behavior, breaking through the boundaries between traditional card games and digital card games.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120147154A_ABST
    Figure CN120147154A_ABST
Patent Text Reader

Abstract

The invention discloses an agent behavior conversion method and device, computer equipment and a storage medium, and the method comprises the steps: carrying out the image edge detection and image content recognition of an entity card image, and correspondingly obtaining an image structure feature and an image content label; performing data fusion on the image structure features and the image content labels, and performing multi-dimensional anti-counterfeiting verification to obtain an image verification result; and based on an image verification result, performing style parameter mapping on an image fusion result by using a low-rank adaptation mechanism to construct a parameterized card model. According to the method, the entity card image is subjected to a series of data processing construction to obtain the parameterized card model, and then attribute mapping is performed on various parameter attributes on the parameterized card model, so that the parameter attributes are converted into the agent behaviors, efficient mapping interaction between the entity card attributes and the agent behaviors is realized, and the interaction efficiency of the entity card attributes and the agent behaviors is improved. The limit between a traditional card game and a digital card game is broken through.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to an agent behavior conversion method, device, computer device and storage medium. Background Art

[0002] Traditional card games usually use physical cards as carriers, which have certain collection value and tactile interaction experience, and can form physical-based social interactions among players. However, limited by physical media, there are obvious limitations in gameplay expansion, interaction methods and data analysis, and it is difficult to support complex or dynamic game mechanisms. In contrast, digital card games achieve high interactivity and content diversity through virtual platforms, and can support rich game modes and feedback mechanisms through program logic, enhancing the immersion of the user experience and the strategic nature of the game. However, due to the lack of a physical form of carrier, digital card games have deficiencies in terms of collection satisfaction and physical communication.

[0003] In recent years, the rapid development of technologies such as multi-modal recognition, computer vision, generative artificial intelligence (AI), and reinforcement learning has provided a technical basis for the conversion between physical cards and digital agents. However, there is no existing solution for efficiently mapping and interacting between the attributes of physical cards and the behaviors of digital agents. Summary of the Invention

[0004] Embodiments of the present invention provide an agent behavior conversion method, device, computer device and storage medium, aiming to solve the problem that there is no efficient mapping and interaction between the attributes of physical cards and the behaviors of digital agents in the prior art.

[0005] In a first aspect, an agent behavior conversion method based on physical cards provided by an embodiment of the present invention includes:

[0006] Obtain an image of a physical card, and perform image edge detection and image content recognition on the image of the physical card respectively to obtain an image structure feature and an image content label correspondingly;

[0007] Perform data fusion on the image structure feature and the image content label to obtain an image fusion result;

[0008] Perform multi-dimensional anti-counterfeiting verification on the image fusion result to obtain an image verification result;

[0009] Based on the image verification result, use a low-rank adaptation mechanism to perform style parameter mapping on the image fusion result to construct a parameterized card model;

[0010] Perform attribute mapping on various parameter attributes on the parameterized card model to convert the parameter attributes into agent behaviors.

[0011] In a second aspect, an embodiment of the present invention provides an intelligent agent behavior conversion device based on an entity card, including:

[0012] A content recognition unit, configured to obtain an entity card image, and perform image edge detection and image content recognition on the entity card image respectively, and correspondingly obtain an image structure feature and an image content label;

[0013] A data fusion unit, configured to perform data fusion on the image structure feature and the image content label to obtain an image fusion result;

[0014] An anti-counterfeiting verification unit, configured to perform multi-dimensional anti-counterfeiting verification on the image fusion result to obtain an image verification result;

[0015] A style mapping unit, configured to perform style parameter mapping on the image fusion result by using a low-rank adaptation mechanism based on the image verification result to construct a parameterized card model;

[0016] An action output unit, configured to perform attribute mapping on various parameter attributes on the parameterized card model to convert the parameter attributes into intelligent agent behaviors.

[0017] In a third aspect, an embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the intelligent agent behavior conversion method based on an entity card in the first aspect is implemented.

[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the intelligent agent behavior conversion method based on an entity card in the first aspect is implemented.

[0019] An embodiment of the present invention provides an intelligent agent behavior transformation method based on an entity card, including obtaining an entity card image, performing image edge detection and image content recognition on the entity card image respectively, and correspondingly obtaining an image structure feature and an image content label; performing data fusion on the image structure feature and the image content label to obtain an image fusion result; performing multi-dimensional anti-counterfeiting verification on the image fusion result to obtain an image verification result; based on the image verification result, using a low-rank adaptation mechanism to perform style parameter mapping on the image fusion result to construct a parameterized card model; performing attribute mapping on various parameter attributes on the parameterized card model to convert the parameter attributes into intelligent agent behaviors. The present invention constructs a parameterized card model by performing a series of data processes on the entity card image, and then performs attribute mapping on various parameter attributes on the parameterized card model, thereby converting the parameter attributes into intelligent agent behaviors. In this way, an efficient mapping interaction between the entity card attributes and the intelligent agent behaviors is realized, breaking through the boundaries between traditional card games and digital card games.

[0020] An embodiment of the present invention also provides an intelligent agent behavior transformation device, a computer device, and a storage medium based on an entity card, which also have the above beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0022] Figure 1 It is a schematic flowchart of an intelligent agent behavior transformation method based on an entity card provided by an embodiment of the present invention; Figure 2 It is a schematic block diagram of an intelligent agent behavior transformation device based on an entity card provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0023] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.

[0024] It should be understood that when used in this specification and the appended claims, the terms "comprising" and "include" indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.

[0025] It should also be understood that the terms used in this specification of the present invention are merely for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in this specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.

[0026] It should be further understood that the term "and / or" used in this specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0027] Please refer to the following Figure 1 , Figure 1 which is a schematic flowchart of an agent behavior transformation method based on an entity card provided for an embodiment of the present invention, specifically including: steps S101 to S105.

[0028] S101. Obtain an entity card image, and respectively perform image edge detection and image content recognition on the entity card image to correspondingly obtain an image structure feature and an image content label; S102. Perform data fusion on the image structure feature and the image content label to obtain an image fusion result; S103. Perform multi-dimensional anti-counterfeiting verification on the image fusion result to obtain an image verification result; S104. Based on the image verification result, use a low-rank adaptation mechanism to perform style parameter mapping on the image fusion result to construct a parameterized card model; S105. Perform attribute mapping on various parameter attributes on the parameterized card model to transform the parameter attributes into agent behaviors.

[0029] In step S101, an entity card image is acquired. In this implementation, an image acquisition system integrated with a high-definition camera module is used to capture the entity card. The camera module supports synchronous acquisition of visible light, infrared, and ultraviolet multi-spectral images, and has a resolution of not less than 12 million pixels and an image output capability of not less than 4K. The acquired image is first denoised, perspective-corrected, and normalized by an image preprocessing module, and then image edge detection and image content recognition operations are performed respectively. The edge detection process preferably uses an improved Canny edge detection algorithm to extract the boundary geometric features of the card; the image content recognition process extracts the semantic labels and key content elements of the card by fusing vision transformer models (such as SAM or Mask2Former), and finally outputs the image structure features and image content labels respectively.

[0030] In a preferred implementation manner of the present invention, to achieve high-quality acquisition of the entity card image and subsequent image processing, the image acquisition process involved in step S101 depends on the support of a specific hardware system. Specifically, the image acquisition is completed by a dedicated acquisition terminal, including the following core hardware components:

[0031] The system is equipped with a high-definition camera module for acquiring the entity card image. The camera module uses a CMOS image sensor with a resolution of not less than 12 million pixels, supports multi-spectral image acquisition such as visible light, infrared, and ultraviolet, the image output resolution is not less than 4K, and the frame rate is not less than 30 frames per second, ensuring clear and detailed image data can be acquired in various lighting environments. The acquired image data is preprocessed in real time by an image processing unit. This processing unit uses a high-performance processor based on the ARM Cortex-A78 architecture with a main frequency of not less than 2.5 GHz, and integrates a dedicated neural network processing unit (NPU) with an AI computing power of not less than 8 TOPS, which is used to accelerate operations such as edge detection, feature extraction, and image enhancement, ensuring the synchronous improvement of processing efficiency and recognition accuracy. To ensure the data communication efficiency between the image processing result and the remote recognition system, the terminal also integrates a high-speed communication module, which supports Wi-Fi 6, Bluetooth 5.2, and 5G mobile communication standards, ensuring that the data delay during the image transmission process is controlled within 10 milliseconds, thus meeting the technical requirements of real-time processing and response.

[0032] In addition, to implement image interaction and editing functions, the system is equipped with a high-resolution touch display unit. The display unit uses an IPS high-definition screen with a size of no less than 10.1 inches, a resolution of no less than 2560×1600, and supports multi-touch operations of more than 10 points, facilitating users to perform image correction, annotation, and auxiliary input of card elements. After the image is captured and preprocessed, the system can choose to produce physical cards from the image content through the print output unit. The printing module supports color output with a precision of more than 300 DPI, and an optional lamination unit can be configured to improve the physical protection performance and adaptability of the physical cards. To cooperate with the anti-counterfeiting verification operation in image recognition, the system also integrates an anti-counterfeiting recognition module, including an ultraviolet / infrared dual-spectrum scanner, an NFC reader, and a high-precision image sensor, which are used to assist in collecting invisible marks, material structures, and encrypted information in the cards, constituting the hardware basis for integrating image acquisition and anti-counterfeiting recognition.

[0033] Through the collaborative work of the above hardware system, the comprehensive performance in aspects such as multi-modal input, high-precision image processing, and data transmission efficiency in the image acquisition and preprocessing stage in step S101 is ensured, providing a stable and reliable source of raw data input for subsequent image recognition, style modeling, and behavior generation.

[0034] In one embodiment, the step S101 includes:

[0035] Perform filtering processing on the physical card image to reduce local noise in the physical card image, and obtain a filtering processing result;

[0036] Based on the filtering processing result, respectively extract the gradient response information of the physical card image in the horizontal and vertical directions through a directional convolution operator, and calculate a direction distribution map using the gradient response information;

[0037] Perform non-maximum suppression processing on the gradient response information according to the direction distribution map to obtain edge extreme values;

[0038] Use a double-threshold discrimination mechanism to perform edge detection on the edge extreme points to obtain the image structure features.

[0039] In this embodiment, the acquired entity card image is filtered to reduce its local noise interference and enhance the expression ability of edge information in the image. The filtering process can adopt the Gaussian filtering method, and the image is smoothed by setting a two-dimensional Gaussian kernel with a standard deviation. This process effectively suppresses the high-frequency noise caused by texture details, uneven illumination, or background interference in the image, providing a clear image basis (i.e., the result of the filtering process) for subsequent gradient calculation. Subsequently, based on the result of the filtering process, directional convolution operators are used to extract the gradient response information of the image in the horizontal and vertical directions, which can be specifically completed by the Sobel operator. The Sobel operator performs convolution operations in two orthogonal directions to obtain the horizontal gradient matrix G x and the vertical gradient matrix G y . By combining the two, the gradient magnitude and direction angle of each pixel point in the image can be calculated, and then a direction distribution map representing the overall structural trend is formed. Among them, the gradient magnitude G(x, y) is calculated by taking the square root of the sum of the squares of G x and G y , and the direction θ(x, y) is calculated by the arctangent function.

[0040] Next, in combination with the obtained direction distribution map, non-maximum suppression processing is performed on the gradient response information in the image. This processing process compares the pixel values in the local area of the image along the gradient direction, and only retains the pixel points with local maximum values in the gradient direction, and sets the remaining pixel values to zero, thereby obtaining the edge extreme values of the image. This step can effectively remove the redundant responses in the non-edge area and retain the pixel positions corresponding to the real edges in the image.

[0041] Finally, a double-threshold discrimination mechanism is performed on the edge extreme values for edge extraction. This mechanism sets two reference values, a high threshold and a low threshold, to distinguish strong edges, weak edges, and non-edge areas. When the response value of a certain pixel point is higher than the high threshold, it is determined as a strong edge point and directly retained; when the response value is between the high and low thresholds and is connected to the already confirmed strong edge points, it is determined as a weak edge point and retained together; the remaining pixel points are excluded. Through this mechanism, the card contour information with a complete boundary structure can be accurately extracted, and finally the image structure features for subsequent recognition and feature fusion are obtained.

[0042] The image structure features can be obtained by referring to the following calculation method:

[0043] Card boundary detection: An improved Canny edge detection algorithm is adopted, as follows: ; ; where G(x, y) ∈ R H×W represents the image gradient magnitude matrix, with a size of H×W; Gx (x, y) ∈ R H×W represents the gradient matrix in the horizontal direction and can be obtained through convolution calculation in the x direction; G y (x, y) ∈ R H×W represents the gradient matrix in the vertical direction and can be obtained through convolution calculation in the y direction; θ(x, y) ∈ R H×W represents the gradient direction matrix, and the value range is [-π, π].

[0044] The improved Canny edge detection algorithm includes the following steps: (a) Gaussian filtering, using the Gaussian kernel K σ Performs smoothing processing on the original image I to reduce the influence of noise: I smooth = I * K σ ; where, * represents the convolution operation, and K σ is the Gaussian kernel with a standard deviation of σ; (b) Gradient calculation, using the Sobel operator to calculate the image gradient: G x = I smooth * S x , G y = I smooth * S y ; where, S x and S y are the Sobel operators in the horizontal and vertical directions respectively; (c) Non-maximum suppression, retaining the local maximum points in the gradient direction: ; (d) Double-threshold processing and edge connection, using two thresholds T high and T low to perform edge detection: ; where, E represents the final edge map, and the points with a value of 1 represent edge points.

[0045] This embodiment is optimized on the basis of the traditional Canny edge detection algorithm, combining a multi-stage processing mechanism of Gaussian filtering, directional gradient response, non-maximum suppression, and double-threshold judgment, effectively improving the accuracy and stability of card boundary detection, and is particularly suitable for the image object recognition scenario with regular geometric structures.

[0046] In one embodiment, the step S101 further includes: Using a preset visual transformer segmentation model to segment the physical card image to obtain a card content area; Extracting context vectors from the physical card image to generate a vector representation set; Convert the vector representation set into an image mask map, and output a content segmentation result; The content information of the card content area is extracted using the content segmentation result to generate the image content label.

[0047] In this embodiment, the physical card image is segmented using a preset visual transformer segmentation model to extract the card content area containing the key information of the physical card image. Preferably, the visual transformer model adopts a prompt-driven or query-driven segmentation network, such as the Segment Anything Model (SAM) or the Mask2Former model. The model extracts features and performs semantic segmentation on the input image by loading the trained encoder-decoder structure, and generates a binary image mask corresponding to the card content area, thereby separating the card content area from the background area.

[0048] Furthermore, context information modeling is performed on the card image, and the encoder performs embedding mapping on the image blocks of the card content area to generate a vector representation set representing the semantic context of the card. The vector representation set is mapped back to the two-dimensional space through the decoder to generate an image mask. The image mask is used to indicate the semantic attribution of each pixel in the card image, thereby achieving accurate segmentation of different content areas in the image. The image mask (i.e., content segmentation result) output by this process has both boundary positioning information and the semantic classification structure of the card content area.

[0049] Finally, based on the above content segmentation results, the core information of the card content area is extracted from the physical card image, such as text description, pattern category, color style and other content features, and structured encoding is performed to generate image content labels. Image content labels can be represented in the form of label vectors or embedded codes to reflect the semantic information carried in the card image and to link with the subsequent style generation and attribute mapping process.

[0050] The image content label can be obtained by referring to the following calculation method: The segmentation process can be expressed as: M=f seg (I,θ seg ); Where M∈{0,1} H×W Represents the segmentation mask, with a size of H×W, and pixels with a value of 1 represent the card area; I∈R H×W×CDenote the input image with size \(H\times W\) and \(C\) channels; f seg : \(\mathbb{R}\) H×W×C \(\to \{0, 1\}\) H×W Denote the segmentation function that maps the input image to a binary mask; \(\theta\) seg Denote the set of parameters of the segmentation model, including the weights and biases of the vision transformer.

[0051] The internal structure of the vision transformer segmentation model \(f\) seg can be expressed as: f seg (I, \(\theta\) seg ) = g decode (f encode (I, \(\theta\) enc ), \(\theta\) dec ); Among them, \(f\) encode : \(\mathbb{R}\) H×W×C \(\to \mathbb{R}\) N×D Denote the encoder that converts the image into \(N\) \(D\)-dimensional feature vectors; g decode : \(\mathbb{R}\) N×D \(\to \{0, 1\}\) H×W Denote the decoder that converts the feature vectors into a segmentation mask; \(\theta\) enc and \(\theta\) dec respectively denote the parameters of the encoder and decoder, satisfying \(\theta\) seg = \(\{\theta\) enc , \(\theta\) dec}\); SAM (Segment Anything Model) and Mask2Former are two segmentation models, and their main features are as follows: SAM: Adopts a prompt-driven segmentation method, which can generate corresponding segmentation masks according to point, box or text prompts, and is suitable for interactive segmentation scenarios; Mask2Former: Adopts a query-driven segmentation method, and predicts multiple segmentation masks by learning a set of query vectors, which is suitable for panoramic segmentation scenarios.

[0052] In step S102, data fusion of the image structure features and the image content labels can be performed. Through a multimodal feature fusion algorithm, different types of information such as edge features and semantic labels can be embedded into a unified feature vector space to obtain an image fusion result.

[0053] In step S103, multi-dimensional anti-counterfeiting verification is performed on the image fusion result. Here, a three-level anti-counterfeiting verification mechanism including physical feature verification, digital signature verification, and integrity hash verification is preferably adopted. Among them, the physical features include parameters such as texture, material, and microstructure. With the help of multi-spectral imaging and deep models, they are jointly extracted and compared with the reference template for similarity matching; the digital signature is verified through an asymmetric encryption mechanism (such as ECDSA) to determine whether the data corresponding to the image is authorized to be generated; the integrity check jointly generates a hash digest through a timestamp and a device code, and compares it with the reference value stored in the system. When all three sub-verifications meet the preset threshold, the image verification result is obtained.

[0054] In one embodiment, step S103 includes: Based on the image fusion result, the texture information, material information, and structural information of the entity card image are respectively extracted to generate a physical feature set; The physical feature set is subjected to similarity matching with the preset reference data to obtain a physical feature verification result; According to the image fusion result, the public key signature verification module is called to obtain a digital signature verification result; Hash verification is respectively performed on the key fields, timestamp, and device identifier of the image fusion result to obtain an integrity verification result; When the physical feature verification result, digital signature verification result, and integrity verification result are all verified to be true, the image verification result is output.

[0055] In this embodiment, the physical features of the entity card image are respectively extracted based on the image fusion result, including texture information, material information, and structural information. For the extraction of texture information, image texture analysis algorithms such as local binary pattern (LBP) and gray-level co-occurrence matrix (GLCM) are preferably adopted. The material information obtains the reflectivity and absorptivity characteristics in different bands through multi-spectral image analysis methods. The structural information can extract the boundary continuity and detail consistency characteristics from the high-magnification image by the microstructure feature modeling network. The physical features in the above multiple dimensions can be combined into a physical feature set. The physical feature set is subjected to similarity matching with the preset reference data. The similarity matching adopts a weighted feature comparison algorithm, and the similarity results are weighted and summed according to the weight parameters set for each physical feature dimension, and compared with the set threshold to determine the physical feature verification result. If the weighted similarity is higher than the preset threshold, it is determined that the physical feature verification is true.

[0056] Further, based on the digital signature information carried in the image fusion result, a preset public key signature verification module is called for signature verification. The digital signature is generated using an asymmetric encryption algorithm, such as ECDSA (Elliptic Curve Digital Signature Algorithm), and the hash digest and signature value in the image fusion result are decrypted and compared using the public key stored in the system. If the decryption result matches the original digest, the digital signature verification result is output as true.

[0057] Further, integrity hash verification is performed on information such as key fields, timestamps, and device identifiers in the image fusion result. This process uses the SHA-256 hash algorithm to concatenate the above fields and generate a hash digest, which is then compared with the original hash value pre-stored in the image. If the two are exactly the same, it is determined that the data has not been tampered with during storage and transmission, and the integrity verification result is output as true.

[0058] Finally, a joint judgment is made on the above three verification results. When the physical feature verification result, digital signature verification result, and integrity verification result are all true, the image verification result is output as passed, and it is confirmed that the image fusion result is legal and valid card data. Otherwise, it is determined as untrusted data, and the subsequent processing flow is terminated. Through the above implementation, the present invention provides a multi-level and multi-dimensional anti-counterfeiting verification mechanism, taking into account physical layer features, cryptographic signature verification, and data integrity verification, improving the security and credibility of entity card images, and effectively preventing security threats such as forgery, tampering, and replay attacks.

[0059] The multi-level anti-counterfeiting verification mechanism can refer to the following calculation formula: Physical feature verification is performed by extracting physical features of the card (such as texture, material, microstructure, etc.), and the feature extraction process can be expressed as: F phy ={f 1 ,f 2 ,...,f n}; Among them, F phy ⊂R m represents the physical feature set, which is a set containing n features; f i ∈R di represents the i-th feature vector, with a dimension of di; n represents the total number of features, usually 5 to 20.

[0060] The extraction of physical features uses a multi-modal sensor fusion method, including: Texture features are extracted using high-resolution image analysis to extract Local Binary Pattern (LBP) and Gray Level Co-occurrence Matrix (GLCM) features; Material characteristics, analyzing the reflectivity and absorptivity characteristics at different wavelengths through multispectral imaging; Microstructure, extracting microstructure characteristics using macro imaging and deep learning models; Optical characteristics, analyzing the reflection and refraction characteristics of the card at different angles and lighting conditions.

[0061] The determination process of physical feature verification is as follows: Among them, V phy represents the physical feature verification result; ; Among them, V phy represents the physical feature verification result; w i represents the weight of the i-th feature, satisfying ; represents the similarity between the extracted feature f i and the reference feature ; τ phy represents the threshold of physical feature verification, usually set to 0.85 - 0.95.

[0062] Digital signature verification, using an asymmetric encryption algorithm to generate and verify digital signatures. The verification process can be expressed as: ; Among them, V sig represents the digital signature verification result; D pub :{0,1}*×{0,1} l →{True,False} represents the verification function using the public key; S∈{0,1}* represents the digital signature, and its length depends on the encryption algorithm used; H:{0,1}*→{0,1} l represents the hash function, which maps a message of any length to a fixed-length digest; M represents the original message, which contains the key attributes and metadata of the card.

[0063] The generation process of the digital signature is as follows: S = E priv (H(M)); Among them, E priv :{0,1} l →{0,1}* represents the encryption function using the private key; The ECDSA (Elliptic Curve Digital Signature Algorithm) can be used as the digital signature algorithm, which has the characteristics of high security and low computational overhead.

[0064] Integrity check, verifying data integrity through hash calculation, and the calculation process can be expressed as: H calc =SHA-256(D║T║C); where, H calc ∈{0,1} 256 represents the calculated hash value, with a length of 256 bits; D∈{0,1}* represents the card data, including information such as the card's attributes, descriptions, and images; T∈{0,1} 64 represents the timestamp, recording the time when the card was generated or last modified; C∈{0,1} 32 represents the device code, identifying the device that generated the card; ║ represents the concatenation operation, concatenating multiple binary strings into one.

[0065] The determination process of the integrity check is: ; where, V int represents the integrity check result; H stored represents the hash value stored in the card or system.

[0066] The final anti-counterfeiting verification result is the logical AND operation of the verification results at three levels: V final =V phy ∧V sig ∧V int ; Only when the physical feature verification, digital signature verification, and integrity verification all pass, the card is considered to be genuine and valid. This multi-level anti-counterfeiting mechanism significantly improves the security of the system. Even if an attacker cracks one layer of protection, it is difficult to pass through the entire verification process.

[0067] In addition, a dynamic adjustment mechanism for anti-counterfeiting verification can be implemented, which can dynamically adjust the verification strategy according to the usage scenario and security requirements: S trategy =f adjust (Context,Risk,History); where, S trategy represents the verification strategy, including the enabled verification levels and the parameter settings for each level; f adjust represents the strategy adjustment function; Context represents the current usage scenario; Risk represents the risk assessment result; History represents the historical verification record; This dynamic adjustment mechanism enables the system to optimize the user experience and computational resource utilization efficiency while ensuring security.

[0068] In step S104, based on the image verification result, the low-rank adaptation mechanism is activated to perform style parameter mapping on the image fusion result. The style feature vector of the image fusion result can be extracted, and by calculating its similarity with multiple LoRA models in the preset style feature library, the most matching LoRA adapter is selected. Subsequently, the parameters of the most matching adapter are embedded into the diffusion model or style generation network to achieve directional migration and fusion of the image style. Finally, a parameterized card model containing multimodal information such as card structure, content, and style is output.

[0069] LoRA (Low-Rank Adaptation) is a parameter-efficient fine-tuning method that reduces the number of trainable parameters through low-rank decomposition. The specific calculation formula is as follows: For the weight matrix W in the pre-trained model 0 ∈R d×k , LoRA is parameterized in the following way: ; where W 0 ∈R d×k represents the original weight matrix in the pre-trained model and remains frozen during the fine-tuning process; W ∈ R d×k represents the adapted weight matrix for actual inference and generation; ∈R d×k represents the weight update matrix, which is achieved through low-rank decomposition; B ∈ R d×r represents the first matrix of the low-rank decomposition, containing d × r parameters; A ∈ R r×k represents the second matrix of the low-rank decomposition, containing r × k parameters; r represents the rank parameter, satisfying the condition r ≪ min(d, k), and is usually set to r ∈ [1, 16].

[0070] In actual implementation, the initialization method of the LoRA adapter is: ; where σ is a small standard deviation (such as 0.01) to ensure that in the initial stage of training , thus keeping the model behavior consistent with the pre-trained model; The forward propagation calculation can be expressed as: ; Among them, h represents the output hidden state; x represents the input vector; α represents a scaling factor used to control the influence degree of the adapter; is a normalization coefficient, which makes the initial variances of different ranks r consistent; This parameterization method reduces the number of trainable parameters from d×k to r×(d + k). When , the reduction in the number of parameters is significant. For example, for the case of d = 768, k = 768, and r = 8, the number of parameters is reduced from 589,824 to 12,288, a reduction of approximately 98%.

[0071] The LoRA adapter can be applied to different layers of the model, such as the query, key, value projection matrices of self-attention, and the feed-forward network. In the present invention, LoRA is mainly applied to the cross-attention module of the diffusion model to achieve efficient injection of style features.

[0072] Multiple LoRA adapters can be combined for use to achieve style mixing: ; where λ i is the weight coefficient of the i-th LoRA adapter, satisfying , λ i = 1, and n is the number of LoRA adapters.

[0073] In one embodiment, the step S104 includes: Extracting a style feature vector corresponding to the entity card image; Based on the style feature vector, screening the style adaptation model with the optimal matching degree in a preset low-rank adaptation model set; Invoking a preset diffusion model to perform multiple rounds of conditional denoising processing on the style adaptation model to generate a stylized image; Aligning and mapping the stylized image with the image content label to construct the parameterized card model with the target style.

[0074] In this embodiment, a style feature vector is extracted from the physical card image, and the style feature extraction process is implemented based on a pre-trained visual encoder model, which extracts style elements in the input image, such as color scheme, line style, material texture, and layout structure, through feature encoding and global pooling operations. This process can map the input image into a style feature vector. The extracted style feature vector is matched with the style feature vector corresponding to each model in the preset low-rank adaptation model set. The low-rank adaptation model set includes multiple style adaptation models pre-trained based on the LoRA (Low-Rank Adaptation) mechanism, and each model represents a specific card style feature. In the matching process, cosine similarity or Euclidean distance is preferably used as a metric to sort the similarity between the input style vector and the style features of each candidate model, and screen out the target LoRA model with the best match (i.e., the optimal style adaptation model).

[0075] Furthermore, the diffusion model matching the selected style adaptation model is called to perform multiple rounds of conditional denoising on the style adaptation model to generate a stylized image with the target style. Based on the conditional generation mechanism, the diffusion model takes the input image content vector and the target style vector as conditional information, and gradually guides the latent image to converge to an image output with a fusion visual style in multiple denoising iterations. The denoising process adjusts the weight structure of key layers (such as the cross attention module) in the diffusion network through a parameterized LoRA insertion module, thereby achieving high-fidelity migration of the target style while maintaining the semantic consistency of the image.

[0076] Finally, the generated stylized image is aligned and mapped with the previously obtained image content label. This process can jointly embed the visual style features of the image and its content semantic labels through feature-level fusion algorithms or image-semantic matching networks, and construct a parametric card model with both content consistency and style feature consistency. The parametric card model not only retains the semantic structure of the original image, but also carries the visual expression form of a specific style, providing a unified data input for subsequent attribute extraction and intelligent agent construction.

[0077] The style transfer process can refer to the following steps: Style analysis, extracts the style features of the card, expressed as: S=f style (I); Among them, S∈R ds Represents the style feature vector, with dimension ds; I∈R H×W×C Represents the input image, with a size of H×W and C channels.

[0078] f style :R H×W×C→R ds Denote the style extraction function, which is usually implemented by a pre-trained visual encoder as the style extraction function f style The internal implementation can be expressed as: f style (I) = g pool (f enc (I)); where f enc denotes the feature encoder that maps the image to the feature space; g pool denotes the pooling function that compresses the feature map into a style vector.

[0079] LoRA model selection, select the optimal LoRA model according to the style features, and the selection process can be expressed as: ; where L denotes the selected LoRA model; ={L 1 , L 2 ,..., L n}} denotes the set of LoRA models, which contains n pre-trained style models; d: R ds ×R ds →R+ denotes the distance function used to measure the similarity between style features; S Li ∈R ds denotes the style feature vector corresponding to the model L i ;

[0080] The distance function d usually adopts the negative value of cosine similarity or Euclidean distance: ; or .

[0081] Style transfer, use an image stylization system based on a diffusion model for style transfer, and the transfer process can be expressed as: I styled = f diffusion (I content , S, θ LoRA ); where: I styled ∈R H′×W′×C denotes the stylized image, with size H′×W′ and number of channels C; I content ∈R H×W×C denotes the content image, that is, the original image to be stylized; S ∈ Rds Represents the target style feature; θ LoRA ={(A 1 ,B 1 ),(A 2 ,B 2 ),...,(A m ,B m )} represents the LoRA parameter set, which contains m pairs of low-rank matrices; f diffusion Represents the denoising process of the diffusion model, which realizes the generation from noise to image.

[0082] The denoising process of the diffusion model can be expressed as iterative calculation: x t =f θ (x t+1 ,t,c); Among them, x t represents the denoised image at time step t; f θ represents the denoising network with parameters θ; t represents the time step; c represents the conditional information, which contains the content image I content and the style feature S.

[0083] The LoRA parameter θ LoRA is applied to the denoising network in the following way: W i =W i,0 +B i A i ; Among them, W i represents the modified weight matrix; W i,0 represents the original weight matrix; B i ∈R d×r and A i ∈R r×k represent the LoRA low-rank decomposition matrices.

[0084] In step S105, for various attribute parameters (such as attack power, defense power, speed, rarity, etc.) in the parameterized card model, an attribute-behavior mapping process is executed. Through the neural network mapping function obtained by training, the attribute vector is input into the non-linear transformation model, and a set of behavioral pattern strategies of the agent is output. The behavioral pattern is represented by a policy function, which supports generating diverse and adaptable action decisions in different environmental states. Thus, the static attributes possessed by the entity card are dynamically transformed into executable agent behavioral strategies, realizing the cross-modal transformation from a static carrier to a dynamic agent.

[0085] In one embodiment, step S105 includes: Obtain various parameter attributes on the parameterized card model, and convert the parameter attributes into attribute vectors; Input the attribute vectors into a preset multi-layer mapping network to integrate and obtain an attribute space; Perform a non-linear feature transformation on the attribute space based on preset mapping parameters to construct a policy function representing the behavior pattern; Perform action probability modeling on the entity card image according to the policy function to obtain a set of behavior policies; Optimize the set of behavior policies by using supervised data, self-play mechanism, and adversarial training mechanism respectively to obtain an intelligent agent behavior model; wherein, the intelligent agent behavior model includes multiple such intelligent agent behaviors.

[0086] In this embodiment, obtaining various attribute parameters in the parameterized card model includes attack power, defense power, speed, rarity, element type, etc. After structuring the above attributes, they are uniformly represented as a set of attribute vectors. To ensure input standardization, each attribute component can be normalized before input to eliminate the influence of dimension and enhance the convergence of the model. Input the attribute vectors into a preset multi-layer mapping network. This network is preferably a multi-layer feedforward neural network structure, composed of several linear transformation layers and non-linear activation functions, and is used to learn the combination relationship between attributes and map them to a unified attribute space.

[0087] After the attribute space is constructed, based on the preset mapping parameters in the system, perform a non-linear feature transformation on the attribute space to further construct a policy function representing the behavior pattern of the intelligent agent. This policy function is represented by the policy modeling method in reinforcement learning. This policy function converts attribute information into an action selection distribution that can be executed by the intelligent agent, thereby completing action probability modeling and outputting a set of behavior policies. To improve the performance of the intelligent agent behavior model, a multi-stage training mechanism can be used to optimize the set of behavior policies. In the first stage, a supervised learning method is adopted to preliminarily train the policy function based on expert demonstration data; in the second stage, a self-play mechanism is adopted to let the intelligent agent fight against itself in a virtual environment, collect policy execution data for policy gradient optimization; in the third stage, an adversarial training mechanism is introduced to train by constructing adversarial intelligent agents or perturbation samples to improve the robustness and generalization ability of the policy. Finally, the optimized set of behavior policies is integrated into a complete intelligent agent behavior model. Through the above implementation method, the structured mapping and intelligent training from static attribute parameters to dynamic behavior patterns are realized, improving the behavior expressiveness and interaction diversity of digital intelligent agents in the card system.

[0088] In this embodiment, the card features are transformed into agent behaviors through attribute-behavior mapping, and the mapping process can be expressed as: B = f map (A, Θ); where B represents the behavior pattern, which is a set of action strategies that the agent can execute in the environment; A represents the card attributes, which include various characteristic parameters of the card; f map represents the mapping function, a non-linear transformation that converts the attribute space to the behavior space; Θ represents the mapping parameters, a set of learnable parameters that control the mapping process.

[0089] The mapping function f map is implemented using a multi-layer neural network, and its structure is: ; where W i and b i are the weight matrix and bias vector of the i-th layer, and σ i is the activation function of the i-th layer, and L is the number of network layers.

[0090] Specifically, the card attribute A can be represented as a multi-dimensional vector: A = [a 1 , a 2 ,..., a n T ; where a i represents the i-th attribute value, such as attack power, defense power, speed, etc.; n represents the total number of attributes; [·] T represents the vector transpose operation.

[0091] Each component in the attribute vector usually undergoes normalization processing: ; where μ i and σ i are the mean and standard deviation of the i-th attribute, respectively.

[0092] The behavior pattern B can be represented as a policy function: π(a|s) = P(a t = a|s t = s); where π represents the policy function, which determines the behavior pattern of the agent; a represents the actions that the agent can execute; s represents the state of the environment; P represents the conditional probability; a​t The action at time step t; s t The state at time step t.

[0093] The policy function can be implemented using the softmax function: ; where Q(s,a) is the state-action value function, τ is the temperature parameter that controls the exploration degree of the policy, is the action space.

[0094] In one embodiment, after the step S105, it includes: Construct a state transition mechanism; Perform interactive sampling on the current environment of the agent behavior model based on the state transition mechanism to generate a state-action-reward sequence; Calculate the advantage estimation information according to the state-action-reward sequence to obtain the policy execution effect; Use the policy execution effect to update the behavior policy set to limit the policy deviation amplitude; During the policy update process, introduce the value function error term and the policy entropy term respectively to complete the training of the agent behavior model.

[0095] In this embodiment, after the initial construction of the agent behavior model, the agent behavior model can also be further optimized by reinforcement learning training. Specifically, it includes the following steps: Construct a state transition mechanism for behavior decision training. The state transition mechanism is based on the agent state machine defined in this system, including multiple state nodes such as waiting, activation, combat, failure, cooling, successful resurrection, failed resurrection, extinction, and victory. The transitions between states are jointly driven by environmental feedback, user interaction, and system rules, forming a complete state transition diagram for simulating the environmental dynamic changes in the real battle process.

[0096] Furthermore, perform an interactive sampling operation on the agent behavior model in the current environment based on the state transition mechanism. The agent behavior model interacts with the current simulation environment, selects actions according to the current policy, and records the generated state-action-reward sequence (state-action-reward trajectory). This sequence reflects the immediate reward and state feedback obtained by the agent after performing operations in the environment under a specific policy and is the core data source in training.

[0097] Furthermore, based on the above sequence, advantage estimation information is calculated to measure the performance advantage of a specific action relative to the average policy. Preferably, the Generalized Advantage Estimation (GAE) method widely used in reinforcement learning is adopted, and the advantage value is obtained through the calculation of the temporal difference value function and reward weighting, so as to quantify the relative superiority of the current policy in executing a certain action in a specific state and form the policy execution effect.

[0098] Furthermore, the policy execution effect is used to update the behavior policy set. The PPO (Proximal Policy Optimization) algorithm can be used to complete the policy optimization. This algorithm restricts the policy update amplitude by clipping the probability ratio to prevent the policy from deviating violently during the optimization process, thus ensuring the stability of training.

[0099] Finally, to improve the comprehensiveness and generalization ability of the training process, two auxiliary terms are introduced during the policy update process: the first is the value function error term, which is used to constrain the difference between the state value function and the actual cumulative reward to improve the value estimation accuracy; the second is the policy entropy term, which is used to encourage the policy to retain sufficient randomness at the initial stage of training to avoid falling into local optimal solutions.

[0100] The agent training can adopt the reinforcement learning method, such as using the PPO (Proximal Policy Optimization) algorithm. The objective function of the PPO algorithm is: ; where L CLIP (θ) represents the clipped objective function of PPO for optimizing the policy parameter θ; t represents the empirical expectation on the trajectory sampled under the current policy; represents the probability ratio of the new and old policies; –π θ (a t |s t ) represents the probability of selecting action a t under the current policy in state s t ; –π θold (a t |s t ) represents the probability of selecting action a t under the old policy in state s t ; t represents the advantage function estimation for evaluating the action a t taken in state s tAdvantages over average performance; It means that the probability ratio r t (θ) is limited to the interval Inside; is a hyperparameter used to control the step size of the policy update, usually set to 0.2.

[0101] The PPO algorithm limits the magnitude of policy updates by clipping the probability ratio to avoid excessive policy changes that lead to unstable training. The algorithm steps are as follows: The first step is to use the current strategy π θold Interact with the environment to collect state-action-reward sequences; The second step is to estimate the advantage function value at each time step ; The third step is to maximize the objective function L CLIP (θ) Update the strategy parameters θ; Repeat the above steps until convergence.

[0102] In actual implementation, the PPO algorithm usually also includes value function loss and entropy regularization terms, and the complete objective function is: L TOTAL (θ) = E t [L CLIP (θ)−c 1 L VF (θ)+c 2 S[π θ ](s t )]; Among them, L VF (θ) is the mean square error loss of the value function; S[π θ ](s t ) is the strategy π θ In status t Entropy under c 1 and c 2 is the coefficient that controls the weight of each item.

[0103] In one embodiment, for the intelligent agent used in the user battle, the failure state during the game process can introduce a knowledge question and answer resurrection mechanism to achieve the integration of educational content and game mechanism, improve the interactive experience and learning effect, and the mechanism includes the resurrection chance calculation logic and the adaptive question generation algorithm, which are as follows:

[0104] In terms of the resurrection mechanism design, when an agent is judged to be in a failed state during a battle, the system will trigger the resurrection mechanism judgment process to determine whether the agent is eligible to enter the knowledge quiz session. In terms of the question generation algorithm, a question set with the optimal matching degree is dynamically generated based on the user's learning progress, agent level, and historical performance. In specific implementation, the knowledge question bank covers multiple disciplinary dimensions, preferably including categories such as English, mathematics, encyclopedia, traditional Chinese culture, and pinyin. Questions are extracted from the corresponding knowledge domains according to the current card type of the agent and the player's behavior preferences. The system can further integrate user label data and learning curve data to achieve personalized adaptation of the quiz content. When the user completes the answering session, the system decides whether to allow the agent to resurrect based on the answering results. If the answer is correct, the agent transfers from the failed state to the successful resurrection state and continues to participate in subsequent battles; if the answer is incorrect, it depends on the remaining resurrection opportunities to decide whether to allow re-entry into the answering process or to be judged as the final failed state.

[0105] When the agent fails, it will be judged whether there is a resurrection opportunity. If there is, it will enter the knowledge quiz process.

[0106] The calculation formula for the resurrection opportunity can be expressed as: R = min(R max , R base + α·L + β·W); Among them, R represents the number of resurrection opportunities; R max represents the maximum number of resurrection opportunities; R base represents the basic number of resurrection opportunities; L represents the agent level; W represents the number of historical wins; α and β are weight coefficients; This design makes the resurrection opportunity associated with the usage situation (level and wins) of the agent, encourages users to actively participate in battles and improve the agent level, and at the same time maintains the game balance through upper limit control.

[0107] The question difficulty assessment can refer to the following formula: D = D base + γ·L + δ·P — η·F; Among them, D represents the question difficulty; D base represents the basic difficulty; L represents the agent level; P represents the user's historical correct rate; F represents the number of failures; γ, δ and η are weight coefficients.

[0108] In actual use, users can create personalized cards through the following steps: Users can collect physical images through the high-definition camera module integrated in the terminal device. The camera module supports multi-spectral imaging and has high-resolution output capabilities to ensure the quality of image acquisition. Subsequently, the system calls a preset vision transformer image segmentation model to perform entity segmentation on the target area in the collected image and accurately extract the main content of the card.

[0109] Based on the diffusion model and selected LoRA style adaptation parameters, perform style transfer on the segmented image to achieve image conversion in the style specified by the user. After the image stylization is completed, users can add text information, borders, pattern decorations, etc. through the graphical interface for further editing and personalized customization of the card elements.

[0110] After the editing is completed, the system can generate corresponding digital cards and support output as physical cards through local or remote printing devices. The printing process supports high-resolution color output, and a plastic sealing device can be optionally configured to improve the durability and anti-counterfeiting ability of the card, constituting a complete flash card DIY creation process.

[0111] In terms of the implementation of the battle system, the system supports multiple intelligent agent recognition and connection methods, including visual recognition, near-field communication (NFC) reading, dedicated card reader recognition, QR code scanning, and augmented reality (AR) marker recognition, etc., to ensure the rapid loading and accurate recognition of card information.

[0112] During the actual battle process, the user terminal can act as the host to initiate a battle request and create a battle room. Other terminals join the battle as slaves by scanning or reading the card information. The system provides a card selection function for both users to complete the intelligent agent configuration according to the tactical strategy and enter the battle space together. The battle engine drives the battle logic in real time according to the attribute-behavior mapping strategy of each intelligent agent and outputs the battle process and results. At the same time, the system maintains data consistency and synchronization among all participating devices through a low-latency communication mechanism to ensure the fairness and smoothness of the battle experience.

[0113] The present invention also supports a variety of actual educational application scenarios, including the following application scenarios: In the "mathematics education card" application, users can create cards covering mathematical concepts such as addition, subtraction, multiplication, etc. Each card is converted into an intelligent agent with corresponding mathematical operation capabilities through the visual recognition system. During the battle, the intelligent agents interact according to their corresponding operation rules. After failure, a math quiz session is triggered, and users can obtain a resurrection opportunity by answering questions, realizing the organic integration of learning and games.

[0114] In the "Natural Science Exploration Card" application, users can create cards representing various animals and plants. The intelligent agent simulates ecological relationships and species behaviors during battles, reflecting the logical knowledge of natural science. The system guides users to review relevant scientific knowledge after losing battles through a question-and-answer method, enhancing users' ecological understanding and scientific literacy.

[0115] In the "Historical Figure Card" application, the system allows users to create cards based on the images of historical figures, and corresponding intelligent agents with character characteristics and historical background behaviors are generated. During battles, the intelligent agent can simulate the evolution path of historical events and deepen users' understanding and memory of historical events and the relationships between characters through knowledge quiz sessions.

[0116] In one embodiment, to further improve the overall performance of the system in terms of operation efficiency, resource utilization, and user adaptability, a performance optimization and function expansion scheme for the intelligent agent behavior conversion method is proposed. This scheme includes the design of model optimization strategies and system expansion interfaces, as follows: First, in terms of performance optimization, to ensure that the system has high responsiveness and low resource consumption capabilities in a multi-terminal deployment environment, the system conducts multi-dimensional optimization on the model calculation and data processing processes, mainly including the following measures: First, model quantization. The system converts the original neural network model based on floating-point precision (such as FP32 or FP16) into a low-bitwidth model (such as INT8 or INT4). By weight compression and low-precision operations, the calculation amount and memory occupancy of the model during inference are significantly reduced, thereby improving the operation efficiency of the model on resource-constrained devices; Second, model pruning. On the premise of not significantly degrading the overall performance of the model, the system removes redundant or low-weight contribution connection nodes in the neural network through pruning algorithms, further reducing the model size and accelerating the inference speed; Third, distributed computing scheduling mechanism. The system adopts a cloud-edge-end collaborative architecture and dynamically divides computing tasks according to task complexity and computing resource conditions. For example, training tasks with high resource consumption are deployed in the cloud, and real-time response tasks are sunk to edge nodes or terminal devices to achieve overall computing resource optimization and load balancing of the system; Fourth, cache mechanism optimization. The system locally caches common card models, intelligent agent behavior models, and policy calculation results, and preferably uses the LRU (Least Recently Used) strategy to manage the cache space, effectively reducing repeated calculations and improving the response speed.

[0117] Secondly, in terms of function expansion, to enhance the openness and sustainable evolution ability of the system, the system designs multiple types of standardized expansion interfaces to support users and third-party developers to flexibly expand the content or functions of the system based on a unified protocol, including: First, a card expansion interface that allows third parties to independently develop new types of card templates and attribute combinations based on system-defined data structures and image processing standards, enhancing the diversity of content and creative space; Second, a knowledge base expansion interface that supports importing user-built or third-party-provided educational content and question bank resources into the system's knowledge Q&A module to achieve the matching of content domain customization and personalized teaching goals; Third, a battle rule expansion interface that provides a rule scripting definition mechanism, allowing developers to adjust or add core parameters such as battle processes, win / loss judgment logics, and skill trigger conditions to build diverse battle gameplay modes; Fourth, a user interface (UI) theme expansion interface that supports users to upload custom interface styles, icon resources, and interactive layout files to achieve personalized customization of the interface visual style and meet the UI adaptation requirements of different brands or usage scenarios.

[0118] Combined with Figure 2 as shown in Figure 2 FIG. 13 is a schematic block diagram of an agent behavior conversion device based on entity cards provided by an embodiment of the present invention. The agent behavior conversion device 200 based on entity cards includes: A content recognition unit 201, configured to obtain an entity card image, and perform image edge detection and image content recognition on the entity card image respectively, and correspondingly obtain an image structure feature and an image content label; A data fusion unit 202, configured to perform data fusion on the image structure feature and the image content label to obtain an image fusion result; An anti-counterfeiting verification unit 203, configured to perform multi-dimensional anti-counterfeiting verification on the image fusion result to obtain an image verification result; A style mapping unit 204, configured to perform style parameter mapping on the image fusion result by using a low-rank adaptation mechanism based on the image verification result to construct a parameterized card model; An action output unit 205, configured to perform attribute mapping on various parameter attributes on the parameterized card model to convert the parameter attributes into agent behaviors.

[0119] In this embodiment, the content recognition unit 201 acquires an entity card image, performs image edge detection and image content recognition on the entity card image respectively, and correspondingly obtains an image structure feature and an image content label; the data fusion unit 202 performs data fusion on the image structure feature and the image content label to obtain an image fusion result; the anti-counterfeiting verification unit 203 performs multi-dimensional anti-counterfeiting verification on the image fusion result to obtain an image verification result; the style mapping unit 204, based on the image verification result, uses a low-rank adaptation mechanism to perform style parameter mapping on the image fusion result to construct a parameterized card model; the behavior output unit 205 performs attribute mapping on various parameter attributes on the parameterized card model to convert the parameter attributes into agent behaviors.

[0120] In one embodiment, the content recognition unit 201 includes: A filtering processing unit, configured to perform filtering processing on the entity card image to reduce local noise of the entity card image and obtain a filtering processing result; A gradient calculation unit, configured to respectively extract gradient response information of the entity card image in the horizontal direction and the vertical direction through a directional convolution operator based on the filtering processing result, and calculate a direction distribution map by using the gradient response information; A suppression processing unit, configured to perform non-maximum suppression processing on the gradient response information according to the direction distribution map to obtain edge extreme values; An edge detection unit, configured to perform edge detection on the edge extreme points by using a double-threshold discrimination mechanism to obtain the image structure feature.

[0121] In one embodiment, the content recognition unit 201 further includes: A segmentation processing unit, configured to perform segmentation processing on the entity card image by using a preset vision transformer segmentation model to obtain a card content area; A vector extraction unit, configured to perform context vector extraction on the entity card image to generate a vector representation set; A set conversion unit, configured to convert the vector representation set into an image mask map and output a content segmentation result; A label generation unit, configured to extract content information of the card content area by using the content segmentation result to generate the image content label.

[0122] In one embodiment, the anti-counterfeiting verification unit 203 includes: A feature extraction unit, configured to respectively extract texture information, material information, and structure information of the entity card image based on the image fusion result to generate a physical feature set; A data matching unit, configured to perform similarity matching between the physical feature set and preset reference data to obtain a physical feature verification result; A verification calling unit, configured to call a public key signature verification module according to the image fusion result to obtain a digital signature verification result; A hash verification unit, configured to perform hash verification on the keyword fields, timestamps, and device identifiers of the image fusion result respectively to obtain an integrity verification result; A comprehensive verification unit, configured to output the image verification result when the physical feature verification result, digital signature verification result, and integrity verification result are all verified to be true.

[0123] In one embodiment, the style mapping unit 204 includes: A style extraction unit, configured to extract a style feature vector corresponding to the entity card image; A model matching unit, configured to screen the most optimal style adaptation model in a preset low-rank adaptation model set based on the style feature vector; A model denoising unit, configured to call a preset diffusion model to perform multi-round conditional denoising processing on the style adaptation model to generate a stylized image; An alignment mapping unit, configured to perform alignment mapping between the stylized image and the image content label to construct the parameterized card model with the target style.

[0124] In one embodiment, the behavior output unit 205 includes: An attribute conversion unit, configured to obtain various parameter attributes on the parameterized card model and convert the parameter attributes into an attribute vector; A vector integration unit, configured to input the attribute vector into a preset multi-layer mapping network to integrally obtain an attribute space; A characterization construction unit, configured to perform non-linear feature transformation on the attribute space based on preset mapping parameters to construct a policy function representing the behavior pattern; An action modeling unit, configured to perform action probability modeling on the entity card image according to the policy function to obtain a behavior policy set; A data optimization unit, configured to optimize the behavior policy set by using supervised data, self-play mechanism, and adversarial training mechanism respectively to obtain an agent behavior model; wherein, the agent behavior model includes a plurality of the agent behaviors.

[0125] In one embodiment, the agent behavior conversion device 200 based on the entity card further includes: A mechanism construction unit, configured to construct a state transition mechanism; An environmental sampling unit, configured to interactively sample the current environment of the agent behavior model based on the state transition mechanism to generate a state-action-reward sequence; A policy execution unit, configured to calculate advantage estimation information according to the state-action-reward sequence to obtain a policy execution effect; A policy update unit, configured to update the behavior policy set by using the policy execution effect to limit the policy deviation amplitude; A model training unit, configured to respectively introduce a value function error term and a policy entropy term during the policy update process to complete the training of the agent behavior model.

[0126] Since the embodiments of the device part correspond to the embodiments of the method part, for the descriptions of the embodiments of the device part, please refer to the descriptions of the embodiments of the method part, which will not be elaborated here.

[0127] The embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiments can be implemented. The storage medium may include: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc that can store program codes.

[0128] The embodiments of the present invention further provide a computer device, which may include a memory and a processor. When the processor calls the computer program stored in the memory, the steps provided in the above embodiments can be implemented. Of course, the computer device may further include various network interfaces, power supplies and other components.

[0129] The embodiments in the specification are described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the system disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description in the method part. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

[0130] It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element.

Claims

1. A method for transforming intelligent agent behavior based on physical cards, characterized in that: include: Acquire a physical card image, and perform image edge detection and image content recognition on the physical card image, respectively, to obtain image structure features and image content labels accordingly; Performing data fusion on the image structure features and the image content labels to obtain an image fusion result; Performing multi-dimensional anti-counterfeiting verification on the image fusion result to obtain an image verification result; Based on the image verification result, a low-rank adaptation mechanism is used to perform style parameter mapping on the image fusion result to construct a parameterized card model; Attribute mapping is performed on the various parameter attributes on the parameterized card model to convert the parameter attributes into agent behaviors.

2. The method for transforming agent behavior based on physical card according to claim 1, characterized in that: The performing image edge detection and image content recognition on the physical card image respectively, and obtaining image structure features and image content labels accordingly, includes: Performing filtering processing on the physical card image to reduce local noise of the physical card image and obtaining a filtering processing result; Based on the filtering result, the gradient response information of the physical card image in the horizontal direction and the vertical direction is extracted by a directional convolution operator, and the directional distribution map is calculated by using the gradient response information; Performing non-maximum suppression processing on the gradient response information according to the directional distribution spectrum to obtain edge extreme point values; The edge extreme point is detected by using a double threshold discrimination mechanism to obtain the image structure feature.

3. The method for transforming agent behavior based on physical card according to claim 1, characterized in that: The performing of image edge detection and image content recognition on the physical card image respectively, and obtaining image structure features and image content labels accordingly, further comprises: Using a preset visual transformer segmentation model to segment the physical card image to obtain a card content area; Extracting context vectors from the physical card image to generate a vector representation set; Convert the vector representation set into an image mask map, and output a content segmentation result; The content information of the card content area is extracted using the content segmentation result to generate the image content label.

4. The method for transforming agent behavior based on physical card according to claim 1, characterized in that: The performing multi-dimensional anti-counterfeiting verification on the image fusion result to obtain an image verification result includes: Based on the image fusion result, respectively extracting texture information, material information and structure information of the physical card image to generate a physical feature set; Performing similarity matching between the physical feature set and preset reference data to obtain a physical feature verification result; Calling the public key signature verification module according to the image fusion result to obtain the digital signature verification result; Performing hash verification on the key fields, timestamp and device identification of the image fusion result respectively to obtain an integrity verification result; When the physical feature verification result, the digital signature verification result and the integrity verification result are all verified to be true, the image verification result is output.

5. The method for transforming agent behavior based on physical card according to claim 1, characterized in that: Based on the image verification result, the image fusion result is mapped to style parameters by using a low-rank adaptation mechanism to construct a parameterized card model, including: Extracting a style feature vector corresponding to the physical card image; Based on the style feature vector, a style adaptation model with the best matching degree is selected from a preset low-rank adaptation model set; Calling a preset diffusion model to perform multiple rounds of conditional denoising on the style adaptation model to generate a stylized image; The stylized image is aligned and mapped with the image content label to construct the parameterized card model with the target style.

6. The method for transforming agent behavior based on physical card according to claim 1, characterized in that: The mapping of multiple parameter attributes on the parameterized card model to convert the parameter attributes into agent behaviors includes: Acquire multiple parameter attributes on the parameterized card model, and convert the parameter attributes into attribute vectors; Inputting the attribute vector into a preset multi-layer mapping network and integrating it to obtain an attribute space; Performing nonlinear feature transformation on the attribute space based on preset mapping parameters to construct a strategy function representing the behavior pattern; Performing action probability modeling on the entity card image according to the strategy function to obtain a behavior strategy set; The behavior strategy set is optimized by using supervision data, self-playing mechanism and adversarial training mechanism respectively to obtain an agent behavior model; wherein the agent behavior model includes a plurality of the agent behaviors.

7. The method for transforming agent behavior based on physical card according to claim 6, characterized in that: After the attribute mapping of the multiple parameter attributes on the parameterized card model to convert the parameter attributes into agent behaviors, the method further comprises: Build a state transfer mechanism; Interactively sampling the current environment of the agent behavior model based on the state transfer mechanism to generate a state-action-reward sequence; Calculate advantage estimation information according to the state-action-reward sequence to obtain the strategy execution effect; The behavior strategy set is updated using the strategy execution effect to limit the strategy deviation amplitude; During the strategy updating process, the value function error term and the strategy entropy term are introduced respectively to complete the training of the agent behavior model.

8. An intelligent agent behavior conversion device based on physical cards, characterized in that: include: A content recognition unit is used to obtain a physical card image, and perform image edge detection and image content recognition on the physical card image, respectively, to obtain image structure features and image content labels accordingly; A data fusion unit, used for performing data fusion on the image structure features and the image content labels to obtain an image fusion result; An anti-counterfeiting verification unit, used to perform multi-dimensional anti-counterfeiting verification on the image fusion result to obtain an image verification result; A style mapping unit, configured to perform style parameter mapping on the image fusion result based on the image verification result by using a low-rank adaptation mechanism to construct a parameterized card model; The behavior output unit is used to perform attribute mapping on the various parameter attributes on the parameterized card model to convert the parameter attributes into agent behaviors.

9. A computer device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the entity card-based intelligent agent behavior conversion method as described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the method for transforming the behavior of an intelligent agent based on a physical card as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Television AR game system and display method

    CN106390457A

  • Method for data processing for responsive augmented reality card game by collision detection for virtual objects and device for playing responsive augmented reality card game

    KR101697041B1

  • Method for data processing for responsive augmented reality card game by collision detection for virtual objects

    KR101740212B1

  • AR and VR card game device and method using smartphone

    KR1020170130732A

  • Augmented reality display method of game card

    KR1020180058326A

Cited By

  • Milk powder drying tower inner wall coking area image identification method and system

    CN120599273A

  • A method and system for identifying coking areas on the inner wall of a milk powder drying tower

    CN120599273B