Neural Network-Based Pattern and Texture Recognition Method and Apparatus

By employing a neural network approach involving multi-scale feature extraction, dynamic feature fusion, and quality assessment, the accuracy and robustness issues of texture recognition technology under complex backgrounds and varying lighting conditions are addressed, achieving efficient texture recognition and reliable classification results.

CN121095663BActive Publication Date: 2026-03-10NANCHANG NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511230294.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2026-03-10
Estimated Expiration
2045-08-29

AI Technical Summary

Technical Problem

Existing texture recognition technologies suffer from low accuracy and poor robustness when dealing with complex backgrounds and diverse texture images. They are particularly ineffective under varying lighting conditions and image quality fluctuations, failing to meet the accuracy and robustness requirements of practical applications.

Method used

A pattern and texture recognition method based on neural networks is adopted. Through multi-scale feature extraction, dynamic feature fusion and quality assessment, multi-scale convolution kernels, channel attention and spatial attention mechanisms are used, combined with regularized classification to generate adaptive multi-scale feature maps and quality assessment indices, thereby improving feature capture ability and classification reliability.

Benefits of technology

It significantly improves the accuracy and robustness of texture recognition, can automatically adjust judgment criteria in complex scenarios, reduce the risk of misjudgment, and enhance the reliability and adaptability of the model, especially performing well in applications such as industrial inspection and medical image analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121095663B_ABST
    Figure CN121095663B_ABST
Patent Text Reader

Abstract

This invention provides a pattern and texture recognition method and apparatus based on neural networks, relating to the field of texture recognition technology. Specifically, it includes: constructing a texture recognition model; extracting multi-scale features from the input image using convolutional kernels of different sizes; weighting and fusing the features to generate a dynamically fused feature map; using a channel attention mechanism to extract global channel information and generate channel attention weights; utilizing a spatial attention mechanism, extracting spatial information and generating spatial attention weights by combining average pooling and max pooling of the feature map with a spatial feature interaction formula; fusing channel and spatial attention weights to weight the feature map; performing global average pooling on the optimized feature map to generate a global feature vector; and combining an improved regularized classification formula to generate the final classification result. This method achieves efficient pattern and texture recognition through multi-scale feature extraction, attention mechanism fusion, and regularized classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of texture recognition technology, specifically to a method and apparatus for pattern texture recognition based on neural networks. Background Technology

[0002] In the field of pattern and texture recognition, traditional methods mainly rely on manual feature extraction and simple classifiers. These methods often fail to effectively capture complex texture features in images. Manual feature extraction depends on the experience of domain experts, and commonly used features include texture orientation, frequency information, and local binary patterns. These methods perform well when processing simple textures, but they fall short when dealing with images with complex backgrounds and diverse textures. Furthermore, traditional models typically use fixed convolutional kernels and feature extraction layers, lacking multi-scale considerations and failing to adapt to scale variations in different textures, thus leading to reduced recognition accuracy. Simultaneously, existing methods exhibit poor robustness to changes in lighting and image quality fluctuations, often failing to withstand the influence of different environmental conditions, resulting in poor final classification performance.

[0003] With the rapid development of deep learning, convolutional neural networks have been widely applied to texture recognition tasks. While this technology has improved the automation of feature extraction, it still has some shortcomings. Existing deep learning models often neglect the dynamic fusion of feature maps and the comprehensive utilization of multi-scale features, resulting in an incomplete understanding of textures in complex scenes. Furthermore, many deep learning models lack effective mechanisms to evaluate and adjust image quality when dealing with variables such as lighting variations, shooting angle differences, and image noise, leading to a significant decrease in classification accuracy on low-quality images. This situation means that in practical applications, especially in fields with high requirements for reliability such as industrial inspection and medical image analysis, traditional and existing deep learning methods cannot meet the growing demands for accuracy and robustness. Therefore, developing a texture recognition system that comprehensively considers multi-scale feature extraction, dynamic feature fusion, and quality assessment is imperative.

[0004] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] The purpose of this invention is to provide a pattern and texture recognition method and apparatus based on neural networks to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] A pattern and texture recognition method based on neural networks includes the following steps:

[0008] Step 1: Construct a texture recognition model based on a deep learning network. Extract multi-scale features from the input image using three different sizes of convolution kernels to generate feature maps of different scales. Perform global average pooling on the feature maps of each scale and combine dynamic weights and non-linear activation functions to generate adaptive multi-scale feature maps.

[0009] Step 2: For the adaptive multi-scale feature map, global channel information is extracted using the channel attention mechanism. Channel attention weights are generated by fusing global average pooling and max pooling and combining them with a nonlinear feature transformation formula.

[0010] Step 3: Extract spatial dimension information using the spatial attention mechanism. Calculate the spatial attention weights by using average pooling and max pooling of the feature map channels, combined with the spatial feature interaction formula. Generate a weighted feature map based on the weights of channel attention and spatial attention.

[0011] Step 4: Perform global average pooling on the feature map processed by the attention mechanism to generate a global feature vector. In the classification process, introduce a regularized classification formula, add a constraint term on the feature distribution to the Softmax function, and generate the final classification result.

[0012] Step 5: Collect the number of pixels in the input image, and simultaneously collect the light intensity and shooting angle when the input image was captured. After dimensionless processing of the number of pixels, light intensity and shooting angle, generate the quality assessment index of the input image, and judge the reliability of the classification result based on the quality assessment index.

[0013] Furthermore, the texture recognition model is based on a deep learning network and is constructed through a modular design. The model architecture consists of four main modules: a multi-scale feature extraction module, a dynamic fusion module, an improved channel and spatial attention module, and a regularized classification module. The entire architecture is based on an end-to-end neural network design, and each module is closely integrated through specific computational methods to form a texture recognition model.

[0014] Furthermore, multi-scale convolution is used to extract texture features at different scales in the image, while fusing local and global information, specifically:

[0015] The input image is fed into the model, defined in matrix form as follows: , indicating the input image It is a three-dimensional tensor. This indicates that each element of the tensor is a real value, where, The height of the image. The width of the image. The number of channels in the image. , indicating the RGB channel;

[0016] Three different sizes of convolution kernels are used: , , For the input image Perform convolution operations to extract features at different scales, as shown in the following expression:

[0017] , , ;

[0018] In the formula, express The feature map corresponding to the convolution kernel of the form Indicates use Convolution operations are performed using convolution kernels of the form [formula missing]. ;

[0019] Using a dynamic weighted fusion formula, the weights of features at each scale are calculated based on the feature distribution information obtained from global average pooling, and weighted fusion is performed on different features:

[0020] ;

[0021] In the formula, This represents the multi-scale feature map after dynamic weighted fusion. The adaptive weights corresponding to the convolution kernel scale are defined as follows:

[0022] ;

[0023] In the formula, Indicates the feature map Perform global average pooling to extract global context information. Representing scale A learnable bias parameter is used to balance the importance of different scales; the initial value is set to zero. It is an exponential function, used to enhance the differentiation of weights. Representation and convolution kernel scale The relevant learnable bias parameters;

[0024] right Applying the nonlinear activation function ReLU:

[0025] ;

[0026] In the formula, Represents an adaptive multi-scale feature map. ReLU is a non-linear activation function used to enhance the non-linear expressive power of features.

[0027] Furthermore, for adaptive multi-scale feature maps Perform global average pooling to generate channel-level global features:

[0028] ;

[0029] In the formula, This represents the channel-level global features generated after global average pooling. This represents the global average pooling operation, which reduces the spatial dimension of the feature map. Projection as ;

[0030] For feature maps Perform global max pooling to generate channel-level global features:

[0031] ;

[0032] In the formula, This represents the channel-level global feature generated after global max pooling. This indicates a global max pooling operation, which takes the maximum value of each channel;

[0033] Introducing a nonlinear feature transformation formula to calculate channel attention weights:

[0034] ;

[0035] ;

[0036] In the formula, For channel attention weights, It is the Sigmoid activation function, used to output channel weights. and These represent the weights and biases of the fully connected layer, respectively. This is a nonlinear transformation formula used to enhance the discriminative power of global features. It is the input quantity of the nonlinear transformation formula;

[0037] right Perform average pooling and max pooling along the channel dimension to generate two channels of size 1. Spatial feature map:

[0038] ;

[0039] In the formula, Indicates the location superior, The value obtained after average pooling along the channel dimension. For the channel index, , The number of channels in the feature map;

[0040] ;

[0041] In the formula, Indicates the location superior, The value obtained after max pooling along the channel dimension;

[0042] Spatial attention weights are generated through the following transformation:

[0043] ;

[0044] ;

[0045] In the formula, Represents spatial attention weights. It is the Sigmoid activation function, used to output weights. This is a spatial feature transformation formula used to combine the interrelationships of different spatial features. This represents the convolution operation. and This is the input quantity for the spatial feature transformation formula;

[0046] Apply channel attention and spatial attention to feature maps :

[0047] ;

[0048] In the formula, This represents the feature map after weighted processing by channel attention and spatial attention, i.e., the output texture feature map incorporating attention information. Represents the element-wise dot product. Represents spatial attention weights. This represents the channel attention weight.

[0049] Furthermore, for feature maps Perform global average pooling to generate global feature vectors. ;

[0050] An improved regularized classification formula is applied to classify features, based on the following formula:

[0051] ;

[0052] In the formula, Indicates the input image Features are categorized into categories The probability, Indicate category The weight vector, Represents the global feature vector. Indicate category The bias term is used to adjust the linear score of the classification. This represents the regularization coefficient, used to control the strength of the regularization term's influence on classification. Represents the expected value of the characteristic distribution. Represents an exponential function. This indicates that the process iterates through each category in the classification task. express and The square Euclidean distance between them;

[0053] The probabilities of all texture categories are compared, and the category with the highest probability is selected as the final classification result.

[0054] Furthermore, the quality assessment index of the input image is calculated using the following formula:

[0055] ;

[0056] In the formula, As a quality assessment index, Number of pixels The maximum pixel reference value. Light intensity, This serves as a reference threshold for light intensity. The shooting angle is within the range of [0, 180].

[0057] Furthermore, the specific logic behind judging the reliability of classification results based on quality assessment indices is as follows:

[0058] The quality assessment index is compared with a preset threshold, and the reliability of the classification result is determined based on the comparison result.

[0059] when If the input image quality meets the standard, the classification result is reliable.

[0060] when If the input image quality does not meet the standard, the accuracy of the classification result will decrease, and the classification result should be manually reviewed immediately.

[0061] In the formula, As a quality assessment index, This is a preset quality assessment threshold.

[0062] The present invention also provides a pattern and texture recognition device based on a neural network, wherein the pattern and texture recognition device based on a neural network is used to perform the above-described pattern and texture recognition method based on a neural network, comprising:

[0063] The multi-scale feature extraction module is based on deep learning to build a texture recognition model. It extracts multi-scale features from the input image through three different sizes of convolution kernels, generates feature maps of different scales, and uses a dynamic weighted fusion formula to calculate the weights of features at each scale based on the feature distribution information obtained by global average pooling. It then performs weighted fusion on different features to generate a dynamically fused multi-scale feature map.

[0064] The channel attention generation module is used to extract global channel information from the dynamically fused feature map using the channel attention mechanism, and generate channel attention weights by fusing global average pooling and max pooling, combined with a nonlinear feature transformation formula.

[0065] The spatial attention fusion module is used to extract spatial dimensional information using the spatial attention mechanism. It calculates spatial attention weights by using average pooling and max pooling of the feature map channels and combining the spatial feature interaction formula. The weights of channel attention and spatial attention are combined to generate a weighted feature map.

[0066] The regularized classification output module is used to perform global average pooling on the feature maps processed by the attention mechanism to generate global feature vectors. During the classification process, a regularized classification formula is introduced, and a constraint term on the feature distribution is added to the Softmax function to generate the final classification result.

[0067] The classification reliability judgment module is used to collect the number of pixels in the input image, as well as the light intensity and shooting angle when the input image was captured. After dimensionless processing of the number of pixels, light intensity and shooting angle, a quality assessment index of the input image is generated, and the reliability of the classification result is judged based on the quality assessment index.

[0068] Compared with the prior art, the beneficial effects of the present invention are:

[0069] This scheme, through multi-scale feature extraction and dynamic weighted fusion, enables the model to fully utilize texture information at different scales, thereby more effectively capturing detailed features in images and significantly improving the accuracy of texture recognition. Secondly, the introduction of channel attention and spatial attention mechanisms allows the model to automatically focus on features more important for classification, further enhancing classification performance. Furthermore, by correlating the calculation of the quality assessment index with the classification results, the model ensures that it can automatically adjust its judgment criteria when processing images of different quality, improving the reliability of the classification results and reducing the risk of misclassification due to poor image quality. This systematic approach provides higher reliability and effectiveness for the application of texture recognition technology, demonstrating broad application potential, especially in real-world scenarios. Attached Figure Description

[0070] Figure 1This is a schematic diagram of the overall method flow of the present invention;

[0071] Figure 2 This is a schematic diagram of the device module of the present invention. Detailed Implementation

[0072] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.

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

[0074] Example:

[0075] Please see Figure 1 The present invention provides a technical solution:

[0076] A pattern and texture recognition method based on neural networks includes the following steps:

[0077] Step 1: Construct a texture recognition model based on a deep learning network. Extract multi-scale features from the input image using three different sizes of convolution kernels to generate feature maps of different scales. Perform global average pooling on the feature maps of each scale and combine dynamic weights and non-linear activation functions to generate adaptive multi-scale feature maps.

[0078] In this embodiment, the texture recognition model is based on deep learning and constructed through modular design. The model architecture is divided into four main modules: a multi-scale feature extraction module, a dynamic fusion module, an improved channel and spatial attention module, and a regularized classification module. The entire architecture is based on an end-to-end neural network design, and each module is closely combined through specific computational forms to form an efficient texture recognition model.

[0079] Multi-scale convolution is used to extract texture features at different scales in the image, while fusing local and global information. Specifically:

[0080] The input image is fed into the model, defined in matrix form as follows: , indicating the input image It is a three-dimensional tensor. This indicates that each element of the tensor is a real value, where, The height of the image. The width of the image. The number of channels in the image. , indicating the RGB channel;

[0081] Three different sizes of convolution kernels are used: , , For the input image Perform convolution operations to extract features at different scales, as shown in the following expression:

[0082] , , ;

[0083] In the formula, express The feature map corresponding to the convolution kernel of the form Indicates use Convolution operations are performed using convolution kernels of the form [formula missing]. ;

[0084] Using a dynamic weighted fusion formula, the weights of features at each scale are calculated based on the feature distribution information obtained from global average pooling, and weighted fusion is performed on different features:

[0085] ;

[0086] In the formula, This represents the multi-scale feature map after dynamic weighted fusion. The adaptive weights corresponding to the convolution kernel scale are defined as follows:

[0087] ;

[0088] In the formula, Indicates the feature map Perform global average pooling to extract global context information. Representing scale A learnable bias parameter is used to balance the importance of different scales; the initial value is set to zero. It is an exponential function, used to enhance the differentiation of weights. Representation and convolution kernel scale The relevant learnable bias parameters;

[0089] right Applying the nonlinear activation function ReLU:

[0090] ;

[0091] In the formula, Represents an adaptive multi-scale feature map. This is used to increase the non-linear expressive power of features.

[0092] Step 1 extracts multi-scale features from the input image using three different sized convolutional kernels, effectively capturing both local details and global structural information within the clothing pattern. Furthermore, by employing a dynamic weighted fusion formula, feature distribution information is calculated based on global average pooling, achieving adaptive weighted fusion of multi-scale features. This allows the model to dynamically adjust the importance of features at different scales according to the characteristics of the pattern. This design is particularly effective in complex texture scenarios because it can flexibly handle pattern variations at different spatial scales, enhancing feature representation capabilities and model adaptability.

[0093] Compared to traditional feature extraction methods based on single-scale convolutional kernels, this scheme extracts texture features through multi-scale convolutional kernels and performs dynamic weighted fusion, effectively solving the problem that single-scale convolutional kernels cannot simultaneously capture local details and global information. Simultaneously, the dynamic weighting mechanism utilizes the global feature distribution to guide weight allocation, enhancing feature diversity and discriminability. This allows the model to better handle multi-scale texture variations in complex clothing patterns, significantly improving recognition accuracy and robustness. Step 1, as the foundational module of the model, directly determines the quality of input features for subsequent modules. Through multi-scale feature extraction and dynamic weighted fusion, this step not only provides more comprehensive and richer multi-scale feature inputs for subsequent channel attention and spatial attention modules but also improves the quality of combining global and local information, thus laying a solid foundation for the overall scheme to achieve efficient texture recognition. Ultimately, this multi-scale dynamic fusion strategy enhances the overall model's performance in complex clothing texture recognition, ensuring accuracy and robustness.

[0094] Step 2: For the adaptive multi-scale feature map, global channel information is extracted using the channel attention mechanism. Channel attention weights are generated by fusing global average pooling and max pooling and combining them with a nonlinear feature transformation formula.

[0095] In this embodiment, the adaptive multi-scale feature map Perform global average pooling to generate channel-level global features:

[0096] ;

[0097] In the formula, This represents the channel-level global features generated after global average pooling. This represents the global average pooling operation, which reduces the spatial dimension of the feature map. Projection as ;

[0098] For feature maps Perform global max pooling to generate channel-level global features:

[0099] ;

[0100] In the formula, This represents the channel-level global feature generated after global max pooling. This indicates a global max pooling operation, which takes the maximum value of each channel;

[0101] Introducing a nonlinear feature transformation formula to calculate channel attention weights:

[0102] ;

[0103] ;

[0104] In the formula, For channel attention weights, It is the Sigmoid activation function, used to output channel weights. and These represent the weights and biases of the fully connected layer, respectively. This is a nonlinear transformation formula used to enhance the discriminative power of global features. It is the input quantity of the nonlinear transformation formula; Part of it is used to amplify larger input values. Part of it is used to capture subtle changes in small inputs;

[0105] Step 2 fully extracts global channel information from the dynamically fused feature map using a channel attention mechanism. It then generates channel attention weights that are highly sensitive to channel information by combining global average pooling and global max pooling with a nonlinear feature transformation formula. This mechanism effectively captures the differences in importance between different channels in clothing patterns, allowing the model to focus more on channel features that contribute more to classification and recognition tasks, thereby optimizing feature representation and improving the model's ability to capture texture information.

[0106] Compared to traditional attention-free mechanisms or simple weighted feature processing methods, this step significantly improves the model's feature selection ability by incorporating a channel attention mechanism. The combination of global average pooling and max pooling enriches and enhances the global channel information, while the unique nonlinear feature transformation formula further strengthens the discriminative and expressive power of global features. This improvement overcomes the problems of inaccurate channel weight allocation and insufficient capture of key information in existing technologies, greatly improving the model's adaptability and robustness in complex texture scenarios. Step 2 provides the model with optimized channel weights, enabling the subsequent spatial attention mechanism to process on higher-quality feature maps, laying a solid foundation for the final classification results. Simultaneously, the introduction of channel attention significantly enhances the model's ability to extract key information from clothing textures, allowing the overall solution to more accurately capture complex and diverse texture features, thereby improving the accuracy and stability of recognition. This module, combined with the dynamic multi-scale feature extraction in Step 1, forms a dual optimization of texture features, playing a crucial role in improving overall performance.

[0107] Step 3: Extract spatial dimension information using the spatial attention mechanism. Calculate the spatial attention weights by using average pooling and max pooling of the feature map channels, combined with the spatial feature interaction formula. Generate a weighted feature map based on the weights of channel attention and spatial attention.

[0108] In this embodiment, for Perform average pooling and max pooling along the channel dimension to generate two channels of size 1. Spatial feature map:

[0109] ;

[0110] In the formula, Indicates the location superior, The value obtained after average pooling along the channel dimension. For the channel index, , The number of channels in the feature map;

[0111] ;

[0112] In the formula, Indicates the location superior, The value obtained after max pooling along the channel dimension;

[0113] Spatial attention weights are generated through the following transformation:

[0114] ;

[0115] ;

[0116] In the formula, Represents spatial attention weights. It is the Sigmoid activation function, used to output weights. This is a spatial feature transformation formula used to combine the interrelationships of different spatial features. This represents the convolution operation. and This is the input quantity for the spatial feature transformation formula;

[0117] Apply channel attention and spatial attention to feature maps :

[0118] ;

[0119] In the formula, This represents the feature map after weighted processing by channel attention and spatial attention, i.e., the output texture feature map incorporating attention information. Represents the element-wise dot product. Represents spatial attention weights. This represents the channel attention weight.

[0120] Step 3 introduces a spatial attention mechanism to extract spatial dimensionality information from the dynamically fused feature map. It captures spatial features using average pooling and max pooling of the feature map channels, and generates spatial attention weights by combining spatial feature interaction formulas. This design enhances the model's ability to capture spatially correlated features in the input image, thereby focusing on regions of positional importance within the texture pattern. By combining channel attention and spatial attention weights, the model can simultaneously focus on both the channel characteristics and spatial layout of the texture, improving the overall quality of feature representation.

[0121] Compared to traditional texture recognition methods, existing technologies often lack sufficient modeling of spatial information and cannot effectively focus on spatially important regions in an image. This solution incorporates global pooling and spatial feature interaction formulas into the spatial attention mechanism, enhancing the model's perception and recognition capabilities for important regions through cross-channel and spatial information interaction. Furthermore, this weighted dot product-based weight fusion strategy, while preserving global information, can more effectively suppress background noise or interference from irrelevant regions, thus significantly improving the model's robustness and accuracy in complex scenes. Step 3, as the spatial modeling module of the attention mechanism, complements the channel attention mechanism in Step 2. Channel attention focuses on the channel importance of the feature map, while spatial attention strengthens the model's ability to express the spatial layout of patterns. This combination of dual attention results in a more comprehensive and accurate weighted feature map. In addition, the optimized feature map in Step 3 provides high-quality input for subsequent modules, effectively improving the overall model's recognition performance and classification accuracy. The addition of this step promotes comprehensive modeling of complex pattern textures, thereby enhancing the reliability and applicability of the overall solution.

[0122] Step 4: Perform global average pooling on the feature map processed by the attention mechanism to generate a global feature vector. In the classification process, introduce a regularized classification formula, add a constraint term on the feature distribution to the Softmax function, and generate the final classification result.

[0123] In this embodiment, the feature map Perform global average pooling to generate global feature vectors. ;

[0124] An improved regularized classification formula is applied to classify features, based on the following formula:

[0125] ;

[0126] In the formula, Indicates the input image Features are categorized into categories The probability, Indicate category The weight vector, Represents the global feature vector. Indicate category The bias term is used to adjust the linear score of the classification. This represents the regularization coefficient, used to control the strength of the regularization term's influence on classification. Represents the expected value of the characteristic distribution. Represents an exponential function. This indicates that the process iterates through each category in the classification task. express and The squared Euclidean distance between them; this formula adds a regularization term to the traditional Softmax classification formula. It combines the expected value of the characteristic distribution. and regularization coefficient This design aims to reduce the deviation of feature distribution and improve classification stability.

[0127] The probabilities of all texture categories are compared, and the category with the highest probability is selected as the final classification result.

[0128] Step 4 generates a global feature vector through global average pooling. An improved regularized classification formula is introduced into the classification process. By adding a feature distribution constraint term to the Softmax function, the distribution of global features is constrained using the regularization coefficient and the mean vector. This design effectively reduces feature overfitting, enhances the model's robustness to sample distribution, and improves the discriminative power between different categories. The introduction of the regularization term promotes a more accurate representation of global features, making the classification results more stable and accurate.

[0129] Existing classification techniques often rely on the standard Softmax function, which lacks constraints on feature distribution, easily leading to sample distribution bias or overfitting to specific classes during model training. This approach, by incorporating a regularized classification formula, significantly enhances the model's control over the global feature distribution, avoiding classification errors caused by feature vectors deviating from their expected distribution. Compared to traditional methods, this improvement better handles datasets with complex textures, class imbalances, or noisy samples, thereby improving classification robustness and generalization ability, especially in practical applications. Step 4, as the final classification module, not only directly determines the model's classification performance but also further effectively utilizes the high-quality features extracted and optimized in previous steps. By combining the regularized classification formula, this step transforms the feature maps, after multi-scale feature extraction and attention enhancement, into more reliable and stable classification results, ensuring high accuracy and robustness of the overall model in texture recognition tasks. Furthermore, this module effectively constrains the distribution of global features, complementing previous modules and ultimately driving the entire approach to achieve superior performance in diverse and complex texture recognition scenarios.

[0130] Step 5: Collect the number of pixels in the input image, and simultaneously collect the light intensity and shooting angle when the input image was captured. After dimensionless processing of the number of pixels, light intensity and shooting angle, generate the quality assessment index of the input image, and judge the reliability of the classification result based on the quality assessment index.

[0131] In this embodiment, the formula used to calculate the quality assessment index of the input image is:

[0132] ;

[0133] In the formula, The quality assessment index is a comprehensive indicator used to reflect the overall quality of an input image. A higher value indicates better image quality. Number of pixels The maximum pixel reference value. Light intensity, This serves as a reference threshold for light intensity. The shooting angle is within the range of [0, 180]. When When the camera lens is almost parallel to the subject's line of sight, i.e., shooting from the front, the frontal features of the subject can be captured clearly, reducing perspective distortion and lighting problems; when When the camera is at a 90-degree angle to the subject, it means shooting from the side; when When the camera is positioned so that the back of the object being photographed is aligned with the back of the object, it means that the image is being taken from behind.

[0134] In the formula, This item reflects the relative proportion of the effective number of pixels in the image. This represents the actual number of pixels in the input image, while This is a reference value, typically representing the maximum number of pixels an image can achieve. A higher ratio means more effective pixels in the image, and it is generally positively correlated with image sharpness and detail quality. Partially, an exponential function is used to reflect the impact of the difference between illumination intensity and reference illumination intensity on image quality. Illumination is one of the important factors affecting image quality. The exponent is 1, which means the lighting conditions are optimal; however, when the difference between S and S_ref is large, the exponent decreases rapidly, leading to... The value decreases. This section reasonably considers the impact of lighting on image quality and emphasizes the importance of good lighting through exponential decay. The impact of shooting angle on image quality has been partially considered. The range is [0, 180], when When the value is 0, the image quality is optimal because the camera is parallel to the front of the subject, minimizing perspective distortion and lighting issues. With... As the value increases, the image quality gradually decreases. When... At 180 degrees, which means the subject is behind you, image quality will drop drastically. This section uses a squared form, a design that makes the impact of the shooting angle on the quality index non-linearly weaken, reflecting the quality variations in actual shooting situations.

[0135] The number of pixels directly reflects the resolution and detail of an image. The more pixels, the better the detail and the higher the image quality. When it increases, Increased light intensity; both excessively strong and insufficient lighting can lead to loss of image detail or problems such as overexposure and underexposure. Appropriate lighting can enhance the detail of an image. Therefore, when the light intensity is high... As the deviation from the reference threshold increases, image quality deteriorates; shooting angle It affects the perspective and light distribution of the image; certain angles may cause shadows or distortion. An angle closer to 0° is more in line with the ideal shooting angle. The smaller the size, the higher the corresponding image quality; that is to say, and There is a positive correlation. , and There is a negative correlation.

[0136] By combining pixel count, light intensity, and shooting angle It can effectively provide a quantitative assessment of image quality, which can then serve as a basis for subsequent processing. This assessment method can help improve accuracy in image processing, recognition, and classification tasks, especially when dealing with low-quality images, and can provide necessary quality feedback.

[0137] The specific logic behind judging the reliability of classification results based on quality assessment indices is as follows:

[0138] The quality assessment index is compared with a preset threshold, and the reliability of the classification result is determined based on the comparison result.

[0139] when If the input image quality meets the standard, the classification result is reliable.

[0140] when If the input image quality does not meet the standard, the accuracy of the classification result will decrease, and the classification result should be manually reviewed immediately.

[0141] In the formula, As a quality assessment index, This is a preset quality assessment threshold.

[0142] Step 5 effectively quantifies image quality by collecting the number of pixels, illumination intensity, and shooting angle of the input image and calculating a quality assessment index. This method, through dimensionless processing, makes different images comparable in quality assessment, ensuring the reliability of subsequent classification results. Compared to traditional methods, Step 5 introduces a quality monitoring mechanism, systematically incorporating the impact of image quality into the overall analysis, thus providing a more reliable foundation for classification results.

[0143] Compared to existing technologies, the beneficial effect of step 5 lies in its introduction of a dynamic quality assessment mechanism. This allows the recognition model to consider not only feature data but also adjust the results based on the image capture conditions. This method enhances the model's robustness to low-quality images and reduces the risk of classification errors due to poor image quality. Furthermore, by setting a quality threshold, manual verification can be performed promptly when results are unreliable, further improving the overall reliability of the system. In this scheme, step 5 significantly promotes the effectiveness and applicability of the overall solution. By systematically evaluating image quality, not only can classification accuracy be improved, but the model's adaptability to various conditions can also be ensured when handling diverse inputs. This mechanism makes the model more practical in real-world applications, enabling it to flexibly respond to different scenarios, reduce misjudgments caused by environmental factors, and thus improve user experience and system trustworthiness.

[0144] Please see Figure 2 A pattern and texture recognition device based on a neural network includes:

[0145] The multi-scale feature extraction module is based on deep learning to build a texture recognition model. It extracts multi-scale features from the input image through three different sizes of convolution kernels, generates feature maps of different scales, and uses a dynamic weighted fusion formula to calculate the weights of features at each scale based on the feature distribution information obtained by global average pooling. It then performs weighted fusion on different features to generate a dynamically fused multi-scale feature map.

[0146] The channel attention generation module is used to extract global channel information from the dynamically fused feature map using the channel attention mechanism, and generate channel attention weights by fusing global average pooling and max pooling, combined with a nonlinear feature transformation formula.

[0147] The spatial attention fusion module is used to extract spatial dimensional information using the spatial attention mechanism. It calculates spatial attention weights by using average pooling and max pooling of the feature map channels and combining the spatial feature interaction formula. The weights of channel attention and spatial attention are combined to generate a weighted feature map.

[0148] The regularized classification output module is used to perform global average pooling on the feature maps processed by the attention mechanism to generate global feature vectors. During the classification process, a regularized classification formula is introduced, and a constraint term on the feature distribution is added to the Softmax function to generate the final classification result.

[0149] The classification reliability judgment module is used to collect the number of pixels in the input image, as well as the light intensity and shooting angle when the input image was captured. After dimensionless processing of the number of pixels, light intensity and shooting angle, a quality assessment index of the input image is generated, and the reliability of the classification result is judged based on the quality assessment index.

[0150] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0151] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.

[0152] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0153] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A pattern texture recognition method based on a neural network, characterized by, The specific steps include: Step 1: A texture recognition model is constructed based on a deep learning network, multi-scale features of an input image are extracted through three different sizes of convolution kernels, different scale feature maps are generated, global average pooling is performed on the feature maps of each scale, and adaptive multi-scale feature maps are generated by combining dynamic weights and a nonlinear activation function; Step 2: For the adaptive multi-scale feature maps, global channel information is extracted using a channel attention mechanism, global average pooling and maximum pooling fusion are combined, a nonlinear feature transformation formula is combined to generate channel attention weights; Step 3: Spatial dimension information is extracted using a spatial attention mechanism, spatial feature interaction formula is combined through average pooling and maximum pooling of feature map channels, and spatial attention weights are calculated, and weighted feature maps are generated according to the weights of channel attention and spatial attention; Step 4: Global average pooling is performed on the feature maps processed by the attention mechanism to generate a global feature vector, a regularization classification formula is introduced in the classification process, a constraint term for feature distribution is added in the Softmax function, and the final classification result is generated; Step 5: The number of pixels of the input image is collected, and the light intensity and shooting angle when the input image is taken are collected, and the quality evaluation index of the input image is generated after dimensionless processing of the pixel number, light intensity and shooting angle, and the reliability of the classification result is determined according to the quality evaluation index; Multi-scale convolution is used to extract texture features of different scales in the image, and local and global information is fused, specifically: The input image is input into the model, and the matrix form is defined as: , which represents the input image is a three-dimensional tensor, , which represents that each element of the tensor is a real value, where is the height of the image, is the width of the image, is the number of channels of the image, , which represents the RGB channel; Three different sizes of convolution kernels are used: , , , the input image is convolved to extract features of different scales, and the expression is as follows: , , In the formula, represents a feature map corresponding to a convolution kernel in the form of represents a convolution operation using a convolution kernel in the form of ;​ The dynamic weighting fusion formula is used to calculate the weights of each scale feature according to the feature distribution information obtained by global average pooling, and different features are weighted and fused: In the formula, denotes the multi-scale feature map after dynamic weighted fusion, denotes the adaptive weight corresponding to the convolution kernel scale, and is defined as follows: In the formula, denotes the global average pooling on the feature map to extract the global context information, denotes the scale of the learnable bias parameter, used to balance the importance of different scales, and the initial value is set to zero, is an exponential function, used to enhance the differentiation of weights, denotes the learnable bias parameter related to the scale of the convolution kernel; To Apply the nonlinear activation function ReLU: In the formula, denotes an adaptive multi-scale feature map, is a nonlinear activation function ReLU, used to increase the nonlinear expression ability of features; The quality evaluation index of the input image is calculated, and the formula is: wherein, is a quality evaluation index, is a pixel number, is a maximum pixel reference value, is an illumination intensity, is a reference threshold value of the illumination intensity, is a shooting angle, ranging in [0, 180]. 2.The pattern texture recognition method based on neural network according to claim 1, characterized in that: The architecture of the texture recognition model is based on a deep learning network and is constructed through modular design. The architecture of the model is divided into four main modules: a multi-scale feature extraction module, a dynamic fusion module, an improved channel and spatial attention module, and a regularization classification module. The entire architecture is based on an end-to-end neural network design, and each module is tightly coupled through a specific calculation form to form a texture recognition model. 3.The pattern texture recognition method based on neural network according to claim 1, characterized in that: Adaptive multi-scale feature map Global average pooling is performed to generate channel-level global features: In the formula, represents the channel-level global feature generated after global average pooling, represents a global average pooling operation, and the spatial dimensions of the feature map are projected into ;​ On the feature map Global max pooling is performed to generate channel-level global features: In the formula, represents the channel-level global feature generated after global maximum pooling, represents a global maximum pooling operation that takes the maximum value of each channel. The nonlinear feature transformation formula is introduced to calculate the channel attention weights: The spatial attention weights are generated by the following transformation: In the formula, is the channel attention weight, is a sigmoid activation function for outputting the channel weight, and respectively represent the weights and biases of the full connection layer, is a nonlinear transformation formula for enhancing the discriminability of global features, is the input quantity of the nonlinear transformation formula; two spatial feature maps with size​​ In the formula, represents the position , the value obtained after channel dimension average pooling, is the index of the channel, , is the number of channels of the feature map; In the formula, denotes the value obtained after passing through the channel dimension max-pooling; on the position ; The improved regularization classification formula is applied to classify the features, and the formula is as follows: In the formula, represents a spatial attention weight, is a Sigmoid activation function for output weight, is a spatial feature transformation formula for combining the mutual relationship of different spatial features, represents a convolution operation, and is an input quantity of the spatial feature transformation formula; Applying channel and spatial attention to feature maps : In the formula, represents the feature map after channel attention and spatial attention weighting processing, that is, the output texture feature map combined with attention information, represents an element-wise dot product, represents a spatial attention weight, is a channel attention weight.

4. The pattern texture recognition method based on neural network according to claim 3, characterized in that: on the feature map global average pooling is performed to generate a global feature vector ; Compare the probabilities of all texture categories and select the category with the maximum probability as the final classification result. wherein denotes an input image whose features are classified into classes with a probability denotes a weight vector for a class denotes a global feature vector denotes a global feature vector denotes a bias term for a class for adjusting a linear score of the classification, denotes a regularization coefficient for controlling an influence strength of the regularization term on the classification, denotes an expected value of a feature distribution, denotes an exponential function, denotes traversing each class in the classification task, denotes the squared Euclidean distance between and According to the quality evaluation index, the reliability of the classification result is determined, and the specific logic is:

5. The pattern texture recognition method based on neural network according to claim 1, characterized in that: The quality evaluation index is compared with the preset threshold, and according to the comparison result, it is judged whether the classification result is reliable: The neural network-based pattern texture recognition device is used to execute the neural network-based pattern texture recognition method of any one of claims 1-5, comprising: When the quality of the input image meets the standard, the classification result is reliable. When the quality of the input image does not reach the standard, the accuracy of the classification result is reduced, and the classification result is immediately manually reviewed. In the formula, is a quality evaluation index, is a preset quality evaluation threshold.

6. The pattern texture recognition apparatus based on a neural network, characterized by: ​ The multi-scale feature extraction module constructs a texture recognition model based on deep learning, extracts multi-scale features of the input image through three different sizes of convolution kernels, generates feature maps of different scales, calculates the weight of each scale feature according to the feature distribution information obtained by global average pooling by using a dynamic weighted fusion formula, and performs weighted fusion on different features to generate a dynamically fused multi-scale feature map; The channel attention generation module is used for extracting global channel information by using a channel attention mechanism for the dynamically fused feature map, generating channel attention weights by global average pooling and maximum pooling fusion, and combining a nonlinear feature transformation formula; The spatial attention fusion module is used for extracting spatial dimension information by using a spatial attention mechanism, calculating spatial attention weights by average pooling and maximum pooling of the feature map channel, combining a spatial feature interaction formula, combining the weights of the channel attention and the spatial attention, and generating a weighted feature map; The regularization classification output module is used for performing global average pooling on the feature map processed by the attention mechanism to generate a global feature vector, introducing a regularization classification formula in the classification process, adding a constraint term for feature distribution in a Softmax function, and generating a final classification result; and the classification reliability judgment module is used for collecting the pixel number of the input image, simultaneously collecting the light intensity and the shooting angle when the input image is shot, performing dimensionless processing on the pixel number, the light intensity and the shooting angle to generate a quality evaluation index of the input image, and judging the reliability of the classification result according to the quality evaluation index.

Citation Information

Patent Citations

  • Multi-feature fusion aneurysm identification method and system based on deep learning

    CN118674992A

  • Improved convolution integral neural network model for leukocyte calculation

    CN120451747A