An artificial intelligence-based waste cable specification model identification method
By using a deep neural network with adaptive core region detection and multi-scale texture feature enhancement, the problems of background interference and insufficient feature extraction in waste cable identification are solved, and high-precision cable specification and model identification is achieved.
Patent Information
- Application Number
- CN202610191300.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2025-12-24
- Filing Date
- 2026-02-10
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies struggle to efficiently and accurately identify the fine-grained specifications of waste cables in complex environments. Traditional methods cannot effectively distinguish key areas of the cable core from the background, and existing convolutional neural networks are susceptible to environmental interference, making it difficult to learn robust and discriminative feature representations.
Adaptive core region detection and normalization processing are adopted, and multi-scale, multi-directional texture decomposition is performed by combining wavelet transform and directional filter bank transform. A deep neural network based on cable core focusing is constructed, and a composite loss function is designed to optimize feature representation, including spatial attention weight map, channel attention weight vector and multi-scale discriminative feature structure constraint.
By accurately enhancing key features and suppressing noise in complex contexts, the model's discriminative power is improved in scenarios with large intra-class differences and inter-class similarities, enabling high-precision identification of the specifications and models of waste cables.
Smart Images

Figure CN122290087A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to an artificial intelligence-based method for identifying the specifications and models of waste cables. Background Technology
[0002] With the surge in global electronic and electrical equipment scrap, the efficient recycling of waste cables, rich in metals such as copper and aluminum, is crucial for resource conservation and environmental protection. However, current waste cable sorting still heavily relies on manual visual inspection and experience, resulting in low efficiency, inconsistent sorting accuracy, and high labor costs. While traditional automated sorting technologies have seen some development, they are mostly based on physical properties for coarse screening, making it difficult to accurately identify the fine-grained specifications of cables. This prevents the precise classification and high-value recycling of high-value materials.
[0003] Existing methods typically perform global normalization on the entire image, failing to distinguish the critical area of the cable core from the complex background. In cases of uneven lighting or cluttered backgrounds, the normalization process treats noise and signal equally, weakening or obscuring the discriminative features of the core. Existing feature extraction techniques are mostly performed at a single or fixed scale and operate only in the spatial domain, making it difficult to adaptively capture the multi-scale characteristics of the core texture and fully utilize directional and detailed information in the frequency domain, resulting in insufficient extraction of subtle but crucial texture features. Conventional convolutional neural networks employ global convolution operations, lacking an explicit mechanism for distinguishing between foreground and background. The model is easily affected by complex backgrounds, contamination, and occlusion in the recycling environment, making it difficult to stably focus on the critical identification area of the cable core. Existing recognition models typically only use classification losses such as cross-entropy for supervision, failing to effectively utilize the prior location information of the core region and the structured information of multi-scale features available during image processing. In fine-grained recognition tasks with large intra-class differences and high inter-class similarities, it is difficult to learn sufficiently robust and discriminative feature representations. Summary of the Invention
[0004] To achieve the above objectives, the present invention employs the following technical solution: This invention provides a method for identifying the specifications and models of waste cables based on artificial intelligence, comprising the following steps: S1. Collect image data of waste cables and construct a dataset; S2. Perform adaptive detection and normalization on the core region in the image of the waste cable to obtain a normalized core focused image; S3. Based on the normalized core focused image, the core texture is decomposed and enhanced in the frequency domain through wavelet transform and directional filter bank transform with adaptive scale selection. By designing a frequency domain fusion function to combine low-frequency and high-frequency information from different transforms, and adaptively weighting according to the information content of each scale, a multi-scale texture feature map is obtained. S4. Construct a deep neural network based on cable core focusing, including a spatial attention weight map generation module, a channel attention weight vector generation module, a core focusing convolution module, and a prediction result output module; the multi-scale texture feature map is processed by the deep neural network based on cable core focusing to obtain the predicted probability vector. S5. A composite loss function that integrates core region alignment constraints and multi-scale discriminative feature structure constraints is used to train and optimize the deep neural network based on cable core focusing.
[0005] Furthermore, in S2, the bright areas in the waste cable image are initially separated by setting a dynamic intensity threshold. A smooth core region soft mask is generated using morphological distance transformation and adaptive thresholding techniques to accurately identify the core region. The core region soft mask is used as an attention guide to perform local statistical calculations on the regions in the original waste cable image that may belong to the core, and a normalization operation is performed to obtain a normalized core focused image.
[0006] Furthermore, the total number of decomposition scales is adaptively determined based on the normalized core focused image size, and discrete wavelet transform and directional filter bank transform are performed at each scale to capture the core texture components from coarse to fine and in different directions, resulting in wavelet transform sub-bands and directional filter bank sub-bands. A frequency domain fusion function is used to combine the low-frequency stability information in the wavelet transform sub-bands with the high-frequency directional details in the directional filter bank sub-bands, directly enhancing the texture features in the frequency domain to obtain frequency domain fusion features. After processing the frequency domain fusion features at each scale through inverse discrete wavelet transform, adaptive weighted summation is performed to obtain a multi-scale texture feature map.
[0007] Furthermore, in the spatial attention weight map generation module, a spatial attention weight map is dynamically generated based on the difference in information entropy of multi-scale texture feature maps at spatial locations. Regions with high information entropy usually correspond to core regions with rich textures and complex structures. Therefore, by calculating local entropy and normalizing it, the network can automatically focus on these key locations.
[0008] Furthermore, in the channel attention weight vector generation module, the channel attention weight vector is dynamically generated based on the spatial variance difference of the multi-scale texture feature map in different channels. Channels with large variance usually contain more spatial variation information and may correspond to the discriminative features unique to the core, so they should be given higher weights.
[0009] Furthermore, in the core-focusing convolutional module, the generated spatial attention weight map and channel attention weight vector are applied to the multi-scale texture feature map to perform adaptive weighting of spatial and channel dimensions. Then, the focused features are extracted through convolution operations to obtain the output feature map of the core-focusing convolutional module. The output feature map of the core-focusing convolutional module is compressed in spatial dimension through a global average pooling layer, then mapped to the number of categories through a fully connected layer, and the Softmax function is applied to output the probability prediction of each specification.
[0010] Furthermore, the composite loss function includes cross-entropy loss, core feature focusing loss, and multi-scale discriminative feature loss.
[0011] Furthermore, the cross-entropy loss is the cross-entropy loss between the network's predicted probability and the true label. It is calculated according to the cross-entropy calculation method based on the probability distribution output by the network's final Softmax layer and the true class labels of the samples in one-hot encoding format, and is used to supervise the accuracy of the classification task.
[0012] Furthermore, the core feature focusing loss maximizes the mutual information between the spatial attention map learned autonomously by the network and the soft mask of the core region generated adaptively through image processing, ensuring that the network attention mechanism is aligned with the real physical core region in the image. At the same time, to avoid focusing attention only on a very small core region and ignoring the overall structure, the attention distribution entropy based on the soft mask is used as a regularization term. Furthermore, the multi-scale discriminative feature loss is applied to the feature map output by the core-focusing convolutional module before the global average pooling layer of the deep neural network based on cable core focusing. In the deep feature embedding space, it is required that the features of similar samples are close to each other, and the features of dissimilar samples are far apart. Considering the discriminative power differences of features from different scales and different feature channels, adaptive weights are used. and channel attention weight vector We construct a weighted feature recombination vector and calculate the triplet loss based on this vector, so that the scale and channel, which contribute more to the discrimination of cable specifications and models, have higher weights in the feature distance metric, thereby learning a more refined and discriminative feature representation.
[0013] The advantages of this invention are: This invention proposes a method for generating soft masks for the core region and adaptive local normalization. A smooth attention mask is generated through dynamic thresholding, distance transformation, and the sigmoid function. Normalization is performed only on the core region identified by the mask, based on local statistics. This accurately enhances key features and suppresses noise in complex backgrounds, solving the problem of foreground and background confusion caused by traditional global normalization. A multi-scale frequency domain texture feature enhancement and fusion mechanism is employed. It adaptively combines wavelet transform and directional filter banks for frequency domain decomposition and uses a gradient- and activity-based nonlinear function to fuse different frequency domain components. Finally, a weighted reconstruction based on information richness is performed, achieving enhanced expression of blurred, multi-scale core textures and overcoming the limitations of single-scale spatial domain methods in feature extraction. An embedded... The deep network architecture of the core-focusing convolutional module is proposed. This module performs dual adaptive weighting on features by parallel computing of spatial attention maps based on local information entropy and channel attention vectors based on channel variance. This enables the network to autonomously focus on key core regions and discriminative channels, avoiding the problems of background interference and unfocused feature representation in conventional convolutional networks. A composite loss function integrating physical priors and feature structure constraints is proposed. In addition to the standard classification loss, a core-attention alignment loss based on mutual information is introduced to force the network to focus on real physical regions. A discriminative triplet loss combining scale and channel weights is designed to optimize the feature space structure. This fully utilizes the prior information generated in the preprocessing stage and improves the discriminative power of the model in scenarios with large intra-class differences and inter-class similarities. Attached Figure Description
[0014] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0015] Figure 1 This is a flowchart of the steps of the method of the present invention; Figure 2 This is the normalized core focusing image of the method of the present invention; Figure 3 This is a multi-scale texture feature map of the method of the present invention; Figure 4 A comparison of the recognition accuracy of different methods. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] Example 1 In this embodiment, as Figure 1 As shown, this invention provides a method for identifying the specifications and models of waste cables based on artificial intelligence, the specific steps of which include: S1. Collection of image data of waste cables and construction of training dataset Systematic image data collection of waste cables was carried out to construct a high-quality training dataset. The collection process was conducted in a real recycling environment. For waste cable samples of different specifications, models, brands, newness, and surface contamination, high-resolution industrial cameras fixed to the end of a multi-degree-of-freedom robotic arm were used to capture images.
[0018] To ensure data diversity and enhance model robustness, the data acquisition process incorporated various variables, including shooting under different ambient lighting conditions (such as natural light, indoor lighting, and partial shadows), varying the cable's placement and angle, and introducing complex background interference (such as metal debris, oil stains, and other cables). For each cable, high-resolution RGB images were acquired from multiple angles, including its end face and side, and its actual physical specifications were recorded as a basis for labeling.
[0019] Data labeling is done by labelers with professional knowledge using auxiliary tools. The labeling method is image-level classification labeling. Specifically, each collected image of waste cable is assigned a specific specification and model label. This label comes from a predefined set of categories, which include, but are not limited to, the conductor cross-sectional area of the cable (such as 0.5mm², 1.0mm², 2.5mm², etc.), the number of cores (such as single core, double core, triple core, five core, etc.), the type of insulation material, and the domestic and international standards it conforms to.
[0020] All labeled images were divided into training, validation, and test sets to provide supervision signals and evaluation benchmarks for core region adaptive detection, multi-scale texture feature enhancement, and deep neural network training.
[0021] S2, Core Region Adaptive Detection and Normalization Image data of scrap cables often face challenges such as cluttered background environments, uneven lighting distribution, and obscuring or weakening of key features of the cable core. Conventional techniques usually apply global image normalization methods directly, which cannot effectively distinguish between the foreground core area and background noise. This can easily lead to the normalization process treating useful signals and interference signals equally, causing key core features to be weakened or completely submerged in subsequent processing, which seriously affects the model's ability to distinguish cable specifications and models.
[0022] This invention achieves an adaptive core focusing normalization method by dynamically generating a core region mask and fusing local statistical characteristics. First, it detects and locates the core region in the image. Then, it performs normalization processing based on local mean and standard deviation only on this region. This significantly enhances key discriminative features of the core while suppressing background noise and eliminating the influence of illumination non-uniformity. The specific steps are as follows: 1) Dynamic mask generation in the core region Based on the prior knowledge that the core region in the original image usually has a high reflectivity, the bright regions in the image are first initially separated by setting a dynamic intensity threshold. Then, a binary mask with a smooth transition is generated using morphological distance transformation and adaptive thresholding techniques to accurately identify the core region. Specifically, the original image of the discarded cable is defined as... , dimension The height is Width is An RGB image with three color channels is acquired by an image acquisition device; Then, the pixel intensity indicator map is calculated: for each spatial location in the image, its RGB vector magnitude is calculated and compared with the dynamic intensity threshold. Compare and generate an initial binary indicator map. ; Then, generate the Euclidean distance transformation graph: for the binary indicator graph Performing an Euclidean distance transformation, such as a two-pass scanning algorithm, calculates the Euclidean distance from each pixel to the nearest pixel with a value of 1, resulting in the Euclidean distance transformation map. Each pixel value represents the Euclidean distance from that location to the nearest highlighted pixel.
[0023] Then, estimate the core radius and generate a soft mask: calculate the median of all pixel values in the Euclidean distance transform image as the core radius estimate. The distance map is then converted into a smooth soft mask for the core region using the Sigmoid function, as follows: .
[0024] In the above, This represents the soft mask for the core region, with dimensions of... , This indicates the position of the soft mask in the core area at the pixel location. The value at that location has a range of 1. The closer the value is to 1, the higher the probability that the pixel location belongs to the core region; This represents a binary indicator map, which is a binary image. This indicates the location of the binary indicator image at the pixel position. The value at the pixel position The intensity is greater than the threshold Output 1 if the condition is met, otherwise output 0, used to generate the initial binary image of the core highlight region; This represents an image of the original, discarded cables. This indicates the pixel location of the original scrap cable image. The RGB pixel value vector at that location; This represents the image height in pixels. Indicates the image width, in pixels; Represents the row and column coordinate indices of the first image pixel, where The index is the first row. Index of the first column; This represents the row and column coordinate indices of the pixels in the second image, where For the second row index, Index of the second column; This represents the mask sharpening factor, a positive constant that controls the steepness of the transition of the Sigmoid function. The larger the value, the sharper the generated mask edges. An example value is 5. This represents the Euclidean distance transform map, characterizing the proximity of each point in the image space to the candidate core region. The smaller the distance value, the more likely it is to belong to the core region. Euclidean distance transformation at pixel location The value at; This represents the dynamic intensity threshold, used to initially distinguish between bright core candidate regions and darker background regions. Its value is set to 60% of the maximum pixel intensity of the entire image. ; Represents the L2 norm; Represents the position of all pixels in the image. Operators for finding the maximum value; This represents the core radius estimate, obtained by calculating the median of all pixel values in the Euclidean distance transform map, and is used to adaptively determine the approximate spatial extent of the core region. This refers to the Sigmoid function, used to map input values to... This allows for the generation of a soft mask with a smooth transition within a given interval.
[0025] 2) Adaptive Local Normalization Based on Core Region Soft Mask By using a soft mask of the core region as attention guide, local statistics are calculated only for regions in the original image that may belong to the core, and normalization is performed to standardize the core feature distribution while suppressing background interference to the greatest extent. Specifically, determine the adaptive local window size. ,definition Represented by pixel position A set of local neighborhood windows centered on the center, with a window size of . Then calculate the position. Based on local window Local mean vector calculated from the brightest pixels in the inner core , and, location Based on local window Local standard deviation vector calculated from the brightest pixels in the inner core ; Then, combining local statistics and a soft mask for the core region, core focusing normalization is performed on the original image to obtain a normalized core-focused image, represented as: , In the above, This represents the normalized core-focused image, with dimensions of [dimension number missing]. , This indicates the pixel position of the normalized core-focused image. The RGB pixel value vector at that location; Indicates the pixel position At this location, a local mean vector is calculated based on the pixels belonging to the core region within its local neighborhood, which is used to represent the central tendency or average level of the core features at that location; Indicates the pixel position At this location, the standard deviation vector calculated based on the pixels belonging to the core region within its local neighborhood is used to measure the degree of fluctuation of the core features at that location. This represents a very small positive integer, used to prevent the denominator from being zero and to ensure the stability of numerical calculations. Examples of its values are shown below. .
[0026] In one implementation, the local window size is adaptive. The window size is dynamically determined based on the dimensions of the input image to ensure it adapts to images of different resolutions. The determination method is as follows: ,in, This represents the floor function. This function takes the larger of two arguments. This represents a function that takes the smaller of two parameters.
[0027] S3, Core Multi-Scale Texture Feature Enhancement and Frequency Domain Fusion The texture features of the core region may be relatively vague and vary in scale. For example, there are significant differences in the core diameter and the thickness of the stranding texture of different cable specifications. Conventional feature extraction techniques, such as histogram of directional gradients or local binary patterns, usually operate only on a single or fixed scale and cannot adaptively capture the multi-scale characteristics of key core textures. Furthermore, they only process in the spatial domain and ignore the rich texture details contained in the frequency domain, resulting in insufficient extraction of subtle but critical discriminative texture features.
[0028] This invention employs a multi-resolution analysis approach, utilizing adaptive scale-selective wavelet transform and directional filter bank transform to decompose and enhance the core texture in the frequency domain across multiple scales and directions. A frequency domain fusion function is designed to organically combine the advantages of different transforms, and adaptive weighting is applied based on the information content of each scale to reconstruct an enhanced texture feature map. This effectively solves the problems of texture blurring and scale sensitivity, improving the discriminative power of the features. The specific steps are as follows: 1) Adaptive multi-scale frequency domain decomposition The total number of decomposition scales is adaptively determined based on the normalized core focused image size, and discrete wavelet transform and directional filter bank transform are performed at each scale to capture the core texture components from coarse to fine and in different directions. Specifically, the first step is to determine the total number of scales. , represented as ,in Indicates rounding up; Furthermore, in the In terms of scale, for normalized core-focused images Perform a two-dimensional discrete wavelet transform to obtain the sub-band set at this scale; At the same time, in the In terms of scale, for normalized core-focused images Perform directional filter bank transformation to obtain multiple directional subbands; Based on this, output the first... Wavelet transform subbands of scale and directional filter bank subband ; In the above, This represents the total scale, which is an adaptively determined total decomposition scale. Its value depends on the minimum side length of the image, ensuring that the decomposition scale can adapt to the image content. Indicates the decomposition scale index. The coarsest scale, A larger value indicates a finer scale, with a range of values. ; Representing scale The wavelet transform low-frequency approximation subband preserves the main outline and coarse texture information of the image at this scale; Representing scale The wavelet transform of the horizontal high-frequency detail subband captures high-frequency information in the horizontal direction, such as vertical edges and textures, at this scale. Representing scale The wavelet transform vertical high-frequency detail subband captures high-frequency information in the vertical direction, such as horizontal edges and textures, at this scale. Representing scale The wavelet transform of the high-frequency detail subband in the diagonal direction captures high-frequency information in the diagonal direction, such as diagonal edges and textures, at this scale. Representing scale Next Each direction sub-band captures edge and texture details in a specific direction at that scale, specifically by focusing the normalized core image. In scale The above is obtained by applying the directional filter bank transform operator, i.e. ; Indicated in scale The directional filter bank transform operator executed above is a part of the contour wave transform and is good at capturing the directional information of smooth contours in images; Indicates the index of the directional sub-band, with a value range of 1. ; Indicated in scale The number of directions for directional filter bank decomposition varies with scale. Increases with the increase, for example: .
[0029] In practical implementation, the directional filter bank is the core component of the contour wave transform. Specifically, it uses a set of filters with specific directional selectivity to decompose the image into subbands, such as fan filters or directional modulation filters, which can more effectively represent the geometric structure with smooth contours in the image. Iterative decomposition is usually performed using a tree-structured filter bank, or convolution and downsampling operations are performed using a predefined directional filter bank.
[0030] 2) Frequency domain feature fusion By employing a frequency domain fusion function, the low-frequency stability information obtained from wavelet transform is organically combined with the high-frequency directional details obtained from the directional filter bank, directly enhancing texture features in the frequency domain, thus obtaining frequency domain fusion features, expressed as: , In the formula, Representing scale The frequency domain fusion features are used to fuse low-frequency contour information and high-frequency directional details, and a nonlinear enhancement mechanism is used to highlight significant textures. This represents the frequency domain fusion function, which defines how frequency domain components from different sources are combined to generate enhanced features; This represents the element-wise multiplication operator; Represents the gradient operator. Indicates direction sub-band The spatial gradient can be calculated using the Sobel operator. Indicates direction sub-band The L2 norm of the spatial gradient, i.e., the gradient magnitude; Represents the natural exponential function; This represents the frequency band smoothing factor, which controls the smoothness of the gradient-based weight mask. The larger the value, the smoother the mask. An example value is 1.5. Indicates direction sub-band The L1 norm is used to measure the overall signal strength or activity of the subband in that direction; Operators representing the L1 norm of vectors or matrices; This represents the directional enhancement factor, which controls the enhancement intensity of high-frequency directional details. An example value is 0.8. This represents the hyperbolic tangent activation function, used to perform a non-linear mapping of activity, restricting it to... Within the specified range, avoid over-enhancing.
[0031] 3) Adaptive scale weighting and feature reconstruction The information richness of the fused features at each scale is evaluated, and adaptive weights are assigned accordingly. After processing the frequency domain fused features at each scale through inverse discrete wavelet transform, adaptive weighted summation is performed to obtain a multi-scale texture feature map, represented as: , In the formula, Represents a multi-scale texture feature map with dimensions of . It integrates multi-scale and multi-directional core texture information, and highlights the contribution of information-rich scales, making it more sensitive to subtle differences in cable specifications and models. This represents the number of feature channels in a multi-scale texture feature map; Representing scale The adaptive weights satisfy The larger the weight of a scale, the greater its contribution to the final output of the fusion features. The calculation method is expressed as follows: , Denotes the Frobenius norm; Representing scale Frequency domain fusion features The total number of elements; This represents the weight adjustment parameter, which controls the steepness of the weight distribution. The larger the value, the more concentrated the weights are on the information-rich scale. An example value is 1. This represents the inverse discrete wavelet transform operator, which reconstructs the frequency domain subband back into the spatial domain image.
[0032] It should be noted that the scale Adaptive weights The calculation is based on the information richness of the fused features at each scale. The Frobenius norm is used to measure the energy of the features, and the weights are assigned through the softmax function, so that the information rich scales receive higher weights.
[0033] S4. Construct and train a deep neural network based on cable core focusing. S401, Construction of Deep Neural Networks The task of identifying the specifications and models of waste cables requires the model to accurately focus on the cable core and extract deep features with strong discriminative power. Conventional convolutional neural networks usually use global convolution operations, which make it difficult to effectively distinguish the foreground core from the complex background, making the model susceptible to background noise interference.
[0034] This invention employs a U-Net-like architecture with an embedded core-focusing convolutional module. This architecture dynamically calculates and weights key regions and channels related to the core in the input feature map through parallel spatial and channel attention mechanisms, achieving adaptive feature focusing. Simultaneously, it combines depthwise separable convolutions to construct an efficient feature extraction path. Finally, the focused features are fused with the efficient features to output classification prediction results. The specific steps are as follows: 1) Spatial attention weight map generation Based on the differences in information entropy of multi-scale texture feature maps at spatial locations, a spatial attention weight map is dynamically generated. Regions with high information entropy typically correspond to core regions with rich textures and complex structures. Therefore, by calculating and normalizing local entropy, the network can automatically focus on these key locations, as shown below: , In the formula, This represents a spatial attention weight graph, with dimensions of . , The spatial attention weight map represents the position. The value at each element value is... Within the range, a larger value indicates that the spatial location is more likely to belong to a critical core area.
[0035] This represents the feature channel index, with a value range of [value range missing]. ; Representing the spatial location of multi-scale texture feature maps Feature channels The value at; This represents a logarithmic function, with the default base being the natural constant. This represents the spatial attention scaling factor, used to adjust the contribution of the entropy value to the final attention weights. An example value is 2.
[0036] 2) Generation of Channel Attention Weight Vectors Based on the spatial variance differences of multi-scale texture feature maps across different channels, channel attention weight vectors are dynamically generated. Channels with larger variances typically contain more spatial variation information and may correspond to discriminative features unique to the core; therefore, they should be assigned higher weights, as shown below: , Output: This represents the channel attention weight vector, with dimensions of... , The channel attention weight vector is represented in the th... The values on each channel, each element value in Within the range, the larger the value, the more important the characteristics of that channel; In the formula, The first multi-scale texture feature map represents the... A two-dimensional matrix consisting of all spatial positions on each channel; This indicates that the variance is calculated in the spatial dimension, which is used to measure the degree of spatial variation of the channel's features; This represents the channel sensitivity factor, used to adjust the contribution of variance to the channel attention weights. An example value is 1.2.
[0037] 3) Core-focused convolution module calculation The generated spatial attention weight map and channel attention weight vector are applied to the input feature map, performing adaptive weighting based on spatial and channel dimensions. Then, the focused features are extracted through convolution operations, as shown below: , In the formula, This represents the output feature map of the core-focusing convolutional module, with dimension [missing information]. By focusing on key core features through spatial and channel attention mechanisms, enhanced discriminative features are extracted, making the identification of cable specifications and models more effective. This represents a convolution operation, specifically a 2D convolution operation. This represents the learnable weight parameters of the convolutional layer in the core-focusing convolutional module. These are trainable parameters used to extract higher-level features from the weighted feature map.
[0038] It should be noted that, Item representation will spatial attention weight map Broadcast to each channel, with multi-scale texture feature maps Multiplying position by position to emphasize the characteristics of important spatial locations, and, The term representation will be the channel attention weight vector Broadcast to each spatial location and multiply it channel by channel attention weight vector to enhance the features of important channels.
[0039] 4) Output the classification prediction results. The output feature map of the core-focusing convolutional module is compressed in spatial dimension through a global average pooling layer, then mapped to the number of classes through a fully connected layer, and the Softmax function is applied to output the probability prediction for each specification, as shown below: , In the formula, The probability vector representing the prediction has dimension 1. The predicted probability vector is the first element Indicates that the image belongs to the first... The probability of each cable specification / model; This represents the Softmax activation function, which normalizes the input vector into a probability distribution; This represents the weight matrix of the fully connected layer, used to map the features after global average pooling to the class space; This represents a global average pooling operation, which averages the spatial features of each channel to compress the spatial dimension. This represents the bias vector of the fully connected layer, used to adjust the classification decision boundary.
[0040] S402, Loss Function Calculation To address the challenge of identifying the specifications and models of waste cables, where samples of the same type exhibit significant intra-class differences due to aging, contamination, and varying shooting conditions, and where different categories may be confused due to similar visual features, conventional cross-entropy loss functions only focus on the independent class labels of samples. They fail to fully explore and utilize the intermediate features and structural information extracted and constructed by the preceding steps of this method, which contain rich prior knowledge. Consequently, it is difficult to guide the model to learn feature representations with strong robustness and high discriminative power in complex scenarios.
[0041] This invention employs a composite loss function that integrates core region alignment constraints and multi-scale discriminative feature structure constraints. This loss function not only supervises the final classification accuracy but also, by introducing a core-attention alignment loss based on mutual information, forces the attention map generated by the network to be highly consistent with the adaptively detected core physical region at the information level, ensuring that the network focuses on the real cable core. Simultaneously, a discriminative loss that integrates scale and channel weights is used. In the feature embedding space, differentiated intra-class aggregation and inter-class separation constraints are applied to features of different sources and importance based on scale importance weights and channel importance weights. This fully utilizes the structured information of multi-scale texture enhancement features, improving the model's performance on fine-grained recognition tasks. The specific steps are as follows: 1) Core Feature Focusing Loss The core feature focusing loss aims to maximize the mutual information between the spatial attention map learned autonomously by the network and the soft mask of the core region adaptively generated through image processing. This ensures that the network's attention mechanism is aligned with the real physical core region in the image. Simultaneously, to avoid focusing attention only on a tiny core region while ignoring the overall structure, attention distribution entropy based on the soft mask is used as a regularization term. This encourages attention to maintain a certain uniformity in the distribution within regions identified as the core, thereby capturing more comprehensive core features. This is expressed as: , In the formula, This indicates the core feature focusing loss, which guides the spatial attention map generated by the network to be highly consistent with the soft mask of the core physical region obtained from image processing, while encouraging attention to be appropriately dispersed within the core region to cover more comprehensive features; This represents the total number of samples in the training batch; Indicates the sample index; This represents the mutual information estimation function, used to measure the statistical dependence between two variables, specifically calculated based on the kernel density estimation method: Indicates the first The spatial attention weight map of the nth sample is the nth Each sample is generated using a spatial attention weight map from a cable core focusing deep neural network. Indicates the first The spatial attention weight map of each sample at pixel position The value at; Indicates the first The soft mask for the core region of the sample is the first... The core region soft mask generated by the adaptive detection and normalization of the core region for each sample. Indicates the first The soft mask for the core region of each sample is located at the pixel position. The value at; This represents the strength coefficient of the attention distribution entropy regularization term, used to balance maximizing mutual information with the uniformity of attention distribution; an example value is 0.1. Indicates the first The probability distribution of the core region of each sample represents the normalization of the soft mask of the core region into a probability distribution. Indicates the first Location of each sample The probability of belonging to the core region of interest is calculated as follows: , Represented by probability distribution As weights, for function values at all locations in space Calculate the expected value.
[0042] 2) Multi-scale discriminative feature loss Multi-scale discriminative feature loss is applied to the feature map output by the core-focusing convolutional module before the global average pooling layer of the cable core-focusing deep neural network. Its core idea is that, in the deep feature embedding space, not only should the features of similar samples be close to each other and the features of dissimilar samples be far apart, but the discriminative differences between features from different scales and different feature channels should also be fully considered, utilizing adaptive weights. and channel attention weight vector A weighted feature recombination vector is constructed, and a triplet loss is calculated based on this vector. This results in the scale and channel, which contribute more to the discrimination of cable specifications and models, having higher weights in the feature distance metric, thereby learning a more refined and discriminative feature representation, expressed as: , In the formula, The multi-scale discriminative feature loss represents the features learned by the model in the embedding space. It should make the distance between samples of the same class less than the distance between samples of different classes by a boundary value, thereby improving the intra-class compactness and inter-class separability of the features. Indicates that for the first All valid triplets constructed from batches of data The set is constructed by dynamically sampling within the batch based on the true class label of the samples after obtaining the features of all samples in the batch through forward propagation of the model; Anchor sample is a sample randomly selected from the current batch; To and Positive samples of the same type are those from the current batch that are similar to... A sample randomly selected from other samples of the same category; To and Negative samples of different classes are those from the current batch that are different from the previous batch. Different categories and with The weighted feature distance is less than the boundary value of the positive sample pair distance plus the triplet loss. A sample randomly selected from the sample; This represents the boundary value of the triplet loss, used to control the distance difference between positive and negative sample pairs. It is a preset positive constant, with an example value of 0.5. For anchor point samples Feature map output by the core-focusing convolution module; Positive sample Feature map output by the core-focusing convolution module; negative samples Feature map output by the core-focusing convolution module; This represents the weighted feature distance metric function.
[0043] In practical implementation, the calculation process of the weighted feature distance metric function is as follows: a) Feature Restructuring: For features with dimension... Feature map First, flatten it along the spatial dimension to a dimension of Feature map Then, using adaptive weights and channel attention weight vector The composite importance weight for each channel is calculated and expressed as follows: ,in, To adapt weights Mapping to feature channels The mapping vector, For the first The composite importance weight of each channel, For the input feature map, such as , or , To input feature map A two-dimensional matrix after its spatial dimension is flattened. This is the weight scaling factor, with an example value of 2.
[0044] b) Weighted aggregation: Calculate the weighted recombination feature vector, represented as... This operation is equivalent to using composite weights to sum all spatial locations of each channel, resulting in a channel-weighted global descriptor, where... The flattened eigenma matrix represents the eigenvalue at the th... The spatial location, the first Feature values on each channel Indicates the index of the spatial dimension after flattening. The weighted recombined feature vector is the global feature descriptor of the sample.
[0045] c) Distance calculation: For the feature maps of two samples, such as and The weighted recombination feature vectors were obtained respectively. and The weighted feature distance is defined as follows: That is, the Euclidean distance between two weighted recombined feature vectors, where, For the first The feature map output by the core-focusing convolution module for each sample For the first The feature map output by the core-focusing convolution module for each sample for The weighted recombined feature vector, for The weighted recombined feature vector, This is the index of the first sample in the training batch. This is the index of the second sample in the training batch.
[0046] It should be noted that, This item is used to ensure that only when The loss will only occur when the distance between positive samples is not sufficiently smaller than the distance between negative samples, in which case a penalty will be imposed.
[0047] 3) Calculation of total loss function The total loss function is composed of a weighted sum of three parts: cross-entropy classification loss, core feature focusing loss, and multi-scale discriminative feature loss, expressed as: , In the formula, The cross-entropy loss between the network's predicted probability and the true label is calculated based on the probability distribution output by the network's final Softmax layer and the true class labels of the samples in one-hot encoding format, according to the cross-entropy calculation method. It is used to supervise the accuracy of classification tasks. This represents the weighting coefficient for the core feature focusing loss, used to balance the strength of the classification loss and the attention alignment constraint. An example value is shown below. ; These are the weighting coefficients for the multi-scale discriminative feature loss, used to balance the strength of the classification loss and the feature structuring constraint. Example values are shown below. 6.
[0048] S403, Model Iterative Training and Parameter Update Using the training dataset, data is input into the network for forward propagation in batches. For each batch of training samples, the core region adaptive detection and normalization processing, core multi-scale texture feature enhancement and frequency domain fusion processing are performed sequentially to generate the corresponding multi-scale texture feature map. Then, the feature map is fed into a deep neural network embedded in the core-focusing convolutional module, and the network performs forward computation and outputs the predicted specification probability distribution. Then, the total loss function is calculated based on the network prediction results and the true labels of the samples. This total loss integrates the cross-entropy classification loss, the core feature focusing loss, and the multi-scale discriminative feature loss. After obtaining the loss value, the backpropagation algorithm is used to calculate the gradient of the total loss with respect to all trainable parameters of the network. The adaptive moment estimation optimizer is then used to dynamically adjust the learning rate of each parameter based on the calculated gradient and update the network parameters to minimize the total loss.
[0049] During training, after each training round, an independent validation set is used to evaluate the current performance of the model and monitor metrics such as recognition accuracy on the validation set. The model iterative training continues until a preset stopping condition is met. The stopping condition usually includes: the validation set performance no longer improves and tends to stabilize in several consecutive rounds, or the total number of training rounds reaches the preset maximum limit.
[0050] When the stopping condition is met, save a snapshot of the model parameters with the best performance on the validation set, complete the training, and obtain a deployable waste cable specification and model identification model.
[0051] S5. Identification of specifications and models of scrap cables Once the deep neural network based on cable core focusing is trained, the model can be used to automatically identify new and unknown specifications of scrap cables. The identification process is a complete forward inference flow. Specifically, First, for the waste cable samples to be identified, their RGB images are acquired using an image acquisition device with the same configuration as in the training phase. Then, the original image is input into the trained recognition system, which automatically performs a series of preprocessing and feature extraction operations: namely, adaptive detection and normalization of the core region to obtain a normalized core-focused image; then, core multi-scale texture feature enhancement and frequency domain fusion are performed on the normalized image to generate an enhanced multi-scale texture feature map; then, the feature map is input into a trained deep neural network, and the network forward propagates through the spatial and channel attention weighting of the core-focused convolutional module and subsequent fully connected layers, and finally outputs a probability vector through the Softmax function, where each element of the probability vector corresponds to the predicted probability of a predefined cable specification and model category.
[0052] The identification system selects the category with the highest probability value as the final identification result for the waste cable image, thus determining its specification and model. The entire identification process requires no manual intervention, achieving end-to-end automated identification from raw image input to specification and model category output, providing key technical support for the efficient sorting and resource utilization of waste cables.
[0053] Example 2 In this embodiment, a comparison is performed before and after feature enhancement to visualize the feature processing effect of the core module of this technology. A typical two-core cable sample is selected for the experiment, and the outputs are as follows: Figure 2 As shown: Normalized core focused image (cable cross-sectional area); as Figure 3 As shown: Multi-scale texture feature map (cable cross-section area).
[0054] The heatmap color mapping feature intensity is represented by a coordinate axis in pixels. Experimental results show that the core region of the normalized core-focused image is brightly colored, while the background region is blue, proving that the adaptive mask effectively suppresses the background. A transition band exists at the core boundary, reflecting the smoothness of the soft mask. Furthermore, the core region intensity is significantly enhanced, exhibiting a texture structure with high brightness in a specific direction, corresponding to the features extracted by the directional filter bank. Therefore, multi-scale frequency domain fusion enhances the core texture feature intensity and introduces rich directionality and multi-scale details, providing highly discriminative input features for the neural network.
[0055] Example 3 In one embodiment, such as Figure 4As shown, the accuracy of different identification methods is compared, and their performance on multiple key tasks is compared to verify the comprehensive advantages of the method of this invention. The experiment sets up four common waste cable identification tasks: conductor cross-sectional area identification, core count identification, insulation material identification, and standard model identification. These tasks cover the core attributes of cable specifications and models. The methods compared include conventional image processing methods, conventional convolutional neural network methods, convolutional neural network with attention mechanism methods, and the method of this invention. Conventional image processing methods refer to non-deep learning techniques based on hand-designed features (edge detection and texture filtering) combined with support vector machine classifiers; conventional convolutional neural network methods refer to deep networks using standard convolutional and pooling layers, without optimization for the cable core; the convolutional neural network with attention mechanism method introduces spatial or channel attention modules on the basis of conventional convolutional neural networks to enhance feature focusing ability; the method of this invention fully integrates core region adaptive detection, multi-scale texture feature enhancement, and core focusing convolutional modules. In the experimental configuration, each method is trained and tested on the same dataset, which covers diverse cable samples in real recycling environments, including different specifications, lighting conditions, and contamination conditions. As can be seen from the grouped bar chart, the horizontal axis represents the recognition task type, and the vertical axis represents the recognition accuracy, in percentage form (displayed as a decimal in the chart, which can be converted to a percentage). The accuracy of the method of this invention is significantly higher than other methods on all tasks, as evidenced by the tallest bar chart. This advantage is particularly evident in the tasks of identifying insulating materials and standard models, indicating that the method of this invention, through core focusing and multi-scale feature enhancement, can more effectively extract discriminative features, thereby improving overall recognition accuracy.
[0056] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for identifying the specifications and models of waste cables based on artificial intelligence, characterized in that, Includes the following steps: S1. Collect image data of waste cables and construct a dataset; S2. Perform adaptive detection and normalization on the core region in the image of the waste cable to obtain a normalized core focused image; S3. Based on the normalized core focused image, the core texture is decomposed and enhanced in the frequency domain through wavelet transform and directional filter bank transform with adaptive scale selection. By designing a frequency domain fusion function to combine low-frequency and high-frequency information from different transforms, and adaptively weighting according to the information content of each scale, a multi-scale texture feature map is obtained. S4. Construct a deep neural network based on cable core focusing, including a spatial attention weight map generation module, a channel attention weight vector generation module, a core focusing convolution module, and a prediction result output module; the multi-scale texture feature map is processed by the deep neural network based on cable core focusing to obtain the predicted probability vector. S5. A composite loss function that integrates core region alignment constraints and multi-scale discriminative feature structure constraints is used to train and optimize the deep neural network based on cable core focusing.
2. The method for identifying the specifications and models of waste cables based on artificial intelligence according to claim 1, characterized in that, In S2, the bright areas in the waste cable image are initially separated by setting a dynamic intensity threshold, and a smooth soft mask for the core area is generated by using morphological distance transformation and adaptive thresholding technology. Using a soft mask of the core region as an attention guide, local statistics are calculated for regions in the original waste cable image that may belong to the core, and a normalization operation is performed to obtain a normalized core-focused image.
3. The method for identifying the specifications and models of waste cables based on artificial intelligence according to claim 2, characterized in that, The total number of decomposition scales is adaptively determined based on the normalized core focused image size, and discrete wavelet transform and directional filter bank transform are performed on each scale to obtain wavelet transform subbands and directional filter bank subbands. A frequency domain fusion function is used to combine the low-frequency stability information in the wavelet transform subband with the high-frequency directional details in the directional filter bank subband to obtain frequency domain fusion features. After processing the frequency domain fusion features at each scale through inverse discrete wavelet transform, adaptive weighted summation is performed to obtain a multi-scale texture feature map.
4. The method for identifying the specifications and models of waste cables based on artificial intelligence according to claim 3, characterized in that, In the spatial attention weight map generation module, a spatial attention weight map is dynamically generated based on the difference in information entropy of multi-scale texture feature maps at spatial locations.
5. The method for identifying the specifications and models of waste cables based on artificial intelligence according to claim 4, characterized in that, In the channel attention weight vector generation module, the channel attention weight vector is dynamically generated based on the spatial variance difference of the multi-scale texture feature map in different channels.
6. The method for identifying the specifications and models of waste cables based on artificial intelligence according to claim 5, characterized in that, In the core-focusing convolutional module, the generated spatial attention weight map and channel attention weight vector are applied to the multi-scale texture feature map to perform adaptive weighting of spatial and channel dimensions. Then, the focused features are extracted through convolution operations to obtain the output feature map of the core-focusing convolutional module. The output feature map of the core-focusing convolutional module is compressed in spatial dimension through a global average pooling layer, then mapped to the number of categories through a fully connected layer, and the Softmax function is applied to output the probability prediction of each specification.
7. The method for identifying the specifications and models of waste cables based on artificial intelligence according to claim 6, characterized in that, The composite loss function includes cross-entropy loss, core feature focusing loss, and multi-scale discriminative feature loss.
8. The method for identifying the specifications and models of waste cables based on artificial intelligence according to claim 7, characterized in that, The cross-entropy loss is the cross-entropy loss between the network's predicted probability and the true label. It is calculated based on the probability distribution output by the network's final Softmax layer and the true class labels of the samples in one-hot encoding format, according to the cross-entropy calculation method.
9. A method for identifying the specifications and models of waste cables based on artificial intelligence according to claim 8, characterized in that, The core feature focusing loss maximizes the mutual information between the spatial attention map learned autonomously by the network and the soft mask of the core region adaptively generated through image processing, and uses the attention distribution entropy based on the soft mask as a regularization term.
10. The method for identifying the specifications and models of waste cables based on artificial intelligence according to claim 9, characterized in that, The multi-scale discriminative feature loss is applied to the feature map output by the core-focusing convolutional module before the global average pooling layer of the deep neural network based on cable core focusing. In the deep feature embedding space, it is required that the features of similar samples are close to each other, and the features of dissimilar samples are far apart. It considers the discriminative power differences of features from different scales and different feature channels, and utilizes adaptive weights. and channel attention weight vector Construct a weighted feature recombination vector and calculate the triplet loss based on this vector.