A PCB area sample double-branch neural network training and parameter optimization method

CN122390006BActive Publication Date: 2026-10-27FUJIAN FUQIANG PRECISION PRINTED CIRCUIT BOARD CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610849819.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-12
Publication Date
2026-10-27
Estimated Expiration
2046-06-12

Smart Images

  • Figure CN122390006B_ABST
    Figure CN122390006B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of neural network modeling and parameter optimization, and discloses a PCB region sample double-branch neural network training and parameter optimization method, comprising the following steps: step 1, obtaining a PCB region level training sample and generating a region modeling unit; step 2, generating double-source sample representation data; step 3, constructing a double-branch neural network; step 4, generating fusion features and positive class determination probability values; step 5, constructing a total objective function and updating parameters; step 6, updating a penalty coefficient, a fusion weight and a determination threshold based on a verification set; and step 7, re-optimizing a class parameter subset based on artificial review results. The present application realizes the classification training of PCB region samples and the continuous optimization of neural network parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of neural network modeling and parameter optimization technology, specifically relating to a method for training and optimizing parameters of a dual-branch neural network for PCB area samples. Background Technology

[0002] In region-level decision-making tasks based on neural networks, training samples typically contain different categories of region objects, which differ in prior structure, observation structure, sample distribution, and decision boundaries. If a uniform input representation, feature fusion method, decision head, loss constraint, and decision threshold are applied to all regions during training, feature interference between different regions can easily occur. This can lead to insufficient parameter updates for some region categories and a continuous accumulation of misclassifications for others, affecting the convergence stability and consistency of categorical decisions during neural network training.

[0003] In PCB area sample determination scenarios, samples from different areas such as pads, lines, and characters typically possess different layout structure features, observed features, and determination boundaries. If all types of PCB area samples are uniformly input into the same neural network and trained using uniform fusion weights and a uniform determination head, it becomes difficult to distinguish the contribution ratios of prior structural data and observed structural data in different category areas, and it is also difficult to constrain the consistency relationship between the two feature branches, easily leading to overlapping feature representations between categories.

[0004] Existing neural network modeling methods typically improve overall judgment results by increasing the number of network layers, expanding the sample size, or adjusting the number of training epochs. However, these methods are mostly applied uniformly to all samples and lack a mechanism for organizing the encoding branches, fusion weights, decision heads, and feature centers according to the category condition labels. In addition, after the model is trained, it usually needs to be corrected by combining validation set samples and manual review results. Existing methods for fine-tuning overall parameters are prone to perturbing the parameters of converged categories and are difficult to adjust the missed judgment penalty, misjudgment penalty, fusion weights, and decision thresholds separately for high-error categories. Summary of the Invention

[0005] This invention provides a method for training and optimizing parameters of a dual-branch neural network for PCB area samples, thereby solving the technical problems in the background art.

[0006] This invention provides a method for training and optimizing parameters of a dual-branch neural network for PCB region samples, comprising the following steps:

[0007] Step 1: Obtain the prior structure data, observation structure data, category mapping table and decision labeling results of the PCB area-level training samples. Generate a set of area modeling units based on the category mapping table, and determine the category condition label and decision labeling results of each area modeling unit.

[0008] Step 2: Generate dual-source sample representation data for each regional modeling unit, and bind them with category condition labels and judgment annotation results to obtain regional neural network training data items;

[0009] Step 3: Construct a dual-branch neural network containing a prior structure encoding branch, an observation structure encoding branch, a category condition fusion layer, and a category-specific decision head; and establish the correspondence between category condition labels and fusion weights, category-specific decision heads, and category feature centers.

[0010] Step 4: Input the dual-source sample representation data into the two coding branches to obtain the prior structural features and observed structural features. Call the fusion weight according to the category condition label to obtain the fusion features, and obtain the positive class determination probability value through the corresponding category-specific determination head.

[0011] Step 5: Based on the positive class determination probability value, determination labeling result, two-branch features, fusion features and category feature centers, construct the overall objective function containing weighted determination loss, two-branch consistency loss and category aggregation loss, and backpropagate to update the neural network parameter set and category feature centers;

[0012] Step 6: Based on the validation set samples, statistically analyze the positive class false negative rate, negative class false negative rate, and two-branch difference statistics according to the category condition. Update the corresponding penalty coefficient, fusion weight, and decision threshold. When the convergence condition is met, the final parameters are obtained.

[0013] Step 7: Based on the results of manual review, an incremental sample set is formed. The category parameter subset is extracted according to the category condition. The non-target parameters are frozen and then optimized and written back to obtain the updated final neural network parameter set.

[0014] The beneficial effects of this invention are as follows: This invention uses a region modeling unit as the basic processing unit, integrating category condition labels throughout the entire process of dual-source sample representation data generation, dual-branch feature encoding, condition fusion, category-specific judgment, loss construction, verification correction, and incremental re-optimization. This ensures that PCB region samples corresponding to different category condition labels no longer share a single parameter path, but instead complete conditional modeling and parameter optimization separately under a unified category index. By introducing weighted judgment loss, dual-branch consistency loss, and category aggregation loss, and combining a categorical update mechanism with positive class missed judgment penalty coefficient, negative class misjudgment penalty coefficient, fusion weight, and judgment threshold, feature interference between different category condition labels can be reduced, improving the convergence consistency of parameters within a category. Furthermore, by combining manual review results with local re-optimization of the category parameter subset, categorical errors can be continuously corrected while maintaining the overall parameter structure stability, resulting in a more stable categorical parameter state and region-level judgment capability in the updated final neural network parameter set. Attached Figure Description

[0015] Figure 1 This is a flowchart of a method for training and optimizing parameters of a dual-branch neural network for PCB area samples according to the present invention;

[0016] Figure 2 This is a flowchart illustrating the construction of a category-conditional dual-branch neural network and the generation of positive class determination probability values ​​and category feature centers according to the present invention. Detailed Implementation

[0017] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, features described in some examples may be combined in other examples.

[0018] It should be noted that, unless otherwise defined, the technical or scientific terms used in one or more embodiments of the present invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in one or more embodiments of the present invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0019] like Figure 1 As shown, a method for training and optimizing parameters of a dual-branch neural network for PCB area samples includes the following steps:

[0020] Step 1: Obtain the prior structure data, observation structure data, category mapping table and decision labeling results of the PCB area-level training samples. Generate a set of area modeling units based on the category mapping table, and determine the category condition label and decision labeling results of each area modeling unit.

[0021] Step 2: Generate dual-source sample representation data for each regional modeling unit, and bind them with category condition labels and judgment annotation results to obtain regional neural network training data items;

[0022] Step 3: Construct a dual-branch neural network containing a prior structure encoding branch, an observation structure encoding branch, a category condition fusion layer, and a category-specific decision head; and establish the correspondence between category condition labels and fusion weights, category-specific decision heads, and category feature centers.

[0023] Step 4: Input the dual-source sample representation data into the two coding branches to obtain the prior structural features and observed structural features. Call the fusion weight according to the category condition label to obtain the fusion features, and obtain the positive class determination probability value through the corresponding category-specific determination head.

[0024] Step 5: Based on the positive class determination probability value, determination labeling result, two-branch features, fusion features and category feature centers, construct the overall objective function containing weighted determination loss, two-branch consistency loss and category aggregation loss, and backpropagate to update the neural network parameter set and category feature centers;

[0025] Step 6: Based on the validation set samples, statistically analyze the positive class false negative rate, negative class false negative rate, and two-branch difference statistics according to the category condition. Update the corresponding penalty coefficient, fusion weight, and decision threshold. When the convergence condition is met, the final parameters are obtained.

[0026] Step 7: Based on the results of manual review, an incremental sample set is formed. The category parameter subset is extracted according to the category condition. The non-target parameters are frozen and then optimized and written back to obtain the updated final neural network parameter set.

[0027] In one embodiment of the present invention, prior structural data, observed structural data, a category mapping table, and decision annotation results corresponding to the PCB area-level training samples are first obtained. The prior structural data represents the structural relationships on the design side of the PCB area samples and can be obtained by parsing PCB design files. The observed structural data represents the structural relationships on the measured side of the PCB area samples and can be obtained by converting measured data collected from PCBs. The category mapping table is rule data used to constrain the attribution relationships of area modeling units and determine the relationships based on category condition identifiers. The decision annotation results are supervisory label data corresponding to the PCB area-level training samples. In the PCB area sample decision scenario, a positive class decision annotation result indicates that the corresponding area modeling unit has an abnormal decision label, and a negative class decision annotation result indicates that the corresponding area modeling unit does not have an abnormal decision label.

[0028] Sample association fields are extracted from prior structure data, observed structure data, category mapping tables, and decision labeling results. These sample association fields are data items used to confirm that data from different sources belong to the same PCB region-level training sample. The consistency of the sample association fields corresponding to the prior structure data, observed structure data, category mapping tables, and decision labeling results is compared. If the sample association fields are consistent, they are associated and encapsulated to obtain training sample units. These training sample units are unified neural network training objects formed after consistency verification of the prior structure data, observed structure data, category mapping tables, and decision labeling results.

[0029] After obtaining the training sample units, the prior structural data in the training sample units is parsed to obtain structural records. These structural records are structured records extracted from the prior structural data that characterize the local structural organization of PCB region samples; their content at least reflects the attribution basis of region objects. Simultaneously, the category mapping table is parsed to obtain category mapping rules. These category mapping rules are a set of rules used to constrain the merging relationships of structural records and the relationship determined by category condition identifiers.

[0030] Subsequently, structural records belonging to the same category of mapping rules are grouped into the same regional modeling unit, while structural records belonging to different categories of mapping rules are divided into different regional modeling units, resulting in a set of regional modeling units. These regional modeling units are the basic data units for subsequent dual-source sample representation data generation, category-conditional dual-branch neural network construction, overall objective function training, and parameter update processing. In other words, this embodiment does not directly use the entire PCB as the sole training object, but first establishes a regional modeling unit-level data organization structure within the PCB regional training samples, enabling each subsequent regional modeling unit to respectively bear category-conditional constraints and supervisory constraints.

[0031] After the set of regional modeling units is determined, category mapping rules are matched to each regional modeling unit in the set. When multiple category mapping rules are matched for the same regional modeling unit, the category mapping rule with the highest priority is retained according to the preset priority in the category mapping table, and the category condition identifier corresponding to this category mapping rule is determined as the unique category condition identifier for that regional modeling unit. The category condition identifier is a unified index marker shared by the subsequent category condition fusion layer, category-specific decision head, category feature center, and parameter update process. Through this process, each regional modeling unit establishes a fixed correspondence with a unique category condition identifier, so that the subsequent neural network training, validation, and incremental update processes can perform conditional modeling around the same category condition identifier, rather than using a uniform processing method for all regional modeling units.

[0032] After the category condition identifier is determined, the judgment labeling results are aggregated to the corresponding regional modeling units based on the regional modeling unit identifiers in the regional modeling unit set. When multiple judgment labeling results correspond to the same regional modeling unit, these results are uniformly merged. When positive judgment labeling results exist among the multiple results, the judgment labeling results for that regional modeling unit are determined as positive. When all judgment labeling results are negative, the judgment labeling results for that regional modeling unit are determined as negative. If no judgment labeling results are aggregated for a particular regional modeling unit, its judgment labeling results are determined as negative.

[0033] After the above processing, the PCB region-level training samples are organized into a region-level neural network training data structure with region modeling units as the basic units, category condition labels as the unified condition index, and decision annotation results as the supervision basis. This region-level neural network training data structure enables subsequent category-conditional dual-branch neural networks to simultaneously read dual-source sample representation data, category condition labels, and decision annotation results under the same region modeling unit object, reducing ambiguity in the correspondence between region objects, category objects, and supervision objects, and providing a unified data index foundation for subsequent category-conditional dual-branch neural network construction, overall objective function training, and categorical parameter updates.

[0034] In one embodiment of the present invention, after determining the set of region modeling units for PCB region-level training samples and the category condition identifiers, dual-source sample representation data corresponding to each region modeling unit is further generated based on the set of region modeling units. This part organizes the prior structure fields in the prior structure data and the observation structure fields in the observation structure data into a unified data object around the already determined set of region modeling units, so that the subsequent category-conditional dual-branch neural network can perform consistent data reading, feature encoding, and conditional modeling processing on different region modeling units.

[0035] Specifically, based on the identifiers of each region modeling unit in the region modeling unit set, the prior structure fields corresponding to each region modeling unit are read from the prior structure data, and the observation structure fields corresponding to each region modeling unit are read from the observation structure data. The prior structure fields refer to data fields used to characterize the design-side structural relationships of the corresponding region modeling unit, read from the prior structure data of the PCB region-level training samples based on the region modeling unit identifier; the observation structure fields refer to data fields used to characterize the measured-side structural relationships of the corresponding region modeling unit, read from the observation structure data based on the same region modeling unit identifier. Through this processing, a fixed correspondence is established between the prior structure fields and the observation structure fields under the same region modeling unit object, ensuring a unified basis for the subsequent dual-source sample representation data.

[0036] After obtaining the prior structure fields and observation structure fields corresponding to each regional modeling unit, the prior structure fields and observation structure fields are aligned according to a preset field order. Then, the aligned prior structure fields and observation structure fields are dimensionally shaped and their order is fixed according to the neural network input specifications. The preset field order refers to the fixed constraint on the arrangement order of fields from different sources within the dual-source sample representation data, ensuring that the position of the same field remains consistent across different regional modeling units. The neural network input specifications refer to the uniform limitations on field dimensions, arrangement methods, and data length. After field alignment, dimensional shaping, and order fixing, the data fields corresponding to each regional modeling unit maintain structural consistency, thereby avoiding input ambiguity caused by different field orders or inconsistent dimensions during subsequent neural network training.

[0037] Furthermore, the shaped prior structure field is determined as the prior structure representation data, and the shaped observation structure field is determined as the observation structure representation data. The prior structure representation data and the observation structure representation data are then combined into dual-source sample representation data. This dual-source sample representation data is the neural network input data formed for the same region modeling unit, and it simultaneously contains both prior structure representation data and observation structure representation data, used to input the prior structure encoding branch and the observation structure encoding branch, respectively.

[0038] Subsequently, based on the regional modeling unit identifiers in the regional modeling unit set, the dual-source sample representation data, category condition identifiers, and decision annotation results corresponding to each regional modeling unit are bound one by one to obtain the regional-level neural network training data item corresponding to each regional modeling unit. The regional-level neural network training data item refers to a unified training data item formed for the same regional modeling unit, using dual-source sample representation data as input, category condition identifiers as condition indices, and decision annotation results as supervision criteria. Since the binding process always uses the same regional modeling unit identifier as the basis, a one-to-one correspondence is maintained between the dual-source sample representation data, category condition identifiers, and decision annotation results, preventing data overlap between different regional modeling units.

[0039] After the above processing, the PCB region-level training samples are further organized into a region-level neural network training structure with region modeling units as basic units, dual-source sample representation data as input carriers, category condition labels as conditional constraints, and decision labeling results as supervision. This region-level neural network training structure enables subsequent category-conditional dual-branch neural networks to synchronously read prior structure representation data and observed structure representation data around the same region modeling unit object, and perform feature encoding, conditional fusion, overall objective function training, and parameter updates under unified category condition label constraints, thereby ensuring the consistency of data organization relationships, condition index relationships, and supervision correspondences during neural network training and parameter optimization.

[0040] In one embodiment of the present invention, such as Figure 2 After obtaining the dual-source sample representation data, category condition labels, and decision annotation results corresponding to each regional modeling unit, a category-conditional dual-branch neural network is further constructed based on the dual-source sample representation data and category condition labels, yielding the positive class decision probability value, the initial neural network parameter set, and the initial category feature center. The category-conditional dual-branch neural network includes a prior structure encoding branch, an observation structure encoding branch, a category conditional fusion layer, and a category-specific decision head. Specifically, the category-conditional dual-branch neural network is used to perform parallel feature encoding, conditional feature fusion, and categorical output mapping on the prior structure representation data and observation structure representation data around the same regional modeling unit object. Through this network structure, regional modeling units under different category condition labels, after completing basic feature extraction, no longer share completely identical fusion and output paths, but instead enter a conditional fusion and specific output process corresponding to the category condition label.

[0041] Furthermore, the prior structure encoding branch is a neural network branch that encodes the prior structure representation data in the dual-source sample representation data. It employs a deep neural network structure consisting of convolutional layers, normalization layers, nonlinear activation layers, pooling layers, and fully connected layers, or a residual neural network structure, to extract prior structure features representing the design-side structural attributes of the current region modeling unit from the prior structure representation data. The observation structure encoding branch is a neural network branch that encodes the observation structure representation data in the dual-source sample representation data. It employs a deep neural network structure consisting of convolutional layers, normalization layers, nonlinear activation layers, pooling layers, and fully connected layers, or a residual neural network structure, to extract observation structure features representing the measured-side structural attributes of the current region modeling unit from the observation structure representation data. Since the two encoding branches process the dual-source sample representation data corresponding to the same region modeling unit, the obtained prior structure features and observation structure features are consistent across the region modeling unit object and can serve as common inputs for subsequent category conditional fusion layers.

[0042] After obtaining the prior structural features and observed structural features, the corresponding fusion weights are invoked based on the category condition identifier to conditionally fuse the two types of features. The category condition fusion layer employs a feature-position-based weighted fusion structure. Specifically, the feature value at each feature position in the prior structural features is multiplied by the corresponding fusion weight value to obtain the prior structural feature contribution; the feature value at each feature position in the observed structural features is multiplied by the corresponding residual weight value to obtain the observed structural feature contribution, where the residual weight value is a value determined by subtracting the corresponding fusion weight value from a given value; the prior structural feature contribution and the observed structural feature contribution are then summarized at the same feature positions to obtain the fused feature. Through this process, regional modeling units under different category condition identifiers can adopt different feature fusion ratios, thus making the fused feature no longer a unified comprehensive representation formed for all regional modeling units, but a categorical feature representation constrained by the category condition identifier.

[0043] After obtaining the fused features, the corresponding category-specific decision head is invoked based on the category condition identifier to determine the fused features and perform probability compression processing to obtain a positive class determination probability value. The category-specific decision head uses a category-specific output branch composed of a fully connected layer, a normalization layer, and a probability compression layer, or a category-specific output branch composed of a multilayer perceptron. Its function is to map the fused features to the positive class determination probability value of the current region modeling unit under the corresponding category condition identifier. Thus, region modeling units under different category condition identifiers can complete probability mapping along their respective corresponding output paths within a unified network framework, instead of relying on a single path to perform a unified output for all region modeling units.

[0044] Simultaneously, features are merged and fused according to category condition identifiers. The merged features are summed item by item, and the summation result is divided by the number of modeling units in the corresponding region to obtain the initial category feature centers. These initial category feature centers represent the initial category centers of the fused features under the corresponding category condition identifiers and subsequently participate in the construction of category aggregation loss and parameter update processing. Through this process, the category condition identifiers not only affect the conditional fusion process of prior structural features and observed structural features but also further affect the merging and formation process of category centers, thereby enabling fused features under the same category condition identifier to establish stable central references under a unified category index.

[0045] Through the above processing, a stable correspondence is established between the dual-source sample representation data, category condition labels, and decision labeling results within a unified neural network framework. The category condition labels simultaneously constrain feature encoding, condition fusion, dedicated output, and category center merging, enabling subsequent construction of the overall objective function, verification and correction, and category parameter subset updates to be executed continuously along the same category index link.

[0046] In one embodiment of the present invention, after obtaining the positive class determination probability value, determination labeling result, prior structural features, observation structural features, fusion features, initial neural network parameter set, and initial category feature center for each region modeling unit in the aforementioned steps, a general objective function is further constructed based on the positive class determination probability value, determination labeling result, prior structural features, observation structural features, fusion features, and category feature center, and the neural network parameter set and category feature center are updated according to the general objective function. The key point of this part is to unify the positive class determination probability value, dual-branch feature expression, and category feature center into the same training objective, so that the update process of the neural network parameter set is simultaneously restricted by the determination constraint, dual-branch consistency constraint, and category aggregation constraint.

[0047] Specifically, the weighted decision loss satisfies: ,in, Indicates the weighted loss assessment. This represents the set of indices consisting of all region modeling units within the current training batch. Indicates the index of the region modeling unit. Represents the region modeling unit Corresponding category condition identifier, Represents the region modeling unit The corresponding judgment and annotation results, A value of 1 indicates the positive class determination labeling result. A value of 0 indicates a negative class labeling result. Represents the region modeling unit The corresponding positive class probability value, Category condition identifier The corresponding penalty coefficient for missed positive cases, Category condition identifier The corresponding negative class misjudgment penalty coefficient, This indicates a preset minimum positive number, used to avoid inputting zero values ​​in logarithmic operations.

[0048] As shown in the formula above, when the region modeling unit corresponds to a positive class determination label, the loss term is determined by the positive class determination probability value and the positive class misclassification penalty coefficient. When the region modeling unit corresponds to a negative class determination label, the loss term is determined by the negative class determination probability value minus the positive class determination probability value and the negative class misclassification penalty coefficient. Through this processing, the positive class misclassification constraint strength and the negative class misclassification constraint strength under different category condition labels are introduced into the same determination loss system.

[0049] After the weighted decision loss is constructed, a dual-branch consistency loss is further constructed based on prior structural features and observed structural features. The dual-branch consistency loss satisfies the following: ,in, This indicates the consistency loss between two branches. This represents the number of feature dimensions for prior structural features and observed structural features. Indicates the feature location index. Represents the region modeling unit The corresponding prior structural features are in the first... Feature values ​​at each feature location Represents the region modeling unit The corresponding observed structural features are in the first The loss is used to constrain the differences between the prior structural features and observed structural features of the same region modeling unit at the same feature location, ensuring that the feature representations of the two encoding branches remain consistent.

[0050] Subsequently, a category aggregation loss is constructed based on the fused features and category feature centers, and the category aggregation loss satisfies: ,in, Represents the category aggregation loss. Represents the region modeling unit The corresponding fusion feature is in the first Feature values ​​at each feature location Category condition identifier The corresponding category feature center is at the th The center value at each feature location. This loss is used to constrain the fused features under the same category condition label to aggregate towards the corresponding category feature center, so that the distribution of fused features within the category remains relatively stable.

[0051] After constructing the above three types of losses, the weighted decision loss, the two-branch consistency loss, and the category aggregation loss are summed to obtain the overall objective function, which satisfies: ,in, This represents the overall objective function, which integrates the region modeling unit-level decision error, dual-branch feature differences, and category center aggregation relationships into the same training constraint system. This ensures that the update of the neural network parameter set no longer depends solely on a single decision result, but is simultaneously subject to multiple training constraints under the same category condition label index.

[0052] After the overall objective function is constructed, the neural network parameter set is updated via backpropagation based on the overall objective function. The update of the neural network parameter set satisfies the following: ,in, Indicates the first The set of neural network parameters before the next training update Indicates the first The set of neural network parameters updated after each training iteration. This indicates the preset learning rate. Describe the overall objective function For neural network parameter set The gradient of the neural network. The set of neural network parameters includes prior structure encoding branch parameters, observation structure encoding branch parameters, class conditional fusion layer parameters, and class-specific decision head parameters.

[0053] After updating the neural network parameter set, the merged and updated features are further grouped according to the category condition labels, and the category feature centers are updated. For any category condition label... The update of the category feature center satisfies: ,in, Category condition identifier The corresponding updated category feature centers, This indicates that the category condition identifier in the current training batch is... The set of regional modeling unit indexes Represents a set The number of regional modeling units in the data. Represents the region modeling unit In the The fused features are obtained after the training update. If If the value is 0, the category condition identifier is preserved. The corresponding category feature centers remain unchanged.

[0054] After the above processing, the positive class determination probability value, determination labeling result, prior structural features, observed structural features, fusion features, and initial class feature centers are uniformly organized into the same training objective system, and further transformed into an updated neural network parameter set and updated class feature centers. Therefore, the training phase no longer focuses on correcting the output results of a single path, but instead simultaneously performs training and updates at three levels: determination constraints, dual-branch consistency constraints, and class center aggregation constraints, all centered around the unified class condition label. This ensures that the subsequent adjustments to the positive class misclassification penalty coefficient, negative class misclassification penalty coefficient, fusion weights, and determination thresholds are based on a more stable parameter foundation and a more clearly defined class center foundation.

[0055] In one embodiment of the present invention, after the aforementioned steps have completed the construction of the overall objective function and updated the neural network parameter set and category feature centers, a categorical sample enhancement mechanism for high-error region modeling units is further introduced during the training phase. This part of the processing does not change the composition of the aforementioned overall objective function, nor does it change the existing meanings of the category condition identifier, weighted decision loss, neural network parameter set, and category feature centers. Instead, based on the weighted decision loss corresponding to each region modeling unit obtained in the previous training round, it continues to refine the error distribution according to the category condition identifier and feeds the statistical results back into the training batch organization process of the next training round. Through this processing, the categorical error information formed in the previous training round is no longer merely retained as the training result of the current round, but is further transformed into the basis for organizing subsequent enhanced training batches, enabling the training process to strengthen the high-error region modeling units.

[0056] Specifically, firstly, the weighted decision loss corresponding to each regional modeling unit is calculated according to the category condition identifier. Then, the weighted decision losses corresponding to the same category condition identifier are summed and divided by the number of corresponding regional modeling units to obtain the average decision loss corresponding to each category condition identifier. The average decision loss referred to here is the reference loss level obtained after equalizing the weighted decision losses calculated for each regional modeling unit under the same category condition identifier constraint within the category. Through this processing, regional modeling units under different category condition identifiers are no longer directly compared in the same error scale, but instead each form a corresponding average decision loss within its own category, thereby avoiding error judgment bias caused by differences in sample distribution between different category condition identifiers.

[0057] After obtaining the average decision loss corresponding to each category condition label, the weighted decision loss corresponding to each region modeling unit is further compared with the average decision loss corresponding to its category condition label. When the weighted decision loss corresponding to a certain region modeling unit is higher than the average decision loss corresponding to its category condition label, the region modeling unit is identified as a high-error region modeling unit. The high-error region modeling unit is not a new object independent of the region modeling unit set, but rather an existing region modeling unit with the added judgment attribute that its error level under the current training state is higher than the average of the same category. In other words, the determination of high-error region modeling units is still based on the existing region modeling unit labels, category condition labels, and weighted decision losses, without introducing new region division rules or changing the one-to-one correspondence between the aforementioned dual-source sample representation data, decision labeling results, and category condition labels. Through this comparison process, the training phase can identify region modeling units that are currently more difficult to converge and have more obvious constraint biases within the category, and distinguish them from ordinary region modeling units.

[0058] After the high-error region modeling units are determined, they are added to the augmented training batch according to the category conditional identifier. The augmented training batch refers to the training batch used as input to the category-conditional dual-branch neural network in the next training round, which includes high-error region modeling units selected based on the category error statistics. This process does not involve unrestricted repeated extraction of the same region modeling units, but rather, while maintaining the distribution of category conditional identifiers and the traceability of region modeling unit identifiers, it prioritizes the high-error region modeling units as the focus of training in the next training round. Since the high-error region modeling units have already undergone selection based on category conditional identifiers in the previous step, the adjustment of the training batch here still maintains category constraints and will not deviate from the existing category-conditional training framework to form a new training system independently.

[0059] Furthermore, after the augmented training batch is formed, the next training round continues to use the previously established class-conditional dual-branch neural network, overall objective function, and neural network parameter set update method for training. The difference is that the region modeling units entering the augmented training batch at this time can more effectively reflect the regions that have not yet fully converged in the previous training round. In this way, the weighted decision loss output from the previous training round not only participates in the loss calculation of the current round, but also further participates in the sample organization and training resource allocation of the next round, forming a continuous data flow relationship from weighted decision loss to high-error region modeling unit identification, and then to the organization of augmented training batches.

[0060] After the above processing, an error feedback reinforcement chain organized by category condition labels is formed during the training phase. The weighted decision loss is first transformed into the intra-category average decision loss, and then high-error region modeling units are selected and used as the basis for organizing the reinforcement training batch in the next training round. This allows the neural network parameter set to be continuously updated around the error concentration region, improving intra-category convergence consistency and providing a more stable training foundation for subsequent validation correction and category parameter subset updates.

[0061] In one embodiment of the present invention, after the aforementioned steps have completed the update of the neural network parameter set and category feature centers based on dual-source sample representation data, category conditional identifiers, and the overall objective function, validation set samples are further introduced to perform categorical validation updates on the current training results. This part of the processing does not change the previously determined method for generating the region modeling unit set, the dual-source sample representation data generation method, or the categorical conditional dual-branch neural network forward processing method. Instead, while maintaining the above processing chain unchanged, validation errors and dual-branch differences are statistically analyzed for different category conditional identifiers, and the statistical results are written back to the positive class missed judgment penalty coefficient, the negative class misjudgment penalty coefficient, the fusion weight, and the decision threshold. This ensures that the subsequently obtained neural network parameter set and decision threshold not only reflect the loss convergence state during the training phase but also further reflect the actual deviation of each category conditional identifier during the validation phase.

[0062] Specifically, firstly, a validation set sample is obtained, and the processes described above regarding the determination of the region modeling unit set and the generation of dual-source sample representation data are repeated on the validation set sample to obtain the region-level neural network training data items corresponding to each region modeling unit in the validation set sample. Subsequently, the region-level neural network training data items are input into the category-conditional dual-branch neural network corresponding to the current neural network parameter set to obtain the positive class determination probability value corresponding to each region modeling unit. Since the validation stage still uses the category condition identifier, fusion weight calling method, and category-specific determination header calling method determined above, the positive class determination probability value obtained in the validation stage is consistent with the positive class determination probability value obtained in the training stage in terms of object meaning; it only serves as a validation statistical input in the current step.

[0063] Next, the positive class determination probability value corresponding to each regional modeling unit is compared with the determination threshold corresponding to its category condition identifier. When the positive class determination probability value is greater than or equal to the determination threshold, the model determination result of the regional modeling unit is determined to be positive; when the positive class determination probability value is less than the determination threshold, the model determination result of the regional modeling unit is determined to be negative.

[0064] After obtaining the model's judgment results, the positive class false negative rate and negative class false positive rate are further calculated according to the category condition labels. For a region modeling unit under a certain category condition label, if the judgment label result is positive and the model judgment result is negative, the region modeling unit is counted in the positive class false negative number; if the judgment label result is negative and the model judgment result is positive, the region modeling unit is counted in the negative class false positive number. After completing the statistical analysis, the positive class false negative number is correlated with the total number of region modeling units with positive judgment labels to obtain the positive class false negative rate; the negative class false positive number is correlated with the total number of region modeling units with negative judgment labels to obtain the negative class false positive rate. When the total number of region modeling units with positive judgment labels is zero, the positive class false negative rate is set to zero; when the total number of region modeling units with negative judgment labels is zero, the negative class false positive rate is set to zero. Through this process, the judgment deviation under different category conditions is quantified into categorical statistical results that can be directly used for parameter correction, thus avoiding the use of the same error description method for all regional modeling units and thus masking the differences between categories.

[0065] After calculating the positive class false negative rate and the negative class false positive rate, the bi-branch difference statistic is further calculated according to the category condition identifier. The bi-branch difference statistic refers to the average degree of difference between the prior structural features and the observed structural features under the same category condition identifier. Specifically, for each region modeling unit under the same category condition identifier, the difference between the prior structural features and the observed structural features at the same feature position is calculated item by item. The absolute values ​​of each difference are taken and summed to obtain the bi-branch difference quantity for each region modeling unit. Then, the bi-branch difference quantities of all region modeling units under the same category condition identifier are summarized and divided by the number of corresponding region modeling units to obtain the bi-branch difference statistic corresponding to that category condition identifier. When the number of corresponding region modeling units is zero, the bi-branch difference statistic is set to zero. Since the bi-branch difference statistic is directly based on the prior structural features and observed structural features obtained above, its statistical results can directly reflect the consistency of the bi-branch feature expressions under the same category condition identifier.

[0066] After obtaining the positive class false negative rate, negative class false negative rate, and dual-branch difference statistics, the positive class false negative penalty coefficient, negative class false negative penalty coefficient, fusion weight, and decision threshold are further updated. For each category condition label, the positive class false negative rate is multiplied by the update rate of the positive class false negative penalty coefficient, and the product is added to the original positive class false negative penalty coefficient to obtain the intermediate update result of the positive class false negative penalty coefficient; the negative class false negative rate is multiplied by the update rate of the negative class false negative penalty coefficient, and the product is added to the original negative class false negative penalty coefficient to obtain the intermediate update result of the negative class false negative penalty coefficient; the dual-branch difference statistics are multiplied by the update rate of the fusion weight, and the product is added to the original fusion weight to obtain the intermediate update result of the fusion weight; the difference between the negative class false negative rate and the positive class false negative rate is multiplied by the update rate of the decision threshold, and the product is added to the original decision threshold to obtain the intermediate update result of the decision threshold.

[0067] Subsequently, the aforementioned intermediate update results are subjected to upper and lower bound truncation processing to obtain the updated positive class missed detection penalty coefficient, the updated negative class misdetection penalty coefficient, the updated fusion weight, and the updated judgment threshold. The upper and lower bound truncation processing means that when the intermediate update result is higher than the corresponding preset upper bound, it is determined as the corresponding preset upper bound; when the intermediate update result is lower than the corresponding preset lower bound, it is determined as the corresponding preset lower bound; and when the intermediate update result is between the corresponding preset upper bound and the corresponding preset lower bound, the intermediate update result is retained.

[0068] After updating the parameters, the changes in the total objective function, the positive class missed detection penalty coefficient, the negative class misclassification penalty coefficient, the fusion weights, and the decision threshold are further calculated to determine whether the current training result meets the preset convergence conditions. If the changes in the total objective function and each parameter do not exceed the corresponding thresholds, the current neural network parameter set, the current decision threshold, and the current class feature center are determined as the final neural network parameter set, the final decision threshold, and the final class feature center. If the preset convergence conditions are not met, the updated positive class missed detection penalty coefficient, negative class misclassification penalty coefficient, fusion weights, and decision thresholds are written back to the aforementioned training update process, so that the next training round continues to be executed under the new categorization constraints.

[0069] After the above processing, the model judgment results in the validation set samples are further transformed into positive class false negative rate and negative class false negative rate, and the dual-branch feature representation is further transformed into dual-branch difference statistics. These categorical statistics then affect the update processes of the positive class false negative penalty coefficient, the negative class false negative penalty coefficient, the fusion weight, and the judgment threshold. After this processing, the current neural network parameter set and judgment threshold not only retain the categorical constraints formed during the training phase but also further absorb the statistical biases exposed by different class condition labels during the validation phase. This allows subsequent optimization of the class parameter subset to be based on a more stable parameter state and a clearer class boundary.

[0070] In one embodiment of the present invention, after the aforementioned steps have completed the verification of the driving parameter update and obtained the final neural network parameter set, the final decision threshold, and the final category feature center, the model further determines the results based on the PCB region-level samples to be reviewed. This part, while maintaining the previously described method for determining the region modeling unit set, the dual-source sample representation data generation method, and the category-conditional dual-branch neural network structure, organizes the PCB region-level samples to be reviewed into region-level neural network input objects consistent with those in the training phase. It then calls the converged final neural network parameter set and the final decision threshold to complete the region-level forward processing, thereby providing a directly callable data foundation for subsequent manual review results, incremental sample set formation, and category parameter subset re-optimization.

[0071] Specifically, firstly, the prior structure data, observation structure data, and category mapping table corresponding to the PCB region-level samples to be reviewed are obtained. Based on the category mapping table, a set of region modeling units is generated, and the category condition identifier corresponding to each region modeling unit is determined. Subsequently, dual-source sample representation data corresponding to each region modeling unit is generated based on the set of region modeling units. The dual-source sample representation data generated in the review stage maintains consistency with the dual-source sample representation data generated in the training stage in terms of field order, dimensional structure, and binding relationships, thereby ensuring that subsequent forward processing is still based on the same data organization and condition index relationships as in the training stage.

[0072] After obtaining the dual-source sample representation data corresponding to each regional modeling unit, the class-conditional dual-branch neural network forward processing is further performed on the dual-source sample representation data corresponding to each regional modeling unit based on the final neural network parameter set. Specifically, the prior structure representation data in the dual-source sample representation data is input into the prior structure encoding branch to obtain the prior structure features of the corresponding regional modeling unit; the observation structure representation data in the dual-source sample representation data is input into the observation structure encoding branch to obtain the observation structure features of the corresponding regional modeling unit; then, according to the class condition identifier corresponding to the regional modeling unit, the corresponding fusion weight is called to conditionally fuse the prior structure features and observation structure features to obtain the fused features; subsequently, according to the same class condition identifier, the corresponding class-specific decision head is called to determine the fused features and perform probability compression processing to obtain the positive class determination probability value corresponding to the regional modeling unit. Since the forward processing stage still uses the class condition identifier, fusion weight calling method, and class-specific decision head calling method already determined above, the positive class determination probability value obtained in the review stage is consistent with the positive class determination probability value obtained in the training stage in terms of object meaning, but only plays the role of generating the model determination result in the current step.

[0073] After obtaining the positive class determination probability value corresponding to each regional modeling unit, the positive class determination probability value of each regional modeling unit is compared with the final determination threshold of the corresponding category condition label to obtain the model determination result of each regional modeling unit. The final determination threshold refers to the categorical determination threshold that has been updated and meets the convergence condition in the aforementioned verification stage by combining the positive class false negative rate, the negative class false positive rate, and the two-branch difference statistic. Therefore, different category condition labels correspond to different final determination thresholds, rather than using a uniform fixed threshold. Specifically, when the positive class determination probability value corresponding to a certain regional modeling unit is greater than or equal to the final determination threshold corresponding to its category condition label, the model determination result of that regional modeling unit is determined to be positive; when the positive class determination probability value corresponding to that regional modeling unit is less than the final determination threshold corresponding to its category condition label, the model determination result of that regional modeling unit is determined to be negative. Through this process, each regional modeling unit obtains a unique model determination result, and this model determination result is directly based on the unified correspondence between the regional modeling unit object, the category condition label, the final neural network parameter set, and the final determination threshold, without the problem of mixed category boundaries or drifting determination criteria.

[0074] After the model judgment result is determined, the regional modeling unit identifier, category condition identifier, positive class judgment probability value, and model judgment result are further collected to obtain the regional-level model judgment record. The regional-level model judgment record refers to the judgment record formed after structured collection of each regional modeling unit in the PCB regional-level sample to be reviewed. This record includes not only the regional modeling unit object itself, but also the category condition identifier, positive class judgment probability value, and model judgment result corresponding to that regional modeling unit. This allows subsequent manual review result correspondence and incremental sample set determination steps to directly call this information without needing to return to the forward processing to re-extract relevant data. In other words, the regional-level model judgment record does not only provide a single judgment conclusion, but retains the output content at the regional modeling unit granularity, category condition granularity, and probability granularity, enabling subsequent identification of negative class misjudged regional modeling units, identification of positive class missed regional modeling units, and category parameter subset updates to be continuously executed under the constraints of a unified regional object and a unified category condition identifier.

[0075] After the above processing, the PCB region-level samples to be reviewed form a continuous processing chain from the region modeling unit set, category condition identifiers, and dual-source sample representation data, to the positive class determination probability value, model determination result, and region-level model determination record. The region modeling unit set constrains the organization object of the dual-source sample representation data, and the category condition identifier constrains the calling object of the fusion weight, category-specific determination header, and final determination threshold. This ensures that the region-level model determination record obtained in the review stage maintains consistent object index relationships and category index relationships with subsequent manual review results, incremental sample sets, and category parameter subset update processes.

[0076] In one embodiment of the present invention, after obtaining the regional-level model judgment record in the aforementioned steps, an incremental sample set is further determined based on the regional-level model judgment record and the manual review result. A subset of category parameters is extracted according to the category condition identifier for updating, resulting in the updated final neural network parameter set. The key processing point in this part is to transform the regional-level model judgment record and the manual review result formed in the previous part into local re-optimization inputs. While maintaining the relationships between the regional modeling unit object, category condition identifier, dual-source sample representation data, and categorized parameter index, the newly added error samples are constrained to the local parameter space of the corresponding category condition identifier, thereby forming a continuous re-optimization mechanism oriented towards the category condition identifier.

[0077] Specifically, the regional model judgment records are first matched with the manual review results based on the regional modeling unit identifiers. The manual review results refer to the manual confirmation marks given to each regional modeling unit in the PCB regional sample to be reviewed; these marks at least indicate whether the corresponding regional modeling unit corresponds to a positive or negative class judgment label. Since the regional model judgment records already contain the category condition identifier, positive class judgment probability value, and model judgment result for each regional modeling unit, in this current step, the regional modeling unit identifiers serve to ensure consistency between the model judgment results and the manual review results.

[0078] After the mapping is completed, the regional modeling units whose model judgment result is positive and whose manual review result is negative are identified as negative misclassified regional modeling units, and the regional modeling units whose model judgment result is negative and whose manual review result is positive are identified as positive missed regional modeling units. Through this process, the regional-level model judgment records output in the previous part are further transformed into error sample sources that can directly participate in parameter re-optimization, and these error sample sources still retain the regional modeling unit identifier and category condition identifier.

[0079] After the negative class misjudgment region modeling unit and the positive class missed judgment region modeling unit are determined, the corresponding dual-source sample representation data, category condition identifiers, and manual verification marks are further incorporated into the incremental sample set. The manual verification marks serve as the incremental judgment annotation results in the incremental sample set. The incremental sample set refers to the regional sample set reorganized from the negative class misjudgment region modeling units and positive class missed judgment region modeling units newly identified during the current regional model judgment process. Each data item within the incremental sample set maintains the same dual-source sample representation data structure and category condition identifier indexing method as described above, without introducing any new sample formats.

[0080] Subsequently, the incremental sample set is classified according to the category condition label to obtain a subset of incremental samples. In other words, the current step does not mix all incremental samples, but still uses the category condition label as the unified classification criterion, so that the error samples under different category condition labels maintain their own independent update paths, thereby ensuring that the subsequent optimization process can be consistent with the category-conditional dual-branch neural network structure established above.

[0081] After the incremental sample subset is formed, a category parameter subset is further extracted according to the category condition identifier. This category parameter subset includes the category-specific decision head parameters in the final neural network parameter set, as well as the fusion weights, positive class false negative penalty coefficients, negative class false positive penalty coefficients, final decision thresholds, and category feature centers corresponding to the category condition identifier. The category parameter subset refers to the set of local parameters in the entire final neural network parameter set that directly corresponds to a specific category condition identifier and participates in the output, fusion, and threshold correction of the region modeling unit under that category condition identifier. Correspondingly, the remaining unextracted parameters remain unchanged.

[0082] This approach limits parameter updates to the local parameter space corresponding to the current error category condition label, rather than extending to all network parameters. This maintains the fixed correspondence between the category condition labels, category-specific decision heads, fusion weights, and category feature centers, while preventing a small number of newly added error samples from disturbing the parameters under unrelated category condition labels.

[0083] After the category parameter subset is extracted, the aforementioned training update and validation update processes are further performed on the category parameter subsets with the same category condition labels as the incremental sample subset. Since the dual-source sample representation data, category condition labels, and manual verification labels in the incremental sample subset are already consistent with the data organization method in the previous training stage, the previously established overall objective function construction method, neural network parameter update method, and validation statistics and parameter correction method can be directly used here without reconstructing new training rules. The difference is that in this step, the parameter objects involved in the update are limited to the category parameter subset, while the other parameters remain unchanged.

[0084] After this processing, the categorical loss constraints formed in the training phase, the categorical parameter correction rules formed in the validation phase, and the newly added error samples in the current phase are all organized into the same local update path in the current step, so that newly added negative class misclassifications and positive class omissions can be corrected in a targeted manner within the parameter space consistent with their category condition labels.

[0085] After completing the training and validation update processes for the corresponding category parameter subsets, the updated category parameter subsets are written back to their original positions, resulting in the updated final neural network parameter set. Writing back to the original positions means maintaining the overall parameter structure and index relationships of the original final neural network parameter set, only replacing the category-specific decision head parameters, fusion weights, positive class misclassification penalty coefficients, negative class misclassification penalty coefficients, final decision thresholds, and category feature centers with the updated results. Therefore, the updated final neural network parameter set is not a newly established independent parameter set, but rather a parameter state that incorporates the current error correction results within the original parameter organization framework.

[0086] After the above processing, the regional model judgment records and manual review results together form the basis for error identification in local re-optimization. The negative class misjudgment region modeling units and the positive class missed judgment region modeling units further constitute the incremental sample set. The incremental sample set is then transformed into an incremental sample subset under the constraint of the category condition label, which ultimately drives the corresponding category parameter subset to complete the local update and write back to the original parameter position. After this processing, the entire process no longer stops at the one-time fixation of parameters after training, but forms a continuous re-optimization mechanism around the category condition label, so that the new errors can be accurately mapped to the local parameter space of the corresponding category, thereby making the updated final neural network parameter set maintain a more stable categorical parameter state and regional output capability.

[0087] In one embodiment of the present invention, after the aforementioned steps have formed the incremental sample subsets and category parameter subsets corresponding to each category condition identifier, the error scale of the incremental sample subsets corresponding to each category condition identifier is further statistically analyzed, and the update order of the category parameter subsets is determined based on the statistical results. The focus of this part is not on changing the previously established incremental sample set composition method and category parameter subset extraction method, but rather on organizing the error distributions corresponding to different category condition identifiers sequentially while maintaining the category condition identifier index system. This allows subsequent local update processes to prioritize category condition identifiers with more concentrated errors, thereby improving the targeting of the re-optimization process and the stability of the update order.

[0088] Specifically, firstly, the number of negative misclassified region modeling units and positive missed region modeling units in each incremental sample subset are counted according to the category condition identifier. Then, the number of negative misclassified region modeling units and positive missed region modeling units are summed to obtain the category error quantity corresponding to each category condition identifier. The category error quantity referred to here is the total number of negative misclassified region modeling units and positive missed region modeling units identified under a certain category condition identifier. Essentially, it reflects the overall error concentration degree of that category condition identifier at the current stage. Through this processing, the local errors corresponding to different category condition identifiers are no longer merely scattered within their respective incremental sample subsets, but are uniformly quantified into a comparable category error quantity, providing a direct basis for determining the subsequent update order.

[0089] After obtaining the number of class errors corresponding to each category condition identifier, the category condition identifier with the largest number of class errors is further identified as the priority update category condition identifier. The remaining category condition identifiers are then arranged in descending order of class error number, resulting in the update order of the category parameter subsets. This update order refers to the sequential arrangement of multiple category parameter subsets during local training update and validation update processes. Through this arrangement, category condition identifiers with larger class error numbers are prioritized for update, while those with smaller class error numbers are updated sequentially in the subsequent order.

[0090] Since this sorting process still uses the category condition identifier as the unified index, it does not change the boundaries of the category parameter subsets established earlier, nor does it disrupt the one-to-one correspondence between the incremental sample subsets and the category parameter subsets. After this processing, the multiple category parameter subsets that originally existed side by side are further organized into a local update sequence with a clear sequential relationship.

[0091] After the update order of the category parameter subsets is determined, the category parameter subsets corresponding to each category condition identifier are updated sequentially according to the update order. Specifically, the incremental sample subset and category parameter subset corresponding to the priority update category condition identifier are called first to perform local updates. After the update of the category condition identifier is completed, the incremental sample subset and category parameter subset corresponding to the next category condition identifier in the update order are called to continue the local updates until the category parameter subsets corresponding to all category condition identifiers are updated. The sequential update mentioned here means that the category parameter subset corresponding to each category condition identifier enters the aforementioned training update process and validation update process separately in a predetermined order, rather than performing unordered parallel adjustments on all category parameter subsets at the same time.

[0092] Through this processing, the aforementioned number of category errors is further transformed into the basis for the sequential update of category parameter subsets. This ensures that the update process of category parameter subsets maintains the consistency of category condition labels while possessing a priority processing mechanism based on error scale. After the above processing, the incremental sample subset not only serves as the data source for local updates but also as the basis for class error sorting; the category condition labels not only serve as parameter extraction indexes but also as the basis for organizing update priorities. Thus, the re-optimization process forms a continuous processing link from the identification of negative class misjudgment region modeling units and positive class misjudgment region modeling units, the statistics of the number of category errors, to the sequential update of category parameter subsets. This allows category condition labels with more concentrated errors to receive priority for parameter correction, and ensures that the updated final neural network parameter set maintains a more ordered local update state at the category condition label level.

[0093] It should be noted that the preset threshold, update rate, learning rate, and upper and lower cutoff ranges involved in this invention can be preset based on the training sample size, the number of class condition labels, and the validation set convergence requirements. These parameters are used to constrain the neural network training and parameter update process without changing the correspondence between region modeling units, class condition labels, dual-source sample representation data, and subsets of class parameters.

[0094] The embodiments of the present invention have been described above. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms based on the guidance of the present embodiments, all of which are within the protection scope of the present embodiments.

Claims

1. A method for training and optimizing parameters of a dual-branch neural network for PCB region samples, characterized in that, Includes the following steps: Step 1: Obtain the prior structure data, observation structure data, category mapping table and decision labeling results of the PCB area-level training samples. Generate a set of area modeling units based on the category mapping table, and determine the category condition label and decision labeling results of each area modeling unit. Step 2: Generate dual-source sample representation data for each regional modeling unit, and bind them with category condition labels and judgment annotation results to obtain regional neural network training data items; Step 3: Construct a dual-branch neural network containing a prior structure encoding branch, an observation structure encoding branch, a category condition fusion layer, and a category-specific decision head; and establish the correspondence between category condition labels and fusion weights, category-specific decision heads, and category feature centers. Step 4: Input the dual-source sample representation data into the two coding branches to obtain the prior structural features and observed structural features. Call the fusion weight according to the category condition label to obtain the fusion features, and obtain the positive class determination probability value through the corresponding category-specific determination head. Steps 3 and 4 include: Step 31: Construct a category-conditional dual-branch neural network based on the category condition identifier, and establish the correspondence between the category condition identifier and the fusion weight, the category-specific decision head parameters, and the storage location of the category feature center; Step 32: Input the prior structure representation data in the dual-source sample representation data into the prior structure encoding branch for encoding to obtain the prior structure features; input the observation structure representation data in the dual-source sample representation data into the observation structure encoding branch for encoding to obtain the observation structure features; Step 33: Based on the category condition identifier, call the corresponding fusion weight, multiply the fusion weight by the prior structural features at the same feature positions to obtain the prior structural feature contribution; multiply the result after subtracting the fusion weight by the observed structural features at the same feature positions to obtain the observed structural feature contribution. Step 34: Summarize the contributions of prior structural features and observed structural features at the same feature positions to obtain the fused features; call the corresponding category-specific decision head according to the category condition identifier to make a decision on the fused features and perform probability compression processing to obtain the positive class decision probability value. Step 35: Identify and merge features according to category conditions, sum the merged features one by one, and then divide the sum by the number of modeling units in the corresponding region to obtain the category feature center; Step 5: Based on the positive class determination probability value, determination labeling result, two-branch features, fusion features and category feature centers, construct the overall objective function containing weighted determination loss, two-branch consistency loss and category aggregation loss, and backpropagate to update the neural network parameter set and category feature centers; Step 6: Based on the validation set samples, statistically analyze the positive class false negative rate, negative class false negative rate, and two-branch difference statistics according to the category condition. Update the corresponding penalty coefficient, fusion weight, and decision threshold. When the convergence condition is met, the final parameters are obtained. Step 7: Based on the results of manual review, an incremental sample set is formed. The category parameter subset is extracted according to the category condition. The non-target parameters are frozen and then optimized and written back to obtain the updated final neural network parameter set.

2. The method for training and optimizing parameters of a dual-branch neural network for PCB region samples according to claim 1, characterized in that, Step 1 includes: Step 11: Extract sample association fields from prior structure data, observation structure data, category mapping table and decision labeling results, compare the consistency of each sample association field, and perform association encapsulation when the sample association fields are consistent to obtain training sample units. Step 12: Parse the category mapping table to obtain the category mapping rules, merge the structural records belonging to the same category mapping rule into the same region modeling unit, and divide the structural records belonging to different category mapping rules into different region modeling units to obtain the region modeling unit set; Step 13: Match category mapping rules to each region modeling unit in the region modeling unit set. When multiple category mapping rules are matched in the same region modeling unit, retain the category mapping rule with the highest priority according to the preset priority in the category mapping table, and determine its corresponding category condition identifier as the unique category condition identifier. Step 14: Based on the regional modeling unit identifier, the judgment labeling results are collected into the corresponding regional modeling unit. When multiple judgment labeling results correspond to the same regional modeling unit, they are merged, and the regional modeling unit with uncollected judgment labeling results is identified as the negative class judgment labeling result.

3. The method for training and optimizing parameters of a dual-branch neural network for PCB region samples according to claim 1, characterized in that, Step 2 includes: Step 21: Based on the regional modeling unit identifier, read the corresponding prior structure field from the prior structure data and the corresponding observation structure field from the observation structure data; Step 22: Align the prior structure fields and observation structure fields according to the preset field order, and perform dimension shaping and order solidification according to the neural network input specifications; Step 23: Determine the shaped prior structure field as the prior structure representation data, determine the shaped observation structure field as the observation structure representation data, and combine the two into dual-source sample representation data; Step 24: Based on the regional modeling unit identifier, bind the dual-source sample representation data, category condition identifier, and judgment labeling results one by one to obtain the regional neural network training data items.

4. The method for training and optimizing parameters of a dual-branch neural network for PCB region samples according to claim 1, characterized in that, Step 5 includes: Step 51: For each region modeling unit, if the determination labeling result is a positive class determination labeling result, take the negative logarithm of the positive class determination probability value and multiply it with the positive class missed determination penalty coefficient of the corresponding category condition label to obtain the positive class sample loss. Step 52: If the labeling result is a negative class labeling result, then the result of subtracting the positive class labeling probability value is used as the negative class labeling probability value. Take the negative logarithm of the negative class labeling probability value and multiply it by the negative class misjudgment penalty coefficient of the corresponding category condition label to obtain the negative class sample loss. Step 53: The cumulative summation of the positive class sample loss and negative class sample loss corresponding to each regional modeling unit is used to obtain the weighted decision loss; the difference between the prior structural features and the observed structural features at the same feature position is calculated item by item, the absolute value of each difference is taken, and all absolute value results are summarized to obtain the dual-branch consistency loss. Step 54: Calculate the difference between the fused feature and the corresponding category feature center at the same feature position, take the absolute value of each difference and summarize them to obtain the category aggregation loss term, and sum the cumulative loss terms of each category aggregation term to obtain the category aggregation loss. Step 55: The weighted decision loss, dual-branch consistency loss and category aggregation loss are summed to obtain the overall objective function. Based on the overall objective function, the parameters of the prior structure coding branch, the parameters of the observed structure coding branch, the parameters of the category condition fusion layer and the parameters of the category-specific decision head are updated by backpropagation. Step 56: Identify the merged and updated features according to the category conditions, sum the merged features one by one, and then divide the summation result by the number of modeling units in the corresponding region to obtain the updated category feature center.

5. The method for training and optimizing parameters of a dual-branch neural network for PCB region samples according to claim 4, characterized in that, Step 5, which involves backpropagating to update the neural network parameter set, also includes: Step 561: Calculate the weighted decision loss corresponding to each regional modeling unit according to the category condition identifier, and summarize the weighted decision loss corresponding to the same category condition identifier and divide it by the number of corresponding regional modeling units to obtain the average decision loss. Step 562: The regional modeling units whose weighted decision loss is higher than the corresponding average decision loss are identified as high-error regional modeling units; Step 563: Write the high-error region modeling units into the enhanced training batch according to the category conditional identifier, and input the enhanced training batch into the category conditional dual-branch neural network in the next training round.

6. The method for training and optimizing parameters of a dual-branch neural network for PCB region samples according to claim 1, characterized in that, Step 6 includes: Step 61: Obtain validation set samples, repeat steps 1 and 2 to obtain regional neural network training data items, obtain positive class determination probability values ​​based on the current neural network parameter set, and compare the positive class determination probability values ​​with the determination threshold of the corresponding category condition label to obtain the model determination result; Step 62: Count the number of region modeling units whose labeling results are positive and whose modeling results are negative according to the category conditions, and determine the positive class false negative rate by the ratio of the number of region modeling units whose labeling results are positive to the total number of region modeling units whose labeling results are positive; when the total number of region modeling units whose labeling results are positive is zero, the positive class false negative rate is determined to be zero. Step 63: Count the number of region modeling units whose labeling results are negative and whose modeling results are positive according to the category conditions, and determine the negative class misclassification rate by the ratio of the number of region modeling units whose labeling results are negative to the total number of region modeling units whose labeling results are negative; when the total number of region modeling units whose labeling results are negative is zero, the negative class misclassification rate is determined to be zero. Step 64: Calculate the difference between the prior structural features and the observed structural features at the same feature locations, take the absolute value of each difference and sum them, and then divide the sum by the number of modeling units in the corresponding region to obtain the dual-branch difference statistics. Step 65: Add the product of the positive class false negative rate and the update rate of the positive class false negative penalty coefficient to the original positive class false negative penalty coefficient; add the product of the negative class false positive rate and the update rate of the negative class false positive penalty coefficient to the original negative class false positive penalty coefficient. Step 66: Add the product of the dual-branch difference statistics and the fusion weight update rate to the original fusion weight; add the product of the difference between the negative class misclassification rate and the positive class omission rate and the decision threshold update rate to the original decision threshold; and truncate the update results with upper and lower limits. Step 67: Calculate the changes in the total objective function, as well as the changes in the parameters of the positive class missed judgment penalty coefficient, the negative class misjudgment penalty coefficient, the fusion weight, and the decision threshold. If the preset convergence condition is met, determine the current neural network parameter set, the current decision threshold, and the current class feature center as the final neural network parameter set, the final decision threshold, and the final class feature center. Otherwise, write back the updated positive class missed judgment penalty coefficient, negative class misjudgment penalty coefficient, fusion weight, and decision threshold to the training update process corresponding to step 5.

7. The method for training and optimizing parameters of a dual-branch neural network for PCB region samples according to claim 1, characterized in that, Step 7 includes: Step 71: Based on the regional modeling unit identifier, match the model judgment result with the manual review result. The regional modeling unit with a positive model judgment result and a negative manual review result is identified as a negative misjudged regional modeling unit, and the regional modeling unit with a negative model judgment result and a positive manual review result is identified as a positive missed regional modeling unit. Step 72: The dual-source sample representation data, category condition labels, and manual verification labels corresponding to the negative class misjudgment region modeling unit and the positive class omission region modeling unit are included in the incremental sample set, and the incremental sample subset is obtained by classifying according to the category condition label; Step 73: Extract a subset of category parameters according to the category condition identifier. The subset of category parameters includes the category-specific decision head parameters in the final neural network parameter set, as well as the fusion weight, positive class missed judgment penalty coefficient, negative class misjudgment penalty coefficient, final decision threshold, and category feature center corresponding to the category condition identifier, while keeping the other parameters unchanged. Step 74: Based on the incremental sample subset, perform the training update process corresponding to step 5 and the verification update process corresponding to step 6 on the category parameter subset that has the same category condition label as the incremental sample subset. Write the updated category parameter subset back to the original parameter position to obtain the updated final neural network parameter set.

8. The method for training and optimizing parameters of a dual-branch neural network for PCB region samples according to claim 7, characterized in that, Step 7, which involves further optimizing the subset of category parameters, also includes: Step 75: Count the number of negative misjudged regions and positive missed regions in each incremental sample subset according to the category condition identifier, and summarize the number of negative misjudged regions and positive missed regions to obtain the number of category errors corresponding to each category condition identifier. Step 76: The category condition identifier with the largest number of category errors is identified as the category condition identifier to be updated first, and the remaining category condition identifiers are arranged in descending order of the number of category errors to obtain the update order of the category parameter subset; Step 77: Update the category parameter subsets corresponding to each category condition identifier in the order of updates, and write the category parameter subsets back to the corresponding parameter storage location after each category parameter subset is updated.

Citation Information

Patent Citations

  • Supervised learning pedestrian attribute identification method based on feature fusion

    CN114663908A

  • Industrial PCB defect identification method based on sample generation model

    CN120278974A