Plastic sorting method based on ZYNQ development board

By combining hardware and software co-processing and FPGA parallel computing on the ZYNQ development board with near-infrared spectroscopy analysis and the LeNet network model, the high energy consumption and low efficiency of plastic sorting methods have been solved, achieving efficient and accurate plastic classification.

CN116188868BActive Publication Date: 2025-11-11HEFEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310217992.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-08
Publication Date
2025-11-11
Estimated Expiration
2043-03-08

AI Technical Summary

Technical Problem

Existing plastic sorting methods suffer from high energy consumption, low efficiency, and secondary pollution. Furthermore, convolutional neural networks struggle to meet the real-time and low-power performance requirements of general-purpose processors.

Method used

Using the ZYNQ development board for hardware and software co-processing, combined with near-infrared spectroscopy analysis and convolutional neural networks, and utilizing FPGA for parallel computing, a LeNet network model was constructed to achieve plastic classification.

Benefits of technology

It improves the accuracy of plastic sorting, shortens system processing time, reduces hardware power consumption, and meets the performance requirements of real-time performance and low power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116188868B_ABST
    Figure CN116188868B_ABST
Patent Text Reader

Abstract

The application discloses a plastic sorting method based on a ZYNQ development board, and steps of the method comprise the following steps: firstly, using a near-infrared spectrometer to collect near-infrared spectral images of different types of plastics as input; then, according to different characteristics of spectral responses of different types of plastics to the near-infrared spectrum, a neural network model for plastic type identification is constructed; and then, by using the parallel computing characteristics of a PL end processor, convolution and down-sampling calculation are performed on image data on the PL end processor, parallelism of a large number of multiplication and addition operations in the convolutional neural network is fully tapped, and different functional hardware modules are generated by configuring internal resources, so that the classification speed is improved, the model power consumption is reduced, and the classification accuracy is ensured. The application can improve the plastic sorting accuracy, greatly shorten the system processing time, and thus improve the shortcomings of the traditional plastic sorting process, such as complexity, slow speed and low efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of pattern recognition, specifically relating to a plastic sorting method based on a ZYNQ development board. Background Technology

[0002] With the continuous development of the global economy, the global plastics industry has also expanded rapidly. Plastic products, with their lightweight, aesthetic appeal, and practicality, are widely used in various sectors such as transportation, home appliances, food, and industry and agriculture, greatly facilitating people's production and daily lives. However, due to their non-biodegradable nature, commonly used plastics, after incineration or pyrolysis, accumulate in landfills or are directly exposed to the natural environment, causing significant impacts on soil and air. Furthermore, the relatively short lifespan of plastic products leads to the accumulation of waste plastics. Therefore, recycling waste plastics is a crucial way to solve this problem, and the sorting of waste plastics is a vital step in recycling and a prerequisite for efficient recycling.

[0003] Plastics come in many varieties, with varying applications and properties. Mixing them together for recycling without proper sorting can easily lead to product quality issues, resource waste, and, in severe cases, safety problems. Common plastic sorting methods include flotation, electrostatic separation, color sorting, wind sorting, manual sorting, and spectroscopic analysis. The first few methods suffer from high energy consumption, low efficiency, and secondary pollution, failing to meet the demand for safe and harmless development. Spectroscopic analysis identifies substances based on the peak positions and intensities of collected spectra, thereby determining their chemical composition and relative content. In recent years, near-infrared spectroscopy has rapidly gained popularity and is widely used in various substance detection and classification fields. However, near-infrared spectroscopy requires processing raw data using chemometrics and mathematical modeling on a computer, a complex and time-consuming process. Furthermore, as the number of samples increases, problems such as overfitting and decreased recognition accuracy can arise during modeling. Convolutional neural networks are increasingly used to extract features from target images. Currently, convolutional neural network implementations are mainly performed on general-purpose processors. However, there are many parallelizable parts in convolutional neural networks, which cannot be implemented on general-purpose processors. This results in a significant time consumption for implementing convolutional neural networks on general-purpose processors, making it difficult to meet the performance requirements of real-time operation and low power consumption. Summary of the Invention

[0004] This invention aims to address the shortcomings of existing technologies by proposing a plastic sorting method based on the ZYNQ development board. The method aims to improve the plastic sorting accuracy while significantly reducing system processing time through ZYNQ hardware and software collaborative processing, thereby overcoming the drawbacks of traditional plastic sorting processes such as complexity, slow speed, and low efficiency.

[0005] To solve the technical problem, the present invention adopts the following technical solution:

[0006] The plastic sorting method based on the ZYNQ development board of this invention is characterized by the following steps:

[0007] Step 1: Collect near-infrared spectral data of plastic using a near-infrared spectrometer and send it to the PC for preprocessing, including smoothing and normalization to remove noise and edge data, so as to obtain preprocessed near-infrared spectral data. Finally, use Python software to convert the preprocessed near-infrared spectral data into two-dimensional grayscale image data.

[0008] Step 2: Construct a convolutional neural network model based on the LeNet network, including: several convolutional layers, several pooling layers, several fully connected layers, and the SoftMax function;

[0009] The input data for the i-th convolutional layer is a point matrix of dimension m×m, and the output data is a point matrix of dimension (m-n+1)×(m-n+1). The convolutional kernel consists of k point matrix data of dimension n×n. The sliding window size for the input data is n×n, with a horizontal sliding step of 1 and a vertical sliding step of 1. The input data for the i-th pooling layer is a point matrix of dimension (m-n+1)×(m-n+1), and the output data is a point matrix of dimension [(m-n+1) / 2]×[(m-n+1) / 2]. The sliding window size is set to 2×2, and the sliding step is 2.

[0010] Step 3: Divide the two-dimensional grayscale image data into a training set and a test set. Use the training set to train the convolutional neural network model until the loss function value no longer decreases or the maximum number of iterations is reached, and then stop training to obtain a trained plastic classification model.

[0011] Step 4: Send the image data from the test set to the PS-end processor on the ZYNQ development board via serial port. Deploy the trained plastic classification model on the PL-end of the ZYNQ development board and use the PL to process the test set sent by the PS-end processor.

[0012] Step 4.1: Configure an n×n register array in the PS-side processor to cache the m×m image bitmap data read from the RAM of the PS-side processor. After convolution processing by an n×n kernel in the i-th convolutional layer, the bitmap data of dimension (m-n+1)×(m-n+1) is obtained. After being added to the corresponding bias data, the i-th convolution result is then activated by the activation function and stored in the dual-port RAM for caching.

[0013] Step 4.4: Retrieve the convolution result after activation of the i-th layer from the dual-port RAM, and after downsampling by the pooling layer of the i-th layer, output the pooling matrix data of the i-th layer with dimension [(m-n+1) / 2]×[(m-n+1) / 2], and temporarily store it in the dual-port RAM for processing by the (i+1)-th convolutional layer.

[0014] Step 4.5: Repeat steps 4.4 and 4.5 until all convolution and pooling processes of the convolutional neural network model are completed. Then, expand the pooling result of the last layer into a one-dimensional vector and pass it to several fully connected layers for processing. The result is then classified by the SoftMax function to obtain the classification result.

[0015] Step 5: The classification results are sent to the HDMI LCD screen via serial port for display.

[0016] The present invention provides an electronic device, including a memory and a processor, wherein the memory is used to store a program that supports the processor in executing the plastic sorting method, and the processor is configured to execute the program stored in the memory.

[0017] The present invention discloses a computer-readable storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, performs the steps of the plastic sorting method.

[0018] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0019] This invention employs near-infrared spectroscopy analysis technology to extract more spectral information of plastic features, effectively improving recognition accuracy. It uses a data dimension transformation method, allowing one-dimensional near-infrared spectral data to be directly applied to a two-dimensional convolutional neural network. Furthermore, this invention designs configurable convolution, pooling, and SoftMax modules, exhibiting strong portability and versatility. Simultaneously, this invention utilizes the PL end of a ZYNQ development board to accelerate the convolutional neural network, while the PS end performs collaborative processing, effectively improving the model recognition speed while reducing hardware power consumption. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of the plastic sorting system developed based on ZYNQ according to the present invention;

[0021] Figure 2 This invention aims to accelerate convolutional neural network models;

[0022] Figure 3 This is a diagram of the convolution operation module of the present invention;

[0023] Figure 4 This invention relates to a pooling operation module diagram. Detailed Implementation

[0024] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0025] In this embodiment, a plastic sorting method based on a ZYNQ development board first uses a near-infrared spectrometer to collect near-infrared spectral images of different types of plastics as input; then, based on the different spectral responses of near-infrared spectra to different types of plastics, a neural network model for plastic type identification is constructed; furthermore, leveraging the parallel computing capabilities of FPGAs, convolution and downsampling calculations are performed on the FPGA, fully exploiting the parallelism of the numerous multiply-accumulate operations in the convolutional neural network, and generating different functional hardware modules by configuring internal resources, thereby achieving the goals of improving computing speed and reducing power consumption while ensuring accuracy. Specifically, as shown... Figure 1 As shown, the plastic sorting method includes:

[0026] Step 1: Collect near-infrared spectral data of plastics using a near-infrared spectrometer and send it to a PC for preprocessing. This includes collecting near-infrared spectral data of six types of plastics, including ABS, PC, PE, PET, PP, and PVC, with the near-infrared band selected as 900-2500nm. This band of near-infrared light can better highlight the differences in characteristic peaks between different plastics. The data is smoothed and normalized to remove noise and edge data, resulting in preprocessed near-infrared spectral data. Finally, the preprocessed near-infrared spectral data is converted into 28×28 two-dimensional grayscale image data using Python software. CNN processing of near-infrared spectra typically requires specifying the width and height channels of the input layer. If the input data is a spectral image, the number of channels is usually set to 3 to indicate channel color. Converting the near-infrared spectral data to two-dimensional grayscale data reduces the number of input layer channels, reducing computation while preserving data features as much as possible, and also adapting to two-dimensional CNN calculations.

[0027] Step 2: Construct a convolutional neural network model based on the LeNet network, including: 2 convolutional layers, 2 pooling layers, 3 fully connected layers, and the SoftMax function;

[0028] The input data for the i-th convolutional layer is a point matrix of dimension m×m, and the output data is a point matrix of dimension (m-n+1)×(m-n+1). The convolutional kernel consists of k point matrix data of dimension n×n. The sliding window size of the input data is n×n, with a horizontal sliding step of 1 and a vertical sliding step of 1. The input data for the i-th pooling layer is a point matrix of dimension (m-n+1)×(m-n+1), and the output data is a point matrix of dimension [(m-n+1) / 2]×[(m-n+1) / 2]. The sliding window size of the pooling layer is set to 2×2, and the sliding step is 2.

[0029] In this embodiment, as Figure 2 As shown, the input data for the first convolutional layer is a 28×28 dot matrix. In the constructed convolutional neural network model, the convolutional kernel has two dimensions: 5×5×6 and 5×5×6×16; the sliding window size of the input data is 5×5.

[0030] Step 3: Divide the two-dimensional grayscale image data into training set and test set. Use the training set to train the convolutional neural network model until the loss function value no longer decreases or the maximum number of iterations is reached, and then stop training to obtain the trained plastic classification model. Store the training set and test set image data in RAM. In order to save the internal BRAM resources of FPGA and reduce the power consumption of accessing external storage, the model parameters obtained by training are written into a coe file and stored in read-only memory ROM.

[0031] Step 4: Send the image data from the test set to the PS-end processor on the ZYNQ development board via serial port. Deploy the trained plastic classification model on the PL-end of the ZYNQ development board and use the PL to process the test set sent by the PS-end processor.

[0032] Step 4.1: The PS-side processor is configured with a 5×5 register array to cache the 28×28 pixel data of the test set read from the PS-side processor's RAM. After convolution processing by a 5×5 kernel in the first convolutional layer, the resulting pixel data is 24×24×6. This data is then added to the corresponding bias data, and the first convolution result is activated by the ReLU activation function before being cached in the dual-port RAM. Figure 3 As shown, convolution calculation requires reading the weight data and feature map data separately, multiplying them accordingly, summing them up, adding the bias, and then outputting the result. Weight values ​​for the same channel need to be reused, and after all channels have been calculated, the results are accumulated using an addition tree to obtain the final result.

[0033] Step 4.4: Retrieve the convolutional result after activation of the first layer from the dual-port RAM, and after downsampling by the pooling layer of the first layer, output the pooled point data of the first layer with a dimension of 12×12×6, and temporarily store it in the dual-port RAM for processing by the next convolutional layer; the pooling layer uses max pooling for downsampling, such as... Figure 4 As shown, each pooling module requires a comparator, a counter, and two FIFO modules. During each calculation, the counter is incremented by 1. At this time, the first data in the FIFO is stored in the register and delayed for one clock cycle. Then it is compared with the second data to obtain the maximum value. This process continues until the counter is full, and then the maximum value is output.

[0034] Step 4.5: Repeat steps 4.4 and 4.5 until all convolution and pooling processes of the convolutional neural network model are completed. Then, expand the pooling result of the last layer into a 256×1 one-dimensional vector and pass it to the three fully connected layers for processing to obtain six output layers. Then, use SoftMax logistic regression to map the output results to the range (0,1) in probability form for classification to obtain the final output result.

[0035] Step 5: The classification results are sent to the HDMI LCD screen via serial port for display.

[0036] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the plastic sorting method described above. The processor is configured to execute the program stored in the memory.

[0037] In this embodiment, a computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the plastic sorting method described above.

[0038] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A plastic sorting method based on a ZYNQ development board, characterized in that, Includes the following steps: Step 1: Collect near-infrared spectral data of plastic using a near-infrared spectrometer and send it to the PC for preprocessing, including smoothing and normalization to remove noise and edge data, so as to obtain preprocessed near-infrared spectral data. Finally, use Python software to convert the preprocessed near-infrared spectral data into two-dimensional grayscale image data. Step 2: Construct a convolutional neural network model based on the LeNet network, including: several convolutional layers, several pooling layers, several fully connected layers, and the SoftMax function; The input data for the i-th convolutional layer is a point matrix of dimension m×m, and the output data is a point matrix of dimension (m-n+1)×(m-n+1). The convolutional kernel consists of k point matrix data of dimension n×n. The sliding window size for the input data is n×n, with a horizontal sliding step of 1 and a vertical sliding step of 1. The input data for the i-th pooling layer is a point matrix of dimension (m-n+1)×(m-n+1), and the output data is a point matrix of dimension [(m-n+1) / 2]×[(m-n+1) / 2]. The sliding window size is set to 2×2, and the sliding step is 2. Step 3: Divide the two-dimensional grayscale image data into a training set and a test set. Use the training set to train the convolutional neural network model until the loss function value no longer decreases or the maximum number of iterations is reached, and then stop training to obtain a trained plastic classification model. Step 4: Send the image data from the test set to the PS-end processor on the ZYNQ development board via serial port. Deploy the trained plastic classification model on the PL-end of the ZYNQ development board and use the PL to process the test set sent by the PS-end processor. Step 4.1: Configure an n×n register array in the PS-side processor to cache the m×m image bitmap data read from the RAM of the PS-side processor. After convolution processing by an n×n kernel in the i-th convolutional layer, the bitmap data of dimension (m-n+1)×(m-n+1) is obtained. After being added to the corresponding bias data, the i-th convolution result is then activated by the activation function and stored in the dual-port RAM for caching. Step 4.4: Retrieve the convolution result after activation of the i-th layer from the dual-port RAM, and after downsampling by the pooling layer of the i-th layer, output the pooling matrix data of the i-th layer with dimension [(m-n+1) / 2]×[(m-n+1) / 2], and temporarily store it in the dual-port RAM for processing by the (i+1)-th convolutional layer. Step 4.5: Repeat steps 4.4 and 4.5 until all convolution and pooling processes of the convolutional neural network model are completed. Then, expand the pooling result of the last layer into a one-dimensional vector and pass it to several fully connected layers for processing. The result is then classified by the SoftMax function to obtain the classification result. Step 5: The classification results are sent to the HDMI LCD screen via serial port for display.

2. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store a program that supports a processor in executing the plastic sorting method of claim 1, the processor being configured to execute the program stored in the memory.

3. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to perform the steps of the plastic sorting method of claim 1.

Citation Information

Patent Citations

  • FPGA-based deep convolution neural network realizing method

    CN106228240A

  • Plastic sorting method, device and equipment and medium

    CN113118065A