Intelligent garbage classification method and device based on meta-learning dynamic relation measurement and medium

Through the meta-learning dynamic relationship measurement method, the convolution feature extractor and relationship network are used to build support sets and query sets, which solves the problems of resource limitation and data scarcity in garbage classification, and achieves efficient and accurate garbage classification.

CN120472437APending Publication Date: 2025-08-12YANGTZE UNIVERSITY
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510543515.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-08-12

Smart Images

  • Figure CN120472437A_ABST
    Figure CN120472437A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent garbage classification method and device based on meta-learning dynamic relation measurement and a medium, and relates to the crossing field of artificial intelligence and environmental protection technologies. The method comprises the steps of obtaining a support set and a query set; randomly selecting one sample image from the support set and randomly selecting one query image from the query set, and inputting the sample image and the query image into a feature extractor to respectively obtain a first feature map and a second feature map; performing element-level addition on the first feature map and the second feature map in a channel dimension to obtain a fused feature map; inputting the fusion feature map into a relation network, and obtaining a prediction relation score of the query image and the sample image; and combining the feature extractor, the feature fusion layer and the relation network into a garbage classification model, and training the garbage classification model. The method not only reduces dependence on large-scale data, but also effectively reduces model complexity and parameter scale through lightweight module design, and is suitable for deployment requirements in a resource-constrained environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the intersection of artificial intelligence and environmental protection technology, and more specifically, to an intelligent garbage classification method, device and medium based on meta-learning dynamic relationship measurement. Background Art

[0002] With the accelerating pace of urbanization, increasing urban population density and pace of life, the amount of municipal solid waste generated has also increased dramatically. The types of waste are becoming increasingly complex and diverse. If it is not effectively sorted and processed, it can easily cause serious environmental pollution and resource waste, hindering the sustainable development of cities. Therefore, building an efficient and intelligent waste sorting system has become a major issue. Currently, waste sorting in practice still mainly relies on manual identification or simple mechanical sorting. This is not only labor-intensive and inefficient, but also requires long-term operator training, making it difficult to meet the current growing demand for sorting. Faced with this situation, the use of artificial intelligence, particularly deep learning technology based on image recognition, has become an important direction for achieving automatic waste identification and classification.

[0003] In recent years, garbage classification algorithms have undergone a transition from traditional machine learning methods to deep neural networks (such as convolutional neural networks (CNNs). While CNNs, through end-to-end training, have improved classification accuracy, they still face several challenges in garbage classification: Deep models typically require large amounts of labeled data for training, but garbage image data is difficult to obtain, data is scarce, and labeling is expensive. Mainstream deep networks are complex in structure, making them difficult to deploy directly on edge computing devices or low-power hardware platforms, limiting their real-time and practical applications. Summary of the Invention

[0004] To address the above technical issues, the present invention provides an intelligent garbage classification method, device, and medium based on meta-learning dynamic relational metrics. Based on the N-way K-shot Few-Shot Learning framework, it constructs support and query sets, and performs intelligent classification through the following modules: a convolutional feature extractor module to capture deep semantic information about images; a feature fusion module to embed and synthesize support and query images in the channel dimension; and a relational network module (RelationNetwork) to learn similarity scores between images and implement the final classification decision. This method not only reduces reliance on large-scale data but also effectively reduces model complexity and parameter size through lightweight module design, making it suitable for deployment requirements in resource-constrained environments.

[0005] In a first aspect, the present invention provides an intelligent garbage classification method based on meta-learning dynamic relationship measurement, the method comprising:

[0006] Acquire a data set; wherein the data set includes a support set and a query set, the support set includes multiple categories, each category corresponds to multiple sample images, and the query set includes at least two query images to be classified;

[0007] Selecting a sample image from the support set and a query image from the query set, and inputting the samples into a feature extractor to obtain a first feature map and a second feature map respectively;

[0008] Inputting the first feature map and the second feature map into a feature fusion layer, performing element-wise addition on the first feature map and the second feature map in the channel dimension to obtain a fused feature map;

[0009] Inputting the fused feature map into a relationship network to obtain a predicted relationship score between the query image and the sample image;

[0010] The feature extractor, feature fusion layer, and relationship network are combined into a garbage classification model. Based on the data set and the set loss function, the N predicted relationship scores obtained by the garbage classification model are subjected to loss calculation with the true labels to obtain a loss value. With the goal of minimizing the loss value, the garbage classification model is trained to obtain a trained garbage classification model.

[0011] Based on the trained garbage classification model, a garbage category is output in response to an input garbage image to be classified.

[0012] Preferably, the feature extractor obtains the first feature map and the second feature map by the following formula:

[0013]

[0014] Where, represents the first feature map, S i represents the i-th sample image, represents the second feature map,

[0015] Q j represents the j-th query image, and F(·) represents the feature extractor. The feature extractor includes four convolutional layers and two maximum pooling layers. Through a hierarchical feature extraction method, the underlying texture features of the input image are gradually abstracted into high-level semantic features and the feature map of a set size is output.

[0016] Preferably, the first feature map and the second feature map are element-wise added in the channel dimension by the following formula to obtain a fused feature map:

[0017]

[0018] Where, Represents the fused feature map.

[0019] Preferably, the fused feature map is input into the relationship network, and the predicted relationship score between the query image and the sample image is obtained by the following formula:

[0020]

[0021] Where, represents the convolution feature, Represents the fused feature map; W1 and W2 both represent the weight matrix of the convolution kernel; * represents the convolution operation; w represents the network weight matrix, b represents the bias, BN1 and BN2 both represent the batch normalization operation; σ represents the ReLU activation function, Sigmoid represents the nonlinear activation function; relation score represents the predicted relationship score; g φ represents a learnable mapping function.

[0022] Preferably, the loss function is expressed as:

[0023]

[0024] Where, Represents the loss value, N represents the number of categories, i represents the sequence number of the sample image, represents the predicted relationship score between the i-th sample image and the j-th query image, y SiQj Represents the true label in one-hot encoding form of the i-th sample image and the j-th query image.

[0025] Preferably, based on the trained garbage classification model, in response to an input garbage image to be classified, outputting a garbage category includes:

[0026] Preprocess the input junk image to be classified to obtain an image tensor of a set size;

[0027] Inputting the image tensor of the set size and the N sample images of the support set into the trained garbage classification model respectively, and calculating N predicted relationship scores in sequence;

[0028] The N predicted relationship scores are compared, and the category corresponding to the highest predicted relationship score is used as the junk category of the junk image to be classified.

[0029] In a second aspect, the present invention provides an intelligent garbage sorting device based on meta-learning dynamic relationship measurement, the device comprising:

[0030] A data acquisition module is configured to acquire a data set; wherein the data set includes a support set and a query set, the support set includes multiple categories, each category corresponds to multiple sample images, and the query set includes at least two query images to be classified;

[0031] a feature extraction module configured to select a sample image from the support set and a query image from the query set, and input the sample images into a feature extractor to obtain a first feature map and a second feature map respectively;

[0032] a feature fusion module configured to input the first feature map and the second feature map into a feature fusion layer, and perform element-wise addition of the first feature map and the second feature map in a channel dimension to obtain a fused feature map;

[0033] a feature prediction module configured to input the fused feature map into a relationship network to obtain a predicted relationship score between the query image and the sample image;

[0034] a model training module configured to combine the feature extractor, the feature fusion layer, and the relationship network into a waste classification model, and based on the data set and a set loss function, perform a loss calculation on the N predicted relationship scores obtained by the waste classification model and the true labels to obtain a loss value, and train the waste classification model with the goal of minimizing the loss value to obtain a trained waste classification model;

[0035] The garbage classification module is configured to output a garbage category in response to an input garbage image to be classified based on the trained garbage classification model.

[0036] Preferably, the feature prediction module is further configured to input the fused feature map into a relationship network, and obtain the predicted relationship score between the query image and the sample image by the following formula:

[0037]

[0038] Where, represents the convolution feature, Represents the fused feature map; W1 and W2 both represent the weight matrix of the convolution kernel; * represents the convolution operation; w represents the network weight matrix, b represents the bias, BN1 and BN2 both represent the batch normalization operation; σ represents the ReLU activation function, Sigmoid represents the nonlinear activation function; relation score represents the predicted relationship score; g φ represents a learnable mapping function.

[0039] Preferably, the garbage classification module is further configured to:

[0040] Preprocess the input junk image to be classified to obtain an image tensor of a set size;

[0041] Inputting the image tensor of the set size and the N sample images of the support set into the trained garbage classification model respectively, and calculating N predicted relationship scores in sequence;

[0042] The N predicted relationship scores are compared, and the category corresponding to the highest predicted relationship score is used as the junk category of the junk image to be classified.

[0043] In a third aspect, the present invention provides a readable storage medium, wherein the readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method as described above.

[0044] The present invention has at least the following beneficial effects:

[0045] 1) Small sample classification capabilities are significantly improved

[0046] Support set and query set design: Through the meta-learning paradigm (the support set provides a small number of sample categories, and the query set is dynamically matched), the model can quickly adapt to new categories based on a small number of labeled samples (such as 5-10 images per category), solving the problem of diverse garbage categories but scarce labeled data in real scenarios.

[0047] 2) Feature representation and relationship modeling optimization

[0048] Feature Extractor: Uses deep networks to extract high-dimensional features of sample and query images, fully mining image details (such as texture and shape), and enhancing the ability to express complex garbage features.

[0049] Feature fusion layer (element-level addition in the channel dimension): While retaining the independent features of the sample and query images, channel fusion is used to enhance feature interaction, avoid information loss, and improve the ability to distinguish similar categories (such as easily confused kitchen waste and recyclable plastics).

[0050] 3) Accurate dynamic relationship measurement

[0051] Relationship Network: By learning the nonlinear relationship between samples and query images end-to-end (rather than the traditional fixed distance metric), it adaptively generates predicted relationship scores, significantly improving the accuracy of fine-grained classification (such as glass bottles of different colors / materials) and cross-domain generalization (such as lighting changes and background interference).

[0052] 4) End-to-end training is efficient and stable

[0053] Joint optimization framework: The feature extractor, fusion layer, and relational network are trained collaboratively. The loss function is used to directly optimize the consistency between the relation scores and the true labels, shortening the model convergence time, reducing gradient fluctuations during training, and improving overall stability.

[0054] 5) Strong applicability to actual scenarios

[0055] Lightweight inference: The trained model only requires a single forward propagation to output classification results, meeting real-time requirements (such as embedded device deployment).

[0056] Enhanced robustness: It has strong tolerance to common interferences such as occlusion and deformation, and is suitable for garbage sorting tasks in complex environments (such as community garbage stations and smart recycling bins).

[0057] In summary, the present invention achieves a balance among small sample learning ability, classification accuracy, and actual deployment efficiency through meta-learning dynamic relationship modeling and multi-stage feature fusion, providing a cost-effective technical solution for intelligent garbage classification scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 A flowchart of an intelligent garbage classification method based on meta-learning dynamic relationship measurement according to an embodiment of the present invention is shown;

[0059] Figure 2 A specific implementation flow chart of an intelligent garbage classification method based on meta-learning dynamic relationship measurement according to an embodiment of the present invention is shown;

[0060] Figure 3 A structural diagram of an intelligent garbage classification device based on meta-learning dynamic relationship measurement according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0061] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments. The embodiments of the present invention are further described in detail below with reference to the accompanying drawings and specific embodiments, but are not intended to limit the present invention. For the various steps described herein, if there is no necessity for a contextual relationship between each other, the order in which they are described as examples herein should not be regarded as limiting, and those skilled in the art should know that they can be adjusted in order as long as the logic between them is not destroyed, resulting in the inability to implement the entire process.

[0062] The embodiment of the present invention provides an intelligent garbage classification method based on meta-learning dynamic relationship measurement, which is a small sample garbage classification method based on convolutional feature extractor, feature fusion and relationship network. Figure 1As shown, first prepare the dataset, divide the data into a support set and a query set, construct a few-sample classification task that meets the N-way K-shot setting, and select a sample S from the support set S. i And select a sample Q from the query set Q j Then the sample S i and sample Q j Their feature representations are obtained through the feature extractor F(·) and Then the obtained features and Fuse in the channel dimension to obtain fusion features Semantic information fusion is performed while maintaining the size of the feature map. The fused features are input into the relational network to calculate the relationship score between samples, that is, the probability of them belonging to the same category. The mean squared error (MSE) loss function is used to calculate the error between the relationship score output by the model and the true one-hot label. The model parameters are iteratively updated using the Adam optimizer to complete network training and save the optimal network model parameters. Finally, the trained model is used to predict the actual query sample and output its spam category.

[0063] Specifically, if Figure 2 As shown, the intelligent garbage classification method based on meta-learning dynamic relationship measurement can be implemented through the following steps S100-S600.

[0064] S100: Acquire a data set; wherein the data set includes a support set and a query set, the support set includes multiple categories, each category corresponds to multiple sample images, and the query set includes at least two query images to be classified.

[0065] In this embodiment, the acquired data set can be composed of two parts: the support set and the query set. The support set (SupportSet) is denoted as S = {S1, S2, S3, ..., S n}, Query Set: denoted as Q = Q1, Q2, Q3, ..., Q m Following the common setting of few-shot learning, this is constructed as an N-way K-shot classification task. The support set consists of N categories, each of which contains only K images, and the query set consists of M spam images to be classified.

[0066] In some embodiments, the support set S contains N categories, and each category only provides K image samples (i.e., K-shot learning). These images serve as reference samples of known categories for feature comparison and matching with the query image. iRepresents the sample image of the i-th category, each S i It contains only image information and also implicitly contains its corresponding category label; the query set Q contains M images, which are objects that need to be identified and classified by the model. j Represents the jth query image to be classified, which comes from the unknown category sample set.

[0067] S200: Selecting a sample image from the support set and a query image from the query set, and inputting the images into a feature extractor to obtain a first feature map and a second feature map, respectively.

[0068] In this embodiment, the purpose of step S200 is to extract features. Specifically, a sample image S is selected from the support set S. i And any query image Q to be classified in the query set Q j , respectively, obtain their feature representations through the feature extractor F(·) and This calculation process can be expressed as:

[0069]

[0070] Where, represents the first feature map, S i represents the i-th sample image, represents the second feature map, Q j represents the j-th query image and F(·) represents the feature extractor.

[0071] The feature extractor F(·) consists of four convolutional layers (Conv2d) and two maximum pooling layers (MaxPool2d). The specific configuration is shown in Table 1. Through the hierarchical feature extraction method, the underlying texture features of the input image are gradually abstracted into high-level semantic features, and finally output a shape of feature map.

[0072] Table 1 Convolutional feature extractor module

[0073]

[0074] S300: Input the first feature map and the second feature map into a feature fusion layer, perform element-wise addition on the first feature map and the second feature map in the channel dimension, and obtain a fused feature map.

[0075] In this embodiment, the purpose of step S300 is to achieve feature fusion. After feature extraction, select the sample S in the support set. i and the sample Q in the query set j First feature map of each feature and the first feature map The sizes of both are . Under the premise of keeping the spatial size unchanged, the two feature maps are added element-wise in the channel dimension. This calculation process can be expressed as:

[0076]

[0077] Finally, the fused feature map is output The size is

[0078] S400: Inputting the fused feature map into a relationship network to obtain a predicted relationship score between the query image and the sample image.

[0079] In this embodiment, the specific implementation process of step S400 is:

[0080] The fused feature map After two convolution layers again, the convolution features are obtained Then Put it into the relationship network and pass Sigmoid to output the sample S with a value between 0 and 1 i and sample Q j The relation score is the similarity between the two. The above calculation process can be expressed as:

[0081]

[0082] in, represents the convolution feature, Represents the fused feature map; W1 and W2 both represent the weight matrix of the convolution kernel; * represents the convolution operation; w represents the network weight matrix, b represents the bias, BN1 and BN2 both represent the batch normalization operation; σ represents the ReLU activation function, Sigmoid represents the nonlinear activation function; relation score represents the predicted relationship score; g φ Represents a learnable mapping function. Finally, the feature Through a learnable mapping function g φ , and obtain the final relationship score as the similarity score between the query image and the support category images. The specific process can be seen in Table 2 below.

[0083] Table 2 Relationship network modules

[0084]

[0085] For N-way K-shot tasks, it is necessary to calculate a sample image S in the support set S separately. i(i=1, 2, 3.....n) and a query image Q in the query set Q j Relationship score, get These N scores can be viewed as relationship scores for the N categories.

[0086] S500: The feature extractor, feature fusion layer and relationship network are combined into a garbage classification model. Based on the data set and the set loss function, the N predicted relationship scores obtained by the garbage classification model are subjected to loss calculation with the true labels to obtain a loss value. With the goal of minimizing the loss value, the garbage classification model is trained to obtain a trained garbage classification model.

[0087] In this embodiment, step S500 is used to implement MSE loss calculation and model training, and its specific implementation process is:

[0088] The N predicted relationship scores obtained and the true label y in the form of one-hot encoding S1Qj ,y S2Qj ,y S3Qj ,y S4Qj ...y SnQj Perform MSE (Mean Squared Error) loss calculation. The MSE loss function can be expressed as:

[0089]

[0090] Where, Represents the loss value, N represents the number of categories, i represents the sequence number of the sample image, represents the predicted relationship score between the i-th sample image and the j-th query image, y SiQj Represents the true label of the one-hot encoding form of the i-th sample image and the j-th query image. By minimizing this loss, the prediction score can gradually approach the true label distribution.

[0091] During the training process, the present invention uses the Adam optimizer to update the network parameters and dynamically adjusts the learning rate during the training process to obtain a better convergence effect. When the accuracy reaches the historical best, the optimal network parameters are recorded.

[0092] S600: Based on the trained garbage classification model, outputting a garbage category in response to an input garbage image to be classified.

[0093] In this embodiment, after training is completed, the saved optimal network parameters are used to infer new query images. The specific method is: randomly collect or select a junk image to be classified from the test set, and obtain an image tensor of shape [3, H, W] after preprocessing. This image and N sample images from the support set are respectively input into the overall model of the present invention, and N relationship scores are calculated in sequence. By comparing the sizes of N scores and using the One-Hot output layer to perform threshold judgment on the scores, the network's predicted category for the query image can be obtained. The corresponding category has the highest score, and the query image is judged to be of that category.

[0094] The embodiment of the present invention also provides an intelligent garbage classification device based on meta-learning dynamic relationship measurement, such as Figure 3 As shown, the device includes:

[0095] The data acquisition module 301 is configured to acquire a data set; wherein the data set includes a support set and a query set, the support set includes multiple categories, each category corresponds to multiple sample images, and the query set includes at least two query images to be classified;

[0096] A feature extraction module 302 is configured to select a sample image from the support set and a query image from the query set, and input the sample images into a feature extractor to obtain a first feature map and a second feature map respectively;

[0097] A feature fusion module 303 is configured to input the first feature map and the second feature map into a feature fusion layer, and perform element-wise addition of the first feature map and the second feature map in a channel dimension to obtain a fused feature map;

[0098] The feature prediction module 304 is configured to input the fused feature map into a relationship network to obtain a predicted relationship score between the query image and the sample image;

[0099] The model training module 305 is configured to combine the feature extractor, feature fusion layer, and relationship network into a waste classification model, and based on the data set and a set loss function, perform a loss calculation between the N predicted relationship scores obtained by the waste classification model and the true labels to obtain a loss value. With the goal of minimizing the loss value, the waste classification model is trained to obtain a trained waste classification model.

[0100] The garbage classification module 306 is configured to output a garbage category in response to an input garbage image to be classified based on the trained garbage classification model.

[0101] Preferably, the feature prediction module is further configured to input the fused feature map into a relationship network, and obtain the predicted relationship score between the query image and the sample image by the following formula:

[0102]

[0103] Where, represents the convolution feature, Represents the fused feature map; W1 and W2 both represent the weight matrix of the convolution kernel; * represents the convolution operation; w represents the network weight matrix, b represents the bias, BN1 and BN2 both represent the batch normalization operation; σ represents the ReLU activation function, Sigmoid represents the nonlinear activation function; relation score represents the predicted relationship score; g φ represents a learnable mapping function.

[0104] Preferably, the garbage classification module is further configured to:

[0105] Preprocess the input junk image to be classified to obtain an image tensor of a set size;

[0106] Inputting the image tensor of the set size and the N sample images of the support set into the trained garbage classification model respectively, and calculating N predicted relationship scores in sequence;

[0107] The N predicted relationship scores are compared, and the category corresponding to the highest predicted relationship score is used as the junk category of the junk image to be classified.

[0108] It should be noted that the structures of the various intelligent garbage classification devices based on meta-learning dynamic relationship measurement described in this embodiment belong to the same technical concept as the intelligent garbage classification method based on meta-learning dynamic relationship measurement described previously, and achieve the same beneficial effects through the same principles, which will not be repeated here.

[0109] An embodiment of the present invention further provides a readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the method described in any of the above embodiments.

[0110] The above description is intended to be illustrative rather than restrictive. For example, the above examples (or one or more of their solutions) can be used in combination with each other. For example, those of ordinary skill in the art may use other embodiments when reading the above description. In addition, in the above-mentioned specific embodiments, various features can be grouped together to simplify the present invention. This should not be interpreted as an intention that a feature of an invention that is not claimed for protection is necessary for any claim. On the contrary, the subject matter of the present invention may be less than all the features of the embodiments of a particular invention. Thus, the following claims are incorporated into the specific embodiments as examples or embodiments, wherein each claim is independently a separate embodiment, and it is considered that these embodiments can be combined with each other in various combinations or arrangements. The scope of the present invention should be determined with reference to the appended claims and the full scope of equivalents to which these claims are entitled.

Claims

1. An intelligent garbage classification method based on meta-learning dynamic relationship measurement, characterized in that: The method comprises: Acquire a data set; wherein the data set includes a support set and a query set, the support set includes multiple categories, each category corresponds to multiple sample images, and the query set includes at least two query images to be classified; Selecting a sample image from the support set and a query image from the query set, and inputting the samples into a feature extractor to obtain a first feature map and a second feature map respectively; Inputting the first feature map and the second feature map into a feature fusion layer, performing element-wise addition on the first feature map and the second feature map in the channel dimension to obtain a fused feature map; Inputting the fused feature map into a relationship network to obtain a predicted relationship score between the query image and the sample image; The feature extractor, feature fusion layer, and relationship network are combined into a garbage classification model. Based on the data set and the set loss function, the N predicted relationship scores obtained by the garbage classification model are subjected to loss calculation with the true labels to obtain a loss value. With the goal of minimizing the loss value, the garbage classification model is trained to obtain a trained garbage classification model. Based on the trained garbage classification model, a garbage category is output in response to an input garbage image to be classified.

2. The intelligent garbage classification method based on meta-learning dynamic relationship measurement according to claim 1 is characterized in that: The feature extractor obtains the first feature map and the second feature map by the following formula: Where, represents the first feature map, S i represents the i-th sample image, represents the second feature map, Q j represents the j-th query image, and F(·) represents the feature extractor. The feature extractor includes four convolutional layers and two maximum pooling layers. Through a hierarchical feature extraction method, the underlying texture features of the input image are gradually abstracted into high-level semantic features and the feature map of a set size is output.

3. The intelligent garbage classification method based on meta-learning dynamic relationship measurement according to claim 2 is characterized in that: The first feature map and the second feature map are added element-wise in the channel dimension using the following formula to obtain a fused feature map: Where, Represents the fused feature map.

4. The intelligent garbage classification method based on meta-learning dynamic relationship measurement according to claim 1 is characterized in that: The fused feature map is input into the relationship network, and the predicted relationship score between the query image and the sample image is obtained by the following formula: Where, represents the convolution feature, Represents the fused feature map; W1 and W2 both represent the weight matrix of the convolution kernel; * represents the convolution operation; w represents the network weight matrix, b represents the bias, BN1 and BN2 both represent the batch normalization operation; σ represents the ReLU activation function, Sigmoid represents the nonlinear activation function; relation score represents the predicted relationship score; g φ represents a learnable mapping function.

5. The intelligent garbage classification method based on meta-learning dynamic relationship measurement according to claim 1 is characterized in that: The loss function is expressed as: Where, Represents the loss value, N represents the number of categories, i represents the sequence number of the sample image, represents the predicted relationship score between the i-th sample image and the j-th query image, y SiQj Represents the true label in one-hot encoding form of the i-th sample image and the j-th query image.

6. The intelligent garbage classification method based on meta-learning dynamic relationship measurement according to claim 1 is characterized in that: Based on the trained garbage classification model, in response to an input garbage image to be classified, outputting a garbage category includes: Preprocess the input junk image to be classified to obtain an image tensor of a set size; Inputting the image tensor of the set size and the N sample images of the support set into the trained garbage classification model respectively, and calculating N predicted relationship scores in sequence; The N predicted relationship scores are compared, and the category corresponding to the highest predicted relationship score is used as the junk category of the junk image to be classified.

7. An intelligent garbage sorting device based on meta-learning dynamic relationship measurement, characterized in that: The device comprises: A data acquisition module is configured to acquire a data set; wherein the data set includes a support set and a query set, the support set includes multiple categories, each category corresponds to multiple sample images, and the query set includes at least two query images to be classified; a feature extraction module configured to select a sample image from the support set and a query image from the query set, and input the sample images into a feature extractor to obtain a first feature map and a second feature map respectively; a feature fusion module configured to input the first feature map and the second feature map into a feature fusion layer, and perform element-wise addition of the first feature map and the second feature map in a channel dimension to obtain a fused feature map; a feature prediction module configured to input the fused feature map into a relationship network to obtain a predicted relationship score between the query image and the sample image; a model training module configured to combine the feature extractor, the feature fusion layer, and the relationship network into a waste classification model, and based on the data set and a set loss function, perform a loss calculation on the N predicted relationship scores obtained by the waste classification model and the true labels to obtain a loss value, and train the waste classification model with the goal of minimizing the loss value to obtain a trained waste classification model; The garbage classification module is configured to output a garbage category in response to an input garbage image to be classified based on the trained garbage classification model.

8. The intelligent garbage classification device based on meta-learning dynamic relationship measurement according to claim 7 is characterized in that: The feature prediction module is further configured to input the fused feature map into a relationship network and obtain a predicted relationship score between the query image and the sample image using the following formula: Where, represents the convolution feature, Represents the fused feature map; W1 and W2 both represent the weight matrix of the convolution kernel; * represents the convolution operation; w represents the network weight matrix, b represents the bias, BN1 and BN2 both represent the batch normalization operation; σ represents the ReLU activation function, Sigmoid represents the nonlinear activation function; relation score represents the predicted relationship score; g φ represents a learnable mapping function.

9. The intelligent garbage classification device based on meta-learning dynamic relationship measurement according to claim 7, characterized in that: The garbage classification module is further configured to: Preprocess the input junk image to be classified to obtain an image tensor of a set size; Inputting the image tensor of the set size and the N sample images of the support set into the trained garbage classification model respectively, and calculating N predicted relationship scores in sequence; The N predicted relationship scores are compared, and the category corresponding to the highest predicted relationship score is used as the junk category of the junk image to be classified. 10 . A non-transitory computer-readable storage medium storing instructions, which, when executed by a processor, executes the method according to claim 1 .

Citation Information

Patent Citations

  • Artificial intelligence small sample meta-learning training method for medical image classification processing

    CN111476292A

  • Trojan horse communication detection method and system combining meta-learning and spatio-temporal feature fusion

    CN112929380A

  • Small sample commodity image classification method, a device, equipment and storage medium

    CN113780335A

  • Small sample image classification method based on global and local feature augmentation

    CN116188900A

  • Water surface garbage identification method based on small sample learning

    CN117496348A