A method and device for identifying scrap nonferrous metal fragments based on image recognition
By using image recognition technology to process scrap non-ferrous metal fragments and utilizing image enhancement, texture and color feature extraction, and radial basis kernel function, the problem of low recognition accuracy in existing technologies is solved, achieving more efficient scrap classification and processing.
Patent Information
- Application Number
- CN202311269235.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2043-09-28
AI Technical Summary
Existing scrap nonferrous metal fragment identification technology has low accuracy and cannot effectively identify samples of unknown composition or non-standard alloys.
An image recognition-based method is adopted to process the scrap image data through the image double enhancement algorithm, the bidirectional image roughening algorithm and the hierarchical contrast algorithm, extract the texture and color features, and combine the radial basis kernel function to generate the classification and recognition decision function to achieve accurate classification of scrap non-ferrous metal scraps.
The recognition accuracy of scrap non-ferrous metal fragments has been improved, and different types of fragments can be better classified and processed, thereby improving processing efficiency and quality.
Smart Images

Figure CN117173426B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a method and device for identifying scrap nonferrous metal fragments based on image recognition. Background Art
[0002] As the annual mining volume of non-ferrous metals increases, the detection and identification of non-ferrous metal scraps are becoming increasingly important. Non-ferrous metal scraps have high recycling value and are the best substitute for metal smelting ore. The rational use of scrap non-ferrous metal scraps can minimize waste and environmental pollution, so accurate identification of scrap non-ferrous metals is necessary.
[0003] Existing scrap nonferrous metal identification technology relies on spectrometer analysis combined with visual spectral analysis of ferrous and nonferrous metals. In practice, spectrometers are limited to specific metal types and ranges and cannot accurately identify samples of unknown composition or non-standard alloys, resulting in low accuracy in scrap nonferrous metal identification. Summary of the Invention
[0004] The present invention provides a method and device for identifying scrap nonferrous metal fragments based on image recognition, the main purpose of which is to solve the problem of low accuracy in identifying scrap nonferrous metal fragments.
[0005] To achieve the above-mentioned purpose, the present invention provides a method for identifying scrap nonferrous metal fragments based on image recognition, comprising:
[0006] S1. Obtaining scrap image data of scrap nonferrous metal scraps, and performing enhancement processing on the scrap image data using a preset image dual enhancement algorithm to obtain scrap enhanced image data;
[0007] S2. Calculating the image roughness of the fragmented material enhanced image data using a preset bidirectional image roughening algorithm, and calculating the image contrast of the fragmented material enhanced image data using a preset hierarchical contrast algorithm;
[0008] S3. Determining texture features of the scrap enhanced image data based on the image roughness and the image contrast, extracting color features of the scrap enhanced image data, and fusing the texture features and the color features into scrap features of the scrap non-ferrous metal scraps;
[0009] S4. Generating a classification and identification decision function for the scrap non-ferrous metal scraps based on the scrap characteristics and a preset radial basis kernel function, wherein the generating a classification and identification decision function for the scrap non-ferrous metal scraps based on the scrap characteristics and a preset radial basis kernel function comprises:
[0010] S41, generating a scrap identification feature set of the scrap nonferrous metal scraps according to the scrap features and a preset metal scrap category label;
[0011] S42. Generate a classification and recognition decision function for the scrap nonferrous metal scraps based on the scrap identification feature set and a preset radial basis kernel function, wherein the classification and recognition decision function is:
[0012]
[0013] Among them, r(u s ) is the feature u of the fragment to be identified s The metal scrap category label, sign is the symbol function, v n is the metal scrap category label in the scrap identification feature set, exp is the exponential function, u s is the feature of the fragment to be identified, u n is the material feature in the material identification feature set, σ is the feature variance, γ is the classification dynamic factor, and N is the number of features in the material identification feature set;
[0014] S5. Obtain image data of scrap non-ferrous metal scraps to be identified, extract target scrap features from the image data of the scrap non-ferrous metal scraps to be identified, identify scrap labels of the target scrap features using the classification and recognition decision function, and determine the metal scrap category of the scrap non-ferrous metal scraps based on the scrap labels.
[0015] Optionally, the enhancing the scrap image data using a preset double image enhancement algorithm to obtain the scrap enhanced image data includes:
[0016] Performing grayscale conversion on the scrap image data to obtain scrap grayscale image data;
[0017] Performing image sharpening on the grayscale image data of the fragments to obtain a fragment sharpened image;
[0018] The fragmented sharpened image is enhanced using the following image double enhancement algorithm to obtain fragmented enhanced pixel values:
[0019]
[0020] Where f(i, j) is the fragment enhancement pixel value of pixel (i, j), g(i, j) is the sharpened pixel value of pixel (i, j), y(i, j) is the grayscale pixel value of the fragment grayscale image of pixel (i, j), β is the fragment enhancement factor, A(i, j) is the domain point set of pixel (i, j), and m is the total number of pixels in the domain point set;
[0021] The fragment-enhanced image data is generated according to the fragment-enhanced pixel value.
[0022] Optionally, the calculating the image roughness of the fragment enhanced image data by using a preset bidirectional image roughening algorithm includes:
[0023] Counting non-overlapping window images of the scrap material image data according to a preset bidirectional window;
[0024] Determining the horizontal grayscale value of the non-overlapping window image according to a preset horizontal direction;
[0025] Determining a vertical grayscale value of the non-overlapping window image according to a preset vertical direction;
[0026] Determine an optimal window size according to the horizontal grayscale value and the vertical grayscale value;
[0027] The image roughness of the fragment enhanced image data is calculated according to the optimal window size using the following bidirectional image roughening algorithm:
[0028]
[0029] Wherein, F is the image roughness, τ is the image roughness correction factor, a is the image width, b is the image height, and S(i, j) is the grayscale value of the pixel point (i, j) in the optimal size of the window.
[0030] Optionally, the calculating the image contrast of the fragment enhanced image data by using a preset hierarchical contrast algorithm includes:
[0031] Calculating the image variance of the fragmented material enhanced image data according to the pixel grayscale value and the pixel grayscale mean of the fragmented material enhanced image data;
[0032] The image contrast of the fragment enhanced image data is calculated according to the image variance and the preset image fourth moment using the following hierarchical contrast algorithm:
[0033]
[0034] Wherein, G is the image contrast, σ is the image variance, and μ4 is the image fourth moment.
[0035] Optionally, determining the texture features of the fragment enhanced image data according to the image roughness and the image contrast includes:
[0036] generating an image texture matrix of the fragment enhanced image data according to the image roughness and the image contrast;
[0037] determining a texture data distribution of the fragment enhanced image data according to the image texture matrix;
[0038] The texture features of the fragment enhanced image data are determined according to the texture data distribution.
[0039] Optionally, extracting color features of the scrap enhanced image data includes:
[0040] converting the first color space of the debris enhanced image data into a second color space;
[0041] Calculating a hierarchical color moment of the fragment-enhanced image data according to the color components in the second color space;
[0042] A color feature of the fragment-enhanced image data is determined according to the hierarchical color moment.
[0043] Optionally, the fusing of the texture feature and the color feature into the scrap feature of the scrap nonferrous metal scrap includes:
[0044] Unifying the dimensions of the texture features and the color features to obtain a unified dimension;
[0045] Linearly concatenating the texture features and the color features according to the unified dimension to obtain a linear concatenation matrix;
[0046] The scrap features of the scrap nonferrous metal scraps are generated according to the linear series matrix.
[0047] Optionally, the identifying the scrap labels of the target scrap features by using the classification recognition decision function includes:
[0048] determining an initial scrap label according to the target scrap characteristics;
[0049] Calculating a target scrap label of the target scrap feature using the classification recognition decision function;
[0050] The initial scrap label is optimized according to the target scrap label to obtain an optimized scrap label, and the optimized scrap label is determined as the scrap label of the target scrap feature.
[0051] Optionally, determining the metal scrap category of the scrap non-ferrous metal scrap according to the scrap label includes:
[0052] Generate a scrap label category mapping table based on a preset scrap identification feature set;
[0053] The scrap labels are mapped according to the scrap label category mapping table to obtain the metal scrap category of the waste non-ferrous metal scraps corresponding to the scrap labels.
[0054] In order to solve the above problems, the present invention also provides a scrap nonferrous metal fragment identification device based on image recognition, the device comprising:
[0055] An image enhancement processing module is used to obtain scrap image data of scrap nonferrous metal scraps, and perform enhancement processing on the scrap image data using a preset image dual enhancement algorithm to obtain scrap enhanced image data;
[0056] a roughness and contrast calculation module, configured to calculate the image roughness of the fragmented material enhanced image data using a preset bidirectional image roughening algorithm, and to calculate the image contrast of the fragmented material enhanced image data using a preset hierarchical contrast algorithm;
[0057] a scrap feature fusion module, configured to determine texture features of the scrap enhanced image data based on the image roughness and the image contrast, extract color features of the scrap enhanced image data, and fuse the texture features and the color features into scrap features of the scrap non-ferrous metal scrap;
[0058] A classification and identification decision function generation module is used to generate a classification and identification decision function for the scrap nonferrous metal scraps based on the scrap characteristics and a preset radial basis kernel function;
[0059] The scrap category recognition module is used to obtain image data of scrap non-ferrous metal scraps to be identified, extract target scrap features from the image data of the scrap to be identified, identify the scrap labels of the target scrap features using the classification recognition decision function, and determine the metal scrap category of the scrap non-ferrous metal scraps based on the scrap labels.
[0060] The embodiment of the present invention enhances the scrap image data, thereby suppressing noise and enhancing image contrast and edge information. The image roughness and contrast of the enhanced scrap image data are calculated to obtain a more accurate texture description, thereby better revealing the texture characteristics of the scrap. The color characteristics of the enhanced scrap image data are extracted to obtain a more comprehensive and accurate scrap feature. The texture characteristics and color characteristics are integrated into the scrap feature to obtain a more comprehensive and accurate feature representation of the scrap non-ferrous metal scrap, thereby facilitating better identification and classification of different types of scrap. A classification recognition decision function is generated based on the scrap features and the radial basis kernel function to determine the metal scrap category of the scrap to be identified. The classification recognition decision function is used to identify the scrap label of the scrap to be identified, and then the metal scrap category is determined based on the scrap label. This allows for accurate classification of the scrap non-ferrous metal scrap. Accurate classification allows for better arrangement and execution of corresponding processing steps, thereby improving processing efficiency and quality. Therefore, the scrap non-ferrous metal scrap identification method and device based on image recognition proposed by the present invention can solve the problem of low accuracy in scrap non-ferrous metal scrap identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 A schematic diagram of a process for identifying scrap nonferrous metal fragments based on image recognition according to an embodiment of the present invention;
[0062] Figure 2 A schematic diagram of a process for calculating image roughness according to an embodiment of the present invention;
[0063] Figure 3 A schematic diagram of a process for extracting color features according to an embodiment of the present invention;
[0064] Figure 4 This is a functional module diagram of a scrap nonferrous metal fragment identification device based on image recognition provided by one embodiment of the present invention;
[0065] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0066] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0067] The embodiment of the present application provides a method for identifying scrap non-ferrous metal scraps based on image recognition. The execution subject of the method for identifying scrap non-ferrous metal scraps based on image recognition includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the method for identifying scrap non-ferrous metal scraps based on image recognition can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0068] Reference Figure 1 FIG. 1 is a flow chart of a method for identifying scrap nonferrous metal fragments based on image recognition according to an embodiment of the present invention. In this embodiment, the method for identifying scrap nonferrous metal fragments based on image recognition includes:
[0069] S1. Obtain scrap image data of scrap nonferrous metal scraps, and perform enhancement processing on the scrap image data using a preset image dual enhancement algorithm to obtain scrap enhanced image data.
[0070] In an embodiment of the present invention, the scrap image data includes copper scrap images, aluminum scrap images, iron scrap images and stainless steel scrap images, wherein the scrap image data of scrap non-ferrous metal scraps can be obtained from a pre-stored storage area through a computer statement with a data capture function (such as a Java statement, a Python statement, etc.), wherein the storage area includes but is not limited to a database and a blockchain.
[0071] Furthermore, in order to improve the image quality of the scrap image data and thus improve the accuracy and reliability of scrap image classification, it is necessary to perform image enhancement processing and analysis on the scrap image data.
[0072] In the embodiment of the present invention, the fragment enhanced image data is obtained by graying, sharpening, smoothing and normalizing the fragment image data, which can suppress noise and enhance image contrast and edge information.
[0073] In the embodiment of the present invention, the method of enhancing the scrap image data using a preset double image enhancement algorithm to obtain the scrap enhanced image data includes:
[0074] Performing grayscale conversion on the scrap image data to obtain scrap grayscale image data;
[0075] Performing image sharpening on the grayscale image data of the fragments to obtain a fragment sharpened image;
[0076] The fragmented sharpened image is enhanced using the following image double enhancement algorithm to obtain fragmented enhanced pixel values:
[0077]
[0078] Where f(i, j) is the fragment enhancement pixel value of pixel (i, j), g(i, j) is the sharpened pixel value of pixel (i, j), y(i, j) is the grayscale pixel value of the fragment grayscale image of pixel (i, j), β is the fragment enhancement factor, A(i, j) is the domain point set of pixel (i, j), and m is the total number of pixels in the domain point set;
[0079] The fragment-enhanced image data is generated according to the fragment-enhanced pixel value.
[0080] In detail, the fragmented image data is first converted into a grayscale image, that is, the grayscale value is calculated by weighted averaging the R, G, and B channel values of each pixel through the channel corresponding to each pixel in the fragmented grayscale image, and the R, G, and B channel values of the original fragmented image data are replaced based on the grayscale value to generate the fragmented grayscale image data, and then the fragmented grayscale image data is sharpened to enhance the high-frequency details in the image, so that the image looks clearer, and then the grayscale image of the fragment is applied to the Laplacian kernel through a filter (such as a Laplacian filter or an edge enhancement filter) to highlight the edges and details in the image, thereby obtaining the sharpened fragmented image.
[0081] Specifically, the image double enhancement algorithm includes performing a smoothing operation based on normalized complement transformation on the fragmented sharpened image. By comparing the grayscale pixel value of the pixel point at position (i, j) in the fragmented grayscale image with the pixel value after sharpening at position (i, j) in the sharpened image, a pixel difference can be obtained, and the fragmented enhancement factor β can be used to adjust the contribution of the grayscale pixel value to the fragmented enhancement; the fragmented sharpened image data can also be denoised by a field averaging method. The larger the field radius, the better the smoothing effect. Noise reduction is performed based on the pixel points in the field point set to obtain the pixel value of each pixel point in the fragmented enhanced image, and then the fragmented enhanced image data is generated based on the pixel value, which can improve the image quality and enhance the image details.
[0082] Furthermore, it is necessary to extract the fragment features of the fragment enhanced image data, which can better highlight the details and texture of the fragment image, thereby improving the visualization effect and quality of the image. Therefore, it is necessary to analyze the roughness and contrast of the fragment enhanced image data.
[0083] S2. Calculate the image roughness of the fragmented material enhanced image data using a preset bidirectional image roughening algorithm, and calculate the image contrast of the fragmented material enhanced image data using a preset hierarchical contrast algorithm.
[0084] In an embodiment of the present invention, the image roughness is a measure used to describe the degree or intensity of features such as texture, details and edges in an image, reflecting the changes in pixel values and spatial frequencies in the image, thereby providing roughness information of the image surface.
[0085] In the embodiment of the present invention, referring to Figure 2 As shown, the method of calculating the image roughness of the fragment enhanced image data by using a preset bidirectional image roughening algorithm includes:
[0086] S21, counting non-overlapping window images of the scrap image data according to a preset bidirectional window;
[0087] S22, determining the horizontal grayscale value of the non-overlapping window image according to a preset horizontal direction;
[0088] S23, determining the vertical grayscale value of the non-overlapping window image according to a preset vertical direction;
[0089] S24, determining an optimal window size according to the horizontal grayscale value and the vertical grayscale value;
[0090] S25, using the following bidirectional image roughening algorithm to calculate the image roughness of the fragment enhanced image data according to the optimal window size:
[0091]
[0092] Wherein, F is the image roughness, τ is the image roughness correction factor, a is the image width, b is the image height, and S(i, j) is the grayscale value of the pixel point (i, j) in the optimal size of the window.
[0093] In detail, the roughness of each type of metal scrap in the scrap enhanced image data is calculated, and then the non-overlapping image data of the scrap image data in the preset initial window size is counted according to the bidirectional window in the horizontal and vertical directions. For example, if the window size is 4×4 and the step size is 2, the scrap enhanced image is slid in the horizontal and vertical directions respectively, so that the non-overlapping window images of the scrap image data can be counted, and the average grayscale value of the non-overlapping window image in the horizontal direction and the average grayscale value in the vertical direction are calculated. Then, the optimal window size of the bidirectional window is determined according to the average grayscale difference between the horizontal average grayscale value and the vertical average grayscale value. When the average grayscale difference is the largest, the θ value corresponding to the pixel point is set to the optimal window size of 2. θ , where θ is the exponential value of the two-way window size.
[0094] Specifically, in the bidirectional image roughening algorithm, the global average grayscale value of the image data is calculated in the optimal window size. The image roughness correction factor τ is a parameter or coefficient used to adjust the image roughness to improve the image quality. It is used to control the degree of enhancement or balance the trade-off between detail enhancement and image smoothing. The image roughness correction factor can be customized based on the size of the grayscale value. If the global average grayscale value error is large, the image roughness correction factor can be set to be close to the actual grayscale value, thereby obtaining accurate image roughness of the fragment-enhanced image data.
[0095] Furthermore, image roughness is a measure of the degree or intensity of features such as texture, details and edges in an image. The image pixel intensity in the fragmented material enhanced image data also needs to be analyzed. Therefore, the image contrast of the fragmented material enhanced image data needs to be calculated.
[0096] In the embodiment of the present invention, the image contrast is used to characterize the distribution of image pixel intensity, reflecting the dark and light levels in the grayscale image. It is affected by edge sharpness and pattern repetition and is an important attribute for describing image clarity and detail richness.
[0097] In the embodiment of the present invention, the step of calculating the image contrast of the fragment enhanced image data using a preset hierarchical contrast algorithm includes:
[0098] Calculating the image variance of the fragmented material enhanced image data according to the pixel grayscale value and the pixel grayscale mean of the fragmented material enhanced image data;
[0099] The image contrast of the fragment enhanced image data is calculated according to the image variance and the preset image fourth moment using the following hierarchical contrast algorithm:
[0100]
[0101] Wherein, G is the image contrast, σ is the image variance, and μ4 is the image fourth moment.
[0102] In detail, in grayscale image data, variance is used to describe the degree of dispersion or variation of pixel grayscale values. The larger the variance, the greater the difference in pixel grayscale values in the image, and the more light and dark contrast the image has. The square of the difference between the grayscale value of each pixel and the mean is taken, and then the total number of all pixels is averaged to obtain the image variance of the fragmented enhanced image data. Then, the image contrast of the fragmented enhanced image data can be calculated by the image variance and the image fourth moment. The image fourth moment includes the mean, variance, skewness and kurtosis, which are usually used to analyze the statistical and morphological characteristics of the data. The image pixel mean, variance, skewness and peak are weightedly fused to obtain the fourth moment of the fragmented enhanced image data.
[0103] Furthermore, image roughness and image contrast are important factors affecting the texture characteristics of the fragmented material image. By adjusting the image enhancement parameters according to the roughness and contrast, a more accurate texture description can be obtained; roughness can reflect the particles and texture details on the surface of the fragmented material, while contrast can enhance the texture edges and details of the fragmented material, thereby better revealing the texture characteristics of the fragmented material.
[0104] S3. Determine texture features of the scrap enhanced image data according to the image roughness and the image contrast, extract color features of the scrap enhanced image data, and fuse the texture features and the color features into scrap features of the scrap non-ferrous metal scrap.
[0105] In the embodiment of the present invention, the texture feature is an attribute or characteristic that describes the surface texture of the material enhanced image data, and provides information on the texture structure, morphology and details.
[0106] In the embodiment of the present invention, determining the texture features of the fragment enhanced image data according to the image roughness and the image contrast includes:
[0107] generating an image texture matrix of the fragment enhanced image data according to the image roughness and the image contrast;
[0108] determining a texture data distribution of the fragment enhanced image data according to the image texture matrix;
[0109] The texture features of the fragment enhanced image data are determined according to the texture data distribution.
[0110] In detail, the image roughness and image contrast are used to generate the image texture matrix of the scrap enhanced image data. For example, the image roughness corresponding to the copper scrap image is F1 and the image contrast is G1; the image roughness corresponding to the aluminum scrap image is F2 and the image contrast is G2; the image roughness corresponding to the iron scrap image is F3 and the image contrast is G3; the image roughness corresponding to the stainless steel scrap image is F4 and the image contrast is G4; then the image texture matrix is generated according to the image roughness and image contrast of different types of scrap images, that is, The texture data distribution of each type of debris in the debris enhanced image data can be determined according to the roughness and contrast in the image texture matrix, so that the texture data distribution is determined as the texture feature of the debris enhanced image data.
[0111] Furthermore, it is necessary to analyze not only the texture features of the fragmented material enhanced image data but also the color features of the fragmented material enhanced image data in order to obtain more comprehensive and accurate fragmented material features.
[0112] In the embodiment of the present invention, the color features are represented by color moments, which do not require subsequent processing operations such as color quantization and smoothing, have lower feature vector dimensions and computational complexity, and make the image information more comprehensive.
[0113] In the embodiment of the present invention, referring to Figure 3 As shown, the step of extracting the color features of the fragment enhanced image data includes:
[0114] S31, converting the first color space of the fragment enhanced image data into a second color space;
[0115] S32. Calculate the hierarchical color moment of the fragment-enhanced image data according to the color components in the second color space;
[0116] S33: Determine color features of the fragment enhanced image data according to the hierarchical color moment.
[0117] In detail, the first color space (RGB color space) of the fragmented enhanced image data is converted into a second color space (HSV color space). For each pixel, each component (red, green and blue) in the RGB space is converted into the corresponding color component (hue, saturation and brightness) in the HSV space. Then, the color moments of different levels of the fragmented enhanced image data are calculated in the second color space. The hierarchical color moments include first-order moments, second-order moments and third-order moments. The first-order moment reflects the brightness and darkness of the image, the second-order moment reflects the color distribution range of the image, and the third-order moment reflects the symmetry of the color distribution of the image.
[0118] Specifically, the first-order moment is where δ i is the first-order moment, P ij is the pixel value at pixel point (i, j), M is the number of image pixels, and the second-order moment is γ i is the second-order moment and the third-order moment is s i If it is a third-order moment, the first-order moment, second-order moment and third-order moment in the hierarchical color moment are determined as the color features of the fragment enhanced image data.
[0119] Furthermore, texture features and color features each provide different information. Fusion of different features can improve the expressiveness of features. Texture features describe the details and texture structure of the scrap surface, while color features provide information about color distribution and properties. By fusing these two different types of features, a more comprehensive and accurate feature representation of scrap non-ferrous metal scrap can be obtained, which helps to better identify and classify different types of scrap.
[0120] In the embodiment of the present invention, the scrap characteristics are texture characteristics and color characteristics of different metal scraps in the scrap non-ferrous metal scraps, and are used to characterize different metal scraps.
[0121] In the embodiment of the present invention, the fusion of the texture feature and the color feature into the scrap feature of the scrap nonferrous metal includes:
[0122] Unifying the dimensions of the texture features and the color features to obtain a unified dimension;
[0123] Linearly concatenating the texture features and the color features according to the unified dimension to obtain a linear concatenation matrix;
[0124] The scrap features of the scrap nonferrous metal scraps are generated according to the linear series matrix.
[0125] In detail, texture features are two-dimensional features, and color features are three-dimensional features. The dimensions of texture features are unified according to the dimensions of color features, and texture features and color features of different dimensions are mapped to a unified dimensional space, which can facilitate direct comparison and fusion between features. The unified dimension makes different features have the same scale and range, reduces the differences between features, and is easier to combine and integrate features, so as to better describe and represent the target. Therefore, the texture features and color features of the unified dimension are concatenated to obtain the fused linear concatenation matrix, and the linear concatenation matrix is Or [F, G, 0, δ, γ, s], the linear series matrix is determined as the fragment characteristics of the scrap non-ferrous metal fragments.
[0126] Furthermore, a classification and recognition function for scrap nonferrous metal scraps can be constructed based on the scrap characteristics to better distinguish different types of metal scraps.
[0127] S4. Generate a classification and identification decision function for the scrap nonferrous metal scraps based on the scrap characteristics and a preset radial basis kernel function.
[0128] In an embodiment of the present invention, the classification and recognition decision function is a function constructed based on a vector machine, which classifies or recognizes input features and divides the input data into different discrete categories and labels, thereby determining the metal scrap label of the scrap non-ferrous metal fragments.
[0129] In an embodiment of the present invention, the generation of the classification and identification decision function of the scrap nonferrous metal scraps based on the scrap characteristics and a preset radial basis kernel function includes:
[0130] Generating a scrap identification feature set of the scrap nonferrous metal scraps according to the scrap features and a preset metal scrap category label;
[0131] A classification and recognition decision function for the scrap nonferrous metal scraps is generated based on the scrap material recognition feature set and a preset radial basis kernel function, wherein the classification and recognition decision function is:
[0132]
[0133] Among them, r(u s ) is the feature u of the fragment to be identified s The metal scrap category label, sign is the symbol function, v n is the metal scrap category label in the scrap identification feature set, exp is the exponential function, u s is the feature of the fragment to be identified, u n is the material feature in the material identification feature set, σ is the feature variance, γ is the classification dynamic factor, and N is the number of features in the material identification feature set.
[0134] In detail, the scrap features and the preset metal scrap category labels are used to generate a scrap identification feature set. For example, in the metal scrap category labels, the copper scrap label is +1 or -1, the aluminum scrap label is +1 or -1, the iron scrap label is +1 or -1, and the stainless steel scrap label is +1 or -1. The scrap features are matched with the metal scrap category labels. For example, the metal scrap category label corresponding to the scrap feature u1 is +1, the metal scrap category label corresponding to the scrap feature u2 is -1, the metal scrap category label corresponding to the scrap feature u3 is +1, and the metal scrap category label corresponding to the scrap feature u4 is +1. The scrap category label is -1, and so on. All scrap features in different metal scrap categories are matched with the metal scrap category labels to generate a scrap identification feature set. For example, the scrap identification feature set of copper scrap is {(u1, +1), (u2, -1), (u3, +1), (u4, -1)...}, and the scrap identification feature set of aluminum scrap is {(u1, -1), (u2, +1), (u3, +1), (u4, -1)...}. Then, a classification and recognition decision function is generated based on the scrap identification feature set and the radial basis kernel function.
[0135] Specifically, the radial basis kernel function in the classification recognition decision function is: By using the radial basis kernel function, a more precise classification model can be established, taking into account the characteristics of scrap nonferrous metals. The radial basis kernel function can capture complex data relationships, thereby better distinguishing different types of scrap. The classification dynamic factor γ is used to represent the characteristics of the metal scraps. For example, Y = 1 represents the scrap identification feature set corresponding to copper scraps, γ = 2 represents the scrap identification feature set corresponding to aluminum scraps, γ = 3 represents the scrap identification feature set corresponding to iron scraps, and γ = 4 represents the scrap identification feature set corresponding to stainless steel scraps. This results in a classification and identification decision function for scrap nonferrous metals.
[0136] Furthermore, the scrap labels of the scrap image data of the scrap non-ferrous metal scraps to be identified can be assigned according to the classification and recognition decision function, thereby determining the metal scrap category of the scrap to be identified.
[0137] S5. Obtain image data of scrap non-ferrous metal scraps to be identified, extract target scrap features from the image data of the scrap non-ferrous metal scraps to be identified, identify scrap labels of the target scrap features using the classification and recognition decision function, and determine the metal scrap category of the scrap non-ferrous metal scraps based on the scrap labels.
[0138] In an embodiment of the present invention, the image data of the scraps to be identified include images of copper scraps, images of aluminum scraps, images of iron scraps, and images of stainless steel scraps, wherein the image data of the scraps to be identified of the scrap non-ferrous metal scraps can be obtained from a pre-stored storage area through a computer statement with a data capture function (such as a Java statement, a Python statement, etc.), wherein the storage area includes but is not limited to a database and a blockchain.
[0139] Furthermore, before determining the fragment labels of the fragment image data to be identified, it is necessary to first extract the target fragment features of the fragment image data to be identified, wherein the target fragment features include texture features and color features. The extraction of the texture features of the fragment image to be identified is consistent with the steps in S2 and S3, and will not be repeated here.
[0140] In the embodiment of the present invention, the scrap label refers to a label type corresponding to the target scrap characteristics, for example, the scrap label corresponding to the target scrap characteristics is an aluminum scrap label.
[0141] In an embodiment of the present invention, the method of identifying the target scrap material labels based on the target scrap material characteristics by using the classification recognition decision function includes:
[0142] determining an initial scrap label according to the target scrap characteristics;
[0143] Calculating a target scrap label of the target scrap feature using the classification recognition decision function;
[0144] The initial scrap label is optimized according to the target scrap label to obtain an optimized scrap label, and the optimized scrap label is determined as the scrap label of the target scrap feature.
[0145] In detail, an initial scrap label is first manually assigned based on the target scrap feature, indicating a subjective scrap label. Then, a target scrap label corresponding to the target scrap feature is calculated using a classification and recognition decision function. For example, if γ is set to 1 in the classification and recognition decision function, the target scrap feature is first identified as copper scrap. If the calculated result is +1, the target scrap label corresponding to the target scrap feature is copper scrap. If the calculated result is -1, γ in the classification and recognition decision function is reset to γ=2. If the calculated result is +1, the target scrap label corresponding to the target scrap feature is aluminum scrap. If the calculated result is -1, γ in the classification and recognition decision function is reset to γ=3 until the result calculated by the classification and recognition decision function is +1, and the final target scrap label is obtained. The target scrap label is then compared with the initial scrap label. If the labels are the same, the target scrap label is determined as the scrap label of the target scrap feature. If the labels are different, the initial scrap label is updated to the target scrap label, thereby determining the scrap label of the target scrap feature.
[0146] Furthermore, the metal category of the scrap image data to be identified can be determined based on the scrap label. By using the scrap label, the scrap non-ferrous metal scrap can be accurately classified. Through accurate classification, the corresponding processing steps can be better arranged and executed, thereby improving processing efficiency and quality.
[0147] In an embodiment of the present invention, determining the metal scrap category of the scrap nonferrous metal scrap according to the scrap label includes:
[0148] Generate a scrap label category mapping table based on a preset scrap identification feature set;
[0149] The scrap labels are mapped according to the scrap label category mapping table to obtain the metal scrap category of the waste non-ferrous metal scraps corresponding to the scrap labels.
[0150] Specifically, by comparing the scrap features in the scrap identification feature set with the scrap categories, a scrap label category mapping table can be generated. For example, the scrap features of different metal categories are mapped in the scrap label category mapping table. For example, if the metal category is copper scrap, the scrap feature is u1; if the metal category is aluminum scrap, the scrap feature is u2; if the metal category is iron scrap, the scrap feature is u3; and if the metal category is stainless steel scrap, the scrap feature is u4. The scrap labels are then compared based on the scrap labels and the classification dynamic factor to obtain the metal scrap category of the scrap non-ferrous metal scrap. Alternatively, the scrap labels can be matched with the scrap type indicated in the classification dynamic factor to obtain the metal scrap category of the scrap non-ferrous metal scrap corresponding to the scrap label, thereby improving the accuracy of scrap non-ferrous metal identification.
[0151] The embodiment of the present invention enhances the scrap image data, thereby suppressing noise and enhancing image contrast and edge information. The image roughness and contrast of the enhanced scrap image data are calculated to obtain a more accurate texture description, thereby better revealing the texture characteristics of the scrap. The color characteristics of the enhanced scrap image data are extracted to obtain a more comprehensive and accurate scrap feature. The texture characteristics and color characteristics are integrated into the scrap feature to obtain a more comprehensive and accurate feature representation of the scrap non-ferrous metal scrap, thereby facilitating better identification and classification of different types of scrap. A classification recognition decision function is generated based on the scrap features and the radial basis kernel function to determine the metal scrap category of the scrap to be identified. The classification recognition decision function is used to identify the scrap label of the scrap to be identified, and then the metal scrap category is determined based on the scrap label. This allows for accurate classification of the scrap non-ferrous metal scrap. Accurate classification allows for better arrangement and execution of corresponding processing steps, thereby improving processing efficiency and quality. Therefore, the scrap non-ferrous metal scrap identification method and device based on image recognition proposed by the present invention can solve the problem of low accuracy in scrap non-ferrous metal scrap identification.
[0152] like Figure 4 , which is a functional module diagram of a scrap nonferrous metal fragment identification device based on image recognition provided by one embodiment of the present invention.
[0153] The image recognition-based scrap non-ferrous metal scrap identification device 100 described in the present invention can be installed in an electronic device. Depending on the functionality implemented, the image recognition-based scrap non-ferrous metal scrap identification device 100 may include an image enhancement processing module 101, a roughness and contrast calculation module 102, a scrap feature fusion module 103, a classification and recognition decision function generation module 104, and a scrap category identification module 105. A module, also referred to as a unit, is a series of computer program segments that can be executed by an electronic device processor and perform a fixed function. These modules are stored in the electronic device's memory.
[0154] In this embodiment, the functions of each module / unit are as follows:
[0155] The image enhancement processing module 101 is used to obtain scrap image data of scrap non-ferrous metal scraps, and perform enhancement processing on the scrap image data using a preset image dual enhancement algorithm to obtain scrap enhanced image data;
[0156] The roughness and contrast calculation module 102 is used to calculate the image roughness of the fragmented material enhanced image data using a preset bidirectional image roughening algorithm, and to calculate the image contrast of the fragmented material enhanced image data using a preset hierarchical contrast algorithm;
[0157] The scrap feature fusion module 103 is configured to determine the texture features of the scrap enhanced image data based on the image roughness and the image contrast, extract the color features of the scrap enhanced image data, and fuse the texture features and the color features into the scrap features of the scrap non-ferrous metal scrap;
[0158] The classification and identification decision function generating module 104 is used to generate a classification and identification decision function for the scrap nonferrous metal scraps based on the scrap characteristics and a preset radial basis kernel function;
[0159] The scrap category identification module 105 is used to obtain scrap image data of scrap non-ferrous metal scraps to be identified, extract target scrap features from the scrap image data to be identified, identify the scrap labels of the target scrap features using the classification and recognition decision function, and determine the metal scrap category of the scrap non-ferrous metal scraps based on the scrap labels.
[0160] In detail, each module in the scrap nonferrous metal fragment identification device 100 based on image recognition according to the embodiment of the present invention is used in the same manner as described above. Figures 1 to 3The same technical means are used as the method for identifying scrap non-ferrous metal fragments based on image recognition described in , and can produce the same technical effects, so they will not be repeated here.
[0161] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the module division is merely a logical function division, and actual implementation may employ other division methods.
[0162] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected to achieve the purpose of the solution of this embodiment according to actual needs.
[0163] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional modules.
[0164] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0165] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is not limited only according to the above description, and it is intended that all changes within the meaning and scope of equivalent elements falling within the scope of protection are included in the present invention.
[0166] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.
[0167] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices described in a system embodiment may also be implemented by a single unit or device through software or hardware. Terms such as first and second are used to indicate names and do not imply any particular order.
[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for identifying scrap nonferrous metal fragments based on image recognition, characterized in that: The method comprises: S1. Obtaining scrap image data of scrap nonferrous metal scraps, and performing enhancement processing on the scrap image data using a preset image dual enhancement algorithm to obtain scrap enhanced image data; S2. Calculating the image roughness of the fragmented material enhanced image data using a preset bidirectional image roughening algorithm, and calculating the image contrast of the fragmented material enhanced image data using a preset hierarchical contrast algorithm; S3. Determining texture features of the scrap enhanced image data based on the image roughness and the image contrast, extracting color features of the scrap enhanced image data, and fusing the texture features and the color features into scrap features of the scrap non-ferrous metal scraps; S4. Generating a classification and identification decision function for the scrap non-ferrous metal scraps based on the scrap characteristics and a preset radial basis kernel function, wherein the generating a classification and identification decision function for the scrap non-ferrous metal scraps based on the scrap characteristics and a preset radial basis kernel function comprises: S41, generating a scrap identification feature set of the scrap nonferrous metal scraps according to the scrap features and a preset metal scrap category label; S42. Generate a classification and recognition decision function for the scrap nonferrous metal scraps based on the scrap identification feature set and a preset radial basis kernel function, wherein the classification and recognition decision function is: Among them, r(u s ) is the feature u of the fragment to be identified s The metal scrap category label, sign is the symbol function, v n is the metal scrap category label in the scrap identification feature set, exp is the exponential function, u s is the feature of the fragment to be identified, u n is the material feature in the material identification feature set, σ is the feature variance, γ is the classification dynamic factor, and N is the number of features in the material identification feature set; S5. Obtain image data of scrap non-ferrous metal scraps to be identified, extract target scrap features from the image data of the scrap non-ferrous metal scraps to be identified, identify scrap labels of the target scrap features using the classification and recognition decision function, and determine the metal scrap category of the scrap non-ferrous metal scraps based on the scrap labels.
2. The method for identifying scrap nonferrous metal fragments based on image recognition according to claim 1, characterized in that: The method of performing enhancement processing on the scrap material image data by using a preset double image enhancement algorithm to obtain scrap material enhanced image data includes: Performing grayscale conversion on the scrap image data to obtain scrap grayscale image data; Performing image sharpening on the grayscale image data of the fragments to obtain a fragment sharpened image; The fragmented sharpened image is enhanced using the following image double enhancement algorithm to obtain fragmented enhanced pixel values: Where f(i,j) is the fragment enhancement pixel value of pixel (i,j), g(i,j) is the sharpened pixel value of pixel (i,j), y(i,j) is the grayscale pixel value of the fragment grayscale image of pixel (i,j), β is the fragment enhancement factor, A(i,j) is the domain point set of pixel (i,j), and m is the total number of pixels in the domain point set; The fragment-enhanced image data is generated according to the fragment-enhanced pixel value.
3. The method for identifying scrap nonferrous metal fragments based on image recognition according to claim 1, characterized in that: The calculating the image roughness of the fragment enhanced image data by using a preset bidirectional image roughening algorithm includes: Counting non-overlapping window images of the scrap material image data according to a preset bidirectional window; Determining the horizontal grayscale value of the non-overlapping window image according to a preset horizontal direction; Determining a vertical grayscale value of the non-overlapping window image according to a preset vertical direction; Determine an optimal window size according to the horizontal grayscale value and the vertical grayscale value; The image roughness of the fragment enhanced image data is calculated according to the optimal window size using the following bidirectional image roughening algorithm: Wherein, F is the image roughness, τ is the image roughness correction factor, a is the image width, b is the image height, and S(i, j) is the grayscale value of the pixel point (i, j) in the optimal size of the window.
4. The method for identifying scrap nonferrous metal fragments based on image recognition according to claim 1, wherein: The calculating the image contrast of the fragment enhanced image data by using a preset hierarchical contrast algorithm includes: Calculating the image variance of the fragmented material enhanced image data according to the pixel grayscale value and the pixel grayscale mean of the fragmented material enhanced image data; The image contrast of the fragment enhanced image data is calculated according to the image variance and the preset image fourth moment using the following hierarchical contrast algorithm: Wherein, G is the image contrast, σ is the image variance, and μ4 is the image fourth moment.
5. The method for identifying scrap nonferrous metal fragments based on image recognition according to claim 1, characterized in that: The determining of the texture features of the fragment enhanced image data according to the image roughness and the image contrast includes: generating an image texture matrix of the fragment enhanced image data according to the image roughness and the image contrast; determining a texture data distribution of the fragment enhanced image data according to the image texture matrix; The texture features of the fragment enhanced image data are determined according to the texture data distribution.
6. The method for identifying scrap nonferrous metal fragments based on image recognition according to claim 1, characterized in that: The extracting color features of the fragment enhanced image data includes: converting the first color space of the debris enhanced image data into a second color space; Calculating a hierarchical color moment of the fragment-enhanced image data according to the color components in the second color space; A color feature of the fragment-enhanced image data is determined according to the hierarchical color moment.
7. The method for identifying scrap nonferrous metals based on image recognition according to claim 1, characterized in that: The step of fusing the texture features and the color features into the scrap features of the scrap non-ferrous metal scraps includes: Unifying the dimensions of the texture features and the color features to obtain a unified dimension; Linearly concatenating the texture features and the color features according to the unified dimension to obtain a linear concatenation matrix; The scrap features of the scrap nonferrous metal scraps are generated according to the linear series matrix.
8. The method for identifying scrap nonferrous metals based on image recognition according to claim 1, wherein: The method of identifying the target scrap material label by using the classification recognition decision function includes: determining an initial scrap label according to the target scrap characteristics; Calculating a target scrap label of the target scrap feature using the classification recognition decision function; The initial scrap label is optimized according to the target scrap label to obtain an optimized scrap label, and the optimized scrap label is determined as the scrap label of the target scrap feature.
9. The method for identifying scrap nonferrous metal fragments based on image recognition according to claim 1, characterized in that: Determining the metal scrap category of the scrap nonferrous metal scrap according to the scrap label includes: Generate a scrap label category mapping table based on a preset scrap identification feature set; The scrap labels are mapped according to the scrap label category mapping table to obtain the metal scrap category of the waste non-ferrous metal scraps corresponding to the scrap labels.
10. A scrap nonferrous metal fragment identification device based on image recognition, characterized in that: The device comprises: An image enhancement processing module is used to obtain scrap image data of scrap nonferrous metal scraps, and perform enhancement processing on the scrap image data using a preset image dual enhancement algorithm to obtain scrap enhanced image data; a roughness and contrast calculation module, configured to calculate the image roughness of the fragmented material enhanced image data using a preset bidirectional image roughening algorithm, and to calculate the image contrast of the fragmented material enhanced image data using a preset hierarchical contrast algorithm; a scrap feature fusion module, configured to determine texture features of the scrap enhanced image data based on the image roughness and the image contrast, extract color features of the scrap enhanced image data, and fuse the texture features and the color features into scrap features of the scrap non-ferrous metal scrap; A classification and identification decision function generation module is used to generate a classification and identification decision function for the scrap nonferrous metal scraps based on the scrap characteristics and a preset radial basis kernel function; The scrap category recognition module is used to obtain image data of scrap non-ferrous metal scraps to be identified, extract target scrap features from the image data of the scrap to be identified, identify the scrap labels of the target scrap features using the classification recognition decision function, and determine the metal scrap category of the scrap non-ferrous metal scraps based on the scrap labels.
Citation Information
Patent Citations
A method of leaf disease identification based on machine learning algorithm
CN109308697A
Model generation method and device based on multi-feature fusion, equipment and storage medium
CN114723636A