An AI model automatic training and optimization method based on data analysis

By constructing a search-to-formation consistent edge structure in the DARTS model, calculating the difference in the two-state structure and updating the parameters, the deviation problem of the DARTS model in the search and formation stages is solved, improving the performance and stability of the AI ​​model and reducing the cost of manual debugging.

CN122491385APending Publication Date: 2026-07-31BEIJING BORUI LINGLONG TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING BORUI LINGLONG TECHNOLOGY CO LTD
Filing Date
2026-05-20
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

The existing DARTS model has a discrepancy between the neural network structure search stage and the finalization stage. This causes the structure with good search performance to degrade after finalization, and the structure parameter update depends on insufficient verification error, making it difficult to constrain the consistency between continuous search results and finalized structures.

Method used

By constructing a search-state-fixed-state consistent edge structure, the bi-state structural difference between the search-state edge output and the fixed-state edge output is calculated, and the difference and verification error are written together into the update process of continuous structural parameters. This suppresses the update amount of unstable candidate transformations and improves the stability of structural parameters.

Benefits of technology

It improves the validation performance, structural stability, and model size control of AI models, reduces the workload of manual design and parameter tuning, and enhances the adaptability of model deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122491385A_ABST
    Figure CN122491385A_ABST
Patent Text Reader

Abstract

This invention discloses an automated training and optimization method for AI models based on data analysis, comprising the following steps: S1, forming a task state description set; S2, establishing an initial search graph; S3, inputting the task state description set into an improved DARTS model, with the task state encoding layer compressing the task state description set into task state codes; S4, a bi-state edge construction layer constructing a search state-defined state consistent edge structure and pushing the task state codes into the structural parameter configuration process of the search state edges; S5, a structural parameter relaxation layer configuring candidate transformation permutations for defined state edges; S6, a bi-state consistent update layer forming a search update graph; S7, a structural defining layer filtering defined state edges, assembling the retained defined state edges into the target AI model structure, and outputting the optimized AI model after defined state training and performance verification. This invention can reduce structural search bias and improve the stability of automatic optimization of AI models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automated training of artificial intelligence models and optimization of neural network structures, and in particular to a method for automated training and optimization of AI models based on data analysis. Background Technology

[0002] With the widespread application of deep learning models in image recognition, text processing, time series prediction, and industrial inspection, the structural design, parameter training, and performance optimization of AI models have become crucial factors influencing model deployment effectiveness. Existing model training methods typically rely on human experience to select the number of network layers, connection methods, feature transformation types, and training parameters. This requires repeated trials across different tasks, resulting in long training cycles and unstable matching between model structure and task data. To reduce the cost of manual design, neural architecture search methods are used to automatically generate neural network structures. Among them, the DARTS model uses differentiable structural parameters to search for candidate structures, improving search efficiency. However, traditional DARTS typically employs continuously relaxed hybrid edge structures during the search phase, with multiple candidate transformations participating in the forward computation. In the finalization phase, candidate structures need to be discretely selected based on structural parameters, leading to discrepancies between the search-state structure and the finalized structure. This can cause structures that perform well during the search phase to experience performance degradation after finalization training. Furthermore, traditional DARTS underutilizes the training task state, with structural parameter updates primarily relying on validation errors, making it difficult to simultaneously constrain the consistency between continuous search results and the output of the finalized structure.

[0003] Therefore, how to provide an automated training and optimization method for AI models based on data analysis is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0004] One objective of this invention is to propose an automated training and optimization method for AI models based on data analysis. This invention constructs a search-state / defined-state consistent edge structure in an improved DARTS model, enabling the same candidate transformation to simultaneously form search-state and defined-state edges, thus synchronously preserving the continuous search state and the defined-state structure during the structure search process. Compared to the traditional DARTS method, which relies solely on continuous relaxed mixed edges for searching and then discretizes the structure after the search, this invention can calculate the bi-state structural difference between the search-state edge output and the defined-state edge output during the search phase. This difference, along with the search-state verification error and the defined-state verification error, is incorporated into the correction process of the continuous structure parameters, thereby reducing the deviation between the search-state structure and the final defined structure. By configuring a negative update amount for unstable candidate transformations using the structural difference offset, candidate structures that perform well during the search phase but have large output deviations after defining the structure can be suppressed, improving the stability of the continuous structure parameter update. Finally, the structural design layer selects the design edges based on the corrected continuous structural parameters and assembles the target AI model structure, which improves the AI ​​model in terms of verification performance, structural stability, model size control and deployment adaptability, and reduces the workload of manual model design and repeated parameter tuning.

[0005] An automated training and optimization method for AI models based on data analysis according to an embodiment of the present invention includes the following steps: S1. Obtain the training data, validation data, and training target corresponding to the target training task; aggregate the task elements of the training data and training target to form a task state description set. S2. Establish the initial search graph corresponding to the target training task, and configure the relationship between the structure search unit and the candidate structure in the initial search graph; S3. Input the task state description set and the initial search graph into the improved DARTS model. The task state encoding layer compresses the task state description set into task state encoding. S4. The dual-state edge construction layer constructs a search-state-fixed-state consistent edge structure based on the candidate structure relationship in the initial search graph, and pushes the task state code into the structural parameter configuration process of the search-state edge. S5. The structural parameter relaxation layer converts the structural parameters corresponding to the search state edge into continuous structural parameters, and configures the candidate transformation arrangement relationship for the fixed state edge according to the continuous structural parameters. S6. The bi-state consistent update layer updates the transformation parameters in the search state edge and the fixed state edge on the training data, calculates the validation error on the validation data, and corrects the continuous structure parameters by combining the bi-state structure difference between the output of the search state edge and the output of the fixed state edge, thus forming a search update graph. S7. The structure shaping layer filters the shaping edges based on the continuous structural parameters in the search update graph, assembles the retained shaping edges into the target AI model structure, and outputs the optimized AI model after shaping training and performance verification.

[0006] Optionally, S1 specifically includes: S11. Read the training data, validation data, and training target corresponding to the target training task, group the training data and validation data into the same task index, and record the task affiliation relationship between the training data, validation data, and training target. S12. Perform sample unit division and sample consolidation on the training data, and group the sample units under the same training objective according to the input consolidation relationship and the target consolidation relationship to form task sample groups. S13. Decompose the training objectives into target elements, and classify the target output type, target constraints and performance verification requirements in the training objectives into the corresponding task sample groups to form task target groups. S14. Encapsulate the task sample group and the task target group in the same position according to the task index, and write the verification attribution relationship of the verification data into the encapsulation result to form a task status description set.

[0007] Optionally, S2 specifically includes: S21. Read the task index and training target from the task state description set, split the target training task into multiple structure search units, and arrange the structure search units according to the structure generation order of the target AI model. S22. Configure candidate connection positions between adjacent structural search units, and establish a connection relationship between the candidate connection positions and the input and output ends of the corresponding structural search units. S23. According to the structural generation requirements corresponding to the training objective, configure candidate structural relationships in the candidate connection positions. The candidate structural relationships include candidate connection relationships and candidate transformation relationships. S24. Write the structural search units, candidate connection positions, and candidate structural relationships into the same search graph index to form the initial search graph corresponding to the target training task.

[0008] Optionally, S3 specifically includes: The improved DARTS model includes a task state encoding layer, a two-state edge construction layer, a structural parameter relaxation layer, a two-state consistent update layer, and a structural shaping layer. The task state encoding layer reads the task state description set according to the task index of the target training task, and assigns the training data elements, validation data elements and training target elements in the task state description set to the task element bits respectively. Perform numerical and categorical mapping on the task element bits to obtain the corresponding task element vectors, and then arrange the task element vectors in the same position according to the task index. The task state encoding layer configures encoding mapping parameters and encoding bias parameters according to the dimension of the task element vector and the target dimension of task state encoding. It calls the encoding mapping parameters to perform dimensional mapping and dimensional convergence on the task element vector after it is arranged in the same position. The mapping result is added to the encoding bias parameters item by item along the same dimension to obtain the compressed task vector. The mean subtraction and scale equalization are performed on the numerical values ​​of each dimension in the compressed task vector, and the vectors are arranged according to the task index of the target training task to obtain the task state code; The task state encoding is indexed and linked to the initial search graph, and then passed to the bi-state edge construction layer.

[0009] Optionally, S4 specifically includes: S41. The dual-state edge construction layer traverses the candidate structural relationships in the initial search graph, and classifies the candidate structural relationships with the same starting structural search unit and the same ending structural search unit into the same edge pair index, and arranges the candidate transformation types under the same edge pair index in order. S42. Under the same edge pair index, set up search state edges and fixed state edges for each candidate transformation type. Both search state edges and fixed state edges are connected between the same starting point structure search unit and the same ending point structure search unit. S43. Write the task status code into the starting position of the structure parameter of the search state edge, attach the transformation parameter corresponding to the candidate transformation to the search state edge, and align the output position of the search state edge with the end structure search unit. S44. Write the candidate transformation arrangement positions under the same side index into the fixed edge, and align the output position of the fixed edge with the end structure search unit. S45. Encapsulate the search-state edge, fixed-state edge, structural parameter starting position, candidate transformation arrangement position and output alignment position under the same edge index into a search-state-fixed-state consistent edge structure.

[0010] Optionally, S5 specifically includes: S51. The structural parameter relaxation layer reads the edge pair index along the search state-fixed state uniformized edge structure, locates the starting position of the structural parameter of each search state edge under the same edge pair index, and collects each structural parameter into a branch structural parameter group according to the order of candidate transformation types. S52. Select the structural parameter with the largest value in the branch structure parameter group as the offset reference, subtract the offset reference from each structural parameter in the branch structure parameter group to obtain the offset branch parameter group, and write the sequence number of the candidate transformation type into the offset branch parameter group simultaneously. S53. Take the exponent value of each offset branch parameter in the offset branch parameter group to obtain the exponent parameter group. Accumulate all the exponent values ​​in the exponent parameter group to obtain the total exponent under the same index. S54. Divide each index value in the index parameter group by the total index to obtain the continuous structure parameters corresponding to each search state edge, and fill the continuous structure parameters back to the search state edge with the same index according to the sequence number of the candidate transformation type. S55. The structural parameter relaxation layer sorts the fixed edges under the same edge pair index in descending order according to the numerical value of the continuous structural parameters, and writes the sorted fixed edges into the candidate transformation arrangement relationship in order. S56. Write the candidate transformation arrangement relationship into the candidate transformation arrangement position of the fixed state edge, and write the search state edge number, continuous structure parameter number and fixed state edge number under the same edge pair index into the same parameter inheritance table.

[0011] Optionally, S6 specifically includes: S61. The dual-state consistent update layer reads the edge pair index in the search state-fixed state consistent edge structure and groups the search state edge and fixed state edge corresponding to the same candidate transformation under the same edge pair index into the same update unit. S62. Push the training data into the update unit in batches. Perform weighted forward calculation on the candidate transformation results according to the continuous structure parameters of the search state edges. Perform fixed state forward calculation on the candidate transformations of the corresponding positions according to the candidate transformation arrangement relationship. S63. Calculate the training error between the forward result of the search-state edge, the forward result of the fixed-state edge and the training target respectively, and backpropagate the back gradients corresponding to the two types of training errors to the transformation parameters of the same candidate transformation. Perform in-situ update on the transformation parameters in the search-state edge and the fixed-state edge. S64. Push the verification data into the update unit after the transformation parameters have been updated to obtain the search state side verification output and the fixed state side verification output, and calculate the search state verification error and the fixed state verification error between the search state side verification output, the fixed state side verification output and the training target, respectively. S65. The dual-state consistent update layer calculates the dual-state structural difference between the search-state edge verification output and the fixed-state edge verification output. The back gradients corresponding to the search-state verification error and the fixed-state verification error, along with the dual-state structural difference, are written into the update amount of the continuous structural parameters to obtain the corrected continuous structural parameters. S66. Refresh the structural parameters of the search state edges according to the corrected continuous structural parameters, and rearrange the candidate transformation arrangement relationship in the fixed state edges to form a search update graph.

[0012] Optionally, the two-state consistent update layer calculates the two-state structural difference between the search-state edge verification output and the fixed-state edge verification output, and writes the back gradients corresponding to the search-state verification error and the fixed-state verification error, along with the two-state structural difference, into the update amount of the continuous structure parameters, specifically including: Within the same update unit, output position alignment is performed on the search state edge verification output and the fixed state edge verification output, and the feature values ​​of the corresponding output positions are subtracted dimension by dimension to obtain the dual-state output difference; The differences in each dimension of the bi-state output difference are squared and accumulated along the feature dimension to obtain the bi-state structure difference of the corresponding candidate transformation. The average value of the bistate structural difference of all candidate transformations under the same index is calculated. The bistate structural difference of each candidate transformation is subtracted from the average value of the bistate structural difference to obtain the structural difference offset. Calculate the difference between the verification error of the current search round and the verification error of the previous search round to obtain the verification error increment; When the structural difference offset is positive, the structural difference offset is written into the negative update amount of the corresponding continuous structural parameter; when the structural difference offset is non-positive and the verification error increment is negative, the negative update amount corresponding to the structural difference offset is set to zero. The dual-state consistent update layer writes the inverse gradients corresponding to the search state verification error and the fixed state verification error into the corresponding update positions according to the continuous structural parameter numbers, and subtracts the negative update amount corresponding to the structural difference offset from the continuous structural parameters to obtain the corrected continuous structural parameters.

[0013] Optionally, S7 specifically includes: S71. The structural shaping layer reads the shaping edges, continuous structural parameters and candidate transformation arrangement relationships in the search update graph, and groups the shaping edges according to the same edge pair index; S72. Within each group of fixed-shape edges, filter the fixed-shape edges according to the numerical order of the continuous structural parameters, configure the fixed-shape edges with the first value as retained edges, and configure the remaining fixed-shape edges as trimmed edges. S73. Assemble the retained edges according to the structural search unit connection relationship in the initial search graph, and write the candidate transformation arrangement relationship corresponding to the retained edges into the corresponding structural search unit to form the target AI model structure. S74. Load training data onto the target AI model structure to perform finalized training, update the model parameters in the target AI model structure, and input the finalized target AI model structure into the validation data for performance verification. S75. When the performance verification result reaches the training objective, the target AI model structure after finalized training is output as the optimized AI model; when the performance verification result does not reach the training objective, the performance verification result is written back to the search update graph, and the finalized edge selection and target AI model structure assembly are re-executed.

[0014] The beneficial effects of this invention are: This invention constructs a search-state-defined edge structure in the improved DARTS model, enabling the same candidate transform to simultaneously possess search-state edges and defined-state edges. During the search process, the difference between the two-state structure outputs of the search-state edges and the defined-state edges is calculated. Compared to the traditional DARTS method, which searches only based on continuous structure parameters and then discretizes the structure after completion, this invention can constrain the defined-state structure output in advance during the search phase, reducing the performance drop of search results after defined-state training.

[0015] This invention does not rely solely on verification errors to update structural parameters. Instead, it incorporates the search-state verification error, the fixed-state verification error, and the dual-state structural difference into the continuous structural parameter update process. For candidate transformations where the search-state output differs significantly from the fixed-state output, this invention uses a structural difference offset to configure a negative update amount, reducing the retention strength of the candidate transformation in the structural search and thus minimizing the interference of unstable candidate structures on the final model structure.

[0016] This invention forms a complete automated structure search chain by using a task state description set, an initial search graph, continuous structure parameters, candidate transformation arrangement relationships, and a search update graph. This enables the target AI model structure to automatically complete structure selection, finalized training, and performance verification based on training data, validation data, and training objectives. Compared to manually designed models or ordinary DARTS models, this invention reduces manual debugging costs, improves the consistency between model structure search results and the target training task, and enhances the validation performance, model size, and deployment efficiency of the optimized AI model. Attached Figure Description

[0017] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of an automated training and optimization method for AI models based on data analysis proposed in this invention; Figure 2 This is an internal structure diagram of the improved DARTS model, which is based on a data analysis-based automated training and optimization method for AI models proposed in this invention. Figure 3 This diagram illustrates the search state-fixed state consistent edge structure and parameter update of the AI ​​model automated training and optimization method based on data analysis proposed in this invention. Detailed Implementation

[0018] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0019] refer to Figures 1-3 An automated training and optimization method for AI models based on data analysis includes the following steps: S1. Obtain the training data, validation data, and training target corresponding to the target training task; aggregate the task elements of the training data and training target to form a task state description set. S2. Establish the initial search graph corresponding to the target training task, and configure the relationship between the structure search unit and the candidate structure in the initial search graph; S3. Input the task state description set and the initial search graph into the improved DARTS model. The task state encoding layer compresses the task state description set into task state encoding. S4. The dual-state edge construction layer constructs a search-state-fixed-state consistent edge structure based on the candidate structure relationship in the initial search graph, and pushes the task state code into the structural parameter configuration process of the search-state edge. S5. The structural parameter relaxation layer converts the structural parameters corresponding to the search state edge into continuous structural parameters, and configures the candidate transformation arrangement relationship for the fixed state edge according to the continuous structural parameters. S6. The bi-state consistent update layer updates the transformation parameters in the search state edge and the fixed state edge on the training data, calculates the validation error on the validation data, and corrects the continuous structure parameters by combining the bi-state structure difference between the output of the search state edge and the output of the fixed state edge, thus forming a search update graph. S7. The structure shaping layer filters the shaping edges based on the continuous structural parameters in the search update graph, assembles the retained shaping edges into the target AI model structure, and outputs the optimized AI model after shaping training and performance verification.

[0020] In this embodiment, S1 specifically includes: S11. Read the training data, validation data, and training target corresponding to the target training task, group the training data and validation data into the same task index, and record the task affiliation relationship between the training data, validation data, and training target. S12. Perform sample unit division and sample consolidation on the training data, and group the sample units under the same training objective according to the input consolidation relationship and the target consolidation relationship to form task sample groups. S13. Decompose the training objectives into target elements, and classify the target output type, target constraints and performance verification requirements in the training objectives into the corresponding task sample groups to form task target groups. S14. Encapsulate the task sample group and the task target group in the same position according to the task index, and write the verification attribution relationship of the verification data into the encapsulation result to form a task status description set.

[0021] In the specific implementation process, after the target training task is connected, a task index is configured for the target training task, and the training data, validation data, and training objective are grouped into the same task index. The training data mainly enters the model parameter learning process, the validation data mainly enters the structural parameter update and performance verification process, and the training objective is used to define the output type and performance verification requirements of the target AI model. If the training data and validation data come from the same original dataset, they can be divided in a 7:3 or 8:2 ratio; if the training set and validation set have already been provided externally, the task affiliation between the two is directly recorded.

[0022] When partitioning training data into sample units, the boundaries of the sample units are determined based on the data format. Image-based tasks can use single images as sample units, text-based tasks can use text segments or question-answer pairs as sample units, and time-series tasks can use continuous time windows as sample units. After the sample units are partitioned, sample units under the same training objective are grouped into task sample groups according to their input and objective relationships; sample units lacking objective items or not matching the training objective are not included in the task sample groups.

[0023] When decomposing the training objective into its constituent elements, the training objective is broken down into target output type, target constraints, and performance validation requirements. The target output type can be classification output, regression output, sequence output, or structured output; target constraints can include model size, inference latency, or resource consumption limitations; performance validation requirements can include accuracy, recall, mean squared error, mean absolute error, or F1 score. These target elements are then encapsulated alongside the task sample group according to the task index, forming the task objective group.

[0024] After the task sample group and task target group are encapsulated in the same location, the verification attribution relationship of the validation data is written into the encapsulation result, forming a task state description set. The task state description set records at least the number of training samples, the number of validation samples, the input data format, the target output type, the target constraints, the performance verification requirements, and the connection relationship between the samples and the training target. This task state description set serves as the input to the task state encoding layer, used to compress it into task state codes, and participates in the configuration process of the structural parameters of the search state edges.

[0025] In this embodiment, S2 specifically includes: S21. Read the task index and training target from the task state description set, split the target training task into multiple structure search units, and arrange the structure search units according to the structure generation order of the target AI model. S22. Configure candidate connection positions between adjacent structural search units, and establish a connection relationship between the candidate connection positions and the input and output ends of the corresponding structural search units. S23. According to the structural generation requirements corresponding to the training objective, configure candidate structural relationships in the candidate connection positions. The candidate structural relationships include candidate connection relationships and candidate transformation relationships. S24. Write the structural search units, candidate connection positions, and candidate structural relationships into the same search graph index to form the initial search graph corresponding to the target training task.

[0026] In the specific implementation process, the initial search graph is used to limit the searchable structural range of the target AI model. After the task state description set is formed, the task index and training objective are read, and the target training task is split into multiple structural search units. These structural search units are arranged according to the structural generation order of the target AI model from input to output. The number of structural search units can be configured according to the complexity of the training task; for example, 3 to 6 structural search units are configured for simple tasks, and 6 to 12 structural search units are configured for complex tasks. This number is only an implementation example and does not limit the actual search scale. Candidate connection positions are configured between adjacent structural search units, and these candidate connection positions are respectively attached to the output of the starting structural search unit and the input of the ending structural search unit. For target AI models that require cross-layer feature transfer, candidate connection positions can also be configured between non-adjacent structural search units. Candidate structural relationships include candidate connection relationships and candidate transformation relationships. The candidate connection relationship records the connectable range between structural search units, and the candidate transformation relationship records the selectable feature transformation types at the candidate connection positions. Candidate transformation types can include feature expansion transformation, feature compression transformation, local feature transformation, global feature transformation, jump connection transformation, or empty transformation. After the structural search units, candidate connection positions, and candidate structural relationships are written into the same search graph index, an initial search graph corresponding to the target training task is formed. After the initial search graph is passed to the dual-state edge construction layer, the dual-state edge construction layer constructs a search state-to-fixed state consistent edge structure according to the starting structural search unit, the ending structural search unit, and the candidate transformation type.

[0027] In this embodiment, S3 specifically includes: The improved DARTS model includes a task state encoding layer, a two-state edge construction layer, a structural parameter relaxation layer, a two-state consistent update layer, and a structural shaping layer. The task state encoding layer reads the task state description set according to the task index of the target training task, and assigns the training data elements, validation data elements and training target elements in the task state description set to the task element bits respectively. Perform numerical and categorical mapping on the task element bits to obtain the corresponding task element vectors, and then arrange the task element vectors in the same position according to the task index. The task state encoding layer configures encoding mapping parameters and encoding bias parameters according to the dimension of the task element vector and the target dimension of task state encoding. It calls the encoding mapping parameters to perform dimensional mapping and dimensional convergence on the task element vector after it is arranged in the same position. The mapping result is added to the encoding bias parameters item by item along the same dimension to obtain the compressed task vector. The mean subtraction and scale equalization are performed on the numerical values ​​of each dimension in the compressed task vector, and the vectors are arranged according to the task index of the target training task to obtain the task state code; The task state encoding is indexed and linked to the initial search graph, and then passed to the bi-state edge construction layer.

[0028] In practice, traditional DARTS typically configures structural parameters directly within a predefined search space. The initial state of these parameters is primarily determined by random or uniform initialization, without considering the data format of the training task, the size of the validation data, the target output type, or performance verification requirements. This leads to different training tasks using similar starting points for structural parameters, with structure search relying heavily on training and validation errors for successive rounds of correction. This can result in instability in the candidate structure selection direction during the initial search phase. This invention improves the DARTS model by adding a task state encoding layer at the front end. This layer does not alter the fundamental framework of DARTS's differentiable search; instead, it compresses the task state description set into a task state code that can be written into the structural parameter configuration process, preceding the two-state edge construction layer and the structural parameter relaxation layer. This allows the data elements and target elements of the training task to be converted into a unified code before entering the starting position of the structural parameters for the search state edges.

[0029] When the task state encoding layer reads the task state description set, it first extracts training data elements, validation data elements, and training target elements according to the task index of the target training task. Training data elements may include the number of training samples, input dimension, number of sample categories, sample length, number of sample channels, or sample sparsity; validation data elements may include the number of validation samples, validation ratio, and validation target attribution; training target elements may include target output type, target constraints, and performance verification requirements. These elements are not limited to fixed fields and can be added or removed according to the data format of the target training task during specific implementation, but they are all assigned to the task element position before entering the task state encoding layer.

[0030] For numerical task elements, the task state encoding layer first performs scaling. For example, the number of training samples, the number of validation samples, the input dimension, and the sample length can be logarithmed or divided by the maximum value in the corresponding task set to ensure that values ​​of different magnitudes fall within a similar range. For categorical task elements, the task state encoding layer performs categorical mapping according to the category number. For example, classification tasks, regression tasks, and sequence prediction tasks are mapped to different category codes. The numerical mapping results and categorical mapping results are arranged in the same position according to the task index to obtain the task element vector. In implementation, the dimension of the task element vector can be set to 32, 64, or 128, and the dimension value is determined by the number of task elements and the encoding accuracy requirements. When the number of task elements is small, 32 dimensions can be used; when the task elements contain multi-objective constraints or multimodal input states, 64 or 128 dimensions can be used.

[0031] The task state encoding layer configures encoding mapping parameters and encoding bias parameters based on the dimensions of the task element vector and the target dimension of the task state encoding. For example, when the task element vector is 64-dimensional and the target dimension of the task state encoding is 32-dimensional, the encoding mapping parameters are arranged according to a 64×32 mapping relationship, and the encoding bias parameters are arranged in 32 dimensions. When the task state encoding layer performs dimension-by-dimensional mapping on the task element vector arranged in the same position, it first multiplies the value of each dimension in the task element vector with the value at the corresponding position in the encoding mapping parameters, and then accumulates them along the input dimension direction to obtain the mapping accumulation result corresponding to each target encoding dimension. Subsequently, the mapping accumulation result corresponding to each target encoding dimension is added to the bias value of the same dimension in the encoding bias parameters to obtain the compressed value of that target encoding dimension. After performing the above addition process on all target encoding dimensions, a compressed task vector is formed. This process is equivalent to converging the discretely distributed task elements into a unified task state encoding space, enabling the bi-state edge construction layer to read the task state in the same dimension.

[0032] After obtaining the compressed task vector, the task state encoding layer performs mean subtraction and scale equalization on the numerical values ​​of each dimension of the compressed task vector. Specifically, first, the mean of all dimensions of the compressed task vector is calculated, and then this mean is subtracted from the numerical value of each dimension. Next, the scale value after mean subtraction is calculated; the scale value can be the standard deviation, root mean square value, or maximum absolute value. When the scale value is close to 0, 1e-6 can be added as a lower limit to avoid division by zero during the scale equalization process. The mean-subtracted value of each dimension is divided by the scale value to obtain the scale-equalized encoded value. The scale-equalized encoded values ​​are arranged according to the task index of the target training task to form the task state code.

[0033] After the task state encoding is formed, the task state encoding layer establishes an index connection relationship between the task state encoding and the initial search graph. Specifically, the task state encoding retains the task index and aligns it with the search graph index in the initial search graph. When a target training task corresponds to only one initial search graph, the task state encoding is directly attached to that search graph index. When a target training task corresponds to multiple candidate initial search graphs, the task state encoding is copied to each search graph index, but retains the same task index. After the index connection is completed, the task state encoding is passed to the dual-state edge construction layer, and the structural parameter configuration process of the search state edges is written when the dual-state edge construction layer constructs the search state-defined consistent edge structure.

[0034] Through the above processing, the task state encoding layer ensures that the data elements, validation elements, and target elements of the training task are uniformly compressed before entering the bi-state edge construction layer, avoiding the use of indiscriminate structural parameter starting points for the improved DARTS model across different tasks. After the task state encoding participates in the structural parameter configuration of the search state edges, the initial distribution of continuous structural parameters can be constrained by the training task state. The bi-state consistent update layer then combines the validation error and the bi-state structural difference to correct the continuous structural parameters, thereby improving the consistency between the structural search starting point and the target training task, and reducing the situation where invalid candidate structures occupy high structural parameters in the early stages of the search.

[0035] In this embodiment, S4 specifically includes: S41. The dual-state edge construction layer traverses the candidate structural relationships in the initial search graph, and classifies the candidate structural relationships with the same starting structural search unit and the same ending structural search unit into the same edge pair index, and arranges the candidate transformation types under the same edge pair index in order. S42. Under the same edge pair index, set up search state edges and fixed state edges for each candidate transformation type. Both search state edges and fixed state edges are connected between the same starting point structure search unit and the same ending point structure search unit. S43. Write the task status code into the starting position of the structure parameter of the search state edge, attach the transformation parameter corresponding to the candidate transformation to the search state edge, and align the output position of the search state edge with the end structure search unit. S44. Write the candidate transformation arrangement positions under the same side index into the fixed edge, and align the output position of the fixed edge with the end structure search unit. S45. Encapsulate the search-state edge, fixed-state edge, structural parameter starting position, candidate transformation arrangement position and output alignment position under the same edge index into a search-state-fixed-state consistent edge structure.

[0036] In practical implementation, traditional DARTS typically sets a hybrid edge between adjacent search nodes and places multiple candidate transformations into this edge, continuously weighting the outputs of these transformations using structural parameters. This approach preserves a continuous hybrid structure during the search phase, but requires discretely selecting candidate transformations from the hybrid edge during the structure-finalization phase. This results in a morphological difference between the edge structure during the search phase and the final target AI model structure. The dual-state edge construction layer of this invention no longer generates only a single hybrid edge, but simultaneously sets up search-state and finalization-state edges for the same candidate structural relationship, ensuring that each candidate transformation has both a continuous search position and a structure-finalization position during the search process.

[0037] After reading the initial search graph, the bi-state edge construction layer first traverses the candidate structural relationships in the initial search graph. Each candidate structural relationship includes at least a starting structural search unit, an ending structural search unit, and a candidate transformation type. The bi-state edge construction layer groups candidate structural relationships with the same starting and ending structural search units into the same edge pair index. For example, if there are three candidate transformation types between structural search unit A and structural search unit B, namely local feature transformation, feature compression transformation, and jump transition transformation, then these three candidate transformation types are grouped into the same edge pair index, forming a set of candidate transformations under the same starting point and the same ending point. The candidate transformation types are arranged according to the order in the initial search graph or the pre-configured transformation number order, such as number 1, number 2, and number 3.

[0038] Under the same edge pair index, the bi-state edge construction layer separately assigns a search-state edge and a fixed-state edge for each candidate transformation type. Both the search-state and fixed-state edges are connected between structural search units with the same starting point and the same ending point, but their structural records differ. The search-state edge records the starting position of the structural parameters, the transformation parameter number, and the search-state output position; the fixed-state edge records the candidate transformation arrangement position, the structural edge number, and the fixed-state output position. In this way, the same candidate transformation participates in continuous structural parameter updates in the search-state edge, while retaining its arrangement position when the structure is fixed in the fixed-state edge.

[0039] When configuring search-state edges, the dual-state edge construction layer writes the task state code into the starting positions of the structural parameters of the search-state edges. Specifically, if the task state code is a 32-dimensional vector and the number of candidate transformation types is 4, then 4 starting positions of structural parameters can be configured for the 4 search-state edges under the same edge index. The task state code can be written into each structural parameter starting position after linear mapping, or it can be written after reading the corresponding dimension interval according to the candidate transformation type number. After writing, each search-state edge has initial structural parameter values ​​related to the target training task, instead of using the same random initial values ​​for all edges.

[0040] When the transformation parameters corresponding to candidate transformations are attached to search-state edges, the dual-state edge construction layer records the candidate transformation parameter number for each search-state edge. If the search-state edge corresponds to a local feature transformation, then the search-state edge records the convolution kernel parameter, linear mapping parameter, or other feature transformation parameter number of the local feature transformation; if the search-state edge corresponds to a jump transformation, then the search-state edge records the parameter reference or null parameter marker of the jump transformation. After the output position of the search-state edge is aligned with the endpoint structure search unit, the output generated by the search-state edge in the forward computation can be written into the same feature position of the endpoint structure search unit.

[0041] When configuring definite edges, the dual-state edge construction layer writes the candidate transformation arrangement positions under the same edge pair index into the definite edge. The candidate transformation arrangement position records the position of the candidate transformation in the definite candidate sequence. After the structural parameter relaxation layer calculates the continuous structural parameters, it can refresh the candidate transformation arrangement positions according to the magnitude of the continuous structural parameters. The definite edge output position is aligned with the endpoint structural search unit, so that the definite edge output and the search state edge output have the same comparison benchmark.

[0042] After completing the above processing, the bi-state edge construction layer encapsulates the search-state edges, fixed-state edges, structural parameter start positions, candidate transformation arrangement positions, and output alignment positions under the same edge pair index into a search-state-fixed-state consistent edge structure. In this structure, the same candidate transformation retains both search-state edge records and fixed-state edge records; the search-state edge output positions and fixed-state edge output positions are aligned according to the same endpoint structural search unit; the edge pair index records the starting structural search unit, the ending structural search unit, and the candidate transformation type index. Thus, when calculating the bi-state structural difference, the bi-state consistent update layer can directly read the search-state edge outputs and fixed-state edge outputs under the same edge pair index and perform dimension-by-dimensional difference calculations.

[0043] In this embodiment, S5 specifically includes: S51. The structural parameter relaxation layer reads the edge pair index along the search state-fixed state uniformized edge structure, locates the starting position of the structural parameter of each search state edge under the same edge pair index, and collects each structural parameter into a branch structural parameter group according to the order of candidate transformation types. S52. Select the structural parameter with the largest value in the branch structure parameter group as the offset reference, subtract the offset reference from each structural parameter in the branch structure parameter group to obtain the offset branch parameter group, and write the sequence number of the candidate transformation type into the offset branch parameter group simultaneously. S53. Take the exponent value of each offset branch parameter in the offset branch parameter group to obtain the exponent parameter group. Accumulate all the exponent values ​​in the exponent parameter group to obtain the total exponent under the same index. S54. Divide each index value in the index parameter group by the total index to obtain the continuous structure parameters corresponding to each search state edge, and fill the continuous structure parameters back to the search state edge with the same index according to the sequence number of the candidate transformation type. S55. The structural parameter relaxation layer sorts the fixed edges under the same edge pair index in descending order according to the numerical value of the continuous structural parameters, and writes the sorted fixed edges into the candidate transformation arrangement relationship in order. S56. Write the candidate transformation arrangement relationship into the candidate transformation arrangement position of the fixed state edge, and write the search state edge number, continuous structure parameter number and fixed state edge number under the same edge pair index into the same parameter inheritance table.

[0044] In the specific implementation process, after receiving the search state-to-fixed state consistent edge structure, the structural parameter relaxation layer first processes them group by group according to the edge pair index. An edge pair index corresponds to a group of candidate transformations between the same starting structural search unit and the same ending structural search unit. The structural parameter relaxation layer reads the starting position of the structural parameters of each search state edge under the edge pair index and extracts the structural parameters according to the order of the candidate transformation types. For example, if there are 3 candidate transformation types under the same edge pair index, arranged in the order of candidate transformation 1, candidate transformation 2, and candidate transformation 3, with corresponding structural parameters of 1.2, 0.4, and -0.1 respectively, then the above 3 structural parameters are grouped into branch structural parameter groups according to the candidate transformation type number.

[0045] To avoid overflow in the exponent calculation due to excessively large structural parameter values, the structural parameter relaxation layer first selects the maximum value in the branch structural parameter group as the offset reference. Taking the above branch structural parameter group as an example, the maximum structural parameter is 1.2, so 1.2 is used as the offset reference. Then, 1.2 is subtracted from each structural parameter to obtain the offset branch parameter groups, which are 0, -0.8, and -1.3, respectively. This process only changes the intermediate values ​​involved in the exponent calculation and does not change the order of the candidate transformation types. The structural parameter relaxation layer also writes the candidate transformation type number into the offset branch parameter group, so that each offset branch parameter can still return to the corresponding search state edge.

[0046] Next, the structural parameter relaxation layer takes the exponential value for each offset branch parameter in the offset branch parameter group. Continuing with the above values ​​as an example, 0 is given an exponential value of 1, -0.8 is given an exponential value of approximately 0.449, and -1.3 is given an exponential value of approximately 0.273, thus obtaining the exponential parameter group. Then, all the exponential values ​​in the exponential parameter group are summed to obtain the total exponent, that is, the sum of 1, 0.449, and 0.273 is approximately 1.722. The structural parameter relaxation layer divides each exponential value by the total exponent to obtain the continuous structural parameters; the corresponding results are approximately 0.581, 0.261, and 0.158. All of the above continuous structural parameters are non-negative, and the sum of the continuous structural parameters under the same index is 1, which allows them to participate in the differentiable forward computation.

[0047] After the continuous structural parameters are generated, the structural parameter relaxation layer backfills the continuous structural parameters to the search state edges with the same index according to the candidate transformation type index. The search state edge corresponding to the first candidate transformation is written with 0.581, the search state edge corresponding to the second candidate transformation is written with 0.261, and the search state edge corresponding to the third candidate transformation is written with 0.158. During the forward search, the search state edges process the output features of the previous structural search unit for each candidate transformation under the same edge index to obtain the corresponding candidate transformation results. For any output position and any feature dimension, the feature value of each candidate transformation result is multiplied by the corresponding continuous structural parameter, and the product results under the same output position and the same feature dimension are accumulated to obtain the forward result of the search state edge corresponding to the edge index.

[0048] On the fixed edge side, the structural parameter relaxation layer sorts the fixed edges under the same edge pair index in descending order according to the numerical value of the continuous structural parameters. Taking the above results as an example, the fixed edge corresponding to 0.581 is arranged in position 1, the fixed edge corresponding to 0.261 is arranged in position 2, and the fixed edge corresponding to 0.158 is arranged in position 3. After the sorting is completed, the structural parameter relaxation layer writes this order into the candidate transformation arrangement relation. The candidate transformation arrangement relation records the arrangement order of each fixed edge in the current search round, providing a direct basis for the structural shaping layer to select fixed edges.

[0049] After writing the parameters for the search-state edges and fixed-state edges, the structural parameter relaxation layer writes the candidate transformation arrangement relationship into the candidate transformation arrangement position of the fixed-state edges, and writes the search-state edge number, continuous structural parameter number, and fixed-state edge number under the same edge pair index into the same parameter inheritance table. The parameter inheritance table can be arranged in the format of "edge pair index - candidate transformation sequence number - search-state edge number - continuous structural parameter number - fixed-state edge number". In this way, when the dual-state consistent update layer refreshes the continuous structural parameters, it can directly locate the search-state edges and fixed-state edges that need to be updated; when the structural shaping layer selects fixed-state edges, it can also complete the structural assembly of the target AI model based on the continuous structural parameters and the candidate transformation arrangement relationship.

[0050] Through the above calculation process, the structural parameter relaxation layer transforms the originally discrete or unnormalized structural parameters in the search-state edges into continuous structural parameters, and simultaneously generates candidate transformation permutations of the definite-state edges. This process retains the characteristic of continuous structural parameters participating in the forward calculation in DARTS differentiable search, and also enables the definite-state edges to continuously obtain sortable structural states during the search process, providing a basis for correcting continuous structural parameters for the difference in two-state structures.

[0051] In this embodiment, S6 specifically includes: S61. The dual-state consistent update layer reads the edge pair index in the search state-fixed state consistent edge structure and groups the search state edge and fixed state edge corresponding to the same candidate transformation under the same edge pair index into the same update unit. S62. Push the training data into the update unit in batches. Perform weighted forward calculation on the candidate transformation results according to the continuous structure parameters of the search state edges. Perform fixed state forward calculation on the candidate transformations of the corresponding positions according to the candidate transformation arrangement relationship. S63. Calculate the training error between the forward result of the search-state edge, the forward result of the fixed-state edge and the training target respectively, and backpropagate the back gradients corresponding to the two types of training errors to the transformation parameters of the same candidate transformation. Perform in-situ update on the transformation parameters in the search-state edge and the fixed-state edge. S64. Push the verification data into the update unit after the transformation parameters have been updated to obtain the search state side verification output and the fixed state side verification output, and calculate the search state verification error and the fixed state verification error between the search state side verification output, the fixed state side verification output and the training target, respectively. S65. The dual-state consistent update layer calculates the dual-state structural difference between the search-state edge verification output and the fixed-state edge verification output. The back gradients corresponding to the search-state verification error and the fixed-state verification error, along with the dual-state structural difference, are written into the update amount of the continuous structural parameters to obtain the corrected continuous structural parameters. S66. Refresh the structural parameters of the search state edges according to the corrected continuous structural parameters, and rearrange the candidate transformation arrangement relationship in the fixed state edges to form a search update graph.

[0052] In this embodiment, the two-state consistent update layer calculates the two-state structural difference between the search-state edge verification output and the fixed-state edge verification output, and writes the back gradients corresponding to the search-state verification error and the fixed-state verification error, along with the two-state structural difference, into the update amount of the continuous structure parameters. Specifically, this includes: Within the same update unit, output position alignment is performed on the search state edge verification output and the fixed state edge verification output, and the feature values ​​of the corresponding output positions are subtracted dimension by dimension to obtain the dual-state output difference; The differences in each dimension of the bi-state output difference are squared and accumulated along the feature dimension to obtain the bi-state structure difference of the corresponding candidate transformation. The average value of the bistate structural difference of all candidate transformations under the same index is calculated. The bistate structural difference of each candidate transformation is subtracted from the average value of the bistate structural difference to obtain the structural difference offset. Calculate the difference between the verification error of the current search round and the verification error of the previous search round to obtain the verification error increment; When the structural difference offset is positive, the structural difference offset is written into the negative update amount of the corresponding continuous structural parameter; when the structural difference offset is non-positive and the verification error increment is negative, the negative update amount corresponding to the structural difference offset is set to zero. The dual-state consistent update layer writes the inverse gradients corresponding to the search state verification error and the fixed state verification error into the corresponding update positions according to the continuous structural parameter numbers, and subtracts the negative update amount corresponding to the structural difference offset from the continuous structural parameters to obtain the corrected continuous structural parameters.

[0053] In its implementation, the dual-state consistent update layer receives the search-state-fixed-state consistent edge structure, continuous structure parameters, candidate transformation arrangement, training data, and validation data. It then establishes update units based on edge pair indices. Each edge pair index corresponds to a set of candidate transformations between the same starting-point and ending-point structure search units; the same candidate transformation has both search-state and fixed-state edges within the update unit. The dual-state consistent update layer groups search-state and fixed-state edges corresponding to the same candidate transformation under the same edge pair index into the same update unit, enabling comparisons of the outputs of the same candidate transformation in both the continuous search state and the fixed-state structure, based on the same input position, output position, and feature dimension.

[0054] Training data is entered into the update unit in batches, with batch size set to 32 or 64. For a training batch, the node features output by the previous structure search unit are entered into each search-state edge under the same side pair index. Each search-state edge calls the corresponding candidate transformation to process the node features, obtaining the candidate transformation result. For any output position and any feature dimension, the feature value of each candidate transformation result is multiplied by the corresponding continuous structure parameter, and the product results under the same output position and the same feature dimension are accumulated to obtain the forward result of the search-state edge. For example, if there are two candidate transformations under the same side pair index, with continuous structure parameters of 0.7 and 0.3 respectively, and the 2D feature obtained by the first candidate transformation at a certain output position is [2.0, 4.0], and the 2D feature obtained by the second candidate transformation at the same output position is [6.0, 1.0], then the forward result of the search-state edge is [2.0×0.7+6.0×0.3, 4.0×0.7+1.0×0.3], which is [3.2, 3.1].

[0055] The fixed edge reads the candidate transformations at the corresponding positions according to the candidate transformation arrangement, and inputs the node features corresponding to the same training batch into the candidate transformation to obtain the forward result of the fixed edge. For example, if the first candidate transformation is located at the beginning position in the current candidate transformation arrangement, the fixed edge directly outputs the 2D feature [2.0, 4.0] corresponding to the first candidate transformation at the same output position. When there are multiple fixed edges under the same edge index, feature transformations are performed on each fixed edge respectively, and the forward result of each fixed edge is recorded according to the candidate transformation arrangement.

[0056] After obtaining the forward results of the search-state edge and the fixed-state edge, the bi-state consistent update layer calculates the training errors between each and the training target. For classification tasks, cross-entropy error can be used; for regression tasks, mean squared error can be used; and for sequence prediction tasks, the error can be calculated item by item at each time position and then averaged along the time dimension. The search-state training error and the fixed-state training error are backpropagated to the transformation parameters of the same candidate transformation. If the search-state edge and the fixed-state edge share the same set of transformation parameters, the gradients corresponding to the two types of training errors are added item by item at the same parameter positions, and then the transformation parameters of the candidate transformation are updated according to the learning rate. If the search-state edge and the fixed-state edge each retain copies of the transformation parameters, the two parameter copies are updated first, and then synchronization is performed according to the candidate transformation number.

[0057] After the transformation parameters are updated, the validation data are entered into the same update unit in batches. The validation data does not update the transformation parameters of the candidate transformations, but instead participates in the correction of the continuous structure parameters. The validation node features output by the previous structure search unit are entered into the search-state edges and fixed-state edges, respectively. The search-state edges obtain the search-state edge validation output according to the continuous structure parameters, and the fixed-state edges obtain the fixed-state edge validation output according to the candidate transformation arrangement. Subsequently, the bi-state consistent update layer calculates the search-state validation error between the search-state edge validation output and the training target, and the fixed-state validation error between the fixed-state edge validation output and the training target, respectively. The search-state validation error and the fixed-state validation error generate the backpropagation gradients corresponding to the continuous structure parameters.

[0058] When calculating the bi-state structural difference, the bi-state consistent update layer first aligns the output positions of the search-state edge validation output and the fixed-state edge validation output. If both are feature vectors, they are aligned according to the feature dimension order; if both are feature maps, they are first aligned according to spatial position, and then aligned according to the channel dimension within each spatial position. After alignment, the feature values ​​at the corresponding output positions are subtracted dimension by dimension to obtain the bi-state output difference. For example, if the search-state edge validation output is [3.2, 3.1, 1.5] and the fixed-state edge validation output is [2.0, 4.0, 1.0], the dimension-by-dimensional subtraction yields [1.2, -0.9, 0.5]. Subsequently, the differences in each dimension are squared to obtain [1.44, 0.81, 0.25], and then accumulated along the feature dimension to obtain the bi-state structural difference of the candidate transformation, 2.50. If there are multiple output positions or multiple verification batches, the bistate structure difference of each output position or verification batch is averaged to obtain the bistate structure difference of the candidate transformation in the current search round.

[0059] When multiple candidate transformations exist under the same index, the bi-state consistent update layer calculates the average bi-state structural difference of all candidate transformations and subtracts this average from the bi-state structural difference of each candidate transformation to obtain the structural difference offset. For example, if the bi-state structural differences of three candidate transformations are 2.50, 0.80, and 1.10, with an average of 1.47, then the structural difference offsets are 1.03, -0.67, and -0.37, respectively. A positive structural difference offset indicates that the deviation between the search-state output and the fixed-state output of the candidate transformation is higher than the average level of the same group; a non-positive structural difference offset indicates that the deviation of the bi-state output of the candidate transformation is not higher than the average level of the same group.

[0060] The dual-state consistent update layer then calculates the verification error increment. Specifically, the search-state verification error and the fixed-state verification error are averaged with equal weights to obtain the comprehensive verification error for the current search round; alternatively, the ratio can be configured according to task requirements, for example, 0.5 for the search-state verification error and 0.5 for the fixed-state verification error. The comprehensive verification error of the previous search round is subtracted from the comprehensive verification error of the current search round to obtain the verification error increment. For example, if the comprehensive verification error of the previous search round was 0.36 and the comprehensive verification error of the current search round is 0.31, then the verification error increment is -0.05, indicating a decrease in verification error; if the comprehensive verification error of the current search round is 0.39, then the verification error increment is 0.03, indicating an increase in verification error.

[0061] During continuous structural parameter correction, for candidate transformations with positive structural difference offsets, the two-state consistent update layer writes the structural difference offset into the negative update amount of the corresponding continuous structural parameter. The negative update amount can be obtained by multiplying the structural difference offset by the difference correction ratio, which can be between 0.001 and 0.05. For example, if the structural difference offset is 1.03 and the difference correction ratio is 0.01, then the negative update amount is 0.0103. For candidate transformations with non-positive structural difference offsets and negative verification error increments, the negative update amount corresponding to the structural difference offset is set to zero.

[0062] Subsequently, the bi-state consistent update layer writes the backward gradients corresponding to the search-state verification error and the fixed-state verification error to the same update position of the continuous structural parameters, and subtracts the negative update amount corresponding to the structural difference offset from the continuous structural parameters to obtain the corrected continuous structural parameters. For example, if the current continuous structural parameter of a candidate transformation is 0.581, the gradient update amount corresponding to the verification error is -0.020, and the negative update amount corresponding to the structural difference offset is 0.010, then 0.581 is first added to the gradient update amount to get 0.561, and then the negative update amount of 0.010 is subtracted to get 0.551, which is the corrected continuous structural parameter. If the structural difference offset of a candidate transformation is non-positive and the verification error increment is negative, then the negative update amount is set to zero, and the continuous structural parameters are only corrected according to the gradient update amount corresponding to the verification error.

[0063] For all candidate transformations under the same edge pair index, the two-state consistent update layer obtains the corrected continuous structure parameters item by item. If a corrected continuous structure parameter has a negative value, the negative value can be truncated to 0, and all continuous structure parameters under the same edge pair index are summed and normalized again to ensure that the set of continuous structure parameters continues to meet the proportional allocation requirements of the forward search. The corrected continuous structure parameters are backfilled into the corresponding search-state edges according to the candidate transformation type index, and the candidate transformation arrangement in the fixed-state edges is refreshed according to the numerical value. Finally, the edge pair index, search-state edges, fixed-state edges, corrected continuous structure parameters, candidate transformation arrangement, search-state verification error, and fixed-state verification error are written into the search update graph.

[0064] In this embodiment, S7 specifically includes: S71. The structural shaping layer reads the shaping edges, continuous structural parameters and candidate transformation arrangement relationships in the search update graph, and groups the shaping edges according to the same edge pair index; S72. Within each group of fixed-shape edges, filter the fixed-shape edges according to the numerical order of the continuous structural parameters, configure the fixed-shape edges with the first value as retained edges, and configure the remaining fixed-shape edges as trimmed edges. S73. Assemble the retained edges according to the structural search unit connection relationship in the initial search graph, and write the candidate transformation arrangement relationship corresponding to the retained edges into the corresponding structural search unit to form the target AI model structure. S74. Load training data onto the target AI model structure to perform finalized training, update the model parameters in the target AI model structure, and input the finalized target AI model structure into the validation data for performance verification. S75. When the performance verification result reaches the training objective, the target AI model structure after finalized training is output as the optimized AI model; when the performance verification result does not reach the training objective, the performance verification result is written back to the search update graph, and the finalized edge selection and target AI model structure assembly are re-executed.

[0065] In the specific implementation process, after reading the search update graph, the structure shaping layer first extracts the edge pair indices, shaped edges, continuous structure parameters, and candidate transformation arrangement relationships stored in the search update graph. The edge pair indices are used to distinguish the candidate connection ranges between different structure search units. Shaped edges under the same edge pair index connect structure search units with the same starting point and the same ending point. Therefore, the structure shaping layer groups the shaped edges according to the edge pair indices to avoid candidate transformations at different connection positions being sorted together.

[0066] Within each group of defined edge types, the structure defining layer reads the continuous structural parameters corresponding to the defined edge and arranges them from highest to lowest value. For example, if there are four defined edges under the same edge pair index, with corresponding continuous structural parameters of 0.52, 0.28, 0.15, and 0.05, the order would be edge 1, edge 2, edge 3, and edge 4. The number of edges retained can be determined based on the structural constraints of the target AI model; if the target AI model requires only one structural edge to be retained per edge pair index, then the defined edge with the highest continuous structural parameter value is configured as the retained edge; if the target AI model allows for multi-branch structures, then the first two edges or defined edges with a cumulative continuous structural parameter value of 0.8 or higher can be retained. The aforementioned 0.8 is only an implementation example and can be adjusted according to model size, inference latency, or training objectives.

[0067] After determining the edges to be retained, the structure shaping layer configures the unselected shape edges within the same group as clipping edges and removes the candidate transformation arrangement relationships corresponding to the clipping edges from the target AI model structure assembly process. The structure shaping layer then assembles the target AI model structure according to the structure search unit connection relationships in the initial search graph. Specifically, starting from the input structure search unit, it sequentially reads the retained edges under each edge pair index and attaches the retained edges between the corresponding starting and ending structure search units; then, it writes the candidate transformation arrangement relationships corresponding to the retained edges into the ending structure search unit, enabling the ending structure search unit to call the corresponding candidate transformations.

[0068] If multiple retained edges point to the same endpoint structural search unit, the input channels can be arranged according to the numerical order of the continuous structural parameters, and the outputs of multiple retained edges can be merged by addition, concatenation, or linear mapping; the specific merging method is determined based on the structural connection relationship in the initial search graph. After all edge pairs are assembled, the input structural search unit, intermediate structural search unit, and output structural search unit form a continuous connection path, and the target AI model structure is finalized.

[0069] After the target AI model structure is formed, training data is loaded to perform formalization training. For formalization training, the search state edges and continuous structure parameters are no longer updated; instead, only the model parameters corresponding to the candidate transformations retained in the target AI model structure are updated. Formalization training can use 50 to 200 training epochs, with a batch size of 32 or 64. The learning rate can start at 0.001 and decrease to 0.5 if the validation error does not decrease for five consecutive epochs. The above values ​​are only implementation examples; the actual number of training epochs and the learning rate can be adjusted according to the training data size and training objectives.

[0070] During training, after each batch of training data is input into the target AI model structure, the target AI model structure outputs prediction results. For classification tasks, cross-entropy error can be calculated; for regression tasks, mean squared error can be calculated; and for sequence tasks, errors can be calculated along time positions and averaged. Errors are updated and retained in the candidate transformations through backpropagation. After finalized training, validation data is input into the finalized target AI model structure for performance verification. The performance verification metrics are consistent with the performance verification requirements in the task state description set. For example, for classification tasks, accuracy, recall, or F1 score can be used; for regression tasks, mean squared error or mean absolute error can be used; and for time series prediction tasks, the mean of multi-step prediction errors can be used.

[0071] If the training objective requires a validation accuracy of at least 0.92, the structure shaping layer calculates the ratio of the number of correct samples to the total number of validation samples. For example, if there are 2000 validation samples and 1860 correct samples, the validation accuracy is 0.93, achieving the training objective. If the training objective requires a mean squared error of at least 0.05, the structure shaping layer subtracts the target value from the predicted value of each validation sample, squares the difference, sums the results, divides by the number of validation samples, obtains the mean squared error, and then compares it with 0.05.

[0072] When the performance verification result meets the training objective, the finalized target AI model structure is output as the optimized AI model, and the connection relationships of the structural search units, the retained edge numbers, the candidate transformation types, the model parameters, and the performance verification result are recorded in the target AI model structure. When the performance verification result does not meet the training objective, the structural finalization layer writes the performance verification result back to the search update graph. The written-back content includes the performance indicators that did not meet the training objective, the retained edge arrangement results under the corresponding edge pair index, the continuous structural parameter distribution, and the verification error record.

[0073] Subsequently, the structure shaping layer re-executes the shape-based edge selection and target AI model structure assembly. For example, the edge pair index that originally only retained one shape-based edge can be adjusted to retain the first two shape-based edges, or the pruning intensity of edges with continuous structural parameters at the beginning can be reduced, allowing shape-based edges with the second-highest continuous structural parameters and lower verification errors to enter the new target AI model structure. The reassembled target AI model structure then undergoes shape-based training and performance verification again until the performance verification result reaches the training objective or the configured maximum number of retries is reached. The maximum number of retries can be 3 to 5. If the training objective is not reached even after reaching the maximum number of retries, the target AI model structure with the best current performance can be output, and the unmet performance verification items can be recorded as a basis for rebuilding the initial search graph or adjusting the training objective.

[0074] Example 1: To verify the feasibility of this invention in practice, it was applied to the automatic construction task of a defect classification model in a visual inspection project for electronic components. This project requires classifying six types of defects in images of electronic component surfaces: scratches, indentations, stains, chipped corners, foreign objects, and normal defects. A total of 24,000 original samples were used, including 18,000 training images and 6,000 validation images, all with a uniform image size of 224×224 pixels. The training objectives were set as follows: validation accuracy no less than 0.94, F1 score no less than 0.92, inference latency per image no more than 18ms, and model parameter count no more than 5M.

[0075] In the specific implementation process, training data, validation data, and training objectives are first read and grouped into the same task index "T-IMG-CLS-01". Training data is divided according to image sample units, with each image and its corresponding category label forming a sample unit. Validation data is written into a verification attribution relationship for structural parameter updates and performance verification. The number of output categories, accuracy requirements, F1 score requirements, inference latency constraints, and model size constraints in the training objectives are grouped into the task objective group. The task sample group, task objective group, and validation data verification attribution relationship are then encapsulated in the same position according to the task index to form a task state description set.

[0076] Subsequently, an initial search graph is established based on the structural generation order of the target AI model. In this embodiment, the initial search graph includes 8 structural search units, corresponding sequentially to the stages of input feature processing, shallow feature extraction, mid-level feature transformation, deep feature transformation, and output mapping. Candidate connection positions are configured between adjacent structural search units, with a total of 13 candidate connection positions configured; each candidate connection position is configured with 5 types of candidate transformation relationships, including local feature transformation, extended feature transformation, compressed feature transformation, jump transition, and empty transformation. The structural search units, candidate connection positions, and candidate structural relationships are written into the search graph index "G-IMG-01" to form the initial search graph.

[0077] After inputting the task state description set and initial search graph into the improved DARTS model, the task state encoding layer first compresses the task state description set into task state codes. Specifically, the number of training samples, the number of validation samples, image size, number of categories, model parameter limits, inference latency limits, and performance verification requirements are incorporated into the task element bits. Numerical elements undergo scaling, and categorical elements undergo categorical mapping, forming a 64-dimensional task element vector. The task state encoding layer then uses 64×32 encoding mapping parameters to perform dimensional mapping and dimensional convergence on the task element vector, and adds the mapping results to the 32-dimensional encoding bias parameters item by item along the same dimension to obtain a 32-dimensional compressed task vector. Finally, mean subtraction and scale equalization are performed on the compressed task vector to obtain the task state code.

[0078] The dual-state edge construction layer reads candidate structural relationships from the initial search graph and groups those with the same starting and ending structural search units into the same edge pair index. For each edge pair index, five candidate transformations are created, and search-state and fixed-state edges are respectively established. Search-state edges are connected to the starting position of structural parameters and transformation parameters, while fixed-state edges are connected to the arrangement position of candidate transformations. Both search-state and fixed-state edges are connected to the same starting and ending structural search units, maintaining output position alignment to form a search-state-fixed-state consistent edge structure.

[0079] The structural parameter relaxation layer performs continuous processing on the structural parameters of the search-state edges. Taking an edge paired with an index as an example, the structural parameters corresponding to the five candidate transformations are 1.1, 0.6, 0.2, -0.3, and -0.8, respectively. The structural parameter relaxation layer selects the maximum value of 1.1 as the offset base, subtracts 1.1 from each structural parameter, obtaining 0, -0.5, -0.9, -1.4, and -1.9; then, it takes the exponent values ​​one by one and accumulates them, dividing each exponent value by the total exponent to obtain continuous structural parameters. The calculated continuous structural parameters are approximately 0.43, 0.26, 0.17, 0.11, and 0.06. The structural parameter relaxation layer fills the corresponding search-state edges with the above continuous structural parameters and sorts the fixed-state edges in descending order according to their numerical values, forming the candidate transformation arrangement relationship.

[0080] When the bi-state consistent update layer performs structure search, each search round first updates the transformation parameters of candidate transformations using training data, and then corrects the continuous structure parameters using validation data. In this embodiment, the number of search rounds is set to 60, and the batch size is set to 64. After the training data enters the update unit, the search-state edges perform weighted forward computation on the candidate transformation results according to the continuous structure parameters; the fixed-state edges perform fixed-state forward computation on the candidate transformations at the corresponding positions according to the candidate transformation arrangement. The cross-entropy error of the two types of forward results is calculated with the training target, and the backward gradient is propagated back to the transformation parameters of the same candidate transformation, completing the co-position update of transformation parameters in the search-state edges and fixed-state edges.

[0081] After the transformation parameters are updated, the verification data enters the same update unit. Taking a certain output position as an example, the verification output of the search-state edge is [3.2, 3.1, 1.5], and the verification output of the fixed-state edge is [2.0, 4.0, 1.0]. The bi-state consistent update layer subtracts the values ​​dimension by dimension to obtain [1.2, -0.9, 0.5]. Then, the differences in each dimension are squared and summed to obtain the bi-state structural difference amount of 2.50. The bi-state structural differences of all candidate transformations under the same edge index are 2.50, 0.80, 1.10, 1.60, and 0.95, respectively, with a mean of 1.39; the structural difference offset corresponding to the first candidate transformation is 1.11. If the difference correction ratio is 0.01, then the negative update amount of the continuous structural parameters corresponding to the first candidate transformation is 0.0111. The dual-state consistent update layer writes the back gradients and negative update amounts corresponding to the search state verification error and the fixed state verification error into the update amount of the continuous structure parameters, thereby obtaining the corrected continuous structure parameters. Based on the corrected continuous structure parameters, the candidate transformation arrangement relationship is refreshed to form a search update graph.

[0082] After the structure shaping layer reads the search update graph, it groups the shaped edges according to the same edge pair index and filters the shaped edges based on the continuous structure parameters. In this embodiment, each edge pair index retains the shaped edge with the highest continuous structure parameter value by default; for edge pair indices where the cumulative value of the first two continuous structure parameters is less than 0.65, the first two shaped edges are retained to avoid premature structure shrinkage. The retained shaped edges are assembled into the target AI model structure according to the structural search unit inheritance relationship in the initial search graph, and the pruned edges are not included in the target AI model structure.

[0083] After the target AI model structure was assembled, training data was loaded for finalized training. The finalized training epochs were set to 120, the batch size to 64, and the initial learning rate to 0.001. When the validation error did not decrease for five consecutive epochs, the learning rate was reduced to 0.5. After finalized training, 6000 validation images were input into the finalized target AI model structure for performance verification. The final optimized AI model had 4.6M parameters, an average inference latency per image of 15.8ms, a validation accuracy of 0.951, and an F1 score of 0.938, all meeting the training objectives.

[0084] To verify the effectiveness of the method of the present invention, a manually designed CNN model, a regular DARTS model and the method of the present invention were compared, and the results are shown in Table 1 below.

[0085] Table 1 Comparison of different training methods

[0086] As shown in Table 1, although the ordinary DARTS model can automatically search for the model structure, there is a significant deviation between the search-state structure and the finalized structure due to the use of continuous mixed edges in the search phase and discrete structure edges in the finalization phase, resulting in a substantial performance drop after finalization. The method of this invention constructs search-state and finalized edges simultaneously through a search-state-finalized consistent edge structure and incorporates the difference in the two-state structure into the continuous structure parameter correction process, thus continuously constraining the output deviation of the finalized edges during the structure search phase. Compared with the ordinary DARTS model, the method of this invention reduces the performance difference between the search-state and finalized states from 2.8 percentage points to 0.9 percentage points, while achieving better results in accuracy, F1 score, parameter count, and inference latency. This demonstrates that the method of this invention can obtain a more stable target AI model structure that is more suitable for finalized deployment during automated training.

[0087] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for automated training and optimization of AI models based on data analysis, characterized in that, Includes the following steps: S1. Obtain the training data, validation data, and training target corresponding to the target training task; aggregate the task elements of the training data and training target to form a task state description set. S2. Establish the initial search graph corresponding to the target training task, and configure the relationship between the structure search unit and the candidate structure in the initial search graph; S3. Input the task state description set and the initial search graph into the improved DARTS model. The task state encoding layer compresses the task state description set into task state encoding. S4. The dual-state edge construction layer constructs a search-state-fixed-state consistent edge structure based on the candidate structure relationship in the initial search graph, and pushes the task state code into the structural parameter configuration process of the search-state edge. S5. The structural parameter relaxation layer converts the structural parameters corresponding to the search state edge into continuous structural parameters, and configures the candidate transformation arrangement relationship for the fixed state edge according to the continuous structural parameters. S6. The bi-state consistent update layer updates the transformation parameters in the search state edge and the fixed state edge on the training data, calculates the validation error on the validation data, and corrects the continuous structure parameters by combining the bi-state structure difference between the output of the search state edge and the output of the fixed state edge, thus forming a search update graph. S7. The structure shaping layer filters the shaping edges based on the continuous structural parameters in the search update graph, assembles the retained shaping edges into the target AI model structure, and outputs the optimized AI model after shaping training and performance verification.

2. The method for automated training and optimization of AI models based on data analysis according to claim 1, characterized in that, S1 specifically includes: S11. Read the training data, validation data, and training target corresponding to the target training task, group the training data and validation data into the same task index, and record the task affiliation relationship between the training data, validation data, and training target. S12. Perform sample unit division and sample consolidation on the training data, and group the sample units under the same training objective according to the input consolidation relationship and the target consolidation relationship to form task sample groups. S13. Decompose the training objectives into target elements, and classify the target output type, target constraints and performance verification requirements in the training objectives into the corresponding task sample groups to form task target groups. S14. Encapsulate the task sample group and the task target group in the same position according to the task index, and write the verification attribution relationship of the verification data into the encapsulation result to form a task status description set.

3. The method for automated training and optimization of AI models based on data analysis according to claim 1, characterized in that, S2 specifically includes: S21. Read the task index and training target from the task state description set, split the target training task into multiple structure search units, and arrange the structure search units according to the structure generation order of the target AI model. S22. Configure candidate connection positions between adjacent structural search units, and establish a connection relationship between the candidate connection positions and the input and output ends of the corresponding structural search units. S23. According to the structural generation requirements corresponding to the training objective, configure candidate structural relationships in the candidate connection positions. The candidate structural relationships include candidate connection relationships and candidate transformation relationships. S24. Write the structural search units, candidate connection positions, and candidate structural relationships into the same search graph index to form the initial search graph corresponding to the target training task.

4. The method for automated training and optimization of AI models based on data analysis according to claim 1, characterized in that, S3 specifically includes: The improved DARTS model includes a task state encoding layer, a two-state edge construction layer, a structural parameter relaxation layer, a two-state consistent update layer, and a structural shaping layer. The task state encoding layer reads the task state description set according to the task index of the target training task, and assigns the training data elements, validation data elements and training target elements in the task state description set to the task element bits respectively. Perform numerical and categorical mapping on the task element bits to obtain the corresponding task element vectors, and then arrange the task element vectors in the same position according to the task index. The task state encoding layer configures encoding mapping parameters and encoding bias parameters according to the dimension of the task element vector and the target dimension of task state encoding. It calls the encoding mapping parameters to perform dimensional mapping and dimensional convergence on the task element vector after it is arranged in the same position. The mapping result is added to the encoding bias parameters item by item along the same dimension to obtain the compressed task vector. The mean subtraction and scale equalization are performed on the numerical values ​​of each dimension in the compressed task vector, and the vectors are arranged according to the task index of the target training task to obtain the task state code; The task state encoding is indexed and linked to the initial search graph, and then passed to the bi-state edge construction layer.

5. The method for automated training and optimization of AI models based on data analysis according to claim 1, characterized in that, S4 specifically includes: S41. The dual-state edge construction layer traverses the candidate structural relationships in the initial search graph, and classifies the candidate structural relationships with the same starting structural search unit and the same ending structural search unit into the same edge pair index, and arranges the candidate transformation types under the same edge pair index in order. S42. Under the same edge pair index, set up search state edges and fixed state edges for each candidate transformation type. Both search state edges and fixed state edges are connected between the same starting point structure search unit and the same ending point structure search unit. S43. Write the task status code into the starting position of the structure parameter of the search state edge, attach the transformation parameter corresponding to the candidate transformation to the search state edge, and align the output position of the search state edge with the end structure search unit. S44. Write the candidate transformation arrangement positions under the same side index into the fixed edge, and align the output position of the fixed edge with the end structure search unit. S45. Encapsulate the search-state edge, fixed-state edge, structural parameter starting position, candidate transformation arrangement position and output alignment position under the same edge index into a search-state-fixed-state consistent edge structure.

6. The method for automated training and optimization of AI models based on data analysis according to claim 1, characterized in that, S5 specifically includes: S51. The structural parameter relaxation layer reads the edge pair index along the search state-fixed state uniformized edge structure, locates the starting position of the structural parameter of each search state edge under the same edge pair index, and collects each structural parameter into a branch structural parameter group according to the order of candidate transformation types. S52. Select the structural parameter with the largest value in the branch structure parameter group as the offset reference, subtract the offset reference from each structural parameter in the branch structure parameter group to obtain the offset branch parameter group, and write the sequence number of the candidate transformation type into the offset branch parameter group simultaneously. S53. Take the exponent value of each offset branch parameter in the offset branch parameter group to obtain the exponent parameter group. Accumulate all the exponent values ​​in the exponent parameter group to obtain the total exponent under the same index. S54. Divide each index value in the index parameter group by the total index to obtain the continuous structure parameters corresponding to each search state edge, and fill the continuous structure parameters back to the search state edge with the same index according to the sequence number of the candidate transformation type. S55. The structural parameter relaxation layer sorts the fixed edges under the same edge pair index in descending order according to the numerical value of the continuous structural parameters, and writes the sorted fixed edges into the candidate transformation arrangement relationship in order. S56. Write the candidate transformation arrangement relationship into the candidate transformation arrangement position of the fixed state edge, and write the search state edge number, continuous structure parameter number and fixed state edge number under the same edge pair index into the same parameter inheritance table.

7. The method for automated training and optimization of AI models based on data analysis according to claim 1, characterized in that, S6 specifically includes: S61. The dual-state consistent update layer reads the edge pair index in the search state-fixed state consistent edge structure and groups the search state edge and fixed state edge corresponding to the same candidate transformation under the same edge pair index into the same update unit. S62. Push the training data into the update unit in batches. Perform weighted forward calculation on the candidate transformation results according to the continuous structure parameters of the search state edges. Perform fixed state forward calculation on the candidate transformations of the corresponding positions according to the candidate transformation arrangement relationship. S63. Calculate the training error between the forward result of the search-state edge, the forward result of the fixed-state edge and the training target respectively, and backpropagate the back gradients corresponding to the two types of training errors to the transformation parameters of the same candidate transformation. Perform in-situ update on the transformation parameters in the search-state edge and the fixed-state edge. S64. Push the verification data into the update unit after the transformation parameters have been updated to obtain the search state side verification output and the fixed state side verification output, and calculate the search state verification error and the fixed state verification error between the search state side verification output, the fixed state side verification output and the training target, respectively. S65. The dual-state consistent update layer calculates the dual-state structural difference between the search-state edge verification output and the fixed-state edge verification output. The back gradients corresponding to the search-state verification error and the fixed-state verification error, along with the dual-state structural difference, are written into the update amount of the continuous structural parameters to obtain the corrected continuous structural parameters. S66. Refresh the structural parameters of the search state edges according to the corrected continuous structural parameters, and rearrange the candidate transformation arrangement relationship in the fixed state edges to form a search update graph.

8. The method for automated training and optimization of AI models based on data analysis according to claim 7, characterized in that, The dual-state consistent update layer calculates the dual-state structural difference between the search-state edge verification output and the fixed-state edge verification output, and writes the back gradients corresponding to the search-state verification error and the fixed-state verification error, along with the dual-state structural difference, into the update of the continuous structure parameters. Specifically, this includes: Within the same update unit, output position alignment is performed on the search state edge verification output and the fixed state edge verification output, and the feature values ​​of the corresponding output positions are subtracted dimension by dimension to obtain the dual-state output difference; The differences in each dimension of the bi-state output difference are squared and accumulated along the feature dimension to obtain the bi-state structure difference of the corresponding candidate transformation. The average value of the bistate structural difference of all candidate transformations under the same index is calculated. The bistate structural difference of each candidate transformation is subtracted from the average value of the bistate structural difference to obtain the structural difference offset. Calculate the difference between the verification error of the current search round and the verification error of the previous search round to obtain the verification error increment; When the structural difference offset is positive, the structural difference offset is written into the negative update amount of the corresponding continuous structural parameter; when the structural difference offset is non-positive and the verification error increment is negative, the negative update amount corresponding to the structural difference offset is set to zero. The dual-state consistent update layer writes the inverse gradients corresponding to the search state verification error and the fixed state verification error into the corresponding update positions according to the continuous structural parameter numbers, and subtracts the negative update amount corresponding to the structural difference offset from the continuous structural parameters to obtain the corrected continuous structural parameters.

9. The method for automated training and optimization of AI models based on data analysis according to claim 1, characterized in that, Specifically, S7 includes: S71. The structural shaping layer reads the shaping edges, continuous structural parameters and candidate transformation arrangement relationships in the search update graph, and groups the shaping edges according to the same edge pair index. S72. Within each group of fixed-shape edges, filter the fixed-shape edges according to the numerical order of the continuous structural parameters, configure the fixed-shape edges with the first value as retained edges, and configure the remaining fixed-shape edges as trimmed edges. S73. Assemble the retained edges according to the structural search unit connection relationship in the initial search graph, and write the candidate transformation arrangement relationship corresponding to the retained edges into the corresponding structural search unit to form the target AI model structure. S74. Load training data onto the target AI model structure to perform finalized training, update the model parameters in the target AI model structure, and input the finalized target AI model structure into the validation data for performance verification. S75. When the performance verification result reaches the training objective, the target AI model structure after finalized training is output as the optimized AI model; when the performance verification result does not reach the training objective, the performance verification result is written back to the search update graph, and the finalized edge selection and target AI model structure assembly are re-executed.