A noise-containing unbalanced sample image regression network training method and application

CN120808057BActive Publication Date: 2026-10-16HEFEI LASSETER ROBOT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510894299.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2026-10-16
Estimated Expiration
2045-06-30

AI Technical Summary

Technical Problem

[0004]本申请旨在至少解决现有技术中存在的技术问题之一;为此,本申请提出了带有噪声的不均衡样本回归网络训练方法及应用,用于解决现有技术中由于需要依赖低噪声假设或人工平衡操作及复杂预处理流程,导致训练策略计算复杂度高,同时降低端到端优化效率与真实场景泛化能力的技术问题

Benefits of technology

[0043] 1. This application discretizes continuous regression values ​​into ordered candidate values ​​and constructs an ordered feature space. Combined with a safety zone mechanism built using relaxation factors, it allows noise to fluctuate within a controllable range. This effectively overcomes the coupling interference between noise and sample imbalance in image regression tasks and significantly reduces the dependence of traditional noise processing schemes on strong assumptions about sample distribution. During training, this method simultaneously achieves adaptive adjustment of noise tolerance and sample distribution, eliminating the need to preset the proportion of noisy samples or manually intervene in sample weights. This greatly reduces the complexity of training strategies and manual costs, and significantly improves the robustness and generalization ability of the regression network under non-ideal labeling conditions. Specifically, the safety zone mechanism defined by the relaxation factor s allows errors in labeled values ​​within ±s candidate value units to not generate erroneous gradients, effectively shielding the negative impact of noise. Simultaneously, the global negative sample push mechanism automatically balances the gradient contributions of various types of samples during training, avoiding the cumbersome process of manually adjusting sample weights and the domain difference risks that generative adversarial networks may cause, achieving efficient end-to-end training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120808057B_ABST
    Figure CN120808057B_ABST
Patent Text Reader

Abstract

The application discloses a noise-containing unbalanced sample image regression network training method and application, and relates to the technical field of image processing. The application solves the problems of low training efficiency, high noise sensitivity and distribution imbalance caused by the dependence on manual intervention weight adjustment and complex preprocessing procedures in the prior art. The application constructs an ordered candidate feature space through discretization of the labeled value, and stabilizes the geometric relationship of adjacent vectors through cosine constraint. The application constructs a regression network to output a predicted feature vector, and dynamically divides positive and negative candidate sets based on a relaxation factor. The application adopts a geometric constraint collaborative optimization mechanism to perform end-to-end training by combining a pull-in loss and a push-away loss. The application normalizes the similarity and fuses the discrete candidate values to output a continuous regression result. The method shields the labeled noise interference through a relaxation safety zone, balances the automatic correction of sample distribution skewness through a global gradient, and significantly improves the robustness and prediction continuity of the model in a complex industrial scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, and in particular relates to an image regression network training method and its application under the condition that the sample annotation is noisy and unevenly distributed. Background Technology

[0002] Training methods and applications for imbalanced regression networks with noisy samples are a supervised learning optimization technique. The training of supervised deep learning image regression networks relies on balance and requires correct sample labels as supervision signals; otherwise, training results are often poor, failing to achieve high-performance regression predictions. In some tasks, the accuracy of sample labels cannot be guaranteed. For example, in measuring pig backfat thickness, manual measurement and labeling are affected by the pig's posture and the differences in technique due to the experience of different measurement personnel, inevitably leading to noise in the measured values, and the accuracy cannot reach that of calipers. Sample balance also cannot be guaranteed; the backfat thickness of most pigs in pig farms is usually concentrated in a small range (e.g., 17mm–23mm), and the number of pigs with smaller or larger backfat thicknesses is generally relatively small.

[0003] In existing technologies, when supervising learning to process noisy or imbalanced data, the training process typically relies on pre-defined sample selection or weighting strategies. Sample data and their labels are input into a multi-stage training framework, and noise is separated or the distribution is balanced through iterative optimization. Alternatively, the training system itself may first perform data preprocessing to enable the model to fit an effective data distribution and output predictions close to the true values ​​based on the input features. However, the process of building a robust model generally involves approximating the objective function using a sample processing procedure under strong assumptions. The ultimate goal is to allow the network to map the mathematical relationship between features and potential true labels, and to determine whether the predicted values ​​conform to the actual distribution trend of the data. However, existing technologies, due to the need to pre-define a low noise ratio, rely on manual intervention for balancing operations, or introduce complex processes such as multi-stage cross-validation, result in high computational complexity of the training strategy, while also reducing the end-to-end optimization efficiency and real-world generalization ability of the model. Summary of the Invention

[0004] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a training method and application for imbalanced sample regression networks with noise, which solves the technical problem in the prior art that the training strategy has high computational complexity due to the need to rely on low-noise assumptions or manual balancing operations and complex preprocessing procedures, while reducing end-to-end optimization efficiency and generalization ability in real-world scenarios.

[0005] To achieve the above objectives, this application adopts the following technical solution:

[0006] The first aspect of this application provides a method for training a regression network for imbalanced sample images with noise, comprising:

[0007] S1. Collect image sample data to be regressed and corresponding labeled values, and generate M discrete candidate values ​​V based on the range of the labeled values ​​and the preset expected accuracy. m The preset expected accuracy W is set in advance based on experience.

[0008] S2. Randomly generate candidate feature vectors based on the discrete candidate values, and constrain the angle between candidate feature vectors by cosine similarity loss;

[0009] S3. Construct a regression network to be trained, with image sample data as input and predicted feature vector p as output; wherein, the predicted feature vector p is a high-dimensional embedding vector extracted by the regression network to be trained from the image sample data.

[0010] S4. Based on the labeled value y, select positive candidate feature vectors C from the candidate feature vectors. q Based on a preset relaxation factor s, a set of negative candidate feature vectors C is selected from the candidate feature vectors. u ;

[0011] The relaxation factor s is used to define the noise tolerance range and control the boundary partitioning of the positive and negative candidate feature vector sets during training; the negative candidate feature vector set C u For all positive candidate eigenvectors C q Candidate eigenvectors whose distance exceeds the relaxation factor s, {C u |u∈[1,qs]∪[q+s,M]};

[0012] S5. Based on the predicted feature vector p and the positive candidate feature vector C q and negative candidate feature vector set C u After calculating the approach loss and push-back loss through geometric constraint co-optimization, the regression network to be trained is jointly trained.

[0013] The narrowing loss is used to force the predicted feature vector p to approach the positive candidate feature vector C. q The push-away loss is to force the predicted feature vector p to move away from the negative candidate feature vector set C. u .

[0014] Preferably, the step of generating M discrete candidate values ​​V based on the labeled value range and the preset expected precision is... m ,include:

[0015] Extract the maximum annotation value L from the annotation values. max and minimum label value L min ;

[0016] Through calculation formula Calculate the number M of discrete candidate values; where W is the preset expected precision. To The calculation result is rounded up;

[0017] Through calculation formula V m =L min +m×W, calculate discrete candidate value V m Where m = 1, 2, 3, ..., M.

[0018] Preferably, constraining the angle between candidate feature vectors using cosine similarity loss includes:

[0019] Arrange the candidate feature vectors in ascending order of discrete candidate values;

[0020] Through calculation formula D a,b =norm(C)@norm(C) T ), calculate the cosine similarity between two candidate feature vectors; where, the D a,b Let represent the cosine similarity between the a-th candidate eigenvector and the b-th candidate eigenvector, norm(*) indicates L2norm calculation, @ indicates matrix multiplication calculation, and c is the set of candidate eigenvectors, a,b=1,2,3,…,M;

[0021] Through calculation formula Calculate the first loss;

[0022] Through calculation formula Update the candidate feature vectors so that the angle between adjacent vectors is fixed at a preset value T.

[0023] Preferably, the first loss is used to force the spatial geometric relationship of all candidate feature vectors to be consistent with the numerical order of the corresponding discrete candidate values.

[0024] Preferably, the step of selecting positive candidate feature vectors C from the candidate feature vectors based on the labeled value y is... q The index q satisfies:

[0025] Preferably, the negative candidate feature vector set C u index u Satisfies: u∈[1,qs]∪[q+s,M].

[0026] Preferably, the formula for calculating the convergence loss is: loss2 = log(1 + exp(-cosd(p,C)). q The narrowing loss is used to minimize the difference between the predicted feature vector p and the positive candidate feature vector C. qThe cosine deviation of the included angle; cosd(p,C) q ) represents the predicted feature vector p and the positive candidate feature vector C. q The cosine similarity.

[0027] Preferably, the formula for calculating the push-out loss is: The push-away loss is used to force the predicted feature vector p to move away from the negative candidate feature vector set C. u .

[0028] Preferably, joint training of the regression network to be trained includes:

[0029] Let the predicted feature vector p and the negative candidate feature vector set C be... u The angle between the predicted feature vector p and the positive candidate feature vector is greater than the angle between the predicted feature vector p and the positive candidate feature vector.

[0030] The narrowing loss loss2 is calculated using the formula for narrowing loss.

[0031] The push-out loss (loss3) is calculated using the formula for push-out loss.

[0032] Through calculation formula The regression network to be trained is trained, wherein param(R) are the learnable parameters of the regression network to be trained.

[0033] A second aspect of this application provides an application of a regression network for imbalanced sample images with noisy data, comprising:

[0034] Obtain the number of image samples to be regressed;

[0035] The image sample data is input into the trained regression network to obtain the predicted feature vector, wherein the trained regression network is a model obtained based on the network training method of the first aspect;

[0036] The weight ratio is obtained by the cosine similarity between the normalized predicted feature vector and all candidate feature vectors. The weight ratio and discrete candidate values ​​are then weighted and fused to output the final regression prediction result.

[0037] Preferably, the weighted fusion weight ratio and discrete candidate values ​​include:

[0038] Through calculation formula D m =cosd(p,C m ), calculate the cosine similarity between the predicted feature vector p and all candidate feature vectors;

[0039] Through calculation formula E m =softmax(D mThe cosine similarity is normalized, and the similarity ratio between the input image sample data and the corresponding labeled value and each candidate feature vector is calculated.

[0040] Through calculation formula The weighted fusion weight ratio and discrete candidate values ​​are used to calculate the final regression prediction result.

[0041] Based on the above technical solutions, this application provides a training method and application for a noisy, imbalanced sample image regression network. By discretizing continuous regression values ​​into ordered candidate values ​​and constructing an ordered feature space, and combining a safety zone mechanism constructed with relaxation factors, the labeled noise is allowed to fluctuate within a controllable range, effectively eliminating the strong assumptions imposed on sample distribution by traditional noise processing schemes. At the same time, the gradient contribution of various samples is automatically balanced through a global negative sample push mechanism, avoiding the domain difference risk caused by generative adversarial networks and the cumbersome process of manual weight adjustment. Finally, continuous interpolation decoding is achieved based on the similarity weighted fusion of ordered feature manifolds, ensuring smooth output of predicted values ​​without step jumps, forming a closed-loop training process from discrete feature mapping to continuous regression output. This achieves efficient end-to-end training while ensuring mathematical continuity, significantly improving the robustness and generalization ability of the model in scenarios with both noise and imbalance.

[0042] Compared with the prior art, the beneficial effects of this application are:

[0043] 1. This application discretizes continuous regression values ​​into ordered candidate values ​​and constructs an ordered feature space. Combined with a safety zone mechanism built using relaxation factors, it allows noise to fluctuate within a controllable range. This effectively overcomes the coupling interference between noise and sample imbalance in image regression tasks and significantly reduces the dependence of traditional noise processing schemes on strong assumptions about sample distribution. During training, this method simultaneously achieves adaptive adjustment of noise tolerance and sample distribution, eliminating the need to preset the proportion of noisy samples or manually intervene in sample weights. This greatly reduces the complexity of training strategies and manual costs, and significantly improves the robustness and generalization ability of the regression network under non-ideal labeling conditions. Specifically, the safety zone mechanism defined by the relaxation factor s allows errors in labeled values ​​within ±s candidate value units to not generate erroneous gradients, effectively shielding the negative impact of noise. Simultaneously, the global negative sample push mechanism automatically balances the gradient contributions of various types of samples during training, avoiding the cumbersome process of manually adjusting sample weights and the domain difference risks that generative adversarial networks may cause, achieving efficient end-to-end training.

[0044] 2. This application constructs an ordered mathematical relationship between discrete candidate features based on a preset angle T, decoupling the continuity of regression values ​​from the topological constraints of the feature space, thus ensuring the smoothness and accuracy of the prediction output. This design enables the model to learn a feature manifold with a clear geometric structure and a direct correlation between distance and labeled value differences. In the application stage, based on the cosine similarity between the predicted feature vector p and all candidate feature vectors, normalized weighting and fusion of discrete candidate values ​​are performed, realizing smooth interpolation decoding from discrete feature space to continuous regression values. This ensures that the prediction results do not jump abruptly, maintaining the continuity requirement of the regression task. Its end-to-end single network training architecture effectively avoids the high computational complexity and information loss introduced by existing technologies that rely on multi-stage cross-validation to identify noise or complex preprocessing processes. While simplifying system implementation and improving training efficiency, it significantly maintains the computational performance advantages required for industrial applications and deployment efficiency in real-world scenarios. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is a schematic diagram of the image regression network training system architecture provided in an embodiment of this application;

[0047] Figure 2 This is a schematic diagram of the overall process of the image regression network training method provided in the embodiments of this application;

[0048] Figure 3 This is a schematic diagram of the positive and negative candidate feature vector filtering process provided in the embodiments of this application;

[0049] Figure 4 This is a schematic diagram of the joint training loss calculation process provided in an embodiment of this application;

[0050] Figure 5 This is a schematic diagram of the overall process of the image regression network application provided in the embodiments of this application. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0052] The training method and application of a noisy, imbalanced sample image regression network provided in this application can be applied to... Figure 1 The example shown is a training system for a noisy, imbalanced image regression network, such as... Figure 1 As shown, the training system 100 includes: a data acquisition device 10, an edge server 20, a storage device 30, an edge computing gateway 40, and a feedback device 50.

[0053] The data acquisition device 10 is deployed at the image sample acquisition site to acquire the image sample data to be processed and the corresponding annotation values ​​in real time, and transmits the image sample data packet and the corresponding annotation values ​​to the edge server 20 through the data transmission channel.

[0054] Edge server 20 is used to execute the core training logic of the regression network. After receiving image sample data and labeled values ​​transmitted by data acquisition device 10, it generates discrete candidate values ​​according to the range of labeled values ​​and the preset expected accuracy, and constructs an ordered feature space. It filters positive candidate feature vectors and negative candidate feature vector sets based on relaxation factors, calculates the close loss and push loss through geometric constraint collaborative optimization mechanism, and drives the end-to-end update of regression network parameters. At the same time, it stores the generated candidate feature vectors in memory 30 and forwards the trained regression network model and prediction data packets to edge computing gateway 40.

[0055] The memory 30 is used to store the discrete candidate values, candidate feature vector sets and intermediate state data of the regression network generated by the edge server 20, to provide real-time access support for the ordered feature space during the training process, and to respond to the data access requests of the edge server 20 through the high-speed data bus.

[0056] The edge computing gateway 40 receives the regression network model and prediction results transmitted from the edge server 20, encapsulates the data and converts the communication protocol, and then distributes the processed data packets to the feedback device 50 through a low-latency network; at the same time, it monitors the communication status between devices to ensure the continuity of the training process.

[0057] Feedback device 50 receives regression prediction results and model status data transmitted from edge computing gateway 40, displays the training process through a graphical interface, and provides the operator with a visual analysis report of the prediction results.

[0058] To address the technical problems in existing technologies, such as high computational complexity of training strategies, low end-to-end optimization efficiency, and weak generalization ability in real-world scenarios due to reliance on low-noise assumptions, the need for manual intervention in sample balancing, and the introduction of complex multi-stage preprocessing procedures, this application provides a training method for imbalanced image regression networks with noisy samples, including:

[0059] S1. Collect image sample data to be regressed and corresponding labeled values, and generate M discrete candidate values ​​V based on the range of the labeled values ​​and the preset expected accuracy. m Among them, the preset expected accuracy W is set in advance based on experience;

[0060] S2. Randomly generate candidate feature vectors based on discrete candidate values, and constrain the angle between candidate feature vectors by cosine similarity loss;

[0061] S3. Construct a regression network to be trained, with image sample data as input and predicted feature vector p as output; where the predicted feature vector p is a high-dimensional embedding vector extracted by the regression network to be trained from the image sample data.

[0062] S4. Based on the labeled value y, select positive candidate feature vectors C from the candidate feature vectors. q Based on a preset relaxation factor s, a set of negative candidate feature vectors C is selected from the candidate feature vectors. u ;

[0063] Among them, the relaxation factor s is used to define the noise tolerance range and control the boundary partitioning of the positive candidate feature vector and negative candidate feature vector sets during training; the negative candidate feature vector set C u For all positive candidate eigenvectors C q Candidate eigenvectors whose distance exceeds the relaxation factor s, {C u |u∈[1,qs]∪[q+s,M]};

[0064] S5. Based on the predicted feature vector p and the positive candidate feature vector C q and negative candidate feature vector set C u After calculating the approach loss and push-back loss through geometric constraint co-optimization, the regression network to be trained is jointly trained.

[0065] Among them, the convergence loss is used to force the predicted feature vector p to approach the positive candidate feature vector C. q The push-away loss forces the predicted feature vector p to move further away from the negative candidate feature vector set C. u .

[0066] Based on this, the embodiments of this application make a breakthrough in solving the dual challenges of weak model robustness and poor generalization ability caused by the coupling of noise interference and sample imbalance in image regression tasks: by constructing a collaborative training mechanism of "discrete sequential feature space - relaxed safe zone - global gradient balance", the continuous regression values ​​are discretized into candidate feature forms with clear geometric constraints. The noise tolerance boundary is dynamically defined by the relaxation factor to achieve adaptive adjustment of labeling error and distribution skew. At the same time, a dual gradient constraint mechanism of bringing-in loss and pushing-out loss is innovatively introduced to simultaneously optimize feature space anchoring and negative sample rejection during training, effectively avoiding information loss and computational redundancy caused by traditional multi-stage preprocessing, and significantly improving the prediction accuracy and anti-interference ability of the model in complex industrial scenarios.

[0067] like Figure 2 As shown in the embodiment of this application, a method for training a noisy, imbalanced sample image regression network includes:

[0068] S1. Collect image sample data to be regressed and corresponding labeled values, and generate M discrete candidate values ​​V based on the range of the labeled values ​​and the preset expected accuracy. m Among them, the preset expected accuracy W is set in advance based on experience;

[0069] In some implementations, a global image dataset for the regression task is collected, the labeled values ​​of all image sample data are extracted, and the global maximum value L is calculated. max With minimum value L min Based on the preset expected accuracy, the range of labeled values ​​is discretized at equal intervals, and the generated discrete candidate value sequence is used as the numerical basis for constructing an ordered feature space.

[0070] It should be noted that,

[0071] The number of discrete candidate values ​​M is calculated as follows: Where W is the preset expected accuracy, To The calculation result is rounded up;

[0072] Discrete candidate value V m Calculation method: V m =L min +m×W; where m=1,2,3,…,M.

[0073] S2. Randomly generate candidate feature vectors based on discrete candidate values, and constrain the angle between candidate feature vectors by cosine similarity loss;

[0074] In some implementations, an N-dimensional initial feature vector is randomly generated for each discrete candidate value and arranged in ascending order of the discrete candidate values. The pairwise cosine similarity matrix of all candidate feature vectors is calculated, where the cosine similarity is achieved through L2 norm normalized candidate feature vector matrix multiplication. A first loss function is calculated based on the cosine similarity, which is generated by statistically analyzing the mean absolute deviation between the measured similarity and the target similarity of each pair of candidate feature vectors. The target similarity is determined by the cosine of the feature vector index spacing and the preset target angle T. The candidate feature vectors are iteratively updated by minimizing the first loss function, forcing the spatial angle between adjacent candidate feature vectors to stably converge to the preset value T.

[0075] It should be noted that,

[0076] Cosine similarity calculation method: D a,b =norm(C)@norm(C) T ); where D a,b This represents the cosine similarity between the a-th candidate eigenvector and the b-th candidate eigenvector; norm(*) indicates L2norm calculation, @ indicates matrix multiplication calculation, C is the set of candidate eigenvectors; a, b = 1, 2, 3, ..., M;

[0077] The first loss is calculated as follows:

[0078] How to calculate updated candidate feature vectors:

[0079] S3. Construct a regression network to be trained, with image sample data as input and predicted feature vector p as output; where the predicted feature vector p is a high-dimensional embedding vector extracted by the regression network to be trained from the image sample data.

[0080] In some implementations, a deep convolutional neural network, such as ResNet-34, is used as the basic skeleton. Its original classification head is removed, and a fully connected layer is added as the output. The network output layer dimension is set to the same N-dimensional space as the candidate feature vector, and the activation function is linear activation. After standardizing the input sample data, it is input into the regression network to be trained. The network extracts the deep semantic features of the image step by step through a multi-layer convolutional structure, compresses the spatial features into a compact vector representation through a global pooling layer, and maps the basic features to an N-dimensional space with the same dimension as the candidate feature vector through a fully connected layer to generate the predicted feature vector p.

[0081] For example, in the application of measuring backfat thickness in pigs, the specific processing flow of the regression network to be trained is as follows: First, the RGB images of the pig's back are standardized to eliminate the influence of lighting changes; then, they are input into the ResNet-34 architecture, where multi-level visual features from edge texture to deep adipose tissue are extracted step by step through five sets of residual convolutional layers; after compression by global average pooling layers, a 512-dimensional basic feature vector is obtained; finally, the feature is projected onto a 128-dimensional candidate feature space through a fully connected layer to generate a predicted feature vector p.

[0082] S4. Based on the labeled value y, select positive candidate feature vectors C from the candidate feature vectors. q Based on a preset relaxation factor s, a set of negative candidate feature vectors C is selected from the candidate feature vectors. u ;

[0083] Among them, the relaxation factor s is used to define the noise tolerance range and control the boundary partitioning of the positive candidate feature vector and negative candidate feature vector sets during training; the negative candidate feature vector set C u For all positive candidate eigenvectors C q Candidate eigenvectors whose distance exceeds the relaxation factor s, {C u |u∈[1,qs]∪[q+s,M]};

[0084] For some implementation methods, please refer to Figure 3 As shown, by calculating the labeled value y corresponding to the image sample data to be trained and all discrete candidate values ​​V m The absolute difference is used to locate the index q corresponding to the minimum difference, thereby determining the positive candidate feature vector C. q A noise-tolerant safe region is constructed based on a preset relaxation factor s, with the range (qs, q+s) to ensure that fluctuations in labeled values ​​within this range will not trigger erroneous gradients; a negative candidate feature vector set C is then selected. u It contains all candidate feature vectors with indices in the range [1, qs] and [q+s, M], which will be forcibly excluded in subsequent training.

[0085] S5. Based on the predicted feature vector p and the positive candidate feature vector C q and negative candidate feature vector set C u After calculating the approach loss and push-away loss through geometric constraint co-optimization, the regression network to be trained is jointly trained.

[0086] Among them, the convergence loss is used to force the predicted feature vector p to approach the positive candidate feature vector C. q The push-away loss forces the predicted feature vector p to move further away from the negative candidate feature vector set C. u .

[0087] For some implementation methods, please refer to Figure 4 As shown, by maximizing the predicted feature vector p and the positive candidate feature vector C q The cosine similarity is used to calculate the convergence loss, which forces the network to anchor the sample features to the feature space position corresponding to the labeled value. By requiring that the cosine similarity between the predicted feature vector p and each negative candidate feature vector is less than the feature space rejection threshold (|qu|×cos(T)) mapped by the distance of discrete candidate values, the network is forced to push the sample features away from the feature region corresponding to the labeled value. The two loss functions are used together for gradient backpropagation to drive the update of regression network parameters.

[0088] It should be noted that the close loss ensures accurate positioning in the feature space, while the push loss establishes a multi-level repulsion barrier to prevent feature shift; noise filtering and distribution equalization are achieved simultaneously in a single forward propagation, without the need for multi-stage preprocessing; adaptive gradient strength is established through the repulsion threshold of the feature distance mapping to avoid manual adjustment of weights; negative samples across the entire domain participate in optimization to form a natural sample balance mechanism, eliminating the influence of distribution skew.

[0089] For example, in the application of measuring backfat thickness in pigs, the specific implementation flow is as follows: When inputting an image sample of a pig's back with a labeled value of 12.3 mm: locate the positive candidate feature vector C. 25 (Corresponding to 12.5mm, since |12.3-12.5|=0.2 is the minimum difference); Based on the relaxation factor s=3, the negative candidate set is screened, candidates within the safe zone [22,28] are excluded, and the far-end negative candidates such as C are selected. 15 (7.5mm) and C 35 (17.5mm); After the regression network outputs the predicted feature vector p: calculate the convergence loss forced by p and C. 25 The cosine similarity improved from 0.85 to 0.92; the forced p and C were calculated simultaneously to reduce the push-out loss. 15 The similarity decreased from 0.45 to 0.32 (below the threshold |25-15|×cos60°=10×0.5=5.0); the network weights were updated by dual loss and backpropagation gradient, and the noisy labeled samples avoided erroneous gradients due to the safety mechanism; the far-end negative candidate feature vector set participated in gradient balancing to eliminate distribution skew.

[0090] like Figure 5 As shown, this example also provides an application of an imbalanced sample image regression network with noisy data, including:

[0091] Obtain the image sample data to be regressed;

[0092] Image sample data is input into the trained regression network to obtain the predicted feature vector. The trained regression network is a model obtained based on a noisy imbalanced sample image regression network training method.

[0093] The weight ratio is obtained by the cosine similarity between the normalized predicted feature vector and all candidate feature vectors. The weight ratio and discrete candidate values ​​are then weighted and fused to output the final regression prediction result.

[0094] In some implementations, image sample data to be regressed is obtained; the image sample data is input into the trained regression network to obtain the predicted feature vector p; and the predicted feature vector p is compared with all candidate feature vectors C. m The cosine similarity is used to obtain the original similarity set D. m ; For D m Perform softmax normalization to convert similarity into a weight ratio E. m This operation ensures that the sum of all weights is 1 and highlights the most relevant discrete candidate values; the weight ratio E is... m With discrete candidate value V m Weighted fusion is performed to output the final regression prediction result y'.

[0095] It should be noted that probabilistic weight allocation is established by similarity normalization to overcome the step jump problem caused by discrete candidate values; smooth interpolation between discrete candidate values ​​is achieved by utilizing the geometric continuity of the ordered feature space to ensure the mathematical continuity of the prediction results; and the end-to-end fusion mechanism avoids the information loss introduced by traditional post-processing.

[0096] For example, in the application of measuring backfat thickness in pigs, the specific implementation flow is as follows: The similarity between the predicted feature vector p and the candidate vector set is calculated, where the similarity with C... 23 (11.5mm), C 24 (12.0mm), C 25 The similarities (12.5mm) were 0.68, 0.92, and 0.85, respectively; the weight ratio E was obtained after softmax normalization. 23 =0.18, E 24 =0.42, E 25 =0.40; The final thickness value calculated by weighted fusion is: y' = 0.18 × 11.5 + 0.42 × 12.0 + 0.40 × 12.5 = 12.17 mm. This result has an error of only 0.03 mm compared with the manually measured value of 12.2 mm, verifying the decoding accuracy.

[0097] The above embodiments are only used to illustrate the technical methods of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of this application without departing from the spirit and scope of the technical methods of this application.

Claims

1. A method for training a regression network with noisy, imbalanced sample images, characterized in that, include: Collect image sample data to be regressed and corresponding labeled values, and generate M discrete candidate values ​​based on the range of labeled values ​​and the preset expected accuracy; Candidate feature vectors are randomly generated based on the discrete candidate values, and the angle between the candidate feature vectors is constrained by cosine similarity loss. Construct a regression network to be trained, which takes image sample data as input and outputs a predicted feature vector p; where the predicted feature vector p is a high-dimensional embedding vector extracted by the regression network to be trained from the image sample data. Positive candidate feature vectors are selected from the candidate feature vectors based on the labeled value y. Based on a preset relaxation factor s, a set of negative candidate feature vectors is selected from the candidate feature vectors. The relaxation factor s is used to control the boundary partitioning of the positive and negative candidate feature vector sets during the training of the regression network to be trained. Based on the predicted feature vector p and positive candidate feature vector and negative candidate feature vector set After calculating the approach loss and push-away loss through geometric constraint co-optimization, the regression network to be trained is jointly trained. The constraint on the angle between candidate feature vectors using cosine similarity loss includes: Arrange the candidate feature vectors in ascending order of discrete candidate values; Through calculation formula Calculate the cosine similarity between two candidate feature vectors; wherein, the Let represent the cosine similarity between the a-th candidate feature vector and the b-th candidate feature vector. express calculate, This represents matrix multiplication calculation. It is a set of candidate feature vectors. ; Through calculation formula Calculate the first loss; Through calculation formula Update the candidate feature vectors so that the angle between adjacent vectors is fixed at a preset value. ; The step of selecting positive candidate feature vectors from candidate feature vectors based on the labeled value y. The index q satisfies: ;in, Discrete candidate values.

2. The training method for a noisy, imbalanced sample image regression network according to claim 1, characterized in that, The process of generating M discrete candidate values ​​based on the range of labeled values ​​and a preset expected precision includes: Extract the maximum value from the labeled values. and minimum label value ; Through calculation formula Calculate the number M of discrete candidate values; where W is the preset expected precision. To The calculation result is rounded up; Through calculation formula Calculate discrete candidate values ;in, .

3. The training method for a noisy, imbalanced sample image regression network according to claim 2, characterized in that, The negative candidate feature vector set The index u satisfies: .

4. The training method for a noisy, imbalanced sample image regression network according to claim 3, characterized in that, The formula for calculating the convergence loss is: The narrowing loss is used to minimize the difference between the predicted feature vector p and the positive candidate feature vector. The cosine deviation of the included angle; the Represents the predicted feature vector p and the positive candidate feature vector The cosine similarity.

5. The training method for a noisy, imbalanced sample image regression network according to claim 4, characterized in that, The formula for calculating the push-out loss is: The push-away loss is used to force the predicted feature vector p to move away from the set of negative candidate feature vectors. .

6. The training method for a noisy, imbalanced sample image regression network according to claim 5, characterized in that, Joint training of the regression network to be trained includes: Let the predicted feature vector p and the negative candidate feature vector set be... The angle between the predicted feature vector p and the positive candidate feature vector is greater than the angle between the predicted feature vector p and the positive candidate feature vector. Calculate the shrinkage loss using the shrinkage loss calculation formula. ; Calculate the thrust loss using the formula. ; Through calculation formula The regression network to be trained is trained, wherein the... These are the learnable parameters of the regression network to be trained.

7. The training method for a noisy, imbalanced sample image regression network according to claim 6, characterized in that, The first loss is used to force the spatial geometric relationship of all candidate feature vectors to be consistent with the numerical order of the corresponding discrete candidate values.

8. An application of a noisy, imbalanced sample image regression network, characterized in that, include: Obtain the image sample data to be regressed; The image sample data is input into the trained regression network to obtain the predicted feature vector, wherein the trained regression network is a model obtained based on the training method of a noisy imbalanced sample image regression network according to any one of claims 1-7. The weight ratio is obtained by the cosine similarity between the normalized predicted feature vector and all candidate feature vectors. The weight ratio and discrete candidate values ​​are then weighted and fused to output the final regression prediction result.

Citation Information

Patent Citations

  • Text recognition model training method and device, text recognition method and device and electronic equipment

    CN114022887A

  • Image regression model training method, image regression analysis method, medium and terminal

    CN115240029A