Intensity value vector table generating method and image coding method for super-dimensional calculation

文档序号:105806 发布日期:2021-10-15 浏览:21次 中文

阅读说明:本技术 用于超维计算的强度值向量表生成方法和图像编码方法 (Intensity value vector table generating method and image coding method for super-dimensional calculation ) 是由 陈劲 李静涵 梁家辉 宁宁 于 2021-09-13 设计创作,主要内容包括:本发明涉及一种用于超维计算的强度值向量表生成方法和图像编码方法。其中用于超维计算的强度值向量表生成方法包括:为强度值中的最大值和最小值分别生成两个随机超向量,作为最大值超向量和最小值超向量;根据最大值超向量和最小值超向量生成中间超向量;对全部中间超向量、最大值超向量和最小值超向量进行翻转处理后得到代表每个强度值的强度值超向量;所有强度值超向量构成强度值向量表。其中图像编码方法中强度值向量表通过上述用于超维计算的强度值向量表生成方法生成。本发明的有益效果是每个强度值都有对应的超向量能够对其进行表示,同时克服了生成的强度值超向量太多导致相邻的超向量间距离过近的问题。(The invention relates to an intensity value vector table generating method and an image coding method for super-dimensional calculation. The method for generating the intensity value vector table for the super-dimensional calculation comprises the following steps: respectively generating two random supervectors for the maximum value and the minimum value in the intensity value as a maximum value supervector and a minimum value supervector; generating a middle supervector according to the maximum value supervector and the minimum value supervector; turning all the intermediate supervectors, the maximum supervectors and the minimum supervectors to obtain an intensity value supervectors representing each intensity value; all the intensity value supervectors constitute an intensity value vector table. The intensity value vector table in the image coding method is generated by the above-mentioned intensity value vector table generation method for super-dimensional calculation. The method has the advantages that each intensity value has a corresponding supervector which can be represented, and the problem that the distance between adjacent supervectors is too short due to too many generated intensity value supervectors is solved.)

1. A method for generating an intensity value vector table for super-dimensional calculation is characterized by comprising the following steps:

step 010: respectively generating two random supervectors for the maximum value and the minimum value in the intensity value as a maximum value supervector and a minimum value supervector;

step 020: generating a middle supervector according to the maximum value supervector and the minimum value supervector;

step 030: turning all the intermediate supervectors, the maximum supervectors and the minimum supervectors to obtain an intensity value supervectors representing each intensity value;

step 040: all the intensity value supervectors form an intensity value vector table;

all the supervectors are binary supervectors, the number of dimensions is D, and each dimension of the supervectors is 0 or 1.

2. The method of claim 1, wherein the step 020 comprises:

step 021: generating an intermediate supervector representing the ith intensity value, wherein i is any number from 1 to 254, the intermediate supervector consisting of D empty positions;

step 022: randomly selecting i multiplied by D/255 vacant positions from the intermediate supervectors of the ith intensity value;

step 023: inquiring the numerical value of the position corresponding to the vacant position selected in the step 022 from the minimum value supervectors, and filling the numerical value into the vacant position corresponding to the middle supervectors;

and 024: inquiring a numerical value of a position corresponding to the non-selected vacant position in the step 022 from the maximum value supervector, and filling the numerical value into a corresponding vacant position in the middle supervector;

step 025: the intermediate supervectors of the ith intensity values filling all the vacant positions are obtained through the steps 021-.

3. The method of claim 1, wherein the flipping process in the step 030 comprises:

step 031: determining a hyperparameter P from 0-1;

step 032: randomly selecting partial dimension positions of the super vector, wherein the proportion of the number of the selected dimension positions to the number of all dimension positions is P;

step 033: and carrying out XOR operation on the numerical value of the selected dimension position and 1 to obtain the inverted supervectors after the operation.

4. An image encoding method for super-dimensional computation, characterized by comprising the steps of:

step 110: generating an intensity value vector table generated by the method for generating an intensity value vector table for multidimensional calculation as claimed in claims 1 to 3 and a location vector table generated by randomly generating a location supervector representing each pixel location of the image, wherein the dimension number of the location supervector is also D, and then performing step 120;

step 120: judging whether the position exists from the first pixel of the picture, if so, inquiring a corresponding position super vector and a corresponding intensity value super vector, multiplying the corresponding position super vector and the intensity value super vector to obtain a pixel vector, and accumulating the pixel vector to the last pixel vector;

step 130: repeating the step 120 to judge the next pixel until the position does not exist, and obtaining a non-binary image super vector;

step 140: and binarizing the non-binary image super vector to obtain a binary image super vector, and finishing image coding.

Technical Field

The present invention relates to an image encoding method, and more particularly, to an intensity value vector table generating method and an image encoding method for super-dimensional computation.

Background

The images are rich in information, and scientific research and statistics show that about 75% of the information obtained by humans from the outside comes from the visual system, i.e. from the images, and an image can be represented by a 2D array f (x, y), where x, y represents the position of a coordinate point in 2D space XY and f represents the intensity information of the image at the point (x, y). Each of these elementary cells containing position and intensity information is called a pixel. Taking a gray-scale image as an example, the information in a gray-scale image mainly has the position of each pixel and the gray-scale value of the position where the pixel is located.

The super-dimensional calculation is a calculation mode inspired by a large number of synapses and neurons in the brain, the traditional calculation is bit-wise as the minimum unit of calculation, and the basic data type of the super-dimensional calculation is a super-vector (a vector with dimensions in thousands). The high-dimensional modeling of the neural circuit can trace back to artificial neural networks, parallel distributed processing and connection mechanisms decades ago, and the characteristics of a high-dimensional space support the models. The same is true for the super-dimensional space, which is a 10000-dimensional binary vector space including 2, for example, binary vector space10000The space forms a high-dimensional hypercube, all points in the hypercube are independently and identically distributed, the ultra-wide data brings redundancy to resist noise, and therefore the super-dimensional calculation has strong robustness and has good representation effect on data. At present, the super-dimensional calculation is applied to the fields of character recognition, voice recognition and the like, and achieves preliminary results in some image classification fields. To encode an image by using super-dimensional calculation, all information needs to be mapped into a super-vector, and then encoded by three operations, i.e., addition, multiplication, and permutation, to obtain a super-vector representing the image.

Due to the unique characteristics of picture information, this mapping cannot be achieved simply by generating a super vector for each attribute. For the position information, the position information is independent, so that the position can be coded by randomly generating a supervector for each position directly, for the intensity values, the intensity values have a magnitude relation and a continuity relation, and for maintaining the continuity relation of the intensity values, the supervectors representing the corresponding intensity values should have a relatively continuous relation. As shown in fig. 1, the currently used method is to divide 256 intensity values equally into L ranges, each range is regarded as a layer, each layer generates a layer vector representing the layer, and the continuous relationship between the intensity values is maintained by the continuous relationship between the layer vectors. The layer vector is generated by first generating a random vector for a layer representing the smallest range of values as the layer vector for the layer, randomly inverting the D ⁄ L bit on the basis of the layer as the layer vector for the next layer, and sequentially generating L layer vectors. And finding a corresponding layer vector according to the range of the intensity value of each pixel, binding the layer vector and the position vector of each pixel together to obtain a super vector representing the pixel, and adding the super vectors of all the representative pixels in the image to complete the encoding of the super vector of the image.

The prior image coding method can only limit the representation of the intensity values within a certain range, cannot accurately give a single super vector representation to each intensity value, and can only perform fuzzy range distinction, so that the intensity representation of each pixel value is not accurate, and if binary vector representation is used, the greater influence is caused. If the conventional method is directly used for generating the supervectors representing all the intensity values in a turnover mode, the intensity vectors representing adjacent intensity values are excessively similar, so that the accurate intensity values are difficult to distinguish in subsequent calculation, the result is greatly influenced, and the continuity of the characteristic values can be guaranteed only in a certain range. Another disadvantage of the original method is that the original intensity value vector cannot be accurately restored during the inverse operation, and only a representative range of supervectors can be obtained.

In summary, the prior art can only divide values according to ranges when encoding images into data suitable for super-dimensional computation algorithms. For example, the division of L into 256 layers (corresponding to 256 intensity values) as described above may result in too close distance between the supervectors representing adjacent intensity values, which may cause a significant interference in the use and calculation of subsequent supervectors.

Disclosure of Invention

The technical problem to be solved by the invention is to overcome the defects in the prior art and provide an intensity value vector table generating method and an image coding method for super-dimensional calculation. The method is used for solving the problem that when the position and the intensity value of the image are mapped to the super-dimensional space and expressed in a super-vector mode in the prior art, the continuous relation among the intensity value super-vectors needs to be maintained. When the position and the intensity value of the image are represented by the super vector, the information of the intensity value of each pixel is reserved, an independent super vector is generated for each intensity value, and the distance between adjacent intensity values can be adjusted, so that adverse effects on subsequent calculation caused by too large similarity of the intensity values are avoided.

The invention is realized by the following technical scheme:

a method for generating an intensity value vector table for super-dimensional calculation comprises the following steps:

step 010: respectively generating two random supervectors for the maximum value and the minimum value in the intensity value as a maximum value supervector and a minimum value supervector;

step 020: generating a middle supervector according to the maximum value supervector and the minimum value supervector;

step 030: turning all the intermediate supervectors, the maximum supervectors and the minimum supervectors to obtain an intensity value supervectors representing each intensity value;

step 040: all the intensity value supervectors form an intensity value vector table;

all the supervectors are binary supervectors, the number of dimensions is D, and each dimension of the supervectors is 0 or 1.

According to the above technical solution, preferably, step 020 includes:

step 021: generating an intermediate supervector representing the ith intensity value, wherein i is any number from 1 to 254, the intermediate supervector consisting of D empty positions;

step 022: randomly selecting i multiplied by D/255 vacant positions from the intermediate supervectors of the ith intensity value;

step 023: inquiring the numerical value of the position corresponding to the vacant position selected in the step 022 from the minimum value supervectors, and filling the numerical value into the vacant position corresponding to the middle supervectors;

and 024: inquiring a numerical value of a position corresponding to the non-selected vacant position in the step 022 from the maximum value supervector, and filling the numerical value into a corresponding vacant position in the middle supervector;

step 025: the intermediate supervectors of the ith intensity values filling all the vacant positions are obtained through the steps 021-.

According to the above technical solution, preferably, the flipping process in step 030 includes:

step 031: determining a hyperparameter P from 0-1;

step 032: randomly selecting partial dimension positions of the super vector, wherein the proportion of the number of the selected dimension positions to the number of all dimension positions is P;

step 033: and carrying out XOR operation on the numerical value of the selected dimension position and 1 to obtain the inverted supervectors after the operation.

An image encoding method for super-dimensional computation, comprising the steps of:

step 110: generating an intensity value vector table and a position vector table, wherein the intensity value vector table is generated by the above-mentioned intensity value vector table generation method for super-dimensional calculation, the position vector table is generated by randomly generating a position super-vector representing each pixel position of the image, wherein the dimension number of the position super-vector is also D, and then executing step 120;

step 120: judging whether the position exists from the first pixel of the picture, if so, inquiring a corresponding position super vector and a corresponding intensity value super vector, multiplying the corresponding position super vector and the intensity value super vector to obtain a pixel vector, and accumulating the pixel vector to the last pixel vector;

step 130: repeating the step 120 to judge the next pixel until the position does not exist, and obtaining a non-binary image super vector;

step 140: and binarizing the non-binary image super vector to obtain a binary image super vector, and finishing image coding.

The invention has the beneficial effects that: the method is provided for encoding the image into data suitable for the super-dimensional calculation algorithm, so that the super-dimensional representation of the intensity values is more accurate, each intensity value has a corresponding super-vector to represent the intensity value, and the problem that the distance between adjacent super-vectors is too short due to too many intensity value super-vectors generated by the original method is solved.

Drawings

Fig. 1 shows a schematic diagram of a conventional super-dimensional computational encoding method in the prior art.

Fig. 2 shows a schematic image encoding flow of the second embodiment.

Fig. 3 is a schematic diagram showing an image encoding method according to the second embodiment.

Fig. 4 shows a line graph of the effect of prior art layer number change on the distance between adjacent vectors.

Fig. 5 shows a comparative line graph of the influence of a change in the flip rate P on the adjacent vector spacing and the adjacent vector spacing when L is taken to be 256 in the prior art.

Detailed Description

In order to make the technical solutions of the present invention better understood by those skilled in the art, the present invention will be further described in detail with reference to the accompanying drawings and preferred embodiments.

Example 1

A method for generating an intensity value vector table for super-dimensional calculation comprises the following steps:

step 010: respectively generating two random supervectors for the maximum value and the minimum value in the intensity value as a maximum value supervector and a minimum value supervector, wherein the maximum value supervectors and the minimum value supervectors are mutually orthogonal due to the characteristic of the super-dimensional space;

step 020: generating an intermediate supervector according to the maximum supervector and the minimum supervector, including the step 021-025;

step 021: generating an intermediate supervector representing the ith intensity value, wherein i is any number from 1 to 254, the intermediate supervector consisting of D empty positions;

step 022: randomly selecting i multiplied by D/255 vacant positions from the intermediate supervectors of the ith intensity value;

step 023: inquiring the numerical value of the position corresponding to the vacant position selected in the step 022 from the minimum value supervectors, and filling the numerical value into the vacant position corresponding to the middle supervectors;

and 024: inquiring a numerical value of a position corresponding to the non-selected vacant position in the step 022 from the maximum value supervector, and filling the numerical value into a corresponding vacant position in the middle supervector;

step 025: obtaining the intermediate supervectors of the ith intensity values for filling all the vacant positions through the steps 021-;

step 030: turning all the intermediate supervectors, the maximum supervectors and the minimum supervectors to obtain an intensity value supervectors representing each intensity value, wherein the turning comprises the following steps:

step 031: determining a hyperparameter P from 0-1;

step 032: randomly selecting partial dimension positions of the super vector, wherein the proportion of the number of the selected dimension positions to the number of all dimension positions is P;

step 033: 032, performing xor operation on the value of the selected dimension position and 1 to obtain a super vector subjected to turnover processing;

step 040: all the intensity value supervectors form an intensity value vector table;

all the supervectors are binary supervectors, the number of dimensions is D, and each dimension of the supervectors is 0 or 1.

Although steps 010 and 020 ensure that each intensity value has a separate supervector representation and continuity, the distance between adjacent values is still too close. Therefore, in step 030, a superparameter P is introduced, and all the intensity value superparameters are inverted in proportion to P to obtain all the final intensity value superparameters. By changing P, the distance between adjacent intensity value supervectors can be adjusted, so that the problem that the distance between the intensity value supervectors is too close to be distinguished is solved.

Example 2

As shown in fig. 2, an image encoding method for super-dimensional computation includes the steps of:

step 110: generating an intensity value vector table and a position vector table, wherein the intensity value vector table is generated by an intensity value vector table generation method for multidimensional calculation in embodiment 1, the position vector table is generated by randomly generating a position supervector representing each pixel position of the image, wherein the dimension number of the position supervector is also D, and then executing step 120;

step 120: judging whether the position exists from the first pixel of the picture, if so, inquiring a corresponding position super vector and a corresponding intensity value super vector, multiplying the corresponding position super vector and the intensity value super vector to obtain a pixel vector, and accumulating the pixel vector to the last pixel vector;

step 130: repeating the step 120 to judge the next pixel until the position does not exist, and obtaining a non-binary image super vector;

step 140: and binarizing the non-binary image super vector to obtain a binary image super vector, and finishing image coding.

The working principle of the embodiment is as follows:

when encoding an image into data suitable for a super-dimensional computation algorithm, all attributes and objects of the image need to be represented by super-vectors. Wherein the different attributes and objects are measured in terms of distance of the supervectors.

The present embodiment is described below with reference to fig. 3, in which the gray-scale value is taken as an example of the intensity value in fig. 3. The left part of the figure shows a method for generating a position vector table, which divides the picture image into 28 × 28 pixels (when actually processing the picture, a number far greater than 28 should be selected), and randomly generates a position super vector representing the position for each pixel position, thereby obtaining the position vector table. The right part of the graph shows a generation method of a pixel gray value vector table, namely, a middle supervectors gray value vector [ i ] is generated according to a maximum value supervectors gray value vector [0] and a minimum value supervectors gray value vector [255], and then each gray value supervectors are turned over according to a proportion P to obtain the pixel gray value vector table. The middle part of the graph shows that corresponding position supervectors and gray value supervectors are selected from a position vector table and a pixel intensity value vector table, wherein the example position is (1, 27), the example intensity value is a, and the corresponding position supervectors and the corresponding intensity value supervectors are multiplied to obtain the pixel vectors. The multiplication defined in the super-dimension calculation is bit-wise multiplication, namely, the multiplication is realized by carrying out XOR operation on numerical values at corresponding positions of two super-vectors. And sequentially accumulating each pixel vector to obtain the super vector of the non-binary image. And finally, binarizing the non-binary image super vector to obtain a binary image super vector and finish image coding.

The invention has the beneficial effects that:

the prior art method can only generate a super vector for similar intensity values, and once a super vector is generated for each intensity value, the distance between adjacent vectors is too close, which causes the problem of difficult differentiation in calculation. For example, the prior art employs a method of dividing the intensity values into L layers. As shown in fig. 4, when the number of L is refined to 256 (a general method for dividing intensity values), the distance between the supervectors representing adjacent intensity values is too close, which causes great interference to the use and calculation of the subsequent supervectors.

And the coding method proposed by us can adjust the distance between adjacent supervectors at will by P. Different from the existing method, the encoding method does not simply quantize the intensity values into L ranges, but generates an intensity vector representing the intensity value for each intensity value through operation, so that the super-dimensional representation of the characteristic values is more accurate, each characteristic value has a corresponding super-vector to represent the characteristic value, and the problem that too many super-vectors of the characteristic values generated by the existing technical method cause too close distance between the adjacent super-vectors is solved. When some needs inverse operation, the coding method can more accurately restore the intensity value of each pixel of the image, rather than the traditional method which can only restore to a range of values.

As shown in FIG. 5, the lower polyline is the prior art distance between adjacent intensity value vectors after L is adjusted to 256, which is not affected by P. The lower broken line shows that the distance between adjacent intensity value supervectors is too close to be distinguished in the prior art. The upper broken line is the influence of the change of the turnover rate P on the adjacent intensity values in the technical scheme of the present application, so that the technical scheme of the present invention can still ensure the distance between the supervectors of the adjacent intensity values even if 256 intensity values are adjusted. And the distance between adjacent intensity value supervectors can be adjusted along with the change of P.

The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于多通道模型融合的深度学习物体分类方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!