Deep learning image recognition and classification system and method
By introducing attention sparse regularization and dynamic difficulty estimation modules into the deep learning image recognition system, combined with multi-level optimizer control, the problems of lack of sparsity and insufficient training adaptability in feature modeling are solved, and the recognition accuracy and robustness are improved.
Patent Information
- Application Number
- CN202510614161.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-08-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing deep learning image recognition system lacks sparse constraints in the feature modeling process, resulting in invalid attention to secondary areas, insufficient training adaptability, rigid optimizer scheduling, weak local and global feature fusion ability, which affects the recognition accuracy and robustness.
The attention sparse regularization module is introduced to impose sparse constraints in the feature extraction process, combined with dynamic difficulty estimation and multi-level optimizer control module, dynamically select the optimizer and adjust the sparse regularization weight, combined with local and global features to generate more distinctive feature expressions.
It improves the model's ability to capture key fine-grained features, enhances the stability and generalization performance of training, and improves the accuracy and robustness of image recognition.
Smart Images

Figure CN120472231A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence and computer vision technology, and specifically to a deep learning image recognition and classification system and method. Background Art
[0002] With the continuous development of artificial intelligence technology, deep learning is increasingly being used in image recognition and classification tasks. Automated processing of multi-source heterogeneous image data has become a critical requirement in fields such as autonomous driving, medical image analysis, industrial quality inspection, security monitoring, and drone navigation. This paper proposes a deep learning image recognition and classification system and method that can support feature learning and classification decisions for large-scale, complex images. This system plays a key role in improving the intelligence level of visual systems, enhancing environmental perception capabilities, and optimizing information processing efficiency, and has broad application prospects.
[0003] Existing deep learning image recognition systems often lack sparsity constraints on attention distribution during feature modeling, resulting in ineffective attention to less important areas, impacting overall recognition accuracy. Current mainstream training mechanisms typically process all samples with a unified strategy, lacking dynamic awareness of changes in sample learning difficulty and insufficient training flexibility. The choice of optimizer is typically fixed at the beginning of training, making it difficult to match the optimal update path when faced with differences in sample complexity. The training process is also susceptible to local extrema, ultimately limiting performance. Regarding feature fusion, existing methods often fail to balance local details with understanding of global structure, leading to deviations in the modeling of information at different scales and difficulty accurately processing highly complex images. Overall, existing technologies lack a feature enhancement mechanism guided by sparsity regularization, the ability to dynamically control training strategies, methods for coordinating multiple optimizers, and system designs for local-global fusion. These limitations hinder the stability and robustness of deep learning image recognition systems in complex environments. Summary of the Invention
[0004] In response to the shortcomings of the existing technology, the present invention provides a deep learning image recognition and classification system and method, aiming to solve the problems of feature redundancy, insufficient training adaptability, rigid optimizer scheduling, and weak local and global feature fusion capabilities in existing image recognition systems, thereby improving the recognition accuracy and robustness of the model.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions: a deep learning image recognition and classification system, comprising: An input preprocessing module is used to receive the original image and perform normalization, enhancement and size adjustment on it to generate a preprocessed image; A dynamic cropping-reconstruction module is used to extract shallow features from the preprocessed image and generate a feature response map, identify high-confidence local areas, extract local and global features and fuse them to generate a fused feature; A feature extraction and modeling module, configured to receive the fused features and further extract deep feature representations to generate more discriminative feature expressions; An attention sparsity regularization module, which performs attention weighting on the deep feature representation during the feature extraction process in the feature extraction and modeling module, generates an attention matrix, and applies a sparsity regularization constraint to the attention matrix; A dynamic difficulty estimation and multi-level optimizer control module is used to dynamically select an optimizer according to the training difficulty of the sample during training and synchronously adjust the weight of the attention sparsity regularization; The classification decision module is used to make classification predictions based on the deep feature representation and output corresponding category results.
[0006] Preferably, the input preprocessing module includes: An image normalization unit, used to perform pixel normalization on the original image; Data augmentation unit, used to perform random cropping, rotation and color perturbation on the original image; The size adjustment unit is used to adjust the original image to a preset size.
[0007] Preferably, the dynamic cropping-reconstruction module includes: A shallow feature extraction unit, used to extract shallow features from the preprocessed image; A cropping decision unit is used to determine multiple high-confidence local regions based on the feature response map generated by shallow features; A local feature extraction unit, used to extract features of each high-confidence local area; A global feature extraction unit, used to extract global features of the entire preprocessed image; The feature fusion unit is used to combine local features with global features to form fused features.
[0008] Preferably, the feature extraction and modeling module includes a convolutional neural network, a Transformer network, or a combined network structure of a convolutional neural network and a Transformer network to extract a multi-scale deep feature representation of the fused features.
[0009] Preferably, the attention sparse regularization module applies an L1 norm regularization constraint to the generated attention matrix during the feature extraction process to encourage attention allocation to concentrate on key feature areas and suppress redundant features; The loss formula of the sparse regularization is: ; in, represents the sparsity regularization loss term; represents the sparsity regularization weight coefficient; Represents the dimension of the attention feature vector; Indicates the first The value of an element.
[0010] Preferably, the dynamic difficulty estimation and multi-level optimizer control module dynamically adjusts the weight of sparsity regularization according to the difficulty of the training sample to adapt to the changes in sample learning complexity. The total loss function of the training is defined as: ; in, represents the overall training loss function; Indicates loss of basic mission; represents the sparsity regularization loss term; represents the sparsity regularization weight.
[0011] Preferably, the difficulty of the training sample is estimated by a weighted combination of the loss gradient modulus and the loss change variance, and the difficulty estimation formula of the training sample is: ; in, Indicates the difficulty of the training sample; Represents the gradient of single-sample loss with respect to model parameters; represents the two-norm; represents the variance of the loss; is the weighting coefficient.
[0012] Preferably, the dynamic difficulty estimation and multi-level optimizer control module switches between different optimizers according to the difficulty of the training samples during the training process; the optimizer selection strategy is: ; in, ; ; ; The optimizer used is The learning rate when The optimizer used is The learning rate when The optimizer used is The learning rate when .
[0013] Preferably, the classification decision module includes a linear classifier, generates classification results based on deep feature representation, and uses cross entropy loss as an optimization target.
[0014] The present invention also provides a deep learning image recognition and classification method, comprising the following steps: Receive the original image and normalize, enhance and resize it through the input preprocessing module to generate a preprocessed image; Extract shallow features to generate feature response maps, determine high-confidence local areas and extract local features, and fuse them with global features to generate fused features; Input the fused features into the feature extraction and modeling module to extract deep feature representation; Apply attention weighting and sparsity regularization to deep feature representation; During training, the optimizer is dynamically selected based on the sample difficulty and the sparsity regularization weight is adjusted synchronously; Perform classification prediction based on deep features and output category labels.
[0015] The present invention provides a deep learning image recognition and classification system and method. It has the following beneficial effects: 1. This invention introduces sparsity regularization constraints in the feature extraction process to suppress the allocation of attention to irrelevant feature areas, significantly improving the model's ability to capture key fine-grained features, thereby maintaining high-precision image recognition performance under complex background interference.
[0016] 2. The present invention designs a dynamic difficulty estimation module based on the dynamic changes of sample training, which can evaluate the learning difficulty of training samples in real time and adjust the training strategy accordingly, so that the model can achieve adaptive learning between easy and difficult samples, thereby enhancing the stability and convergence of training.
[0017] 3. The present invention uses a multi-level optimizer control mechanism to automatically switch optimizers according to the difficulty of training samples, matching appropriate optimization paths for learning stages of different complexities, effectively improving the training speed, and enhancing the generalization performance of the model through dynamic adjustment strategies.
[0018] 4. In the feature extraction process, the present invention combines dynamic cropping of high-confidence local areas with global feature reconstruction, fully integrating local fine-grained features with overall structural information, improving the model's ability to model and understand multi-scale image features and improving classification accuracy.
[0019] 5. This invention systematically optimizes the training process and feature learning process through the synergistic effect of multiple innovative mechanisms such as sparsity regularized attention guidance, dynamic difficulty estimation, adaptive optimizer switching and local-global feature fusion, thereby improving the overall recognition accuracy and robustness of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a module architecture diagram of the present invention; Figure 2 This is an architecture diagram of the input preprocessing module of the present invention; Figure 3 This is the architecture diagram of the dynamic cropping-reconstruction module of the present invention Figure 4 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0021] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the present specification. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0022] Please see the attached Figure 1 -Attached Figure 3 , an embodiment of the present invention provides a deep learning image recognition and classification system, including: An input preprocessing module is used to receive the original image and perform normalization, enhancement and size adjustment on it to generate a preprocessed image; As a crucial component of the deep learning image recognition and classification system of the present invention, the input preprocessing module is responsible for converting raw image data into standardized input data. This module not only provides unified and quality-controlled input features for the subsequent dynamic cropping and reconstruction module, but also influences overall system training stability and reasoning consistency. To ensure a seamless flow of processing while balancing diversity and standardization, this module incorporates normalization, data augmentation, resizing, and other steps, and appropriately supports batch processing mechanisms.
[0023] In some implementations of the present invention, the input preprocessing module first receives the original image data, denoted as .in, Indicates the height of the image, Indicates the width of the image, is the number of image channels, usually 3, corresponding to RGB three-channel color image.
[0024] Generally speaking, in order to eliminate the problem of inconsistent pixel scales caused by different image sources, the input image needs to be normalized first. Specifically, each original pixel value Convert according to the following relationship: ; in, is the normalized pixel value, It is the original pixel value, ranging from 0 to 255.
[0025] As an option, in some embodiments, zero-mean normalization can be further performed based on the statistical characteristics of the training set. That is, after normalization, each pixel Apply the following transformation: ; in, is the normalized pixel value; is the mean of the pixel values of each channel; is the standard deviation of the pixel values of each channel. The above mean and standard deviation can be obtained by statistically analyzing the training data set, or by using preset standard values.
[0026] After the normalization step, the input preprocessing module performs data augmentation operations to enhance data diversity and prevent model overfitting. Specifically, this includes but is not limited to the following processing methods: In one possible implementation, the random cropping operation first determines a cropping window with a random position and random scale on the original image. The ratio is usually controlled between 0.8 and 1.0. After the cropping is completed, the content in the window is scaled to the specified input size.
[0027] In some embodiments, random rotation can be introduced to perturb the image within an angle range of −15° and +15°. The rotation operation can be performed based on the image center, and boundary compensation can use constant padding or mirror padding strategies to prevent deformation caused by image size changes.
[0028] In order to further increase the variation of color distribution, in general, perturbations in brightness, contrast, saturation, etc. can be performed. For example, brightness variation can be defined as follows: ; in, is the pixel value after brightness adjustment; is the brightness perturbation factor, usually Random value between .
[0029] Similarly, saturation perturbation and contrast perturbation can be adjusted multiplicatively, and the parameter range is set according to the characteristics of the actual dataset.
[0030] In some embodiments, the input preprocessing module further supports random horizontal flipping operations with probability (Usually 0.5) Flip the image left and right to increase the symmetry of the training sample.
[0031] After processing, the input image is resized to a uniform size to ensure consistency of input to the subsequent feature extraction network. In general, and Standard sizes such as 224 or 512 are used, but other values can be set based on actual application requirements. During the resizing process, interpolation is used to fill in pixels. Interpolation methods can include nearest neighbor interpolation, bilinear interpolation, or bicubic interpolation. Bilinear interpolation is preferred because it strikes a good balance between computational complexity and image smoothness.
[0032] It should be noted that in this embodiment, the input preprocessing module not only supports processing a single image, but can also be extended to batch image input. ,in Batch processing can improve the overall data flow throughput, especially significantly improving the utilization of computing resources during the training phase.
[0033] In some possible implementations, in order to increase the robustness of the model to abnormal samples, weak noise injection can be introduced in the preprocessing stage. The addition of Gaussian noise can be performed according to the following formula: ; in, The mean is 0 and the variance is Gaussian distributed noise; Typically set to less than 0.02.
[0034] In this embodiment, the image obtained after normalization, data enhancement, and size adjustment is recorded as . It will be directly passed as input to the dynamic cropping-reconstruction module. Subsequent modules will be based on Extract the feature response map and further perform high-confidence region recognition and feature fusion operations. Therefore, the quality of the input preprocessing module is directly related to the performance stability and recognition accuracy of the overall system.
[0035] A dynamic cropping-reconstruction module is used to extract shallow features from the preprocessed image and generate a feature response map, identify high-confidence local areas, extract local and global features and fuse them to generate a fused feature; After completing the standardization operation of the input preprocessing module, the image data The image is directed to the dynamic cropping and reconstruction module, which aims to adaptively select local key areas based on the input image feature response while preserving the overall scene information. This module further improves the subsequent deep feature extraction and classification performance by jointly encoding local and global features.
[0036] Generally speaking, images First, through the shallow feature extraction network , to generate a preliminary texture feature response map The extraction process can be expressed as: ; in, , and are the height and width of the shallow feature map respectively.
[0037] Shallow feature extraction networks typically use lightweight convolutional structures. Alternatively, the convolution kernel size can be 3×3 with a stride of 1 to preserve more local texture information. Alternatively, the stride can be adjusted to 2 based on computational resource constraints to achieve a trade-off between feature extraction speed and spatial resolution.
[0038] In order to enhance the accuracy of subsequent cropping decisions, the shallow feature response map S is generally normalized. The normalization process can be performed using a linear stretching method, and the specific formula is as follows: ; in, Represents the normalized feature response value; and are the minimum and maximum values of all elements in S respectively; :gather Middle Rank The element value of the column (such as the original brightness value of a pixel).
[0039] In one possible implementation, a response threshold is set. , usually the value range is 0.6, 0.8, select all The position of is taken as the candidate center point of the local region of interest.
[0040] After determining the local center point, you can use the preset cropping window size Perform local area extraction. Specifically, for the center position , local area It can be defined as: ; in, The height of the cropping window; is the cropping window width, usually and , and can also be flexibly adjusted according to actual needs.
[0041] In order to prevent the cropping window from exceeding the original image boundary, usually Coordinates are corrected to ensure Always in within the range.
[0042] In this embodiment, each local area Input independent local feature extraction network , and obtain the local feature representation: ; in, It is the feature vector or feature map corresponding to the local cropping area.
[0043] At the same time, the overall input image Through the global feature extraction network Perform global feature extraction and then use global average pooling (GAP) operation to obtain global features , the expression is: ; in, , is the dimension of the global feature vector.
[0044] In general, in order to achieve effective fusion of local and global features, this embodiment adopts the feature concatenation method to concatenate all local features and global features in the feature dimension to form a fusion feature. , as follows: ; in, Represents a matrix or feature map Middle Rank The characteristics of the column, here is an index, indicating a specific feature of the location; Represents the characteristics of a region or a specific layer; The number of local cropping regions is usually set between 2 and 5 and adjusted appropriately according to the complexity of the task.
[0045] As an option, after feature concatenation, a linear transformation can be added Perform dimension compression, where is the feature dimension after concatenation, is the target dimension after compression. The linear transformation expression is: ; in, represents the input feature matrix; is the weight matrix, the learned parameters; is the output feature matrix.
[0046] ; The center position is corrected to: ; By introducing perturbations, we can simulate position uncertainty in natural environments and improve the robustness of the model.
[0047] As an option, the number of local regions It can also be adjusted dynamically based on the characteristic response strength instead of a fixed number. For example, when the number of high response points is insufficient, the , ensuring that local information is sufficient but not too sparse.
[0048] Finally, the fusion features As the output of the dynamic cropping-reconstruction module, it is directly sent to the feature modeling module for subsequent discriminant feature learning and reasoning.
[0049] A feature extraction and modeling module, configured to receive the fused features and further extract deep feature representations to generate more discriminative feature expressions; After completing dynamic cropping and feature reconstruction, the system obtains the input features after local and global feature fusion processing. . In order to further refine deep semantic information and map feature vectors to task-related output spaces, the present invention designs a feature extraction and modeling module. This module not only improves feature resolution, but also provides a more refined basis for discrimination for subsequent classification or regression tasks. The overall processing process forms a natural continuity with the dynamic cropping-reconstruction module, ensuring the coherence of the overall system structure and the consistency of the processing flow.
[0050] Typically, input First pass it to the feature transformation network Perform high-order feature extraction. In this embodiment, the feature extraction process can be described as follows: ; in, , represents the high-order feature vector after feature extraction, is the dimension of the feature space.
[0051] Specifically, the feature transformation network It can be composed of a series of linear layers and nonlinear activation functions. As an option, the linear layer uses a fully connected operation and the nonlinear activation uses a ReLU function to enhance the feature expression capability.
[0052] In one possible implementation, the feature extraction network includes two layers of linear transformation, the first layer expands the dimension, and the second layer compresses the dimension.
[0053] The expansion operation can be expressed as: ; The compression operation further obtains the final features: ; in, 、 is the weight matrix; 、 is the corresponding bias term; is the input feature dimension; Expand the feature dimension in the middle.
[0054] In general, Can be taken or , used to increase the nonlinear expression capacity of features.
[0055] The dimension is set to 256, 512 or higher depending on the application scenario to balance feature richness and computational efficiency.
[0056] To mitigate the risk of overfitting, a dropout mechanism can be introduced between feature transformation layers. Optionally, the dropout ratio can be set between 0.3 and 0.5, depending on the size of the training set and the noise level.
[0057] In this embodiment, the extracted high-level features It is passed as input to the task modeling submodule. In the classification task scenario, the modeling submodule usually uses a fully connected layer plus softmax activation for inference, as shown below: ; in, 、 ; is the number of output categories.
[0058] As an option, for regression tasks, the modeling submodule can be simplified to a layer of linear transformation to predict the output The calculation formula is ; in, 、 .
[0059] Specifically, the difference between the classification and regression submodules is only reflected in the design of the output mapping layer, and the feature extraction part remains consistent.
[0060] In one possible implementation, in order to further enhance the model's modeling of the importance of local features, the present invention introduces an attention mechanism module. For example, the SE (Squeeze-and-Excitation) mechanism can be used to adaptively adjust the feature channel weights.
[0061] The SE module processing process is as follows: First, the eigenvector Perform global pooling to obtain the channel description vector , the formula is: ; Subsequently, the channel attention vector is generated through two layers of linear transformation and nonlinear activation ; Finally, the original eigenvector With channel attention Perform element-by-element multiplication to obtain weighted features: ; in, Represents the Sigmoid activation function; , are linear transformation matrices respectively; , is the bias term; Represents an element-wise product operation.
[0062] In general, the features after channel weighting It has better discriminability and expression ability.
[0063] As an option, after feature transformation, in order to further standardize the feature distribution, the feature vector can be L2 normalized. The normalization formula is as follows: ; in, express The second norm of , that is: ; Normalized features This is then fed into a classifier or regressor to complete the final inference.
[0064] In some embodiments, in order to improve the deep feature modeling effect, a residual connection mechanism can be introduced, that is, a skip connection is added between every two layers to prevent the gradient disappearance problem in the deep network.
[0065] In terms of loss function design, in general, cross entropy loss is used for classification tasks and mean square error (MSE) loss is used for regression tasks.
[0066] The specific loss expression is as follows: Classification task: ; Return mission: ; in, is the true label; is the predicted value; and Respectively represent True and predicted probabilities of the classes.
[0067] The overall optimization process is performed through back-propagation with an optimizer (such as Adam or SGD) for parameter updates.
[0068] As an option, the learning rate can adopt a dynamic adjustment strategy, such as CosineAnnealing or Warm-up mechanism, to further improve the convergence speed and model performance.
[0069] An attention sparsity regularization module, which performs attention weighting on the deep feature representation during the feature extraction process in the feature extraction and modeling module, generates an attention matrix, and applies a sparsity regularization constraint to the attention matrix; After the feature extraction and modeling module outputs high-order features, the present invention introduces an attention sparsity regularization module to further suppress irrelevant features and highlight key information. This module is closely integrated with the feature modeling component, ensuring the natural continuity of the data flow in the end-to-end training process without causing sudden changes or anomalies in the feature space. By imposing sparsity constraints at the feature channel level, this module effectively optimizes feature utilization efficiency and avoids overfitting caused by redundant channels.
[0070] In general, the feature vector output from the feature extraction and modeling module is or attention-weighted features is used as the initial input to the attention sparse regularization module.
[0071] In this embodiment, in order to extract the importance weight of each feature channel, an additional attention generation network is introduced .
[0072] Specifically, the attention generation network can contain one or more layers of linear mapping and appropriate nonlinear activation functions. The final generated attention weight vector is denoted as .
[0073] The calculation method of attention weight can be expressed as: ; in, is the weight matrix; is the bias term; Represents the Sigmoid activation function, which is used to map weights to the range 0 and 1.
[0074] As an option, in order to reduce the computational complexity of the attention generation network, low-rank decomposition or weight sharing can be used to convert Decompose it into the product of two small matrices, thereby reducing the number of parameters and improving inference speed.
[0075] In this embodiment, the attention vector obtained For input features or Element-wise weighting to generate sparse weighted features , the formula is as follows: ; Where ⊙ represents an element-by-element multiplication operation.
[0076] Generally speaking, in order to make the attention vector naturally sparse, that is, most channel weights are close to zero and only a small number of valid feature channels are retained, a sparse regularization loss term is introduced into the training objective.
[0077] The most common approach is based on The norm designs sparse loss, and the specific expression is as follows: ; in, represents the hyperparameter that controls the strength of the sparsity constraint; is the number of features or parameters; For the feature weights or coefficients.
[0078] Alternatively, to gain more fine-grained control over the sparsity distribution, a group-wise sparsity regularization strategy can be employed.
[0079] That is, the feature channels are divided into several groups, and the weight vectors within each group are calculated norm, and then the overall weighted summation, the formula is as follows: ; in, Indicates the feature groups; is the total number of groups; is the group sparsity regularization hyperparameter.
[0080] Specifically, grouping can be performed according to the natural hierarchical structure of the feature space, such as dividing channel features in adjacent order or dividing them according to functional relevance.
[0081] In one possible implementation, in order to avoid information loss caused by overly strong sparsity constraints, a minimum entropy regularization term can be added to the sparsity regularization term to encourage clarity in the distribution of attention weights.
[0082] Minimum entropy regularization term It can be expressed as: ; in, is the minimum entropy regularization hyperparameter, To prevent numerical instability, a very small constant is usually taken as 1×10 -8 .
[0083] As an option, a dynamic weight adjustment mechanism can be used to 、 、 It increases gradually as the training progresses, thus avoiding the obstruction of feature learning due to overly strong sparse constraints in the early stages of training.
[0084] In this embodiment, the comprehensive loss function It can be defined as: ; in, 、 、 are the balance coefficients corresponding to the regularization terms, The main task loss, such as cross entropy or mean squared error.
[0085] In some embodiments, in order to further improve the sparse regularization effect, a soft threshold correction mechanism can be set. When , it is directly set to zero. The specific operation is: ; in, It is a preset threshold, usually between 0.05 and 0.1.
[0086] The final output sparse features After regularization processing, the most core information content is retained, which effectively improves the discrimination performance and anti-interference ability of subsequent reasoning modules, while avoiding the waste of training resources caused by the expansion of network scale.
[0087] A dynamic difficulty estimation and multi-level optimizer control module is used to dynamically select an optimizer according to the training difficulty of the sample during training and synchronously adjust the weight of the attention sparsity regularization; After the attention sparsity regularization module outputs optimized features, the present invention proposes a dynamic difficulty estimation and multi-level optimizer control module to further address the differences in difficulty among different training samples. This module seamlessly integrates with the output of the previous stage and automatically evaluates and adjusts the training difficulty of the sample to ensure a more stable and efficient learning process for complex tasks. By dynamically managing the difficulty of the training samples and employing a multi-level optimizer strategy, this module can significantly improve training efficiency and reduce the risk of overfitting.
[0088] Generally, the output features from the upstream module The dynamic difficulty estimation process will begin. This process first determines the difficulty of each sample by calculating the loss value. The loss value of a single sample Expressed as: ; in, is the predicted output, is the true label, is a task-specific loss function. In classification tasks, the loss function is usually cross entropy loss: ; In regression tasks, the loss function usually uses mean square error: ; After calculating the loss of each sample, this module dynamically classifies it according to the sample loss value, usually into easy samples, medium samples and hard samples.
[0089] Easy samples refer to samples with smaller losses and more accurate predictions, while difficult samples refer to samples with larger losses and difficult predictions.
[0090] Specifically, the difficulty level of samples is divided according to the size of their loss values.
[0091] The training samples can be sorted by loss value and divided into different difficulty groups according to a preset ratio. For example, the first 30% of samples are easy samples, the middle 40% are medium samples, and the last 30% are difficult samples.
[0092] This division helps to dynamically adjust the optimization strategy during training.
[0093] Generally speaking, the higher the difficulty of the sample, the greater the impact on the training process. To this end, this module adopts a multi-level optimizer control mechanism to process samples of different difficulty levels through different optimization strategies.
[0094] For example, for easy samples, a higher learning rate and a smaller momentum factor can be used to accelerate the training process and improve the convergence speed; while for difficult samples, a lower learning rate and a larger momentum factor can be used to ensure a stable training process and prevent gradient explosion or excessive fluctuations.
[0095] In this embodiment, the learning rate of the easy sample Higher learning rates for difficult samples The momentum factor is lower and the momentum factor is the opposite. The specific settings are: ; ; in, represents the learning rate, represents the momentum factor.
[0096] This learning strategy helps to adjust the step size of the training process according to the training difficulty of the sample, avoiding the model from falling into local optimality during training.
[0097] Alternatively, separate optimizers are used for training at different difficulty levels.
[0098] For example, different optimizer instances (such as Adam, SGD, etc.) can be initialized for easy samples, medium samples, and hard samples respectively, and the optimizer used can be switched in real time according to the sample difficulty.
[0099] The flexibility of optimizer selection helps to further improve training efficiency and accuracy.
[0100] In order to improve the stability and adaptability of training, this module also introduces a dynamic difficulty estimation mechanism.
[0101] During the training process, after a certain number of training steps (such as each epoch or several batches), the loss of the current sample is re-evaluated, and the difficulty level of the sample is dynamically adjusted according to the updated loss.
[0102] Specifically, the sliding window averaging method can be used to calculate the loss of samples to avoid affecting the stability of difficulty estimation due to excessive fluctuations in single loss values.
[0103] At this time, the update rule of the loss function is: ; in, is the sample loss after sliding window smoothing; is the window size, usually 5 to 10 steps. After updating the sample difficulty grouping, this module further adjusts the weight of each sample during training through a dynamic weighting mechanism.
[0104] Specifically, the gradient update rule of the sample is: ; in, is the difficulty weight factor of the sample; is the learning rate; is the loss gradient of the sample; are model parameters.
[0105] Difficulty Weight Factor Dynamically adjust according to the difficulty of the sample. For example, the weight of easy samples is lower, and the weight of difficult samples is higher.
[0106] Through this weighted mechanism, the optimizer can be guided to focus more on samples with higher difficulty, thereby improving the model's ability to learn complex samples.
[0107] In addition, in order to further improve the accuracy of sample selection, this module supports the introduction of strategies based on experience resampling.
[0108] That is, in each training iteration, samples can be resampled based on the loss of each sample, with samples with larger losses being prioritized for update. This approach can further improve the learning efficiency of difficult samples during training.
[0109] Ultimately, through the synergy between dynamic difficulty estimation and multi-level optimizer control mechanism, this module can effectively adjust the learning pace and sample distribution during training, improving the stability and efficiency of training and the final performance of the model.
[0110] A classification decision module, configured to make classification predictions based on the deep feature representation and output corresponding category results; After completing dynamic difficulty estimation and multi-level optimizer control, the classification decision module aims to transform feature information obtained from upstream modules into specific category predictions. This module processes the optimized features through fully connected layers and a softmax activation function, ultimately generating the model's classification results. The classification decision module not only assumes responsibility for the model's final output but also ensures classification accuracy and robustness based on a multi-level, comprehensive optimization approach.
[0111] In general, the output features from the dynamic difficulty estimation and multi-level optimizer control module It will serve as the input of the classification decision module.
[0112] In this embodiment, the classification decision module maps the input features through a fully connected network layer to generate the predicted probability of each category. Through the fully connected layer, combined with the weights and bias, the output category probability is: ; in, is the category probability distribution of the classification task; is the number of categories; is the weight matrix of the classification layer; is the bias term; is the input feature; is the feature dimension.
[0113] The Softmax function maps the output of each category to a probability value, and the sum of the probabilities of all categories is 1. The formula is as follows: ; in, Representation category The predicted probability of .
[0114] In some embodiments, for multi-label classification tasks, Softmax may be replaced with a Sigmoid activation function to ensure that the probability of each category is calculated independently, rather than forcing normalization. In this case, the model will independently predict the probability of each category, which is suitable for tasks with multiple independent labels.
[0115] Generally, the classification decision module generates the final prediction category based on the output of Softmax.
[0116] Specifically, by selecting the category with the highest probability as the final prediction result, the formula is: ; in, is the predicted category; Indicates that the category index with the maximum probability is selected.
[0117] In order to further improve the stability and robustness of the model, a regularization strategy is introduced in this embodiment to prevent overfitting.
[0118] Specifically, the Dropout mechanism can be used to add a Dropout layer before the classification layer so that each neuron is randomly inactivated during the training process. It is set between 0.3 and 0.5 to effectively prevent the model from over-relying on certain specific neurons.
[0119] As an option, if the learning rate fluctuates greatly during training, a BatchNormalization layer can be introduced.
[0120] Batch Normalization reduces the impact of internal bias during training by standardizing the input of each layer, thereby improving training stability. Specifically, the normalization formula is as follows: ; in, For the The input of samples, and are the mean and standard deviation of the input to this layer, and are learnable parameters used to scale and translate the normalized output.
[0121] In order to further improve the classification accuracy, the target label can be smoothed by combining the Label Smoothing technology. Specifically, by Smoothing is performed to avoid overfitting of the model to certain categories. The label calculation method after smoothing is ; in, is the smoothing coefficient; usually is the number of categories; is the target label.
[0122] In the scenario of multi-task learning, the classification decision module can also support the joint optimization of multiple tasks.
[0123] In this case, the loss functions of multiple tasks will be combined into a total loss function through weighted summation, so that multiple tasks can be optimized simultaneously.
[0124] For example, classification and regression tasks can share part of the network structure and improve the overall system performance through joint optimization: ; in, and is the task weight hyperparameter; is the loss for the classification task; is the loss of the regression task.
[0125] In order to further optimize the attention mechanism of the model, the classification decision module can also adopt the self-attention mechanism.
[0126] The self-attention mechanism can dynamically assign different weights to different features, thereby better capturing the dependencies between different parts of the input data.
[0127] In this embodiment, weights can be assigned to input features using the following calculation method: ; ; in, represent query, key, and value matrices respectively; is the attention weight matrix; is the weighted output.
[0128] Finally, through the processing of the classification decision module, the system will output the category prediction , and conduct subsequent reasoning or evaluation based on the prediction results.
[0129] Please see the attached Figure 4 The present invention also provides a deep learning image recognition and classification method, comprising the following steps: Receive the original image and normalize, enhance and resize it through the input preprocessing module to generate a preprocessed image; Extract shallow features to generate feature response maps, determine high-confidence local areas and extract local features, and fuse them with global features to generate fused features; Input the fused features into the feature extraction and modeling module to extract deep feature representation; Apply attention weighting and sparsity regularization to deep feature representation; During training, the optimizer is dynamically selected based on the sample difficulty and the sparsity regularization weight is adjusted synchronously; Perform classification prediction based on deep features and output category labels.
[0130] The method of this embodiment can be used to execute the above system embodiment. Its principles and technical effects are similar and will not be described in detail here.
[0131] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. Deep learning image recognition and classification system, characterized by: include: An input preprocessing module is used to receive the original image and perform normalization, enhancement and size adjustment on it to generate a preprocessed image; A dynamic cropping-reconstruction module is used to extract shallow features from the preprocessed image and generate a feature response map, identify high-confidence local areas, extract local and global features and fuse them to generate a fused feature; A feature extraction and modeling module, configured to receive the fused features and further extract deep feature representations to generate more discriminative feature expressions; An attention sparsity regularization module, which performs attention weighting on the deep feature representation during the feature extraction process in the feature extraction and modeling module, generates an attention matrix, and applies a sparsity regularization constraint to the attention matrix; A dynamic difficulty estimation and multi-level optimizer control module is used to dynamically select an optimizer according to the training difficulty of the sample during training and synchronously adjust the weight of the attention sparsity regularization; The classification decision module is used to make classification predictions based on the deep feature representation and output corresponding category results.
2. The deep learning image recognition and classification system according to claim 1, characterized in that The input preprocessing module includes: An image normalization unit, used to perform pixel normalization on the original image; Data augmentation unit, used to perform random cropping, rotation and color perturbation on the original image; The size adjustment unit is used to adjust the original image to a preset size.
3. The deep learning image recognition and classification system according to claim 1, characterized in that The dynamic cropping-reconstruction module includes: A shallow feature extraction unit, used to extract shallow features from the preprocessed image; A cropping decision unit is used to determine multiple high-confidence local regions based on the feature response map generated by shallow features; A local feature extraction unit, used to extract features of each high-confidence local area; A global feature extraction unit, used to extract global features of the entire preprocessed image; The feature fusion unit is used to combine local features with global features to form fused features.
4. The deep learning image recognition and classification system according to claim 1, characterized in that The feature extraction and modeling module includes a convolutional neural network, a Transformer network, or a combined network structure of a convolutional neural network and a Transformer network to extract a multi-scale deep feature representation of the fused features.
5. The deep learning image recognition and classification system according to claim 1, characterized in that The attention sparse regularization module applies an L1 norm regularization constraint to the generated attention matrix during the feature extraction process to encourage attention allocation to concentrate on key feature areas and suppress redundant features; The loss formula of the sparse regularization is: ; in, represents the sparsity regularization loss term; represents the sparsity regularization weight coefficient; Represents the dimension of the attention feature vector; Indicates the first The value of an element.
6. The deep learning image recognition and classification system according to claim 1, characterized in that The dynamic difficulty estimation and multi-level optimizer control module dynamically adjusts the weight of sparsity regularization according to the difficulty of the training sample to adapt to the changes in sample learning complexity. The total loss function of the training is defined as: ; in, represents the overall training loss function; Indicates loss of basic mission; represents the sparsity regularization loss term; represents the sparsity regularization weight.
7. The deep learning image recognition and classification system according to claim 1, characterized in that: The difficulty of the training sample is estimated by a weighted combination of the loss gradient modulus and the loss change variance. The difficulty estimation formula of the training sample is: ; in, Indicates the difficulty of the training sample; Represents the gradient of single-sample loss with respect to model parameters; represents the two norm; Var represents the variance of the loss; is the weighting coefficient.
8. The deep learning image recognition and classification system according to claim 1, characterized in that: The dynamic difficulty estimation and multi-level optimizer control module switches between different optimizers according to the difficulty of the training samples during the training process; the optimizer selection strategy is: ; in, ; ; ; The optimizer used is The learning rate when The optimizer used is The learning rate when The optimizer used is The learning rate when .
9. The deep learning image recognition and classification system according to claim 1, characterized in that: The classification decision module includes a linear classifier, generates classification results based on deep feature representation, and uses cross entropy loss as an optimization target.
10. A deep learning image recognition and classification method, characterized in that: The image recognition and classification system using the deep learning according to any one of claims 1 to 9 comprises the following steps: Receive the original image and normalize, enhance and resize it through the input preprocessing module to generate a preprocessed image; Extract shallow features to generate feature response maps, determine high-confidence local areas and extract local features, and fuse them with global features to generate fused features; Input the fused features into the feature extraction and modeling module to extract deep feature representation; Apply attention weighting and sparsity regularization to deep feature representation; During training, the optimizer is dynamically selected based on the sample difficulty and the sparsity regularization weight is adjusted synchronously; Perform classification prediction based on deep features and output category labels.
Citation Information
Cited By
Intelligent monitoring system and method for high-altitude operation safety rope
CN120892695A
Intelligent monitoring system and method for aerial work safety rope
CN120892695B