Reinforcement learning-based sports uniform variable information automatic layout optimization method and computing device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DONGGUAN OTAPIKO TECHNOLOGY CO LTD
- Filing Date
- 2026-03-16
- Publication Date
- 2026-06-23
AI Technical Summary
In the mass production of professional sports uniforms, there are complex rule conflicts, element overlaps, difficulty in ensuring visual consistency, high production consistency requirements and low efficiency in the personalized information layout process. Existing automated layout algorithms are unable to handle complex and ambiguous multi-factor constraints, resulting in difficulty in ensuring compliance and visual consistency, as well as low efficiency.
An automatic layout optimization method based on reinforcement learning is adopted. The reinforcement learning agent makes iterative decisions in a constrained environment to optimize the compliance, visual consistency across individuals and sizes, manufacturability and material utilization of the layout scheme. The decision is guided by a multi-objective reward function and combined with actor-critic architecture and feasibility projection operation to ensure the legality and optimization of the layout scheme.
It has improved typesetting efficiency, optimized material utilization, and solved the problem of automatic typesetting of complex rules and personalized data while ensuring compliance and visual consistency, generating high-quality, directly producible typesetting files.
Smart Images

Figure CN122263607A_ABST
Abstract
Description
Technical Field
[0001] This disclosure generally relates to the fields of computer-aided design, artificial intelligence, and digital manufacturing, and particularly to a method and computing device for automatically optimizing the layout of variable information in sports uniforms by using reinforcement learning technology to solve the complex conflict and consistency problems in the layout of personalized information in sports uniforms. Background Technology
[0002] In the large-scale customized production of professional sports uniforms, especially team sports uniforms, there is an extremely tedious and error-prone step: personalized information layout. This step requires accurately and compliantly laying out the visual elements corresponding to a complete roster (containing dozens of players' unique names, numbers, sponsor information, year markings, etc.) onto each garment piece (such as front, back, sleeves, etc.) corresponding to each player and each size (e.g., 4XS to 6XL) for the entire team. This process faces multiple complex challenges: First, the rules are complex, requiring simultaneous compliance with multi-level design specifications from international organizations, regional leagues, and clubs, with potential conflicts between rules; second, the constraints are diverse, requiring consideration of font borders, color gradients, embedded text in team logos, fabric optical properties (nailing, reflection), and production process tolerances; third, the consistency requirement is high, ensuring a high degree of visual uniformity for all players and all sizes of uniforms; finally, the degree of personalization is high, as each player's information is different, especially the handling of long names and special characters, which requires intelligent judgment.
[0003] Currently, this work relies entirely on manual operation by senior designers, which is extremely time-consuming and makes it difficult to simultaneously optimize material utilization while ensuring compliance and visual consistency. Traditional automated typesetting algorithms are mostly hard-coded rule engines, lacking the ability to perform global optimization and intelligent reasoning under complex and ambiguous multi-faceted constraints. They cannot handle decisions that require comprehensive consideration, such as "whether to wrap lines, compress, or enable abbreviations when a long name cannot fit." Therefore, the industry urgently needs a solution that can automatically process complex rules and personalized data and intelligently output the optimal typesetting scheme. Summary of the Invention
[0004] In view of the above problems, this disclosure provides a method and computing device for automatic layout optimization of variable information of sports uniforms based on reinforcement learning, so as to solve the above technical problems.
[0005] In a first aspect, embodiments of this disclosure provide an automatic layout optimization method for variable information in sports uniforms, executed by a computing device. The method includes: receiving input data, the input data including roster data, a multi-source rule set, fabric specification parameters, and multiple size pattern templates, wherein the roster data contains personalized variable information for multiple individuals, and the pattern templates contain inherent images and text; generating multiple variable information image layers containing the personalized variable information based on the roster data; constructing a constraint environment for layout decisions based on the multi-source rule set and the fabric specification parameters, and defining layout constraints according to the inherent images and text in the pattern templates; and using a reinforcement learning agent... Iterative decision-making is performed under the aforementioned constraints to determine the layout action of each variable information image layer on the target fabric piece. The layout action includes placement position, scaling ratio, rotation angle, and layer level. The reinforcement learning agent's strategy is trained to maximize a multi-objective reward function, which simultaneously optimizes the compliance score, cross-individual and cross-size visual consistency score, manufacturability score based on the fabric specification parameters, and material utilization score of the layout scheme. Based on the decision results of the reinforcement learning agent, combined with the inherent images and text in the fabric piece template, a final layout scheme corresponding to each size fabric piece is generated. The production file corresponding to the final layout scheme is then output.
[0006] Optionally, the multi-source rule set includes international sports association rules, regional competition specifications, club customization requirements, font usage licensing specifications, and special processing rules for captain's logo.
[0007] Optionally, the fabric specifications include information on the nap direction, the reflectivity and color difference tolerance model under preset light source conditions, and the fabric stretchability parameters. The manufacturability score is calculated at least in part based on the color difference tolerance model and the stretchability parameters.
[0008] Optionally, the personalized variable information includes at least one of athlete name, athlete number, sponsor logo, and year information, and the generation of variable information image layer includes standardized rendering of multilingual name fields containing diacritics, and applying predefined abbreviation or line break strategies to excessively long names.
[0009] Optionally, the method further includes: when the reinforcement learning agent makes a decision, performing a feasibility projection operation to project the sampled original typesetting action onto the legal action space defined by the multi-source rule set and the inherent image and text, thereby obtaining a legal typesetting action.
[0010] Optionally, the reinforcement learning agent adopts an actor-critic architecture, including a policy network and a value network. The policy network is used to sample and arrange actions according to the state, and the value network is used to evaluate the state value to assist in policy updates. The multi-objective reward function is a weighted sum of compliance score, visual consistency score, productiveity score, and material utilization score.
[0011] Optionally, the method further includes: switching between the optimal quality layout mode and the optimal material-saving layout mode by adjusting the weights of the corresponding scoring items in the multi-objective reward function; wherein, in the optimal quality layout mode, the weights of the manufacturability score and the visual consistency score are increased; and in the optimal material-saving layout mode, the weight of the material utilization score is increased.
[0012] Optionally, the method further includes: selecting an overall layout template and visual anchor points for the typesetting task through a high-level policy network, and fine-tuning the parameters of a single variable information image layer based on the selected template through a low-level policy network.
[0013] Optionally, the reinforcement learning agent is trained through a course, starting with simple typesetting tasks involving short text and single-layer fonts, and gradually transitioning to more complex typesetting tasks involving long text, multiple font borders, embedded logos, and complex optical constraints.
[0014] In a second aspect, embodiments of this disclosure provide a computing device, including: one or more processors; and a memory storing computer-executable instructions, which, when executed by the one or more processors, implement the method of the first aspect of this disclosure.
[0015] In one or more embodiments, the system and method include receiving input containing a roster, rules, fabric parameters, and a size template that already contains an inherent design; processing complex variable information through an image generation module; constructing a hard-constrained environment through a rule engine that integrates feasible projections to fundamentally prevent overlap between variable information and inherent design and rule violations; learning an optimal typography strategy in this environment through a reinforcement learning agent whose decisions are guided by a multi-objective reward function that simultaneously optimizes compliance, consistency, manufacturability, and material utilization; and finally outputting a typography file that integrates inherent design and variable information, is conflict-free, highly consistent, and directly manufacturable, thus solving various typography problems.
[0016] These or other aspects of this disclosure will become more apparent in the following description of embodiments. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 An architecture diagram of a reinforcement learning-based automatic layout optimization system for variable information in sports uniforms is shown, according to one or more embodiments.
[0019] Figure 2 A flowchart is shown for an automatic layout optimization method for variable information of sports uniforms based on reinforcement learning, according to one or more embodiments.
[0020] Figure 3 A structural block diagram of an exemplary computing device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0021] Embodiments of this disclosure are described in detail below, with examples of embodiments shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this disclosure, and should not be construed as limiting this disclosure.
[0022] To enable those skilled in the art to better understand the solutions disclosed herein, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this disclosure, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.
[0023] In this disclosure, it should be noted that relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0024] Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0025] In the description of embodiments in this disclosure, terms such as "example" or "for example" are used to indicate exemplification, illustration, or description. Any embodiment or design described as "example" or "for example" in this disclosure is not to be construed as being more preferred or having more advantages than another embodiment or design. The use of terms such as "example" or "for example" is intended to present relative concepts in a clear manner.
[0026] Furthermore, in this disclosure, "multiple" refers to two or more. Therefore, in this disclosure, "multiple" can also be understood as "at least two." "At least one" can be understood as one or more, such as one, two, or more. For example, including at least one means including one, two, or more, and is not limited to which ones are included. For instance, including at least one of A, B, and C could mean including A, B, C, A and B, A and C, B and C, or A and B and C.
[0027] It should be noted that in this embodiment of the disclosure, "and / or" describes the relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. In addition, the character " / ", unless otherwise specified, generally indicates that the associated objects before and after it are in an "or" relationship.
[0028] It should be noted that in the embodiments of this disclosure, "connection" can be understood as electrical connection, and the connection between two electrical components can be a direct or indirect connection between the two electrical components. For example, the connection between A and B can be a direct connection between A and B, or an indirect connection between A and B through one or more other electrical components.
[0029] In the mass production of professional sports uniforms, the layout of personalized information (such as player names and numbers) has long faced severe challenges. Traditional manual or automated layout methods based on simple rules are insufficient to effectively address the many deep-seated problems revealed in this disclosure: First, element overlap and conflicts are frequent, such as the logo, last name, and the inherent pattern of the uniform overlapping, compromising design integrity and readability. Second, personalized information is complex and diverse; extremely long names and special characters in multiple languages (such as diacritics) are difficult to place compliantly on small-sized (such as 4XS, 3XS) pieces, and forced compression can lead to illegibility. Third, rule conflicts and compliance are difficult to guarantee; international, regional, and club-level rules may contradict each other, and complex requirements such as font borders, color gradients, and embedded numbers in team logos further increase the difficulty of compliance judgment. Furthermore, stringent requirements for visual and production consistency necessitate maintaining visual uniformity across all sizes, from adult to youth and toddler teams, and from 4XS to 6XL. Simultaneously, production factors such as fabric nap direction and color variations under different lighting conditions must be considered to prevent inconsistencies in the finished product's appearance. Finally, the trade-off between efficiency and cost makes balancing "optimal quality layout" and "optimal material-saving layout" exceptionally difficult. These issues result in existing methods being inefficient, error-prone, and heavily reliant on manual experience, failing to meet the demands of large-scale, highly consistent, and short-lead-time modern production.
[0030] Figure 1The architecture of a reinforcement learning-based automatic layout optimization system 100 for variable information in sports uniforms, according to an embodiment of this disclosure, is shown. This system is designed to address complex issues in personalized sports uniform layout, such as multi-rule conflicts, element overlap, visual consistency, and production feasibility. The operation of system 100 begins with input module 110, which receives and preprocesses all necessary raw data, including roster data, multi-source rule sets, fabric specification parameters, and multiple size pattern templates. The multiple size pattern templates not only contain the geometry and coordinate system of each pattern piece but also pre-include inherent, non-personalized images and text on the uniform, such as team logos, fixed stripes or pattern backgrounds, league logos, fixed advertising spaces, and unchanging promotional text. These inherent images and text constitute the baseline visual environment for the layout. Subsequently, image generation and parsing module 120 converts the personalized variable information in the roster into operable image layers. The rules engine and feasibility projection module 130 plays the role of the core constraint manager throughout the process. It dynamically constructs and maintains a legal decision space that explicitly includes the "protected areas" occupied by inherent images and text. Through feasibility projection operations, it ensures that all explorations are within compliance limits, especially avoiding overlap with inherent elements. The reinforcement learning agent 140 performs sequential decision learning within this constraint space. It adopts an actor-critic architecture, samples layout actions through a policy network, and evaluates state values through a value network to explore how to optimally arrange variable information within the inherent design framework. The simulation and evaluation module 130 simulates each decision and its outcome and quantifies and evaluates them according to a multi-objective reward function. The calculation of this function takes into account the visual consistency between variable information and inherent design. Finally, the output module 160 encodes the learned optimal policy sequence into a standard file that can directly drive production equipment. These modules are connected through a preset data interface to form an end-to-end automated intelligent processing pipeline, from templates containing inherent design and variable data inputs to high-quality, executable production solutions output integrating all visual elements.
[0031] Input module 110 serves as the interface for the system to interact with external data sources. In some embodiments, its implementation includes multiple parallel processing sub-channels responsible for data reception, cleaning, fusion, and standardization. The roster data processing sub-channel receives raw tabular data containing personalized and variable information such as athlete names, numbers, captain status, and associated sponsor identifiers. This sub-channel performs character encoding standardization, diacritic verification and processing, and pre-analysis of excessively long names, as well as associating them with predefined abbreviation or line break strategy libraries, outputting a structured roster object. The multi-source rule set processing sub-channel receives various design specifications that may exist in the form of natural language, structured JSON / XML, or database records. This sub-channel embeds a rule parser capable of identifying entities, attributes, and constraints in rule clauses and arbitrating rule conflicts from different sources according to a preset priority (e.g., event-specific rules > club specifications > general international rules), outputting a unified and unambiguous set of structured rules. The fabric specification parameter processing subchannel receives the fabric's technical parameter table, extracts key physical properties such as the "stretch parameters" of the warp and weft directions, and loads spectral data measured under a standard light source to construct a "color difference tolerance model." This model can predict the visual difference (ΔE value) between any two colors on the fabric under a specified light source. Furthermore, explicit "pile direction" markings are also parsed and encoded. The pattern template processing subchannel loads digital pattern files for all sizes from 4XS to 6XL. These pattern templates have embedded the basic design of the uniform, namely inherent images and text. This subchannel not only establishes a local coordinate system for each pattern and calculates its outline geometry, but also additionally parses and extracts the precise outline, position, and color attributes of these inherent elements, identifying them as an immovable "baseline design layer." All processed data is encapsulated into a unified data structure within the system and passed to subsequent modules.
[0032] The core function of the image generation and parsing module 120 is to convert personalized variable information such as text and identifiers into digital image layers rich in geometric and visual attributes. In some embodiments, this is implemented based on a programmable vector graphics rendering engine. Its workflow begins by generating a detailed graphic description file based on each record in the roster and its associated design specifications. The rendering engine generates corresponding vector graphics based on this description file and precisely calculates the geometric attributes of each layer, including the minimum bounding rectangle, visual centroid coordinates, opaque area masks, and, for text layers, character boundaries. For long names or special characters, the module invokes a pre-defined text layout algorithm to pre-calculate the geometric dimensions under different typographic variations such as single-line display and intelligent line breaks. Ultimately, each personalized variable information is represented as one or more image layer objects, accompanied by complete metadata available for computational geometric operations. These generated layers, called "variable information layers," will work together with the "baseline design layer" provided by the input module to form a complete typographic scenario in subsequent processes.
[0033] The rule engine and the feasibility projection module 130 together constitute the system's real-time constraint management and execution system. In some embodiments, the rule engine's workflow includes constraint compilation, spatial mapping, and context management. It compiles a unified set of rules into a series of efficiently executable state query functions and action verification functions. In the spatial mapping stage, it combines the geometry of the cutout template with the contours of the inherent images and text parsed from it to generate a "spatial attribute mask map" on each cutout, clearly distinguishing "inherent design protection zones," "variable information placement zones," and "safety spacing buffer zones," etc. It manages the context of the current typesetting task to dynamically enable the corresponding rule subsets. The feasibility projection module is a key bridge connecting reinforcement learning's free exploration and hard constraints, and its logic follows the principle of "immediate correction, guided exploration." When the policy network of the reinforcement learning agent 140 samples an original typesetting action a_t_raw, the action is first sent to this module. The module calls the rule engine for fast constraint detection. If the action is illegal (such as the coordinates falling into the "protection zone"), projection calculation is triggered. The projection algorithm searches for a legal action a_t_feasible that is closest to the original action in terms of metric. For example, for coordinate out-of-bounds errors, boundary projection is used to calculate the perpendicular projection point to the nearest legal region boundary for correction; for attribute out-of-bounds errors (such as scaling exceeding limits), clamping projection is used to set it to the nearest extremum within the allowed range. This process is deterministic, and the output is always within the legal action space, enabling the reinforcement learning agent to efficiently learn to explore within the legal space defined by its inherent design.
[0034] The reinforcement learning agent 140 is the core decision-making unit of the system. In some embodiments, it employs an actor-critic architecture for training and inference, internally containing a policy network (actor) π_θ and a value network (critic) V_φ. At each decision step t, the agent receives a state representation s_t, generated by a state encoder network that incorporates features of the remaining space in the current crop, attributes of the already laid-out variable layers, spatial mask features of the inherent images and text, and the currently active rule context encoding. The policy network π_θ takes the state s_t as input and processes it through a multi-layer neural network, outputting a parameterized action probability distribution π_θ(a|s_t). This distribution defines the probability of selecting different layout actions a (including continuous coordinates, scaling, rotation parameters, or discrete options such as line break selection) in the current state. The agent samples a raw action a_t_raw based on this distribution, which is immediately corrected to a legal action a_t_feasible by the feasibility projection module. Subsequently, the system executes this legal action in the simulation environment, updating the environment state to s_{t+1}. The simulation and evaluation module 130 provides the corresponding immediate reward r_t. The value network V_φ takes state s_t as input and outputs a scalar value V_φ(s_t), representing an estimate of the expected cumulative reward that can be obtained by following the current policy from that state. During the training phase, it is updated using a policy gradient algorithm (such as Proximal Policy Optimization, PPO). A batch of trajectory data (s_t, a_t_feasible, r_t, s_{t+1}) is sampled from the experience replay buffer. First, the value network updates the parameter φ by minimizing the temporal difference error (r_t + γV_φ(s_{t+1}) - V_φ(s_t))^2 to make its value estimate more accurate. Then, the policy network updates the parameter θ by maximizing the proximal policy optimization objective function L^{CLIP}(θ). The objective function encourages increasing the probability π_θ(a_t_feasible|s_t) of actions a_t_feasible that bring high "advantage" A_t (typically estimated as r_t + γV_φ(s_{t+1}) - V_φ(s_t)). Simultaneously, it constrains the step size of each update through importance sampling ratio pruning to ensure training stability. Through numerous iterations, the policy network gradually learns a mapping from arbitrarily complex, inherently designed layout states s_t to the optimal action distribution π_θ(a|s_t) that maximizes the long-term cumulative reward Σ r_t.
[0035] In some embodiments, the reinforcement learning agent 140 employs a hierarchical decision architecture, which includes a high-level policy network, a low-level policy network, and a shared value network. The high-level policy network receives a global high-level feature s_t^high extracted by the state encoder as input. This high-level feature incorporates macro-level information about the task, such as the logo of the currently processed team, season information, the selected home and away uniform styles, the client-specified "quality mode" or "cost-saving mode" preference, and the matching degree of several typical layout templates summarized from a database of historical success cases. The high-level policy network π_θ^high outputs a probability distribution regarding the selection of which "overall layout template and visual anchor point" to use. For example, it may assign different selection probabilities to preset templates such as "compact centering," "distributed alignment," or "diagonal dynamic." Once a template T is selected, it defines the visual skeleton of the entire layout scheme, including the expected relative position areas of various elements (such as the back surname and chest number), the dominant alignment axis, and the coordinates of key visual anchor points. The low-level policy network is responsible for making refined layout decisions under the constraints of the template T selected by the high-level network. Its input state s_t^low is a richer feature vector, consisting of three parts: (1) the encoding vector of the template T output by the high-level network; (2) local state information related to the current specific decision, such as the remaining space features of the target crop, the attributes of the single variable information image layer to be laid out, the spatial relationship between the inherent design of the layer and other laid-out layers; and (3) the currently activated rule context. The low-level policy network π_θ^low takes s_t^low as input and outputs a parameterized action probability distribution π_θ^low(a|s_t^low), which precisely determines the specific layout action a of the layer on the target crop, including its precise placement position, scaling ratio, rotation angle, and layer level within the area defined by the template T. The high-level and low-level policy networks work together, with the high-level network performing macro-planning and the low-level network performing micro-adjustments. The value network V_φ evaluates the value of the comprehensive state and assists in the training of both. During the training phase, the parameters θ^high and θ^low of the high-level and low-level policy networks are jointly updated through algorithms such as proximal policy optimization, enabling the high-level network to learn to select templates that bring high global rewards, and the low-level network to make optimal local adjustments under those templates.
[0036] The simulation and evaluation module 130 is responsible for building a virtual environment, simulating the execution of typesetting actions, and calculating the multi-objective reward function R. When a legal typesetting action a_t_feasible is executed, the module updates the virtual typesetting canvas maintained internally. Subsequently, the reward function calculates the immediate reward r_t from four dimensions: (1) Compliance score R_compliance: Calls the rule engine to perform fast collision detection and rule compliance verification. If the action causes any rule to be violated (such as overlapping with the inherent area), a large negative reward is returned; if it is fully compliant, a small positive reward is given. (2) Visual consistency score R_consistency: Calculates the statistical difference between the current typesetting scheme and the preset "team visual anchor template". The difference measure includes the distribution variance of the center point of the same variable element (such as the surname on the back) of all players in the same team, the standard deviation of the scaling factor, and the fluctuation of the relative positional relationship between the variable element and the inherent design. The smaller the difference, the higher the reward. (3) Producibility score R_producibility: Using the optical model in the fabric specification parameters, simulate the visual color difference (ΔE) that may occur between any adjacent areas (variable-variable, variable-inherent, inherent-inherent) in the layout scheme under a specified light source. If ΔE exceeds the tolerance, points are deducted. At the same time, check whether the overall orientation of all elements is consistent with the "pile direction" of the fabric. (4) Material utilization score R_material: After a piece or a batch of pieces is laid out, the module calculates the layout occupancy rate of all piece outlines on the virtual fabric. The higher the utilization rate, the higher the reward.
[0037] In some embodiments, the system supports switching between "optimal quality layout" and "optimal material-saving layout" modes. This is achieved by dynamically adjusting the weights w of each item in the reward function R, i.e., R = w_c * R_compliance + w_v * R_consistency + w_p * R_producibility + w_m * R_material. In quality mode, w_p and w_v are increased; in material-saving mode, w_m is increased.
[0038] The user-selected "optimal material-saving layout" mode is achieved by significantly increasing the weight w_m of the material utilization score R_material in the multi-objective reward function R. In this mode, the system prioritizes the optimization of R_material during decision-making. This means that when exploring strategies, the reinforcement learning agent, while ensuring that the layout scheme meets compliance (R_compliance, the hard bottom line) and the basic visual consistency threshold (R_consistency, the acceptable minimum uniformity), proactively and significantly relaxes the pursuit of certain high-order optical consistency standards (such as extremely uniform color difference ΔE under a specific light source) in the producibility score R_producibility, and actively explores layout schemes that maximize fabric utilization. This "relaxed standards, pursuit of material saving" optimization can be reflected in: directional flexibility: allowing patterns or text on different fabric pieces to adopt a not entirely consistent global direction, i.e., "the direction may be used for both positive and negative (insertion) layout." An agent might rotate a layer on a piece of fabric by 180 degrees to nest two pieces' outlines in a razor-sharpened manner. While this might cause the "pile direction" of the pattern on that piece to be slightly different from adjacent pieces, the high R_material reward encourages this behavior as long as it remains within acceptable production tolerances. Layout Aggressiveness: Employing a more aggressive nesting strategy during pattern making allows for smaller gaps between pieces and may accept slight suboptimal visual alignment due to tighter arrangement, as long as it remains within the broad definition of "consistency." Shape Compromise: Fine-tuning the position and scaling of variable information may slightly sacrifice the theoretically "optimal" visual proportions to create a more favorable outer contour for overall nesting. Ultimately, the "final layout" and corresponding "production file" output by the trained agent not only contain the precise coordinates of all layers on each piece, but their implicit, R_material-driven optimization results represent a pattern layout that maximizes the utilization of virtual fabric. This layout diagram defines the optimal placement and rotation angle of each cut piece on the solid fabric. It can be directly used to drive CNC cutting equipment for high-efficiency, low-material-consumption production, achieving the industrial goal of "optimal piece layout".
[0039] In some embodiments, the reinforcement learning agent 140 acquires the ability to solve complex typography problems through a series of carefully designed training strategies. Core training employs a curriculum-based learning strategy. Initially, the system constructs a simplified learning environment: containing only short names, no complex patterns, a single standard size (e.g., size L), and fabric with uniform optical properties. During this phase, the agent primarily learns basic obstacle avoidance, alignment, and fulfilling simple rules. As the strategy stabilized, the course difficulty gradually increased according to the predetermined plan: First, medium-length names containing diacritics were introduced to train the agent to handle character rendering and basic scaling; then, long names and a preset abbreviation / line break dictionary were added, forcing the agent to make decisions between actions such as "shrink," "break," and "enable abbreviation"; next, the course introduced "texture" forbidden zones with complex patterns to strengthen the agent's learning of spatial avoidance and feasibility projection dependencies; then, fabrics with different "pile orientations" and reflective properties were mixed to help the agent understand and internalize optical consistency constraints; finally, and most challengingly, the course required the agent to simultaneously process layouts across all sizes from 4XS to 6XL and optimize visual consistency scores across sizes. This progressive learning approach ensured that the strategy evolved from simple to complex and generalized robustly.
[0040] In some embodiments, the training process combines imitation learning with priority experience replay to improve sample efficiency. During the pre-training phase, historical successful typesetting cases are used as expert demonstrations, and the policy network is initialized using a behavior cloning method, enabling it to quickly acquire a near-compliant baseline policy. During the online reinforcement learning phase, the agent's interaction experiences with the environment (s_t, a_t_feasible, r_t, s_{t+1}) are stored in a replay buffer. The priority experience replay mechanism assigns priority based on the temporal difference error (TD-error) of the experience; experiences with larger errors (typically indicating inaccurate estimation of the value of the state-action pair or high learning potential) are more likely to be sampled for network updates, thus accelerating the learning process.
[0041] In some embodiments, the parameter updates of the reinforcement learning agent 140 are based on a policy gradient algorithm, such as Proximal Policy Optimization (PPO). In each update, a batch of empirical data is sampled from the replay buffer. The value network updates its parameter φ by minimizing the mean squared error between the predicted value V_φ(s_t) and the actual reward (discounted cumulative reward), making its value estimation more accurate. The parameter θ updates of the policy network aim to increase the probability π_θ(a_t_feasible|s_t) of the action a_t_feasible that yields a high “advantage” A_t (actual reward minus the baseline predicted by the value network), while constraining the step size of each update through an importance sampling ratio and a pruning term to ensure training stability. The entire update process computes gradients using a backpropagation algorithm and uses an optimizer (such as Adam) to adjust the network weights.
[0042] Output module 160 is the system's production interface. This module is invoked after the reinforcement learning agent completes the layout decision sequence for the entire roster across all sizes. Its workflow is deterministic, involving parsing the final complete action sequence and state set. The final state s_T contains the complete "baseline design layer" and the optimized layout "variable information layer." The module merges these two layers, converting the final parameters (position, deformation matrix) of each layer into absolute coordinates in the production equipment coordinate system through coordinate transformation. It then writes this information into a standard file format according to the target equipment's requirements, such as generating a layered PDF file for printing or a DXF file with cutting paths for cropping. Optionally, the module can also attach a production report recording the rule version used for layout and the scores of each component of the final reward function to meet quality traceability and auditing requirements.
[0043] Figure 2 A flowchart is shown for a reinforcement learning-based automatic layout optimization method for variable information in sports uniforms, according to one or more embodiments. The method can be executed by the aforementioned system 100.
[0044] Step S210: Receive input data. The input data includes roster data, multi-source rule sets, fabric specification parameters, and pattern templates for multiple sizes, wherein the pattern templates contain inherent images and text.
[0045] Specifically, the pattern templates for multiple sizes not only include the geometric shape and coordinate system of each pattern piece, but also pre-include inherent, non-personalized images and text on the uniform, such as team logos, fixed stripes or pattern backgrounds, league logos, fixed advertising spaces, and unchanging promotional text. These inherent images and text constitute the baseline visual environment for the layout.
[0046] Step S220: Generate an image layer. The image generation and parsing module 120 converts the personalized variable information in the roster into an independent variable information image layer containing precise geometric attributes. The system simultaneously loads and parses the inherent images and text in the cutout template, using them as the baseline design layer.
[0047] Step S230: Based on the multi-source rule set and the fabric specification parameters, and according to the inherent image and text definitions in the cut piece template, construct a constraint environment for layout decisions.
[0048] Step S240 involves iterative decision-making under constraints using a reinforcement learning agent. This is the core optimization step of the method, aiming to solve a series of practical problems in personalized layout through intelligent decision-making. The reinforcement learning agent iteratively decides under the constraints to determine the layout action of each variable information image layer on the target fabric piece. The layout action includes placement position, scaling ratio, rotation angle, and layer level. The reinforcement learning agent's strategy is trained to maximize a multi-objective reward function that simultaneously optimizes the compliance score of the layout scheme, the visual consistency score across individuals and sizes, the manufacturability score based on the fabric specification parameters, and the material utilization score.
[0049] First, to address the issues of element overlap and rule conflicts, the policy network π_θ of the reinforcement learning agent 140 observes the current layout state s_t, which integrates the baseline design layer and the already laid-out variable information layer. When the policy network samples a raw layout action a_t_raw for the variable information layer (e.g., placing the surname "SMITH") based on the distribution π_θ(a|s_t), this action is first subject to mandatory correction by the feasibility projection module 130. If the proposed coordinates fall within the "protected area" of inherent images and text (such as striped backgrounds), the feasibility projection module immediately corrects them to the legal a_t_feasible, ensuring that the coordinates are moved to the nearest legal blank area. Simultaneously, the compliance score R_compliance in the multi-objective reward function R severely penalizes any scheme that intrudes into the protected area, eliminating overlap from the decision-making source and learning objective.
[0050] Secondly, regarding the compliant placement of complex and personalized information, such as handling excessively long names like "Grzegorz Brz"... The policy network, named "czyszczykiewicz", evaluates multiple actions 'a' in state 's_t', including single-line compression, smart line breaks, or enabling abbreviations. A multi-objective reward function comprehensively evaluates: a visual consistency score (R_consistency) requires the typography to be visually consistent with the short name; a producibility score (R_producibility) ensures the minimum readable font size is met on smaller pages; and a compliance score (R_compliance) checks whether it is completely within the placeable area and maintains distance from inherent elements. By maximizing the cumulative reward Σ r_t, the agent learns to select the optimal solution (e.g., "abbreviation + smart line breaks").
[0051] Furthermore, to address the issue of visual consistency across sizes, the visual consistency score R_consistency drives the agent to learn a non-linear adjustment strategy. This score calculates the statistical variance of the relative positions of variable information (such as surnames) and inherent designs (such as stripes) across all sizes. To optimize this score, the agent adjusts the strategy π_θ, ensuring that the relative positional relationship between variable elements and inherent designs remains constant across all sizes from 4XS to XXL, thus achieving visual coherence. Regarding production inconsistencies caused by fabric optical properties, in the "optimal quality layout" mode, the manufacturability score R_producibility has a higher weight w_p. When the agent considers rotating a variable logo to save space (action a_t_raw), the simulation evaluation module simulates the overall design's performance under venue lighting. If the simulation shows that rotation would cause a color difference with adjacent inherent patterns (ΔE exceeding the threshold), the manufacturability score will provide a negative reward r_t, guiding the agent to abandon the rotation scheme and ensuring optical consistency in the finished product. For special rules such as captain logos, the conditional rules defined in the rule engine will be activated. When making decisions, the agent not only needs to place the number, but also needs to generate parameters for the horizontal bar in the action space. The visual consistency score R_consistency drives all captain icons in the team to maintain a consistent relative position with the inherent design elements.
[0052] Finally, for the switching of layout modes, the weights w_m and w_p of the reward function R are dynamically adjusted. In the "optimal material-saving layout" mode, the weight w_m of the material utilization score R_material is increased, and the AI learns to explore a more compact layout scheme to improve fabric utilization while meeting basic compliance and consistency thresholds.
[0053] In an embodiment employing a hierarchical decision-making architecture, this decision-making process is further refined. First, the high-level policy network π_θ^high selects a suitable set of "overall layout templates and visual anchors" T based on global task characteristics (such as teams, styles, and patterns). For example, a template that allows for more vertical space is selected for teams with longer names. Then, for each variable information layer to be laid out, the low-level policy network π_θ^low receives a comprehensive state s_t^low containing the template T encoding, specific cut pieces, and local layer information, and within this framework, finely determines the final layout action a. Feasibility projection ensures the legitimacy of action a, while the reward function R evaluates the action from multiple dimensions.
[0054] The reinforcement learning agent learns a layout strategy π_θ that maximizes the long-term cumulative reward Σr_t within the inherent design framework through a massive number of (s_t, a_t_feasible, r_t, s_{t+1}) interactive loops. The specific implementation of the automatic layout optimization method is reflected in the agent's complete closed-loop operation at each decision step t: state encoding s_t, policy network inference π_θ(a|s_t), action sampling a_t_raw and projection a_t_feasible, environment state transition s_{t+1}, reward calculation r_t, and network parameter (θ, φ) update based on this empirical data.
[0055] Step S250: Based on the decision results of the reinforcement learning agent, and combined with the inherent images and text in the pattern template, generate the final layout scheme corresponding to each size pattern piece.
[0056] Once all personalized variable information layers have been successfully laid out onto the target pattern piece based on the inherent design, the action sequence (a_0, a_1, ..., a_{T-1})_feasible experienced by the reinforcement learning agent, together with the initial baseline design layer, constitutes the final, complete optimized layout scheme, corresponding to the final state s_T. This scheme ensures no element overlap, clear, readable, and compliant information, visual uniformity across all sizes, and meets the client's selected economic objectives.
[0057] Step S260: Output the production file.
[0058] The output module 160 decodes the final layout scheme s_T, integrates the inherent images and text with the optimized layout variable information, and outputs a segmented production file containing all visual elements that can be directly used in production processes such as digital cutting or printing.
[0059] This disclosure also provides a computing device including one or more processors and a memory storing computer-executable instructions that, when executed by the processor, implement the above-described method. Furthermore, a non-volatile computer-readable storage medium storing corresponding computer-executable instructions is also provided.
[0060] Exemplary embodiments of this disclosure also provide a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform a method according to embodiments of this disclosure.
[0061] Exemplary embodiments of this disclosure also provide a computer program product, including a computer program, wherein, when executed by a processor of a computer, the computer program is used to cause the computer to perform a method according to an embodiment of this disclosure.
[0062] refer to Figure 3 The present invention describes a structural block diagram of a computing device 300 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The computing device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The computing device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0063] like Figure 3 As shown, the computing device 300 includes a computing unit 301, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 302 or a computer program loaded from storage unit 308 into random access memory (RAM) 303. The RAM 303 may also store various programs and data required for the operation of the computing device 300. The computing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0064] Multiple components in the computing device 300 are connected to the I / O interface 305, including: an input unit 306, an output unit 307, a storage unit 308, and a communication unit 309. The input unit 306 can be any type of device capable of inputting information to the computing device 300. The input unit 306 can receive input numerical or character information and generate key signal inputs related to user settings and / or function control of the computing device. The output unit 307 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. The storage unit 308 may include, but is not limited to, a hard disk and an optical disk. The communication unit 309 allows the computing device 300 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network interface cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0065] The computing unit 301 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model methods, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 301 performs the various methods and processes described above. For example, in some embodiments, the methods of the embodiments of this disclosure can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 308. In some embodiments, part or all of the computer program can be loaded and / or installed on the computing device 300 via ROM 302 and / or communication unit 309. In some embodiments, the computing unit 301 can be configured to implement the methods of the embodiments of this disclosure by any other suitable means (e.g., by means of firmware).
[0066] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0067] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0068] As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0069] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) or liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0070] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0071] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.
[0072] The above are merely preferred embodiments of this disclosure and are not intended to limit this disclosure in any way. Although this disclosure has been disclosed above with reference to preferred embodiments, it is not intended to limit this disclosure. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the technical solution of this disclosure. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of this disclosure without departing from the content of the technical solution of this disclosure shall still fall within the scope of the technical solution of this disclosure.
Claims
1. A method for automatically optimizing the layout of variable information on sports uniforms, characterized in that, Performed by a computing device, the method includes: Receive input data, which includes roster data, multi-source rule sets, fabric specification parameters, and pattern templates for multiple sizes, wherein the roster data contains personalized variable information for multiple individuals, and the pattern templates contain inherent images and text. Based on the roster data, generate multiple variable information image layers containing the personalized variable information; Based on the multi-source rule set and the fabric specification parameters, and according to the inherent images and text in the cut pattern template, a constraint environment for layout decision is constructed. The reinforcement learning agent makes iterative decisions under the constraints to determine the layout action of each variable information image layer on the target piece, the layout action including placement position, scaling ratio, rotation angle and layer level, wherein the strategy of the reinforcement learning agent is trained to maximize a multi-objective reward function that simultaneously optimizes the compliance score of the layout scheme, the visual consistency score across individuals and sizes, the manufacturability score based on the fabric specification parameters, and the material utilization score. Based on the decision results of the reinforcement learning agent, and combined with the inherent images and text in the pattern template, a final layout scheme corresponding to each size of pattern piece is generated; and Output the production file corresponding to the final layout scheme.
2. The method according to claim 1, characterized in that, The multi-source rule set includes international sports association rules, regional competition regulations, club customization requirements, font usage licensing regulations, and special handling rules for captain badges.
3. The method according to claim 1, characterized in that, The fabric specifications include information on the nap direction, the reflectivity and color difference tolerance model under preset light source conditions, and the fabric stretchability parameters. The manufacturability score is calculated at least in part based on the color difference tolerance model and the stretchability parameters.
4. The method according to claim 1, characterized in that, The personalized variable information includes at least one of athlete name, athlete number, sponsor logo, and year information, and the generation of variable information image layer includes standardized rendering of multilingual name fields containing diacritics, and application of predefined abbreviation or line break strategies to excessively long names.
5. The method according to claim 1, characterized in that, The method further includes: when the reinforcement learning agent makes a decision, performing a feasibility projection operation to project the sampled original typesetting action onto the legal action space defined by the multi-source rule set and the inherent image and text, thereby obtaining a legal typesetting action.
6. The method according to claim 1, characterized in that, The reinforcement learning agent adopts an actor-critic architecture, including a policy network and a value network. The policy network is used to sample and arrange actions based on the state, and the value network is used to evaluate the value of the state to assist in policy updates. The multi-objective reward function is a weighted sum of compliance score, visual consistency score, productiveity score, and material utilization score.
7. The method according to claim 1, characterized in that, The method further includes: switching between the optimal quality layout mode and the optimal material-saving layout mode by adjusting the weights of the corresponding scoring items in the multi-objective reward function; wherein, in the optimal quality layout mode, the weights of the manufacturability score and the visual consistency score are increased; and in the optimal material-saving layout mode, the weight of the material utilization score is increased.
8. The method according to claim 1, characterized in that, The method further includes: selecting an overall layout template and visual anchor points for the typesetting task through a high-level policy network, and fine-tuning the parameters of a single variable information image layer based on the selected template through a low-level policy network.
9. The method according to any one of claims 1-8, characterized in that, The reinforcement learning agent is trained through a course, starting with simple typesetting tasks involving short texts and single-layer fonts, and gradually transitioning to more complex typesetting tasks involving long texts, multi-layer font borders, embedded logos, and complex optical constraints.
10. A computing device, characterized in that, include: One or more processors; as well as A memory storing computer-executable instructions that, when executed by one or more processors, implement the method as described in any one of claims 1-9.