Image feature selection method and module based on memristor, neural network model
Patent Information
- Application Number
- CN202111550255.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-12-17
Smart Images

Figure CN114358146B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data processing technology, and more specifically, relates to an image feature selection method and module based on a memristor, and a neural network model. Background Art
[0002] In the era of artificial intelligence, the explosive growth of data has made high-dimensional data more and more common. For algorithms, there are some irrelevant features and noise features in a large amount of data. In neural networks, irrelevant features will increase the complexity of network learning, and the appearance of noise may change the original eigenvalues of the features, thereby affecting different networks to varying degrees. Feature selection, as a preprocessing process of data before neural network training, can effectively select important features, filter out irrelevant and redundant features, and reduce the complexity of network training while ensuring the accuracy of neural network training. Some feature selection algorithms have been reported for data dimensionality reduction, but most of these methods are implemented through software, or feature selection is achieved using memory, processors, etc. The circuits are relatively complex, and the energy and area consumption is large. Summary of the invention
[0003] In view of the above defects or improvement needs of the prior art, the present invention provides an image feature selection method and module based on memristors, and a neural network model, the purpose of which is to use memristors to realize feature selection to effectively reduce circuit energy consumption and area, and achieve high-density integration of feature processing and network learning circuits.
[0004] To achieve the above object, according to one aspect of the present invention, a memristor-based image feature selection method is provided, which comprises:
[0005] Get a data set containing multiple images, each image contains M features, and the feature value of each feature is 0 or 1;
[0006] Count the number of images N whose feature value of the i-th feature in the data set is 1 i , i = 1, 2, ..., M, set the image number threshold N th ;
[0007] Construct a memristor array consisting of 1 row × M columns, each memristor has the same pulse number threshold P th The initial state of the memristor is volatile and when it receives a pulse number greater than or equal to the pulse number threshold P th After the pulse, it becomes non-volatile;
[0008] To the memristor R in the i-th column i Apply P i The pulses are used to modulate the corresponding memristor R iThe conductance state of the memristor array with characteristic selection performance is obtained, where P i =(P th / N th )×N i .
[0009] In one embodiment, after obtaining a memristor array with feature selection performance, the method further includes:
[0010] The data set is input into the memristor array for feature selection and then enters the network learning circuit for learning.
[0011] In one embodiment, each image in the data set is binarized to represent each feature as a feature value of 0 or 1.
[0012] In one embodiment, all memristors in the memristor array are initially volatile and have the lowest conductance value.
[0013] In one embodiment, when receiving a pulse number less than the pulse number threshold P th When a pulse of is applied, the corresponding memristor behaves volatile and the conductance state decays spontaneously to a low conductance value.
[0014] In one embodiment, the memristor is a Pt / HfO2 / Ti memristor.
[0015] In one embodiment, the image quantity threshold N is set th include:
[0016] Select different initial thresholds for feature selection to obtain corresponding feature subsets, evaluate the feature subsets through the recognition rate of the learning algorithm on the feature subsets, and use the initial threshold corresponding to the highest recognition rate as the image quantity threshold N th .
[0017] According to another aspect of the present invention, there is provided a memristor-based image feature selection module, comprising:
[0018] A feature selection circuit, wherein the feature selection circuit comprises a 1-row×M-column memristor array, each memristor having the same pulse quantity threshold P th The initial state of the memristor is volatile and when it receives a pulse number greater than or equal to the pulse number threshold P th After the pulse, it becomes non-volatile;
[0019] A data set processing unit, used to convert each feature of each image in the data set into a feature value of 0 or 1 and to count the number of images N in the data set whose feature value of the i-th feature is 1 i , i = 1, 2, ..., M, where each image contains M features;
[0020] Pulse calculation unit, used to calculate the pulse according to the formula P i =(P th / N th )×N i Calculate the memristor R towards the i-th column i Number of input pulses P i , where N th is the set image quantity threshold;
[0021] The pulse input unit is used to input a pulse to each column of memristors to modulate the conductance state of the corresponding memristors, thereby obtaining a memristor array with feature selection performance, wherein the pulse input to the memristor R in the i-th column i The number of pulses applied is P i indivual.
[0022] In one embodiment, the memristor is a Pt / HfO2 / Ti memristor.
[0023] According to another aspect of the present invention, there is provided a neural network model, comprising:
[0024] The image feature selection module described above;
[0025] The network learning circuit is connected to the output end of each memristor in the image feature selection module, and is used to obtain the features selected by the memristor array with feature selection performance.
[0026] In general, the present application converts image features into binary feature values, and counts the number of images with a corresponding feature value of 1 in each feature. For example, the number of images with a feature value of 1 in the i-th feature is counted as N. i , in N i In the images with eigenvalues of 1, the eigenvalues of some images may be 1 because of the existence of common features, and the eigenvalues of some images may be 1 because of noise or irrelevant features. In this application, a threshold value N of the number of images is set. th , when N i <N th , the i-th feature is considered as noise or irrelevant feature, when N i ≥N th, the i-th feature is considered to be a common feature. Based on the above settings, the pulse is used to control the volatility of the memristor to non-volatility, the number of pulses of each memristor is calculated, and a specific pulse is input to control the conductance value of the corresponding memristor. When the number of pulses applied to the memristor does not reach the pulse number threshold, the memristor is volatile, its conductance value will decay to the lowest conductance state, the corresponding memristor is turned off, and the input feature is blocked; when the number of pulses applied to the memristor reaches or exceeds the pulse number threshold, the memristor is transformed into non-volatile, all non-volatile memristors are set to the highest conductance state, the corresponding memristor is turned on, and the input feature is selected, thereby realizing the selection of features.
[0027] This application makes full use of the conversion of memristors from volatility to non-volatility. The principle is simple and easy to implement. It can screen out the common features of the data set and reduce the complexity of network learning. On the basis of using memristors to realize neural networks, the data feature selection preprocessing process can also be implemented on memristor hardware, thereby achieving high-density integration of feature processing and network learning hardware circuits. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 is a flowchart of the steps of the memristor-based image feature selection method in one embodiment of the present application;
[0029] Figure 2 is a schematic diagram of a memristor array including 1 row×M columns in an embodiment of the present application;
[0030] Figure 3 is a schematic diagram of the conductance change of a memristor in an embodiment of the present application when it is converted from volatile to non-volatile;
[0031] Figure 4 It is a schematic diagram of the composition of the image feature selection module based on memristor in one embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0033] like Figure 1 FIG. 1 is a flowchart of a method for selecting image features based on a memristor in an embodiment of the present application, which includes:
[0034] Step S100: Obtain a data set containing multiple images, each image contains M features, and the feature value of each feature is 0 or 1.
[0035] In one embodiment, a data set is obtained, the number of samples in the data set is N, each sample has M features, and each feature corresponds to a column of memristors. Binarization is performed on the training sample image, and the feature value of each feature is 0 or 1.
[0036] Step S200: Counting the number of images N whose feature value of the i-th feature in the image set is 1 i , i = 1, 2, ..., M, set the image number threshold N th .
[0037] Among them, when N i ≥N th When N i <N th When , the i-th feature is considered to be an irrelevant feature or a noise feature. Usually, irrelevant features or noise features will appear in the data set, but the probability of irrelevant features or noise features appearing is generally within a controllable range. According to statistical principles, for N images, the more images with the feature value of the i-th feature being 1, the more likely the feature is to be a common feature. On the contrary, the fewer images with the feature value of the i-th feature being 1, the more likely the feature is to be an irrelevant feature or a noise feature. The present applicant flexibly uses this rule to set an image number threshold N th To determine whether the current feature is a common feature, an irrelevant feature, or a noise feature. th The choice of can be flexibly set according to the actual situation. Different data sets can have different corresponding image number thresholds, and the same data set can also have different corresponding image number thresholds. If the image number threshold is set too small, the selection effect will be weakened, and the more irrelevant features or noise features will be retained in the feature subset selected in the end, but the complexity of network learning will be higher; if the image number threshold is set too large, the selection effect will be enhanced, and the fewer irrelevant features or noise features will be retained in the feature subset selected in the end, but more common features will be filtered out, and the fewer common features will be retained in the subset in the end, and the worse the network learning results will be. Therefore, the image number threshold can be determined by combining multiple indicators such as the complexity of network learning and the network learning effect.
[0038] In one embodiment, multiple different initial thresholds can be selected, and feature selection is performed using the method in this application to obtain a corresponding feature subset, and then the feature subset is evaluated by the recognition rate of the learning algorithm on the feature subset, and the initial threshold corresponding to the highest recognition rate is used as the image quantity threshold N. th The learning algorithm may be the STDP algorithm of a pulse neural network or the back propagation algorithm of an artificial neural network, or other evaluation algorithms.
[0039] Step S300: construct a memristor array comprising 1 row×M columns, each memristor having the same pulse number threshold P th , the initial state of the memristor is volatile and when it receives a pulse number greater than or equal to the threshold value P th After a pulse, it becomes nonvolatile.
[0040] The row and column positions of the memristor array are not limited. Figure 2 The horizontal direction is the column and the vertical direction is the row, or the horizontal direction is the row and the vertical direction is the column.
[0041] In this embodiment, the memristor used is both volatile and non-volatile, and can be converted from volatile to non-volatile by applying a pulse, such as the Pt / HfO2 / Ti memristor device reported by Lei Wu et al. in the paper "Volatile and Nonvolatile Memory Operations Implemented in a Pt / HfO2 / Ti Memristor" in 2021.
[0042] Take a specific example to illustrate, and select the MNIST dataset as a sample for feature selection and subsequent verification and evaluation. The MNIST dataset training set has a total of 60,000 images, each of which has 784 features. After the image is binarized, the feature value of each feature is 0 or 1, so a 1-row × 784-column memristor array (such as Figure 2 In the 60,000 training images, the number of images with the eigenvalue of the first feature being 1 is N1, the number of images with the eigenvalue of the second feature being 1 is N2, and so on. The number of images with the eigenvalue of the 784th feature being 1 is N. 784 . Image number threshold N th , N1, N2, ..., N 784 Greater than or equal to N th The features corresponding to the number of are considered to be common important features, which are less than N th The features corresponding to the number of are considered to be irrelevant noise features, N th The larger it is, the fewer common features are obtained after screening, and the more irrelevant features or noise features are screened out.
[0043] Step S400: To the memristor R in the i-th column i Apply P i The pulses are used to modulate the corresponding memristor R i The conductance state of the memristor array with characteristic selection performance is obtained, where P i =(P th / N th )×N i.
[0044] In this embodiment, the conductivity of all memristors is initialized to be volatile, that is, initialized to a low conductivity state. The pulse threshold of a single memristor can be adjusted by pulse amplitude and pulse width. An increase in the applied pulse amplitude and pulse width will result in a decrease in the pulse threshold. Conversely, a decrease in the applied pulse amplitude and pulse width will result in an increase in the pulse threshold. Before performing the feature selection operation, an optimal pulse operation plan should be formulated, and the pulse amplitude and pulse width should be adjusted to fix the pulse threshold of the device; in actual operation, the pulse thresholds of all memristors in the memristor array should be kept consistent.
[0045] Before feature selection begins, find the pulse threshold P th and the image number threshold N th The ratio of a = P th / N th , and then the number of images N1, N2, ..., N obtained above is counted 784 Convert to pulse number P1, P2, ..., P according to the ratio a 784 , the corresponding number of pulses are continuously applied to the corresponding memristor to modulate the memristor. The number of applied pulses is lower than the pulse threshold P th The memristor is volatile. After the pulse is stopped, the conductivity state of the memristor will spontaneously decay to a low conductivity state. Then the feature selection circuit corresponding to the image is not turned on, that is, the feature is not selected. The number of applied pulses is greater than or equal to the pulse threshold P th The memristor exhibits non-volatility, and the conductance state of the memristor is maintained even after the pulse application stops. Figure 3 shown.
[0046] After step S400, all non-volatile memristors are modulated to the highest conductance state, and the feature selection circuits corresponding to these memristors are turned on, that is, the features corresponding to these memristors are selected. The present application converts all image features of the data set into pulses and applies them to the corresponding feature selection circuit. The modulated memristor feature selection circuit can screen the features, and the selected common features can be used for subsequent neural network learning. The circuits corresponding to irrelevant features and noise features are not turned on and cannot participate in subsequent network learning, thereby reducing the complexity of network learning. Therefore, when a memristor array with feature selection performance is obtained, the data set can be re-input into the memristor array for feature selection and then enter the network learning circuit for learning.
[0047] In one embodiment, when the data set is replaced, that is, when the feature selection is performed on other data sets using the memristor array that has been feature selected, all memristors can be initialized to a low conductance state, and then feature selection is performed again according to the above steps S100 to S400.
[0048] It should be noted that the order of the steps of the memristor-based image feature selection method in the present application is not limited, and the order of step S100 to step S400 in the above text is only an example, but is not limited to this.
[0049] The present application also relates to an image feature selection module based on a memristor, such as Figure 4 As shown, it includes:
[0050] The feature selection circuit includes a 1-row × M-column memristor array, each memristor has the same pulse number threshold P th , the initial state of the memristor is volatile and when it receives a pulse number greater than or equal to the threshold value P th After the pulse, it becomes non-volatile;
[0051] The data set processing unit is used to convert each feature of each image in the data set into a feature value of 0 or 1 and to count the number of images N whose feature value of the i-th feature of the image in the data set is 1. i , i = 1, 2, ..., M, where each image contains M features;
[0052] Pulse calculation unit, used to calculate the pulse according to the formula P i =(P th / N th )×N i Calculate the memristor R towards the i-th column i Number of input pulses P i , where N th is the set image quantity threshold;
[0053] The pulse input unit is used to input a pulse to each column of memristors to modulate the conductance state of the corresponding memristors, thereby obtaining a memristor array with feature selection performance, wherein the pulse input to the memristor R in the i-th column i The number of pulses applied is P i indivual.
[0054] The memristor-based image feature selection module is actually used to execute the memristor-based image feature selection method mentioned above. The various units and circuits in the image feature selection module are used to implement the corresponding steps in the method. For details, please refer to the above introduction and will not be repeated here. It should be noted that the image feature selection module can be an integrated module, or the various components can be distributed in different devices. For example, the feature selection circuit is prepared in a semiconductor structure, while the data set processing unit and the pulse calculation unit are located in a computer, and the pulse input unit can be located in a power generation device.
[0055] Correspondingly, the present application also relates to a neural network model, which can be referred to Figure 2As shown, it includes the image feature selection module and network learning circuit described above, wherein the network learning circuit is connected to the output end of each memristor in the image feature selection module, and is used to obtain the features selected by the memristor array with feature selection performance. In specific operation, the image features can be first converted into pulses, the conductance state of the corresponding memristor is adjusted, and the memristor array with feature selection performance is obtained, and then the image features are re-input, and the image features are selected by the memristor array with feature selection performance to filter out feature subsets and input into the network learning circuit for learning.
[0056] In summary, in this application, a threshold value N of the number of images is set th , when N i <N th , the i-th feature is considered as noise or irrelevant feature, when N i ≥N th , the i-th feature is considered to be a common feature. Based on the above settings, the pulse is used to regulate the volatility of the memristor to non-volatility, the number of pulses of each memristor is calculated, and the specific pulse is input to regulate the conductance value of the corresponding memristor. When the number of pulses applied to the memristor does not reach the pulse number threshold, the memristor is volatile, and its conductance value will decay to the lowest conductance state, the corresponding memristor is turned off, and the input feature is blocked; when the number of pulses applied to the memristor reaches or exceeds the pulse number threshold, the memristor is transformed into non-volatile, all non-volatile memristors are set to the highest conductance state, the corresponding memristor is turned on, and the input feature is selected, thereby realizing the selection of features. This application makes full use of the conversion of the memristor from volatility to non-volatility, the principle is simple, easy to implement, and can screen out the common features of the data set, reducing the complexity of network learning. On the basis of using memristors to realize neural networks, the data feature selection preprocessing process can also be realized on the memristor hardware, so that the hardware circuits of feature processing and network learning can be integrated with high density.
[0057] It will be easily understood by those skilled in the art that 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 and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A memristor-based image feature selection method, characterized in that: include: Get a data set containing multiple images, each image contains M features, and the feature value of each feature is 0 or 1; Count the number of images N whose feature value of the i-th feature in the data set is 1 i , i = 1, 2, ..., M, set the image number threshold N th ; Construct a memristor array consisting of 1 row × M columns, each memristor has the same pulse number threshold P th The initial state of the memristor is volatile and when it receives a pulse number greater than or equal to the pulse number threshold P th After the pulse, it becomes non-volatile; To the memristor R in the i-th column i Apply P i The pulses are used to modulate the corresponding memristor R i The conductance state of the memristor array with characteristic selection performance is obtained, where P i =(P th / N th )×N i .
2. The memristor-based image feature selection method according to claim 1, characterized in that: After obtaining the memristor array with feature selection performance, it also includes: The data set is input into the memristor array for feature selection and then enters the network learning circuit for learning.
3. The image feature selection method based on memristor according to claim 1, characterized in that: Each image in the data set is binarized to represent each feature as a feature value of 0 or 1.
4. The memristor-based image feature selection method according to claim 1, characterized in that: All memristors in the memristor array are initially volatile and have the lowest conductance value.
5. The memristor-based image feature selection method according to claim 4, characterized in that: When receiving a pulse number less than the threshold value P th When a pulse of is applied, the corresponding memristor behaves volatile and the conductance state decays spontaneously to a low conductance value.
6. The memristor-based image feature selection method according to claim 1, characterized in that: The memristor is a Pt / HfO2 / Ti memristor.
7. The memristor-based image feature selection method according to claim 1, characterized in that: Set the image number threshold N th include: Select different initial thresholds for feature selection to obtain corresponding feature subsets, evaluate the feature subsets through the recognition rate of the learning algorithm on the feature subsets, and use the initial threshold corresponding to the highest recognition rate as the image quantity threshold N th .
8. A memristor-based image feature selection module, characterized in that: include: A feature selection circuit, wherein the feature selection circuit comprises a 1-row×M-column memristor array, each memristor having the same pulse quantity threshold P th The initial state of the memristor is volatile and when it receives a pulse number greater than or equal to the pulse number threshold P th After the pulse, it becomes non-volatile; A data set processing unit, used to convert each feature of each image in the data set into a feature value of 0 or 1 and to count the number of images N in the data set whose feature value of the i-th feature is 1 i , i = 1, 2, ..., M, where each image contains M features; Pulse calculation unit, used to calculate the pulse according to the formula P i =(P th / N th )×N i Calculate the memristor R towards the i-th column i Number of input pulses P i , where N th is the set image quantity threshold; The pulse input unit is used to input a pulse to each column of memristors to modulate the conductance state of the corresponding memristors, thereby obtaining a memristor array with feature selection performance, wherein the pulse input to the memristor R in the i-th column i The number of pulses applied is P i indivual.
9. The memristor-based image feature selection module according to claim 8, characterized in that: The memristor is a Pt / HfO2 / Ti memristor.
10. A neural network model, characterized in that: include: The image feature selection module according to claim 8 or 9; The network learning circuit is connected to the output end of each memristor in the image feature selection module, and is used to obtain the features selected by the memristor array with feature selection performance.
