A method for quickly classifying household garbage based on a convolutional neural network
Patent Information
- Application Number
- CN202611030816.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-12
- Publication Date
- 2026-10-16
AI Technical Summary
目前,垃圾分类主要依赖人工分拣,但在实际操作中存在以下显著弊端:一是效率限制,人工分拣效率受人体生理极限限制,无法实现24小时高强度作业;二是健康隐患,垃圾仓储环境恶劣,存在大量致病菌与有害气体,严重威胁工人健康;三是技术局限,面对具有高度形变、重叠特性的垃圾目标,传统机器视觉算法因依赖颜色、边缘等浅层特征,无法提取有效的深层特征信息,导致在复杂场景下的分类准确率低下
本发明利用AlexNet的深层特征提取能力与数据增强技术,有效克服了垃圾形态不规则及复杂环境干扰的难题,在实测准确率高的同时,确保单次推理耗时低于1秒,实现了兼具高鲁棒性与实时性的工业级处理能力。在此基础上,系统构建的“视觉-决策-执行”自动化闭环不仅支持24小时全天候连续作业,单台设备即可替代3-5名分拣工人,显著降低了人力与管理成本,更通过机器替代人工接触有害废物,从根本上规避了职业健康风险,实现了高效、经济且安全的智能化垃圾分类。
Smart Images

Figure CN122929265A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and deep learning image processing technology, specifically relating to a rapid classification method for household waste based on convolutional neural networks. Background Technology
[0002] With global population growth and rising consumption levels, the amount of urban household waste is increasing exponentially. Currently, waste sorting mainly relies on manual sorting, but this method has several significant drawbacks in practice: First, efficiency is limited, as manual sorting is subject to physiological limitations and cannot operate at high intensity 24 hours a day. Second, there are health risks, as waste storage environments are harsh and contain a large number of pathogens and harmful gases, seriously threatening workers' health. Third, there are technological limitations, as traditional machine vision algorithms rely on shallow features such as color and edges, failing to extract effective deep feature information, resulting in low classification accuracy in complex scenarios.
[0003] In recent years, although deep learning technology has made progress in the field of image recognition, existing sorting methods often face the problem of mismatch between algorithm complexity and real-time processing capabilities. Especially in real-world sorting scenarios with complex lighting and severe occlusion, how to extract deep, robust features from waste images while maintaining extremely low inference latency is a technical bottleneck that urgently needs to be overcome in the field of industrial waste sorting. Summary of the Invention
[0004] To address the problems raised in the background art, a first aspect of the present invention provides a method for rapid classification of household waste based on convolutional neural networks, comprising: acquiring original images of household waste to be classified, and preprocessing the original images to obtain standardized image samples; constructing a convolutional neural network model, the convolutional neural network model being configured to receive the standardized image samples and perform feature extraction; iteratively training the convolutional neural network model using the standardized image samples, and optimizing the model parameters using a backpropagation algorithm until a preset convergence condition is met to obtain a target classification model; and using the target classification model to classify the waste image to be identified, and outputting the waste category to which the waste image to be identified belongs.
[0005] In some embodiments of the present invention, the preprocessing includes: adjusting the original RGB image to a preset standard pixel size; converting the resized RGB image into a single-channel grayscale image; and performing linear normalization processing on the single-channel grayscale image to map the pixel values to a specified range.
[0006] In some embodiments of the present invention, prior to the iterative training, data augmentation processing is performed on the training set images, the data augmentation processing including at least one of random rotation, mirror flipping, and random translation.
[0007] In some embodiments of the present invention, the convolutional neural network model includes: an input layer for receiving single-channel grayscale image data; multiple convolutional layers for extracting deep features of the image through filters; an activation layer for mapping the output of the convolutional layers using a nonlinear activation function; a pooling layer interleaved with the multiple convolutional layers for reducing the spatial dimension of the feature data; and a fully connected layer for making classification decisions based on the feature output of the activation layer.
[0008] Furthermore, the convolutional neural network model also includes a local response normalization layer and a Dropout layer.
[0009] In some embodiments of the present invention, during the iterative training process, the cross-entropy loss function is used to calculate the deviation between the predicted output and the true label.
[0010] A second aspect of the present invention provides a rapid household waste sorting device based on a convolutional neural network, comprising: an acquisition module for acquiring original images of household waste to be sorted and preprocessing the original images to obtain standardized image samples; a construction module for constructing a convolutional neural network model configured to receive the standardized image samples and perform feature extraction; an iteration module for iteratively training the convolutional neural network model using the standardized image samples and optimizing the model parameters using a backpropagation algorithm until a preset convergence condition is met to obtain a target classification model; and an output module for classifying the waste images to be identified using the target classification model and outputting the waste category to which the waste images to be identified belong.
[0011] A third aspect of the present invention provides an electronic device comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the rapid waste sorting method based on convolutional neural networks provided in the first aspect of the present invention.
[0012] In a fourth aspect, the present invention provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the rapid waste sorting method based on a convolutional neural network provided in the first aspect of the present invention.
[0013] The beneficial effects of this invention are: This invention leverages AlexNet's deep feature extraction capabilities and data augmentation techniques to effectively overcome the challenges of irregular waste shapes and complex environmental interference. While achieving high accuracy in real-world testing, it ensures that a single inference iteration takes less than one second, realizing industrial-grade processing capabilities that combine high robustness and real-time performance. Furthermore, the system's automated "vision-decision-execution" closed loop not only supports 24 / 7 continuous operation, with a single device replacing 3-5 sorting workers, significantly reducing labor and management costs, but also fundamentally avoids occupational health risks by replacing manual contact with hazardous waste, achieving efficient, economical, and safe intelligent waste sorting. Attached Figure Description
[0014] Figure 1 This is a schematic diagram of the basic process of a rapid waste sorting method based on a convolutional neural network in some embodiments of the present invention; Figure 2 This is a schematic diagram of convolution operations in some embodiments of the present invention; Figure 3 These are image data comparison diagrams from some embodiments of the present invention; Figure 4 This is a schematic diagram of pooling operations in some embodiments of the present invention; Figure 5 This is a diagram illustrating the connection methods of neural network neurons in some embodiments of the present invention; Figure 6 This is a diagram of the AlexNet network architecture in some embodiments of the present invention; Figure 7 This is a flowchart of a CNN garbage sorting system in some embodiments of the present invention; Figure 8 These are system training dynamic curves in some embodiments of the present invention; Figure 9 This is a diagram of a recyclable waste identification interface in some embodiments of the present invention; Figure 10 This is a schematic diagram of the structure of a rapid household waste sorting device based on a convolutional neural network in some embodiments of the present invention; Figure 11 This is a schematic diagram of the structure of an electronic device in some embodiments of the present invention. Detailed Implementation
[0015] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0016] Example 1 refer to Figure 1 and Figure 7In a first aspect, the present invention provides a method for rapid classification of household waste based on a convolutional neural network, comprising: S100. acquiring an original image of the household waste to be classified, and preprocessing the original image to obtain a standardized image sample; S200. constructing a convolutional neural network model, the convolutional neural network model being configured to receive the standardized image sample and perform feature extraction; S300. iteratively training the convolutional neural network model using the standardized image sample, and optimizing the model parameters using a backpropagation algorithm until a preset convergence condition is met to obtain a target classification model; S400. classifying the waste image to be identified using the target classification model, and outputting the waste category to which the waste image to be identified belongs.
[0017] It should be noted that the hardware environment for this invention uses a computer with an Intel Core i5 processor, 8GB of RAM, and a 512GB solid-state drive (SSD) as the running platform. The software environment configuration includes a Windows operating system to provide a stable environment for software development. The development language used is Matlab R2021a, utilizing its built-in deep learning toolbox for model building, training, and simulation.
[0018] In step S100 of some embodiments of the present invention, the original image of the household waste to be classified is obtained, and the original image is preprocessed to obtain a standardized image sample. Specifically, using web crawling technology and on-site photography, a raw image library of no fewer than 2000 images was established, encompassing four main categories: kitchen waste (e.g., fruit peels, leftovers), recyclables (e.g., aluminum cans, plastic bottles), hazardous waste (e.g., batteries, medicine bottles), and other waste (e.g., cigarette butts, ceramic fragments). A data index was created using the 'imageDatastore' function in MATLAB, with tags derived from folder names. The preprocessing includes: S101. Adjust the original RGB image to the preset standard pixel size; Specifically, the original RGB image (Irgb) is normalized. Images of any size are resized to a standard size of 224x224 pixels using bilinear interpolation.
[0019] S102. Convert the resized RGB image to a single-channel grayscale image; Specifically, the color space conversion is performed using the following formula: I_gray(x,y)=0.299 R(x,y)+0.587 G(x,y)+0.114 B(x,y), Where R, G, and B are the red, green, and blue channel component values of the original image at the (x, y) coordinates, respectively; S103. Perform linear normalization processing on the single-channel grayscale image to map the pixel values to a specified range.
[0020] Specifically, linear normalization: To eliminate the impact of light intensity fluctuations on feature extraction and accelerate the convergence of the model's gradient descent, the grayscale image is linearly normalized, mapping pixel values to the [0,1] interval. The normalization formula is: I_norm=(I_gray-Min(I_gray)) / (Max(I_gray)-Min(I_gray)), In the formula, Igray is the gray value of the current pixel, and Min(Igray) and Max(Igray) are the minimum and maximum values of the pixels in the image, respectively (usually 0 and 255). In step S300 of some embodiments of the present invention, prior to the iterative training, data augmentation processing is performed on the training set images, the data augmentation processing including at least one of random rotation, mirror flipping, and random translation.
[0021] Specifically, to prevent model overfitting, the training set images are subjected to random geometric transformations to simulate the random falling posture of garbage on a conveyor belt. This includes: (1) Random rotation: Rotate the image by randomly selecting an angle θ within the range of [0, 360°]; (2) Mirror flip: The image is flipped horizontally or vertically with a 50% probability; (3) Random translation: Performing translations along the X and Y axes [ Translation within a range of 10,10 pixels.
[0022] The expanded dataset was divided into training and validation sets in a 7:3 ratio.
[0023] refer to Figures 2 to 5 In step S200 or S300 of some embodiments of the present invention, the convolutional neural network model includes: The input layer is used to receive single-channel grayscale image data; Specifically, the input size is uniformly set to 224×224×1, and the single-channel grayscale image processed in step one is received. Multiple convolutional layers are used to extract deep features of the image through filters; Specifically, the core component of a convolutional neural network mainly consists of a series of filters. These filters are essentially two-dimensional numerical arrays. A convolutional layer typically contains numerous convolutional units, each capable of recognizing different image features, and its output is multiple feature maps. Each feature map represents a unique feature; The activation layer uses a non-linear activation function to map the output of the convolutional layer; Specifically, it is generally used to process the output of convolutional network layers. Activation functions are typically used to perform non-linear operations on the output of convolutional layers to enhance the model's generalization ability. Pooling layers, interleaved with multiple convolutional layers, are used to reduce the spatial dimensionality of feature data; Specifically, it is often used alternately with convolutional layers to gradually reduce the spatial dimension of the data, effectively extract the core features in the image and preserve its spatial structure. This can reduce the number of network parameters, reduce the demand for computing resources, and help prevent overfitting. Fully connected layers are used to output classification decisions based on the features of the activation layers.
[0024] Specifically, after successive processing through multiple convolutional layers, activation layers, and pooling layers, the information in the image is transformed into highly informative features. After feature extraction, the convolutional neural network typically employs one or two fully connected layers at the end to output the final classification decision.
[0025] Optional, see reference Figure 6 In one example of a neural network, an improved AlexNet architecture is used. The input layer is first configured to receive a 224×224×1 grayscale image. The feature extraction part consists of a multi-layer convolutional network: the first layer uses 11×11 convolutional kernels (96 filters, stride 4), the second layer uses 5×5 convolutional kernels (256 filters), both equipped with ReLU activation, LRN normalization, and max pooling layers; subsequent layers use multiple 3×3 convolutional kernels (containing 384, 192, and 128 filters respectively) for deep feature extraction. Finally, features are integrated through two fully connected layers with 4096 neurons each, incorporating Dropout technology, and the final classification probability is calculated using the Softmax function by an output layer with 4 nodes.
[0026] refer to Figure 8 In step S300 of some embodiments of the present invention, the convolutional neural network model is iteratively trained using the standardized image samples, and the model parameters are optimized by the backpropagation algorithm until the preset convergence condition is met, thereby obtaining the target classification model. Specifically, S301. Initialize training parameters: Stochastic gradient descent with momentum was used as the optimizer. The maximum number of iterations was set to 50, the initial learning rate to 0.001, and the momentum factor to 0.9. The mini-batch size was set to 50, meaning that 50 images were randomly selected for parameter updates in each iteration. S302. Forward Propagation and Loss Calculation: Input the training set images into the network and calculate the cross-entropy loss between the predicted output and the true label: , Among them, y i For one-hot encoding of the real label, P i Predict probabilities for the network.
[0027] S303. Backpropagation and Weight Update: Based on the calculated loss value, the gradients of the weights W and biases b of each layer are calculated using the backpropagation algorithm, and the parameters are updated according to the following formula: , , Where α is the learning rate and μ is the momentum coefficient. L is the gradient.
[0028] S304, Model Validation and Saving: During training, the model is evaluated using a validation set every 10 iterations. When the validation accuracy no longer improves or reaches a preset threshold, training is stopped and the network model parameter file is saved.
[0029] refer to Figure 9 In step S400 of some embodiments of the present invention, the target classification model is used to classify and determine the garbage image to be identified, and the garbage category to which the garbage image to be identified belongs is output.
[0030] Specifically, the recognition and prediction process is as follows: In the main program 'main.m', the recognition process first loads the model (if 'cnn_net.mat' already exists, it is loaded directly; otherwise, 'trainNetwork' is started for training and saved). Next, the garbage image to be recognized is selected through the 'OpenImageFile' dialog box, and its size is formatted and adjusted using 'imresize' (bilinear interpolation). Subsequently, the image undergoes the same normalization processing as the training set (such as grayscale conversion and pixel value normalization) to ensure consistent input data distribution. Finally, the 'classify(net,xw)' function is called to perform inference and judgment on the preprocessed image, and the recognition result is displayed in the window title bar.
[0031] Specifically, regarding performance evaluation, the training progress screenshots show that the system's validation set accuracy reaches 91.02%. Furthermore, to conduct a comprehensive and in-depth quantitative evaluation of the system's performance, a multi-dimensional analysis was performed using various metrics such as accuracy, loss rate, recall, F1 score, MCC, and ROC curve.
[0032] Example 2 refer to Figure 10 In a second aspect, the present invention provides a rapid household waste sorting device 1 based on a convolutional neural network, comprising: an acquisition module 11, configured to acquire an original image of the household waste to be sorted and preprocess the original image to obtain a standardized image sample; a construction module 12, configured to construct a convolutional neural network model, the convolutional neural network model being configured to receive the standardized image sample and perform feature extraction; an iteration module 13, configured to iteratively train the convolutional neural network model using the standardized image sample and optimize the model parameters using a backpropagation algorithm until a preset convergence condition is met to obtain a target classification model; and an output module 14, configured to classify and determine the waste image to be identified using the target classification model and output the waste category to which the waste image to be identified belongs.
[0033] Furthermore, the acquisition module 11 includes: an adjustment unit for adjusting the original RGB image to a preset standard pixel size; a conversion unit for converting the resized RGB image into a single-channel grayscale image; and a mapping unit for performing linear normalization processing on the single-channel grayscale image to map pixel values to a specified range.
[0034] Example 3 refer to Figure 11 In a third aspect, the present invention provides an electronic device comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for rapid sorting of household waste based on a convolutional neural network according to the first aspect of the present invention.
[0035] Electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from storage device 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. An input / output (I / O) interface 505 is also connected to bus 504.
[0036] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, hard disks; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 11 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 11 Each box shown can represent a device or multiple devices as needed.
[0037] Specifically, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by a processing device 501, it performs the functions defined in the methods of embodiments of this disclosure. It should be noted that the computer-readable medium described in embodiments of this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0038] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more computer programs, which, when executed by the electronic device, cause the electronic device to: Computer program code for performing the operations of embodiments of this disclosure can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages—such as Java, Smalltalk, C++, and Python—and conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0039] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0040] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A rapid classification method for household waste based on convolutional neural networks, characterized in that, include: Acquire the original image of the household waste to be classified, and preprocess the original image to obtain standardized image samples; Convolutional neural network model is constructed, the convolutional neural network model being configured to receive the standardized image samples and perform feature extraction; The convolutional neural network model is iteratively trained using the standardized image samples, and the model parameters are optimized using the backpropagation algorithm until the preset convergence condition is met, thus obtaining the target classification model. The target classification model is used to classify and determine the garbage image to be identified, and the garbage category to which the garbage image to be identified belongs is output.
2. The method for rapid classification of household waste based on convolutional neural networks according to claim 1, characterized in that, The preprocessing includes: Adjust the original RGB image to a preset standard pixel size; Convert the resized RGB image to a single-channel grayscale image; The single-channel grayscale image is linearly normalized to map pixel values to a specified range.
3. The method for rapid classification of household waste based on convolutional neural networks according to claim 1, characterized in that, Prior to the iterative training, data augmentation processing is performed on the training set images, including at least one of random rotation, mirror flip, and random translation.
4. The method for rapid classification of household waste based on convolutional neural networks according to claim 1, characterized in that, The convolutional neural network model includes: The input layer is used to receive single-channel grayscale image data; Multiple convolutional layers are used to extract deep features of the image through filters; The activation layer uses a non-linear activation function to map the output of the convolutional layer; Pooling layers, interleaved with multiple convolutional layers, are used to reduce the spatial dimensionality of feature data; Fully connected layers are used to output classification decisions based on the features of the activation layers.
5. The method for rapid classification of household waste based on convolutional neural networks according to claim 4, characterized in that, The convolutional neural network model also includes a local response normalization layer and a Dropout layer.
6. The method for rapid classification of household waste based on convolutional neural networks according to claim 1, characterized in that, During the iterative training process, the cross-entropy loss function is used to calculate the deviation between the predicted output and the true label.
7. A rapid household waste sorting device based on convolutional neural networks, characterized in that, include: The acquisition module is used to acquire the original image of the household waste to be classified, and to preprocess the original image to obtain a standardized image sample; A building module is used to build a convolutional neural network model, which is configured to receive the standardized image samples and perform feature extraction; The iteration module is used to iteratively train the convolutional neural network model using the standardized image samples and optimize the model parameters through the backpropagation algorithm until the preset convergence condition is met, thereby obtaining the target classification model. The output module is used to classify and determine the garbage image to be identified using the target classification model, and output the garbage category to which the garbage image to be identified belongs.
8. The rapid household waste sorting device based on convolutional neural networks according to claim 7, characterized in that, The acquisition module includes: The adjustment unit is used to adjust the original RGB image to a preset standard pixel size; The conversion unit is used to convert a resized RGB image into a single-channel grayscale image. The mapping unit is used to perform linear normalization processing on the single-channel grayscale image, mapping the pixel values to a specified range.
9. An electronic device, comprising: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the rapid waste sorting method based on a convolutional neural network as described in any one of claims 1 to 6.
10. A computer-readable medium having a computer program stored thereon, wherein, When the computer program is executed by the processor, it implements the rapid classification method for household waste based on convolutional neural networks as described in any one of claims 1 to 6.