Compression device, compression method, compression program, and system
By segmenting the image and progressively calculating the singular value decomposition of some feature matrices, accumulating global singular values and right singular matrices, the problem of large-capacity memory requirements in existing technologies is solved, and efficient compression of feature matrices is achieved.
Patent Information
- Application Number
- CN202480085464.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-30
- Publication Date
- 2026-08-25
AI Technical Summary
In existing technologies, compressing the feature matrix requires storing the entire feature matrix in the processor's memory, which leads to the need for a large amount of memory.
By segmenting an image into multiple partial images, the singular value decomposition of the partial feature matrix of each partial image is calculated, and the global singular value and right singular matrix are gradually accumulated. Only the partial feature matrix is stored to achieve compression.
It enables feature matrix compression by storing only a portion of the data in memory, thus reducing the memory capacity requirement.
Smart Images

Figure CN122642011A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to compression apparatus, compression method, compression program, and system. Background Technology
[0002] There is a compression device that compresses the feature matrix representing the features of an image.
[0003] As such a compression device, Patent Document 1 discloses a method for compressing a feature matrix by performing Singular Value Decomposition (SVD) on the feature matrix using a processing device.
[0004] Patent Document 1: Japanese Patent Application Publication No. 2014-10495
[0005] In the method disclosed in Patent Document 1, the processing device needs to store the entire feature matrix in the processor's memory in order to perform SVD on the feature matrix. The processor's memory is a working memory such as RAM (Random Access Memory) used for temporary data storage, which is different from storage devices such as hard disks used for long-term data storage. Since the data size of the feature matrix is usually large, the method disclosed in Patent Document 1 presents the problem of needing a processing device equipped with a large-capacity memory. Summary of the Invention
[0006] This disclosure was made to solve the aforementioned problems, and its purpose is to provide a compression device that can compress a feature matrix by storing only a portion of the feature matrix in memory.
[0007] The compression apparatus disclosed herein is configured to include: a matrix acquisition unit that sequentially acquires a partial feature matrix for each of a plurality of partial images into which an image is segmented; and a first global matrix calculation unit that performs singular value decomposition on the first partial feature matrix acquired by the matrix acquisition unit, i.e., the first partial feature matrix, and calculates a first global singular value matrix containing the singular values of the first partial feature matrix as a first global singular value matrix, and a first global right singular matrix containing the right singular vectors corresponding to the singular values of the first partial feature matrix as a first global right singular matrix. In addition, the compression apparatus includes: an object matrix calculation unit that calculates a matrix, i.e., the b-th partial feature matrix, which includes the b-th (b is an integer of 2 or more) partial feature matrix obtained by the matrix acquisition unit, the (b-1)-th global singular value matrix, and the (b-1)-th global right singular matrix, which becomes the b-th singular value decomposition object, i.e., the b-th object matrix; and a second global matrix calculation unit that performs singular value decomposition on the b-th object matrix calculated by the object matrix calculation unit, calculates the singular value matrix of the b-th object matrix containing the singular values of the b-th object matrix as the b-th global singular value matrix, and calculates the right singular matrix of the b-th object matrix containing the right singular vectors corresponding to the singular values of the b-th object matrix as the b-th global right singular matrix.
[0008] According to this disclosure, feature matrix compression can be achieved by storing only a portion of the feature matrix in memory. Attached Figure Description
[0009] Figure 1 This is a configuration diagram showing the system including the compression device 101 according to Embodiment 1.
[0010] Figure 2 This is a hardware configuration diagram showing the hardware of the compression device 101 according to Embodiment 1.
[0011] Figure 3 This is a hardware configuration diagram of a computer when the compression device 101 is implemented by software or firmware.
[0012] Figure 4 This is an explanatory diagram showing the feature matrix after compression using the compression method disclosed in Patent Document 1.
[0013] Figure 5 This is a flowchart illustrating the compression method as a processing step of the compression device 101.
[0014] Figure 6 It is an explanatory diagram representing multiple parts of an image.
[0015] Figure 7 It means by Figure 1 An explanatory diagram of the feature matrix after compression by the compression device 101 shown.
[0016] Figure 8 It means by Figure 1 An explanatory diagram of the feature matrix after compression by the compression device 101 shown.
[0017] Figure 9 This is a configuration diagram showing a system including another compression device 101 according to Embodiment 1.
[0018] Figure 10 This is a configuration diagram showing the system including the compression device 101 according to Embodiment 2.
[0019] Figure 11 This is a hardware configuration diagram showing the hardware of the compression device 101 according to Embodiment 2.
[0020] Figure 12 U represents the b-th first left singular matrix. b The vector ' and the b-th second left singular matrix U b A diagram illustrating the difference between vectors.
[0021] Figure 13 This is a configuration diagram showing the system including the compression device 101 according to Embodiment 3.
[0022] Figure 14 This is a hardware configuration diagram showing the hardware of the compression device 101 according to Embodiment 3.
[0023] Figure 15 This is a configuration diagram showing the system including the compression device 101 according to Embodiment 4.
[0024] Figure 16 This is a hardware configuration diagram showing the hardware of the compression device 101 according to Embodiment 4. Detailed Implementation
[0025] Hereinafter, the manner in which this disclosure is carried out will be described with reference to the accompanying drawings in order to illustrate this disclosure in more detail.
[0026] Implementation method 1.
[0027] Figure 1 This is a configuration diagram showing the system including the compression device 101 according to Embodiment 1.
[0028] Figure 2 This is a hardware configuration diagram showing the hardware of the compression device 101 according to Embodiment 1.
[0029] Figure 1 The system shown includes a compression device 101, a recovery device 102, and an inspection device 103.
[0030] Figure 1 The compression device 101 shown includes a matrix acquisition unit 1, a partial feature matrix storage unit 2, a first global matrix calculation unit 3, an object matrix calculation unit 4, a second global matrix calculation unit 5, a global matrix storage unit 6, a first singular matrix calculation unit 7, and a second singular matrix calculation unit 8.
[0031] Compression device 101 is an image compression device. The image to be compressed may be, for example, an inspection image. An inspection image is an image containing an object to be inspected.
[0032] Matrix acquisition part 1, for example, is obtained by Figure 2 The matrix acquisition circuit 21 shown is implemented.
[0033] The matrix acquisition unit 1 sequentially acquires the partial feature matrix X for each of the multiple partial images into which the image has been segmented from the outside. b (b=1, ..., B). B is an integer greater than 2. The source images for segmentation of multiple partial images are, for example, images used for inspection. Partial feature matrix X b It is a matrix containing the feature vectors of each part of the image.
[0034] Matrix Acquisition Part 1: Whenever a partial eigenma matrix X is acquired... b Then part of the feature matrix X b Stored in the partial feature matrix storage section 2.
[0035] Partial feature matrix storage unit 2, for example, is composed of Figure 2 The partial feature matrix storage circuit 22 shown is implemented.
[0036] Partial feature matrix storage unit 2 stores the partial feature matrix X obtained by matrix acquisition unit 1. b (b=1,...,B).
[0037] The partial feature matrices stored in the partial feature matrix storage unit 2 are X1 to X2. B Any partial feature matrix X in b .
[0038] The first global matrix calculation unit 3, for example, is composed of... Figure 2 The first global matrix calculation circuit 23 shown is implemented.
[0039] The first global matrix calculation unit 3 performs singular value decomposition (SVD) on the first partial characteristic matrix X1 obtained by the matrix acquisition unit 1, i.e., the first partial characteristic matrix X1, to calculate the first global singular value matrix S and the first global right singular matrix V. T .
[0040] The first part, the characteristic matrix X1, contains more than one singular value s1~s2. K A matrix. K is an integer greater than or equal to 1.
[0041] The first global singular value matrix S is the set of singular values s1 to s2 containing the first part of the characteristic matrix X1. K The first global singular value matrix.
[0042] First global right singular matrix V T It contains singular values s that are part of the first characteristic matrix X1. k The right singular vector v corresponding to (k=1,...,K) k The first global right singular matrix.
[0043] The first global matrix calculation unit 3 calculates the first global singular value matrix S and the first global right singular matrix V. T Stored in global matrix storage section 6.
[0044] exist Figure 1 In the compression device 101 shown, it is envisioned that the first partial feature matrix X1 is subjected to SVD by the first singular matrix calculation unit 7. However, this is only an example. Alternatively, the first global matrix calculation unit 3 can obtain the first partial feature matrix X1 from the partial feature matrix storage unit 2, perform SVD on the first partial feature matrix X1, and calculate the first global singular value matrix S and the first global right singular matrix V. T .
[0045] Object matrix calculation unit 4, for example, is composed of Figure 2 The object matrix calculation circuit 24 shown is implemented.
[0046] The object matrix calculation unit 4 obtains the b-th (b=2,...,B) partial feature matrix X obtained by the matrix acquisition unit 1 from the partial feature matrix storage unit 2. b The following will be the partial feature matrix X obtained for the b-th time. b This is called "the b-th part of the characteristic matrix X". b ".
[0047] The object matrix calculation unit 4 obtains the (b-1)th global singular value matrix S, which is the (b-1)th global singular value matrix, and the (b-1)th global right singular matrix V from the global matrix storage unit 6. T The (b-1)th global right singular matrix V T .
[0048] The object matrix calculation unit 4 calculates the characteristic matrix X containing part b. b The (b-1)th global singular value matrix S and the (b-1)th global right singular matrix V T The b-th object matrix Wb The b-th object matrix W b It is the matrix that becomes the b-th singular value decomposition object.
[0049] The object matrix calculation unit 4 calculates the b-th object matrix W. b The output is sent to the second global matrix calculation unit 5.
[0050] The second global matrix calculation unit 5 is, for example, composed of... Figure 2 The second global matrix calculation circuit 25 shown is implemented.
[0051] The second global matrix calculation unit 5 obtains the b-th object matrix W from the object matrix calculation unit 4. b (b=2,...,B).
[0052] The second global matrix calculation unit 5 calculates the b-th object matrix W. b Perform SVD to compute the b-th global singular value matrix S as the b-th global singular value matrix and the b-th global right singular matrix V as the b-th global right singular matrix. T .
[0053] The b-th global singular value matrix S is a matrix containing the b-th object matrix W. b The singular values of the b-th object matrix W b The singular value matrix. The b-th object matrix W b Singular values and stacked matrix X 1-b The singular values contained are approximately equal. Therefore, the b-th object matrix W b It is related to the stacked matrix X 1-b Approximately equal matrices. Stacked matrices X 1-b The partial characteristic matrices X1 to Xb obtained by matrix acquisition part 1 are the first to the bth matrices. b A virtual matrix formed by all layers stacked on top of each other.
[0054] The b-th global right singular matrix V T It contains the matrix W of the b-th object. b The right singular vector v corresponding to the singular value k The right singular matrix of the b-th object matrix.
[0055] The second global matrix calculation unit 5 calculates the b-th global singular value matrix S and the b-th global right singular matrix V. T Stored in global matrix storage section 6.
[0056] Global matrix storage unit 6, for example, is composed of Figure 2 The global matrix storage circuit 26 shown is implemented.
[0057] The global matrix storage unit 6 stores the first global singular value matrix S output from the first global matrix calculation unit 3 or the b-th global singular value matrix S output from the second global matrix calculation unit 5.
[0058] Global matrix storage unit 6 stores the first global right singular matrix V output from the first global matrix calculation unit 3. T Alternatively, the b-th global right singular matrix V output from the second global matrix calculation unit 5. T .
[0059] Whenever a new b-th global singular value matrix S is output from the second global matrix calculation unit 5, the first global singular value matrix S or the b-th global singular value matrix S stored in the global matrix storage unit 6 is updated to the newly output b-th global singular value matrix S. Therefore, the global matrix storage unit 6 only stores the latest b-th global singular value matrix S.
[0060] Additionally, whenever the b-th global right singular matrix V is output from the second global matrix calculation unit 5... T At that time, the first global right singular matrix V stored in the global matrix storage unit 6 T Or the b-th global right singular matrix V T It is then updated to the b-th global right singular matrix V of the new output. T Therefore, the global matrix storage unit 6 only stores the latest b-th global right singular matrix V. T .
[0061] The first singular matrix calculation unit 7, for example, is composed of... Figure 2 The first singular matrix calculation circuit 27 shown is implemented.
[0062] The first singular matrix calculation unit 7 obtains the b-th partial characteristic matrix X obtained by the matrix acquisition unit 1 (b=1,...,B) from the partial characteristic matrix storage unit 2. b .
[0063] The first singular matrix calculation unit 7 pairs the characteristic matrix X of part b. b Perform SVD to calculate the b-th first singular value matrix S. b '、The b-th first left singular matrix U b 'and the b-th first right singular matrix V b ' T .
[0064] The b-th first singular value matrix S b ' is the feature matrix X containing the b-th part. b The singular values s1~s K The matrix.
[0065] The b-th first left singular matrix U b' is a feature matrix X containing the b-th part. b singular values s k The left singular vector u corresponding to (k=1,...,K) k The matrix.
[0066] The b-th first right singular matrix V b ' T It contains the characteristic matrix X of part b. b singular values s k The corresponding right singular vector v k The matrix.
[0067] The first singular matrix calculation unit 7 calculates the b-th first singular value matrix S. b '、The b-th first left singular matrix U b 'and the b-th first right singular matrix V b ' T Output to the second singular matrix calculation unit 8.
[0068] The second singular matrix calculation unit 8 is, for example, composed of... Figure 2 The second singular matrix calculation circuit 28 shown is implemented.
[0069] The second singular matrix calculation unit 8 obtains the b-th global singular value matrix S and the b-th global right singular matrix V from the global matrix storage unit 6. T b=1, ..., B.
[0070] The second singular matrix calculation unit 8 obtains the b-th first singular value matrix S from the first singular matrix calculation unit 7. b '、The b-th first left singular matrix U b 'and the b-th first right singular matrix V b ' T .
[0071] The second singular matrix calculation unit 8 calculates the b-th global singular value matrix S and the b-th global right singular matrix V. T The b-th first singular value matrix S b '、The b-th first left singular matrix U b 'and the b-th first right singular matrix V b ' T To calculate the matrix W containing the b-th object. b The singular values correspond to the left singular vector u k The b-th second left singular matrix U b ".
[0072] The second singular matrix calculation unit 8 calculates the b-th second left singular matrix U. b The b-th global singular value matrix S and the b-th global right singular matrix V TOutput to the recovery device 102.
[0073] The restoration device 102 obtains the b-th second left singular matrix U from the second singular matrix calculation unit 8 of the compression device 101. b The b-th global singular value matrix S and the b-th global right singular matrix V T .
[0074] The restoration device 102 is based on the b-th second left singular matrix U b The b-th global singular value matrix S and the b-th global right singular matrix V T To reconstruct the segmented source image of multiple parts of the image.
[0075] The restoration device 102 outputs the restored image to the inspection device 103.
[0076] The inspection device 103 obtains the restored image from the restoration device 102.
[0077] The inspection device 103 inspects the objects contained in the restored image based on the restored image.
[0078] exist Figure 1 The design envisions a matrix acquisition unit 1, a partial feature matrix storage unit 2, a first global matrix calculation unit 3, an object matrix calculation unit 4, a second global matrix calculation unit 5, a global matrix storage unit 6, a first singular matrix calculation unit 7, and a second singular matrix calculation unit 8 as components of the compression device 101. Figure 2 The dedicated hardware implementation is shown. That is, the compression device 101 is envisioned to be implemented by a matrix acquisition circuit 21, a partial feature matrix storage circuit 22, a first global matrix calculation circuit 23, an object matrix calculation circuit 24, a second global matrix calculation circuit 25, a global matrix storage circuit 26, a first singular matrix calculation circuit 27, and a second singular matrix calculation circuit 28.
[0079] Here, the partial feature matrix storage circuit 22 and the global matrix storage circuit 26 are implemented, for example, by RAM (Random Access Memory) or flash memory.
[0080] The matrix acquisition circuit 21, the first global matrix calculation circuit 23, the object matrix calculation circuit 24, the second global matrix calculation circuit 25, the first singular matrix calculation circuit 27, and the second singular matrix calculation circuit 28 are respectively equivalent to a single circuit, a composite circuit, a programmable processor, a parallel programmable processor, an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), or a combination thereof.
[0081] The components of the compression device 101 are not limited to being implemented by dedicated hardware, and the compression device 101 can also be implemented by software, firmware, or a combination of software and firmware.
[0082] The software or firmware is stored as a program in the memory of a computer. A computer refers to the hardware that executes the program, such as a CPU (Central Processing Unit), GPU (Graphics Processing Unit), central processing device, processing device, arithmetic device, microprocessor, microcomputer, processor, or DSP (Digital Signal Processor).
[0083] Figure 3 It is a hardware configuration diagram of a computer when the compression device 101 is implemented by software or firmware, etc.
[0084] When the compression device 101 is implemented by software or firmware, etc., the partial feature matrix storage unit 2 and the global matrix storage unit 6 are respectively constructed on the memory 41 of the computer. A compression program for causing the computer to execute each processing step in the matrix acquisition unit 1, the first global matrix calculation unit 3, the object matrix calculation unit 4, the second global matrix calculation unit 5, the first singular matrix calculation unit 7, and the second singular matrix calculation unit 8 is stored in the memory 41. Moreover, the processor 42 of the computer executes the compression program stored in the memory 41.
[0085] In addition, Figure 2 shows an example in which each component of the compression device 101 is implemented by dedicated hardware, and Figure 3 shows an example in which the compression device 101 is implemented by software or firmware, etc. However, this is only an example, and it is also possible that some components of the compression device 101 are implemented by dedicated hardware, and the remaining components are implemented by software or firmware, etc.
[0086] Figure 4 It is an explanatory diagram showing the feature matrix compressed by the compression method disclosed in Patent Document 1.
[0087] In the feature matrix compression method disclosed in Patent Document 1, first, a processing device (not shown) acquires a feature matrix X representing the features of an image including an object from the outside and stores the feature matrix X in a memory (not shown). In Figure 4 's example, the data size of the feature matrix X is M×N, where M < N. M and N are integers of 2 or more. The feature matrix X includes N feature vectors n1 to n N .
[0088] The processing device compresses the feature matrix X by performing SVD on the feature matrix X.
[0089] Specifically, the processing device such as Figure 4 As shown, the singular values s1 to s2 contained in the feature matrix X are calculated by performing SVD on the feature matrix X. K The singular value matrix S contains the singular values s. k The left singular vector u corresponding to (k=1,...,M) k The left singular matrix U, and the singular values s k The corresponding right singular vector v k The right singular matrix V T K is an integer greater than or equal to 1, and K < 1. <M。
[0090] The singular value matrix S has a data size of K×K, the left singular matrix U has a data size of K×N, and the right singular matrix V... T The data size is M×K.
[0091] Next, for Figure 1 The operation of the compression device 101 shown will be explained.
[0092] Figure 5 This is a flowchart illustrating the compression method as a processing step of the compression device 101.
[0093] exist Figure 1 In the compression device 101 shown, such as Figure 6 As shown, assume the image is segmented into multiple partial images.
[0094] Figure 6 It is an explanatory diagram representing multiple parts of an image.
[0095] Figure 6 The example shown is an image divided into 16 parts, each of which is the same size. However, this is just an example, and the number of segmented images is not limited to 16. Furthermore, the sizes of the multiple segmented images are not limited to the same size.
[0096] exist Figure 1 In the compression device 101 shown, for ease of explanation, it is assumed that the number of partial images is B. B is an integer greater than or equal to 2.
[0097] Figure 7 and Figure 8 They represent by Figure 1 An explanatory diagram of the feature matrix after compression by the compression device 101 shown.
[0098] The matrix acquisition unit 1 sequentially acquires the partial feature matrix X for each of the B partial images from the outside. b (b=1, ..., B) Figure 5 Step ST1).
[0099] Matrix Acquisition Part 1: Whenever a partial eigenma matrix X is acquired... b At that time, part of the characteristic matrix X will be... b Stored in the partial feature matrix storage section 2.
[0100] The partial feature matrices stored in the partial feature matrix storage unit 2 are X1 to X2. B Any partial feature matrix X in b .
[0101] Partial characteristic matrix X b The data size is one-B times the data size of the feature matrix X.
[0102] exist Figure 1 In the compression device shown, the matrix acquisition unit 1 sequentially acquires partial feature matrices X. b (b=1, ..., B). However, this is only an example. The matrix acquisition part 1 can also acquire individual partial images and calculate the partial feature matrix X for each partial image. b Partial feature matrix X b There are no particular limitations on the calculation method. For example, there are methods that assign a portion of the image to a CNN (Convolutional Neural Network) and obtain the feature vectors of that portion of the image from the CNN. A CNN is a learning model that completes the learning of the feature vectors of an image.
[0103] The first singular matrix calculation unit 7 obtains the first partial feature matrix X1 obtained by the matrix acquisition unit 1 from the partial feature matrix storage unit 2.
[0104] like Figure 7 As shown, the first singular matrix calculation unit 7 performs SVD on the first part of the characteristic matrix X1. Figure 5 Step ST2).
[0105] Specifically, the first singular matrix calculation unit 7 performs stub SVD on the first part of the feature matrix X1 as shown in the following formula (1), and outputs the SVD result to the first global matrix calculation unit 3.
[0106] X1 ~ U1' S1' V1' T (1)
[0107] In formula (1), “~” is the mathematical symbol for truncating SVD.
[0108] Truncated SVD is a type of SVD that uses the M singular values s1 to s2 contained in the first part of the characteristic matrix X1. M Only the singular values s1 to s2 of the uppermost singular value are calculated. KThe method of discarding the remaining singular values. The upper singular values s1~s K These are singular values among multiple features in an image that are related to important features of the image.
[0109] The first global matrix calculation unit 3 obtains the SVD result from the first singular matrix calculation unit 7.
[0110] The first global matrix calculation unit 3 calculates the first first singular value matrix S1' as the first global singular value matrix S based on the SVD result, and calculates the first first right singular matrix V1'. T As the first global right singular matrix V T ( Figure 5 Step ST3).
[0111] The first singular value matrix S1' is composed of the M singular values s1~s1 contained in the first part of the characteristic matrix X1. M It contains the upper K singular values s1 to s2. K The matrix. The first right singular matrix V1' T It contains the singular values s contained in the first part of the characteristic matrix X1. k The right singular vector v corresponding to (k=1,...,K) k The matrix.
[0112] The following refers to the singular values s1 to s2 contained in the first global singular value matrix S. K That's how it's expressed.
[0113] Specifically, the first global matrix calculation unit 3 does not include the singular values s contained in the first part of the characteristic matrix X1. k The left singular vector u corresponding to (k=1,...,K) k The first left singular matrix U1' is calculated.
[0114] The first global matrix calculation unit 3 stores the first global singular value matrix S in the global matrix storage unit 6.
[0115] The first global matrix calculation unit 3 calculates the first global right singular matrix V. T Stored in global matrix storage section 6.
[0116] The object matrix calculation unit 4 obtains the b-th (b=2,...,B) partial characteristic matrix X obtained by the matrix acquisition unit 1 from the partial characteristic matrix storage unit 2. b .
[0117] The object matrix calculation unit 4 retrieves the previously calculated global singular value matrix S from the global matrix storage unit 6.
[0118] Specifically, when the object matrix calculation unit 4 obtains the second part feature matrix X2 obtained by the matrix acquisition unit 1 from the part feature matrix storage unit 2, it obtains the first global singular value matrix S calculated by the first global matrix calculation unit 3 from the global matrix storage unit 6.
[0119] When the object matrix calculation unit 4 retrieves the b-th partial feature matrix X obtained by the matrix acquisition unit 1 (b=3,...,B) from the partial feature matrix storage unit 2, b At that time, the (b-1)th global singular value matrix S calculated by the second global matrix calculation unit 5 is obtained from the global matrix storage unit 6.
[0120] The (b-1)th global singular value matrix S contains some of the characteristic matrices X1 to X2. b-1 A matrix formed by stacking layers of each other is also known as a stacked matrix X. 1-(b-1) The singular values s1 to s2 are approximately equal. K The matrix.
[0121] As shown in the following formula (2), the object matrix calculation unit 4 calculates the feature matrix X containing the b-th part. b The (b-1)th global singular value matrix S and the (b-1)th global right singular matrix V T The b-th object matrix W, which is the b-th singular value decomposition object. b ( Figure 5 Step ST4).
[0122] W b
[0123] = [V T S, X b T ]
[0124] = [V T diag(s1...s) K ), X b T (2)
[0125] In formula (2), diag is the mathematical symbol for the (b-1)th global singular value matrix S as a diagonal matrix. T is the mathematical symbol for the transpose.
[0126] The object matrix calculation unit 4 calculates the b-th object matrix W. b The output is sent to the second global matrix calculation unit 5.
[0127] The second global matrix calculation unit 5 obtains the b-th object matrix W from the object matrix calculation unit 4. b (b=2,...,B).
[0128] like Figure 8 As shown, the second global matrix calculation unit 5 calculates the b-th object matrix W. b Perform SVD ( Figure 5 Step ST5).
[0129] Specifically, the second global matrix calculation unit 5 calculates the b-th object matrix W as shown in the following formula (3). b Perform truncated SVD to compute the b-th global singular value matrix S as the b-th global singular value matrix and the b-th global right singular matrix V as the b-th global right singular matrix. T ( Figure 5 Step ST6).
[0130] W b ~ VSU T (3)
[0131] In the truncated SVD performed by the second global matrix calculation unit 5, the second global matrix calculation unit 5 calculates the b-th global singular value matrix S and the b-th global right singular matrix V. T However, the global left singular matrix U is not calculated.
[0132] The object matrix W of the bth generation b It not only includes the b-th part of the feature matrix X b It also includes the (b-1)th global singular value matrix S and the (b-1)th global right singular matrix V. T The matrix. Therefore, as Figure 8 As shown, for the b-th object matrix W b Performing truncated SVD is equivalent to processing a portion of the feature matrix X1 to X... b The matrix formed by all the layers stacked on top of each other is also known as the stacked matrix X. 1-b Perform truncated SVD. Therefore, the b-th global singular value matrix S is a subset of the stacked matrix X. 1-b Singular values s1 to s2, which contain one or more singular values that are approximately equal. K The matrix. Additionally, the b-th global right singular matrix V. T It is contained in the stacked matrix X 1-b The singular values s contained therein are approximately equal in number. k The right singular vector v corresponding to (k=1,...,K) k The matrix.
[0133] The second global matrix calculation unit 5 calculates the b-th global singular value matrix S and the b-th global right singular matrix V. T The data is overwritten and saved to the global matrix storage section 6.
[0134] Therefore, since the (b-1)th global singular value matrix S stored in the global matrix storage unit 6 is updated to the bth global singular value matrix S output from the second global matrix calculation unit 5, the global matrix storage unit 6 only stores the latest global singular value matrix S, that is, the bth global singular value matrix S.
[0135] Furthermore, since the (b-1)th global right singular matrix V is first stored in the global matrix storage unit 6 T Updated to the b-th global right singular matrix V output from the second global matrix calculation unit 5 T Therefore, the global matrix storage unit 6 only stores the latest global right singular matrix V. T That is, the b-th global right singular matrix V T .
[0136] As described above, the first singular matrix calculation unit 7 obtains the first partial feature matrix X1 obtained by the matrix acquisition unit 1 from the partial feature matrix storage unit 2.
[0137] like Figure 7 As shown, the first singular matrix calculation unit 7 performs SVD on the first part of the feature matrix X1.
[0138] Specifically, as shown in formula (1), the first singular matrix calculation unit 7 performs truncated SVD on the first part of the characteristic matrix X1 to calculate the first first singular value matrix S1', the first first left singular matrix U1', and the first first right singular matrix V1'. T .
[0139] The first left singular matrix U1' contains M singular values s1~s1 contained in the first part of the characteristic matrix X1. M The top K singular values s k The left singular vector u corresponding to (k=1,...,K) k The matrix.
[0140] The first singular matrix calculation unit 7 obtains the b-th (b=2,...,B) partial characteristic matrix X obtained by the matrix acquisition unit 1 from the partial characteristic matrix storage unit 2, which is also the b-th partial characteristic matrix X. b .
[0141] like Figure 8 As shown, the first singular matrix calculation unit 7 calculates the characteristic matrix X of the b-th part. b Perform SVD ( Figure 5 Step ST7).
[0142] Specifically, the first singular matrix calculation unit 7 calculates the characteristic matrix X of the b-th part as shown in the following formula (4). b Perform truncated SVD to compute the b-th first singular value matrix S.b '、The b-th first left singular matrix U b 'and the b-th first right singular matrix V b ' T ( Figure 5 Step ST8).
[0143] The b-th first singular value matrix S b ' is the feature matrix X containing the b-th part. b It contains M singular values s1 to s2. M The top K singular values s1 to s2 are among them. K The matrix. The b-th first left singular matrix U b ' is a feature matrix X containing the b-th part. b The included singular values s k The left singular vector u corresponding to (k=1,...,K) k The matrix. The b-th first right singular matrix V b ' T It contains the characteristic matrix X of part b. b The included singular values s k The corresponding right singular vectors v1~v K The matrix.
[0144] X b ~ U b 'S b 'V b ' T (4)
[0145] The first singular matrix calculation unit 7 calculates the b-th (b=1,...,B) first singular value matrix S b '、The b-th first left singular matrix U b 'and the b-th first right singular matrix V b ' T Output to the second singular matrix calculation unit 8.
[0146] The second singular matrix calculation unit 8 obtains the b-th (b=1,...,B) global singular value matrix S, i.e., the b-th global singular value matrix S, and the b-th global right singular matrix V from the global matrix storage unit 6. T That is, the b-th global right singular matrix V T .
[0147] The second singular matrix calculation unit 8 obtains the b-th first singular value matrix S from the first singular matrix calculation unit 7. b '、The b-th first left singular matrix U b 'and the b-th first right singular matrix V b ' T .
[0148] The second singular matrix calculation unit 8 is based on the following formula (5), according to the b-th global singular value matrix S and the b-th global right singular matrix V. T The b-th first singular value matrix S b '、The b-th first left singular matrix U b 'and the b-th first right singular matrix V b ' T To calculate the b-th second left singular matrix U b ( Figure 5 Step ST9).
[0149] The b-th second left singular matrix U b "is contained in the feature matrix X of part b". b The included singular values s k The left singular vector u corresponding to (k=1,...,K) k The matrix.
[0150] U b SV T = U b 'S b 'V b ' T (5)
[0151] The second singular matrix calculation unit 8 calculates the b-th second left singular matrix U. b The b-th global singular value matrix S and the b-th global right singular matrix V T Output to the recovery device 102.
[0152] The following is a detailed explanation of how the second singular matrix calculation unit 8 calculates the b-th second left singular matrix U. b The calculation and processing of ".
[0153] First, as shown in the following formula (6), the second singular matrix calculation unit 8 multiplies both sides of formula (5) by V.
[0154] U b SV T V = U b 'S b 'V b ' T V
[0155] ↓
[0156] U b S = U b 'S b 'V b ' T V (6)
[0157] Next, as shown in the following formula (7), the second singular matrix calculation unit 8 calculates the inverse matrix S of the b-th global singular value matrix S. -1 .
[0158] S = diag(s1...s) K )
[0159] ↓
[0160] S -1 = diag(1 / s1...1 / s K (7)
[0161] Next, as shown in the following formula (8), the second singular matrix calculation unit 8 multiplies both sides of formula (6) by the inverse matrix S. -1 To calculate the b-th second left singular matrix U b ".
[0162] U b SS -1 = U b 'S b 'V b ' T VS -1
[0163] ↓
[0164] U b = U b 'S b 'V b ' T VS -1 (8)
[0165] The restoration device 102 obtains the b-th second left singular matrix U from the second singular matrix calculation unit 8 of the compression device 101. b The b-th global singular value matrix S and the b-th global right singular matrix V T .
[0166] The restoration device 102 is based on the b-th second left singular matrix U b The b-th global singular value matrix S and the b-th global right singular matrix V T To reconstruct the segmented source image of multiple parts of the image.
[0167] Specifically, the restoration device 102 will restore the b-th second left singular matrix U b The b-th global singular value matrix S and the b-th global right singular matrix V T Substituting into formula (5), we can calculate U, which is the right-hand side of formula (5). b 'Sb 'V b ' T .
[0168] That is, the restoration device 102 calculates U b 'S b 'V b ' T X, as the feature matrix of part b b .
[0169] If the characteristic matrix of part b is X1~X B Once the calculation is complete, the restoration device 102 will contain the b-th part of the feature matrix X1 to X2. B The feature matrix X of the inspection image is restored. Restoring the feature matrix X of the inspection image is equivalent to restoring the inspection image itself. Here, when restoring the inspection image, the restoration device 102 knows in advance the feature matrix X of part b. b The relevant partial image (b=1, ..., B) is the image at which position of the image is being examined. Furthermore, the restoration device 102 also knows in advance the feature matrix X of the b-th part obtained by the matrix acquisition unit 1. b The order in which they are acquired.
[0170] Specifically, if matrix acquisition part 1 acquires the b-th eigenma matrix X b If partial feature matrix information is obtained from an external source, then the restoration device 102 obtains partial feature matrix information from the compression device 101. The partial feature matrix information, for example, includes information used to identify the b-th part of the feature matrix X. b The identification information, represented by the matrix, is obtained from the feature matrix X of the b-th part. b The order information of acquisition order, and the feature matrix X representing the b-th part. b The location information is relative to the position of the image being examined. The restoration device 102 calculates the feature matrix X of part b according to the acquisition order shown in the sequence information. b If the characteristic matrix of part b is X1~X B Once the calculation is complete, the feature matrix X1 to X2 containing the b-th part is determined based on the location information. B The image is restored using its feature matrix X.
[0171] The restoration device 102 outputs the feature matrix X of the image to the inspection device 103.
[0172] The inspection device 103 obtains the feature matrix X of the inspection image from the restoration device 102 as the restored image.
[0173] The inspection device 103 inspects the objects contained in the inspection image based on the feature matrix X.
[0174] Since the process of inspecting objects contained in an image based on the feature matrix X is a well-known technique, the process of inspecting objects will be briefly explained here.
[0175] The inspection device 103 stores one or more feature vectors contained in the feature matrix of a normal object. If the inspection device 103 does not store such feature vectors, the feature vectors can be obtained from an external source, for example.
[0176] The inspection device 103 calculates the difference between one or more eigenvectors contained in the feature matrix of a normal object and one or more eigenvectors contained in the feature matrix X.
[0177] If all calculated differences are within the threshold, the inspection device 103 determines that the object contained in the inspection image is normal. The threshold can be stored in the internal memory of the inspection device 103 or provided externally.
[0178] If one or more of the calculated differences are above a threshold, the inspection device 103 determines that the object contained in the inspection image is abnormal.
[0179] In the above embodiment 1, the compression device 101 is configured to include: a matrix acquisition unit 1, which sequentially acquires a partial feature matrix for each of a plurality of partial images into which an image is segmented; and a first global matrix calculation unit 3, which performs singular value decomposition on the first partial feature matrix acquired by the matrix acquisition unit 1, i.e., the first partial feature matrix, and calculates a first global singular value matrix containing the singular values of the first partial feature matrix as the first global singular value matrix, and a first global right singular matrix containing the right singular vectors corresponding to the singular values of the first partial feature matrix as the first global right singular matrix. Furthermore, the compression device 101 includes: an object matrix calculation unit 4, which calculates a matrix that becomes the object of the b-th singular value decomposition, i.e., the b-th partial feature matrix, which includes the b-th (b is an integer greater than or equal to 2) partial feature matrix obtained by the matrix acquisition unit 1, the (b-1)-th global singular value matrix, and the (b-1)-th global right singular matrix; and a second global matrix calculation unit 5, which performs singular value decomposition on the b-th object matrix calculated by the object matrix calculation unit 4, calculates the singular value matrix of the b-th object matrix containing the singular values of the b-th object matrix as the b-th global singular value matrix, and calculates the right singular matrix of the b-th object matrix containing the right singular vectors corresponding to the singular values of the b-th object matrix as the b-th global right singular matrix. Therefore, the compression device 101 can compress the feature matrix by storing only a portion of the feature matrix in memory.
[0180] Furthermore, the compression device 101 includes: a first singular matrix calculation unit 7, which performs singular value decomposition on the b-th part feature matrix obtained by the matrix acquisition unit 1 to calculate a b-th first singular value matrix containing the singular values of the b-th part feature matrix, a b-th first left singular matrix containing the left singular vectors corresponding to the singular values of the b-th part feature matrix, and a b-th first right singular matrix containing the right singular vectors corresponding to the singular values of the b-th part feature matrix; and a second singular matrix calculation unit 8, which calculates a b-th second left singular matrix containing the left singular vectors corresponding to the singular values of the b-th object matrix based on the b-th global singular value matrix calculated by the second global matrix calculation unit 5, the b-th global right singular matrix calculated by the second global matrix calculation unit 5, the b-th first singular value matrix calculated by the first singular matrix calculation unit 7, the b-th first left singular matrix calculated by the first singular matrix calculation unit 7, and the b-th first right singular matrix calculated by the first singular matrix calculation unit 7. Therefore, the compression device can compress the feature matrix by storing only a portion of the feature matrix in memory.
[0181] exist Figure 1 In the compression apparatus shown, each of the second global matrix calculation unit 5 and the first singular matrix calculation unit 7 performs truncated SVD of the matrix. As long as the matrix can be compressed, the SVD is not limited to truncated SVD; for example, each of the second global matrix calculation unit 5 and the first singular matrix calculation unit 7 can also perform economic SVD of the matrix.
[0182] Furthermore, as a type of SVD, there is incremental SVD. Even when performing incremental SVD, the matrix can be compressed. That is, by modifying a portion of the eigenma matrix X... b By performing incremental SVD, the second left singular matrix U can be obtained. b "In this case, the larger the value of b and the closer the value of b is to the value of B, the more likely the second left singular matrix U is to be formed." b "The more the number of left singular vectors it contains increases, the more the second left singular matrix U..." b The more rows there are, the longer the incremental SVD takes. Therefore, the larger the value of b and the closer the value of b is to the value of B, the longer the processing time will be.
[0183] In contrast, the second global matrix calculation unit 5 calculates the b-th object matrix W... b Perform truncated SVD to compute the b-th global singular value matrix S and the b-th global right singular matrix V. T However, it does not include the matrix W containing the b-th object. b The right singular matrix of the b-th object matrix, which is also the b-th global right singular matrix, is calculated based on the right singular vectors corresponding to the singular values. Therefore, even if the value of b increases and approaches the value of B, the processing time of SVD will not increase as much as with incremental SVD.
[0184] Figure 1 The compression device 101 shown includes a matrix acquisition unit 1, a partial feature matrix storage unit 2, a first global matrix calculation unit 3, an object matrix calculation unit 4, a second global matrix calculation unit 5, a global matrix storage unit 6, a first singular matrix calculation unit 7, and a second singular matrix calculation unit 8. However, this is only an example; the compression device 101 may also include, for example, a matrix acquisition unit 1, a partial feature matrix storage unit 2, a first global matrix calculation unit 3, an object matrix calculation unit 4, a second global matrix calculation unit 5, and a global matrix storage unit 6, with the first singular matrix calculation unit 7 and the second singular matrix calculation unit 8 respectively disposed outside the compression device 101. Examples of the external components of the compression device 101 include clouds.
[0185] When the first singular matrix calculation unit 7 and the second singular matrix calculation unit 8 are respectively installed in a cloud, for example, the compression device 101 will store the b-th part of the feature matrix X in the part feature matrix storage unit 2. b (b=2,...,B) and the b-th global singular value matrix S and the b-th global right singular matrix V stored in the global matrix storage unit 6. T Send to the cloud.
[0186] Therefore, the first singular matrix calculation unit 7, located in the cloud, calculates the b-th first singular value matrix S. b '、The b-th first left singular matrix U b 'and the b-th first right singular matrix V b ' T The second singular matrix calculation unit 8, located in the cloud, calculates the b-th second left singular matrix U. b ".
[0187] The compression device 101 obtains the b-th second left singular matrix U from the second singular matrix calculation unit 8 located in the cloud. b The b-th global singular value matrix S and the b-th global right singular matrix V T .
[0188] Then, the compression device 101 compresses the b-th second left singular matrix U b The b-th global singular value matrix S and the b-th global right singular matrix V T Output to the recovery device 102.
[0189] When the first singular matrix calculation unit 7 and the second singular matrix calculation unit 8 are respectively installed outside the compression device 101, the compression device and Figure 1 Compared to the compression device 101 shown, it can reduce the processing load.
[0190] exist Figure 1In the compression device 101 shown, the second singular matrix calculation unit 8 calculates the b-th second left singular matrix U. b The b-th global singular value matrix S and the b-th global right singular matrix V T The output is sent to the recovery device 102. However, this is just an example; the compression device 101 can also be used as follows. Figure 9 As shown, it includes a storage unit 12, which stores the b-th second left singular matrix U calculated by the second singular matrix calculation unit 8. b The b-th global singular value matrix S calculated by the second global matrix calculation unit 5 and the b-th global right singular matrix V calculated by the second global matrix calculation unit 5. T . Figure 9 This is a configuration diagram showing a system including another compression device 101 according to Embodiment 1.
[0191] In this case, when restoring the segmented source image of multiple partial images, the restoration device 102 obtains the b-th second left singular matrix U from the storage unit 12. b The b-th global singular value matrix S and the b-th global right singular matrix V T .
[0192] Implementation method 2.
[0193] In embodiment 2, the second singular matrix calculation unit 9 obtains the first left singular matrix U such that the b-th first left singular matrix U... b 'The b-th rotation matrix R b And according to the b-th rotation matrix R b and the b-th first left singular matrix U b 'Calculate the b-th second left singular matrix U' b The compression device 101 will be described.
[0194] Figure 10 This is a configuration diagram showing the system including the compression device 101 according to Embodiment 2. Figure 10 In the middle, due to with Figure 1 and Figure 9 The same reference numerals indicate the same or equivalent parts, so detailed descriptions are omitted.
[0195] Figure 11 This is a hardware configuration diagram showing the hardware of the compression device 101 according to Embodiment 2. Figure 11 In the middle, due to with Figure 2 The same reference numerals indicate the same or equivalent parts, so detailed descriptions are omitted.
[0196] Figure 10The compression device 101 shown includes a matrix acquisition unit 1, a partial feature matrix storage unit 2, a first global matrix calculation unit 3, an object matrix calculation unit 4, a second global matrix calculation unit 5, a global matrix storage unit 6, a first singular matrix calculation unit 7, and a second singular matrix calculation unit 9. However, this is only an example; the compression device 101 may also include the matrix acquisition unit 1, the partial feature matrix storage unit 2, the first global matrix calculation unit 3, the object matrix calculation unit 4, the second global matrix calculation unit 5, and the global matrix storage unit 6, with the first singular matrix calculation unit 7 and the second singular matrix calculation unit 9 respectively disposed outside the compression device 101. For example, a cloud can be cited as an example of the outside of the compression device 101.
[0197] The second singular matrix calculation unit 9, for example, is composed of... Figure 11 The second singular matrix calculation circuit 29 shown is implemented.
[0198] The second singular matrix calculation unit 9 obtains the b-th (b=1,...,B) first left singular matrix U from the first singular matrix calculation unit 7. b ', and obtain the b-th rotation matrix R from the processing device not shown in the figure. b .
[0199] Rotation matrix R b It is based on the b-th global singular value matrix S and the b-th global right singular matrix V. T The b-th first singular value matrix S b 'and the b-th first right singular matrix V b ' T The calculated matrix.
[0200] The second singular matrix calculation unit 9 calculates the b-th rotation matrix R based on... b and the b-th first left singular matrix U b 'Calculate the b-th second left singular matrix U' b ".
[0201] The b-th second left singular matrix U b "is contained in the matrix W of the b-th object" b The included singular values s k The corresponding left singular vector u k The matrix.
[0202] The second singular matrix calculation unit 9 calculates the b-th second left singular matrix U. b The b-th global singular value matrix S and the b-th global right singular matrix V T Output to the recovery device 102.
[0203] exist Figure 10In this design, the matrix acquisition unit 1, the partial feature matrix storage unit 2, the first global matrix calculation unit 3, the object matrix calculation unit 4, the second global matrix calculation unit 5, the global matrix storage unit 6, the first singular matrix calculation unit 7, and the second singular matrix calculation unit 9, which are components of the compression device 101, are respectively constructed by... Figure 11 The dedicated hardware implementation is shown. That is, the compression device 101 is envisioned to be implemented by a matrix acquisition circuit 21, a partial feature matrix storage circuit 22, a first global matrix calculation circuit 23, an object matrix calculation circuit 24, a second global matrix calculation circuit 25, a global matrix storage circuit 26, a first singular matrix calculation circuit 27, and a second singular matrix calculation circuit 29.
[0204] The matrix acquisition circuit 21, the first global matrix calculation circuit 23, the object matrix calculation circuit 24, the second global matrix calculation circuit 25, the first singular matrix calculation circuit 27, and the second singular matrix calculation circuit 29 are respectively equivalent to a single circuit, a composite circuit, a programmable processor, a parallel programmable processor, an ASIC, an FPGA, or a combination thereof.
[0205] The components of the compression device 101 are not limited to being implemented by dedicated hardware; the compression device 101 can also be implemented by software, firmware, or a combination of software and firmware.
[0206] When the compression device 101 is implemented by software or firmware, each of the partial feature matrix storage unit 2 and the global matrix storage unit 6 is built into the computer. Figure 3 The memory 41 shown contains compressed programs for enabling the computer to execute the respective processing steps of the matrix acquisition unit 1, the first global matrix calculation unit 3, the object matrix calculation unit 4, the second global matrix calculation unit 5, the first singular matrix calculation unit 7, and the second singular matrix calculation unit 9. Furthermore, Figure 3 The processor 42 shown executes the compression program stored in the memory 41.
[0207] In addition, Figure 11 The diagram shows an example of how the various components of the compression device 101 are implemented using dedicated hardware. Figure 3 The diagram shows an example of compression device 101 implemented by software or firmware. However, this is only an example; it is also possible that some components of compression device 101 are implemented by dedicated hardware, while the remaining components are implemented by software or firmware.
[0208] Next, for Figure 10 The operation of the compression device 101 shown will be explained. This includes, except for the second singular matrix calculation unit 9, and... Figure 1 The compression device 101 shown is similar. Therefore, the operation of the second singular matrix calculation unit 9 will be mainly explained here.
[0209] like Figure 12 As shown, the b-th (b=1,...,B) first left singular matrix U b The vector ' and the b-th second left singular matrix U b There is a difference between the vectors, which is equivalent to the b-th rotation matrix R. b The vector. Therefore, by making the b-th first left singular matrix U b 'Rotate the b-th rotation matrix R b , such that the b-th first left singular matrix U b 'and the b-th second left singular matrix U b "Consistent."
[0210] Figure 12 U represents the b-th first left singular matrix. b The vector ' and the b-th second left singular matrix U b A diagram illustrating the difference between vectors.
[0211] The first singular matrix calculation unit 7 calculates the b-th first singular value matrix S. b 'and the calculated b-th first right singular matrix V b ' T The output is sent to a processing device (not shown). This processing device (not shown) may be located, for example, in the cloud.
[0212] The second singular matrix calculation unit 9 calculates the b-th global singular value matrix S and the b-th global right singular matrix V stored in the global matrix storage unit 6. T Output to a processing device not shown.
[0213] As shown in the following formula (9), the processing device (not illustrated) is based on the b-th global singular value matrix S and the b-th global right singular matrix V. T The b-th first singular value matrix S b 'and the b-th first right singular matrix V b ' T To calculate the first left singular matrix U that makes the b-th matrix... b 'The b-th rotation matrix R b Rotation matrix R b The data size is K×K.
[0214] R b
[0215] = S b 'V b ' T V T S -1
[0216] = diag(s1...s K V b ' T V T diag (1 / s 1... 1 / s) K (9)
[0217] The processing device (not shown) will process the b-th rotation matrix R. b The output is sent to the second singular matrix calculation unit 9.
[0218] The second singular matrix calculation unit 9 obtains the b-th first left singular matrix U from the first singular matrix calculation unit 7. b ', and obtain the b-th rotation matrix R from the processing device not shown in the figure. b .
[0219] As shown in the following formula (10), the second singular matrix calculation unit 9 calculates the second singular matrix based on the rotation matrix R. b and the first left singular matrix U b 'Calculate the b-th second left singular matrix U' b ".
[0220] U b = U b ' R b (10)
[0221] Due to the rotation matrix R b Since the data size is small, the second singular matrix calculation unit 9 calculates the second left singular matrix U. b "processing load ratio Figure 1 The second singular matrix calculation unit 8 shown calculates the second left singular matrix U. b "It has a small processing load."
[0222] In the above implementation method 2, Figure 10 The compression device 101 shown is configured such that: the second singular matrix calculation unit 9 obtains the b-th first left singular matrix calculated by the first singular matrix calculation unit 7 and the b-th rotation matrix that rotates the b-th first left singular matrix, and calculates the b-th second left singular matrix containing the left singular vector corresponding to the singular value of the b-th object matrix based on the b-th rotation matrix and the b-th first left singular matrix. Therefore, Figure 10 The compression device 101 shown is Figure 1 The compression device 101 shown also compresses the feature matrix by storing only a portion of it in memory; otherwise, it is similar to... Figure 1 Compared to the compression device 101 shown, it can reduce the computational burden of the second left singular matrix U. b "processing load".
[0223] exist Figure 10 In the compression device 101 shown, the processing device (not shown) calculates the first left singular matrix U. b 'Rotation matrix R' b However, this is only an example. The second singular matrix calculation unit 9 can also calculate the first left singular matrix U as shown in formula (9). b 'Rotation matrix R' b However, in this case, the second left singular matrix U is calculated. b "processing load and Figure 1 The same applies to the compression device 101 shown.
[0224] Implementation method 3.
[0225] In Embodiment 3, a compression device 101 equipped with a sampling unit 10 will be described. For this sampling unit 10, if the b-th first left singular matrix U... b 'With the b-th rotation matrix R b The product of the two and the b-th second left singular matrix U b If the absolute value of the difference is above the first threshold Th1, then output the b-th second left singular matrix U. b If the absolute value of the difference is less than the first threshold Th1, then the b-th second left singular matrix U is not output. b ".
[0226] Figure 13 This is a configuration diagram showing the system including the compression device 101 according to Embodiment 3. Figure 13 In the middle, due to with Figure 1 , Figure 9 and Figure 10 The same reference numerals indicate the same or equivalent parts, so detailed descriptions are omitted.
[0227] Figure 14 This is a hardware configuration diagram showing the hardware of the compression device 101 according to Embodiment 3. Figure 14 In the middle, due to with Figure 2 and Figure 11 The same reference numerals indicate the same or equivalent parts, so detailed descriptions are omitted.
[0228] Figure 13 The compression device shown includes a matrix acquisition unit 1, a partial feature matrix storage unit 2, a first global matrix calculation unit 3, an object matrix calculation unit 4, a second global matrix calculation unit 5, a global matrix storage unit 6, a first singular matrix calculation unit 7, a second singular matrix calculation unit 9, and a sampling unit 10.
[0229] Sampling unit 10, for example, is composed of Figure 14 The sampling circuit 30 shown is implemented.
[0230] The sampling unit 10 obtains the b-th (b=1,...,B) first left singular matrix U from the first singular matrix calculation unit 7. b ', and obtain the b-th second left singular matrix U from the second singular matrix calculation unit 9. b The b-th global singular value matrix S and the b-th global right singular matrix V T .
[0231] Sampling unit 10 obtains the b-th rotation matrix R from the processing device not shown in the figure. b .
[0232] Sampling unit 10 calculates the b-th first left singular matrix U b 'With the b-th rotation matrix R b The product of the two and the b-th second left singular matrix U b The absolute value of the difference between and .
[0233] If the absolute value of the difference is above the first threshold Th1, then the sampling unit 10 will sample the b-th second left singular matrix U. b "Output to recovery device 102."
[0234] If the absolute value of the difference is less than the first threshold Th1, then the sampling unit 10 will not sample the b-th second left singular matrix U. b "Output to recovery device 102."
[0235] The first threshold Th1 can be stored in the internal memory of the sampling unit 10, or it can be provided from outside the compression device 101.
[0236] exist Figure 13 In the compression device shown, the sampling unit 10 is applied to Figure 10 The compression device 101 shown is just an example; the sampling unit 10 can also be applied to... Figure 1 The compression device 101 shown or Figure 9 The compression device 101 shown.
[0237] exist Figure 13 In this design, the matrix acquisition unit 1, the partial feature matrix storage unit 2, the first global matrix calculation unit 3, the object matrix calculation unit 4, the second global matrix calculation unit 5, the global matrix storage unit 6, the first singular matrix calculation unit 7, the second singular matrix calculation unit 9, and the sampling unit 10, which are components of the compression device 101, are respectively composed of... Figure 14The dedicated hardware implementation is shown. That is, the compression device 101 is envisioned to be implemented by a matrix acquisition circuit 21, a partial feature matrix storage circuit 22, a first global matrix calculation circuit 23, an object matrix calculation circuit 24, a second global matrix calculation circuit 25, a global matrix storage circuit 26, a first singular matrix calculation circuit 27, a second singular matrix calculation circuit 29, and a sampling circuit 30.
[0238] The matrix acquisition circuit 21, the first global matrix calculation circuit 23, the object matrix calculation circuit 24, the second global matrix calculation circuit 25, the first singular matrix calculation circuit 27, the second singular matrix calculation circuit 29, and the sampling circuit 30 are respectively equivalent to, for example, a single circuit, a composite circuit, a programmable processor, a parallel programmable processor, an ASIC, an FPGA, or a combination thereof.
[0239] The components of the compression device 101 are not limited to being implemented by dedicated hardware; the compression device 101 can also be implemented by software, firmware, or a combination of software and firmware.
[0240] When the compression device 101 is implemented by software or firmware, each of the partial feature matrix storage unit 2 and the global matrix storage unit 6 is built into the computer. Figure 3 The memory 41 shown contains compressed programs for enabling the computer to execute various processing steps in the matrix acquisition unit 1, the first global matrix calculation unit 3, the object matrix calculation unit 4, the second global matrix calculation unit 5, the first singular matrix calculation unit 7, the second singular matrix calculation unit 9, and the sampling unit 10. Furthermore, Figure 3 The processor 42 shown executes the compression program stored in the memory 41.
[0241] In addition, Figure 14 The diagram shows an example of how the various components of the compression device 101 are implemented using dedicated hardware. Figure 3 The diagram shows an example of compression device 101 implemented by software or firmware. However, this is only an example; it is also possible that some components of compression device 101 are implemented by dedicated hardware, while the remaining components are implemented by software or firmware.
[0242] Next, for Figure 13 The operation of the compression device 101 shown will be explained. This includes, except for the sampling unit 10, the... Figure 10 The compression device 101 shown is similar. Therefore, the operation of the sampling unit 10 will be mainly explained here.
[0243] The sampling unit 10 obtains the b-th (b=1,...,B) first left singular matrix U from the first singular matrix calculation unit 7. b ', and obtain the b-th second left singular matrix U from the second singular matrix calculation unit 9.b The b-th global singular value matrix S and the b-th global right singular matrix V T .
[0244] Sampling unit 10 obtains the b-th rotation matrix R from the processing device not shown in the figure. b .
[0245] Sampling unit 10 calculates the b-th first left singular matrix U b 'With rotation matrix R b The result of multiplication U b 'R b and the b-th second left singular matrix U b The absolute value of the difference | U b - U b ' R b |2, and the absolute value of the difference|U b - U b ' R b |2 is compared with the first threshold Th1.
[0246] As shown in the following formula (11), if the absolute value of the difference |U b - U b ' R b If |2 is above the first threshold Th1, then the sampling unit 10 will sample the b-th second left singular matrix U. b The b-th global singular value matrix S and the b-th global right singular matrix V T Output to the recovery device 102.
[0247] |U b - U b ' R b |2 ≥ Th1 (11)
[0248] If the absolute value of the difference |U b - U b ' R b If |2 is less than the first threshold Th1, then the sampling unit 10 will not sample the b-th second left singular matrix U. b The b-th global singular value matrix S and the b-th global right singular matrix V T Output to the recovery device 102.
[0249] In the absolute value of the difference |U b - U b ' R b When |2 is less than the first threshold Th1, due to the b-th second left singular matrix U b "The relevant part of the image does not contain important features, so when restoring the image, the b-th second left singular matrix U..."b "The necessity of outputting to the recovery device 102 is low."
[0250] In the above implementation method 3, Figure 13 The compression device 101 shown is configured to include a sampling unit 10. For this sampling unit 10, if the absolute value of the difference between the product of the b-th first left singular matrix calculated by the first singular matrix calculation unit 7 and the b-th rotation matrix, and the difference between the product of the product of the b-th first left singular matrix and the product of the product of the b-th second left singular matrix calculated by the second singular matrix calculation unit 9 and the product of ... Figure 13 The compression device 101 shown is Figure 1 The compression device 101 shown also compresses the feature matrix by storing only a portion of it in memory; otherwise, it is similar to... Figure 1 , 9 Compared to the compression device 101 shown in Figure 10, it can improve the compression ratio of the feature matrix.
[0251] Implementation method 4.
[0252] In Embodiment 4, a compression device 101 equipped with a sampling unit 11 will be described, which calculates the b-th rotation matrix R. b The difference between each of the multiple matrix elements contained in the identity matrix I and each of the multiple matrix elements contained in the identity matrix I is calculated. If the sum of the calculated multiple differences is greater than or equal to the second threshold Th2, then the b-th second left singular matrix U is output. b If the sum of the differences is less than the second threshold Th2, then the b-th second left singular matrix U is not output. b ".
[0253] Figure 15 This is a configuration diagram showing the system including the compression device 101 according to Embodiment 4. Figure 15 In the middle, due to with Figure 1 , Figure 9 and Figure 10 The same reference numerals indicate the same or equivalent parts, so detailed descriptions are omitted.
[0254] Figure 16 This is a hardware configuration diagram showing the hardware of the compression device 101 according to Embodiment 4. Figure 16 In the middle, due to with Figure 2 and Figure 11 The same reference numerals indicate the same or equivalent parts, so detailed descriptions are omitted.
[0255] Figure 15The compression device shown includes a matrix acquisition unit 1, a partial feature matrix storage unit 2, a first global matrix calculation unit 3, an object matrix calculation unit 4, a second global matrix calculation unit 5, a global matrix storage unit 6, a first singular matrix calculation unit 7, a second singular matrix calculation unit 9, and a sampling unit 11.
[0256] Sampling unit 11, for example, is composed of Figure 16 The sampling circuit 31 shown is implemented.
[0257] Sampling unit 11 obtains the b-th (b=1,...,B) first left singular matrix U from second singular matrix calculation unit 9. b ', and obtain the b-th second left singular matrix U from the second singular matrix calculation unit 9. b The b-th global singular value matrix S and the b-th global right singular matrix V T .
[0258] Sampling unit 11 obtains the b-th rotation matrix R from the processing device not shown in the figure. b .
[0259] Sampling unit 11 calculates the rotation matrix R b The difference between each of the multiple matrix elements contained in the identity matrix I and each of the multiple matrix elements contained in the identity matrix I.
[0260] If the sum of the calculated differences is greater than or equal to the second threshold Th2, then the sampling unit 11 will convert the b-th second left singular matrix U b "Output to recovery device 102."
[0261] If the sum of the calculated differences is less than the second threshold Th2, then the sampling unit 11 will not sample the b-th second left singular matrix U. b "Output to recovery device 102."
[0262] The second threshold Th2 can be stored in the internal memory of the sampling unit 11, or it can be provided from outside the compression device 101.
[0263] exist Figure 15 In the compression device 101 shown, the sampling unit 11 is applied to Figure 10 The compression device 101 is shown. However, this is only an example; the sampling unit 11 can also be applied to... Figure 1 The compression device 101 shown or Figure 9 The compression device 101 shown.
[0264] exist Figure 15The design envisions a matrix acquisition unit 1, a partial feature matrix storage unit 2, a first global matrix calculation unit 3, an object matrix calculation unit 4, a second global matrix calculation unit 5, a global matrix storage unit 6, a first singular matrix calculation unit 7, a second singular matrix calculation unit 9, and a sampling unit 11 as components of the compression device 101. Figure 16 The dedicated hardware implementation is shown. That is, the compression device 101 is envisioned to be implemented by a matrix acquisition circuit 21, a partial feature matrix storage circuit 22, a first global matrix calculation circuit 23, an object matrix calculation circuit 24, a second global matrix calculation circuit 25, a global matrix storage circuit 26, a first singular matrix calculation circuit 27, a second singular matrix calculation circuit 29, and a sampling circuit 31.
[0265] The matrix acquisition circuit 21, the first global matrix calculation circuit 23, the object matrix calculation circuit 24, the second global matrix calculation circuit 25, the first singular matrix calculation circuit 27, the second singular matrix calculation circuit 29, and the sampling circuit 31 are respectively equivalent to, for example, a single circuit, a composite circuit, a programmable processor, a parallel programmable processor, an ASIC, an FPGA, or a combination thereof.
[0266] The components of the compression device 101 are not limited to being implemented by dedicated hardware; the compression device 101 can also be implemented by software, firmware, or a combination of software and firmware.
[0267] When the compression device 101 is implemented by software or firmware, each of the partial feature matrix storage unit 2 and the global matrix storage unit 6 is built into the computer. Figure 3 The memory 41 shown contains compressed programs for enabling the computer to execute various processing steps in the matrix acquisition unit 1, the first global matrix calculation unit 3, the object matrix calculation unit 4, the second global matrix calculation unit 5, the first singular matrix calculation unit 7, the second singular matrix calculation unit 9, and the sampling unit 11. Furthermore, Figure 3 The processor 42 shown executes the compression program stored in the memory 41.
[0268] In addition, Figure 16 The diagram shows an example of how the various components of the compression device 101 are implemented using dedicated hardware. Figure 3 The diagram shows an example of compression device 101 implemented by software or firmware. However, this is only an example; it is also possible that some components of compression device 101 are implemented by dedicated hardware, while the remaining components are implemented by software or firmware.
[0269] Next, for Figure 15 The operation of the compression device 101 shown will be explained. However, apart from the sampling unit 11, the operation of the compression device 101 will also be explained. Figure 10The compression device 101 shown is similar. Therefore, the operation of the sampling unit 11 will be mainly explained here.
[0270] Sampling unit 11 obtains the b-th second left singular matrix U from second singular matrix calculation unit 9. b The b-th global singular value matrix S and the b-th global right singular matrix V T .
[0271] Sampling unit 11 obtains the b-th rotation matrix R from the processing device not shown in the figure. b .
[0272] As shown in the following formula (12), the sampling unit 11 calculates the rotation matrix R. b The multiple matrix elements r contained therein p,q Each of the multiple matrix elements i contained in the identity matrix I (p=1,...,K: q=1,...,K) p,q The difference d of each p,q .
[0273]
[0274] As shown in the following formula (13), the sampling unit 11 calculates multiple differences d. p,q The sum D of (p=1, ..., K: q=1, ..., K).
[0275]
[0276] Sampling unit 11 will sample multiple differential d p,q The sum D is compared with the second threshold Th2.
[0277] As shown in the following formula (14), if multiple differences d p,q If the sum D is greater than or equal to the second threshold Th2, then the sampling unit 11 will sample the b-th second left singular matrix U. b The b-th global singular value matrix S and the b-th global right singular matrix V T Output to the recovery device 102.
[0278] D ≥ Th2 (14)
[0279] If there are multiple differences d p,q If the sum D is less than the second threshold Th2, then the sampling unit 11 will not sample the b-th second left singular matrix U. b The b-th global singular value matrix S and the b-th global right singular matrix V T Output to the recovery device 102.
[0280] In multiple differences d p,qWhen the sum D is less than the second threshold Th2, due to the b-th second left singular matrix U b "It does not contain important features, so when restoring the image, the b-th second left singular matrix U..." b "The necessity of outputting to the recovery device 102 is low."
[0281] In the above implementation method 4, Figure 15 The compression device 101 shown is configured to include a sampling unit 11, which calculates the difference between each of the plurality of matrix elements contained in the rotation matrix and each of the plurality of matrix elements contained in the identity matrix. If the sum of the calculated differences is greater than or equal to a second threshold, the b-th second left singular matrix calculated by the second singular matrix calculation unit 9 is output; if the sum of the differences is less than the second threshold, the b-th second left singular matrix is not output. Therefore, Figure 15 The compression device 101 shown is Figure 1 The compression device 101 shown also compresses the feature matrix by storing only a portion of it in memory; otherwise, it is similar to... Figure 1 , 9 Compared to the compression device 101 shown in Figure 10, it can improve the compression ratio of the feature matrix.
[0282] This disclosure allows for free combination of various embodiments, or arbitrary modification of the constituent elements of each embodiment, or omission of any constituent element in each embodiment.
[0283] Industrial practicality
[0284] This disclosure applies to compression apparatus, compression methods, compression programs, and systems.
[0285] Explanation of reference numerals in the attached figures
[0286] 1...Matrix acquisition unit; 2...Partial feature matrix storage unit; 3...First global matrix calculation unit; 4...Object matrix calculation unit; 5...Second global matrix calculation unit; 6...Global matrix storage unit; 7...First singular matrix calculation unit; 8, 9...Second singular matrix calculation unit; 10, 11...Sampling unit; 12...Storage unit; 21...Matrix acquisition circuit; 22...Partial feature matrix storage circuit; 23...First global matrix calculation circuit; 24...Object matrix calculation circuit; 25...Second global matrix calculation circuit; 26...Global matrix storage circuit; 27...First singular matrix calculation circuit; 28, 29...Second singular matrix calculation circuit; 30, 31...Sampling circuit; 41...Memory; 42...Processor; 101...Compression device; 102...Restore device; 103...Checking device.
Claims
1. A compression device, characterized in that, have: The matrix acquisition unit sequentially acquires the partial feature matrix for each of the multiple partial images into which the image has been segmented; The first global matrix calculation unit performs singular value decomposition on the first partial feature matrix obtained by the matrix acquisition unit, i.e., the first partial feature matrix, and calculates a first global singular value matrix containing the singular values of the first partial feature matrix as the first global singular value matrix, and a first global right singular matrix containing the right singular vectors corresponding to the singular values of the first partial feature matrix as the first global right singular matrix. The object matrix calculation unit calculates the matrix that becomes the object of the b-th singular value decomposition, i.e., the b-th partial feature matrix, which is obtained by the b-th matrix acquisition unit, the (b-1)-th global singular value matrix, and the (b-1)-th global right singular matrix, where b is an integer greater than or equal to 2. as well as The second global matrix calculation unit performs singular value decomposition on the b-th object matrix calculated by the object matrix calculation unit, calculates the singular value matrix of the b-th object matrix containing the singular values of the b-th object matrix as the b-th global singular value matrix, and calculates the right singular matrix of the b-th object matrix containing the right singular vectors corresponding to the singular values of the b-th object matrix as the b-th global right singular matrix.
2. The compression device according to claim 1, characterized in that, The system includes a first singular matrix calculation unit, which performs singular value decomposition on the b-th part feature matrix obtained by the matrix acquisition unit, and calculates a b-th first singular value matrix containing the singular values of the b-th part feature matrix, a b-th first left singular matrix containing the left singular vectors corresponding to the singular values of the b-th part feature matrix, and a b-th first right singular matrix containing the right singular vectors corresponding to the singular values of the b-th part feature matrix.
3. The compression device according to claim 2, characterized in that, The system includes a second singular matrix calculation unit, which calculates a second left singular matrix containing left singular vectors corresponding to the singular values of the b-th object matrix based on the b-th global singular value matrix calculated by the second global matrix calculation unit, the b-th global right singular matrix calculated by the second global matrix calculation unit, the b-th first singular value matrix calculated by the first singular matrix calculation unit, the b-th first left singular matrix calculated by the first singular matrix calculation unit, and the b-th first right singular matrix calculated by the first singular matrix calculation unit.
4. The compression device according to claim 3, characterized in that, It includes a storage unit that stores the b-th second left singular matrix calculated by the second singular matrix calculation unit, the b-th global singular value matrix calculated by the second global matrix calculation unit, and the b-th global right singular matrix calculated by the second global matrix calculation unit.
5. The compression device according to claim 2, characterized in that, The system includes a second singular matrix calculation unit, which obtains the b-th first left singular matrix calculated by the first singular matrix calculation unit and a b-th rotation matrix that rotates the b-th first left singular matrix, and calculates a b-th second left singular matrix containing a left singular vector corresponding to the singular value of the b-th object matrix based on the b-th rotation matrix and the b-th first left singular matrix.
6. The compression device according to claim 5, characterized in that, The second singular matrix calculation unit calculates the b-th rotation matrix based on the b-th global singular value matrix calculated by the second global matrix calculation unit, the b-th global right singular matrix calculated by the second global matrix calculation unit, the b-th first singular value matrix calculated by the first singular matrix calculation unit, and the b-th first right singular matrix calculated by the first singular matrix calculation unit.
7. The compression device according to claim 5, characterized in that, The sampler is equipped with a sampling unit. If the absolute value of the difference between the product of the b-th first left singular matrix and the b-th rotation matrix calculated by the first singular matrix calculation unit and the b-th second left singular matrix calculated by the second singular matrix calculation unit is greater than or equal to a first threshold, the sampling unit outputs the b-th second left singular matrix. If the absolute value of the difference is less than the first threshold, the sampling unit does not output the b-th second left singular matrix.
8. The compression device according to claim 5, characterized in that, The system includes a sampling unit that calculates the difference between each of the plurality of matrix elements contained in the rotation matrix and each of the plurality of matrix elements contained in the identity matrix. If the sum of the calculated differences is greater than or equal to a second threshold, the b-th second left singular matrix calculated by the second singular matrix calculation unit is output. If the sum of the differences is less than the second threshold, the b-th second left singular matrix is not output.
9. The compression device according to claim 1, characterized in that, The image is an inspection image containing the object to be inspected. The compression device is a device for compressing the image used for inspection.
10. A compression method, characterized in that, The matrix acquisition unit sequentially acquires the partial feature matrix for each of the multiple partial images into which the image has been segmented. The first global matrix calculation unit performs singular value decomposition on the first partial feature matrix obtained by the matrix acquisition unit, i.e., the first partial feature matrix, and calculates a first global singular value matrix containing the singular values of the first partial feature matrix as the first global singular value matrix, and a first global right singular matrix containing the right singular vectors corresponding to the singular values of the first partial feature matrix as the first global right singular matrix. The object matrix calculation unit calculates the matrix that becomes the object of the b-th singular value decomposition, i.e., the b-th partial characteristic matrix, which is obtained by the b-th matrix acquisition unit, the (b-1)-th global singular value matrix, and the (b-1)-th global right singular matrix, where b is an integer greater than or equal to 2. The second global matrix calculation unit performs singular value decomposition on the b-th object matrix calculated by the object matrix calculation unit, calculates the singular value matrix of the b-th object matrix containing the singular values of the b-th object matrix as the b-th global singular value matrix, and calculates the right singular matrix of the b-th object matrix containing the right singular vectors corresponding to the singular values of the b-th object matrix as the b-th global right singular matrix.
11. A compression program, characterized in that, The compression program is used to cause the computer to perform the following processing steps: The matrix acquisition unit sequentially acquires the partial feature matrix for each of the multiple partial images into which the image has been segmented; The first global matrix calculation unit performs singular value decomposition on the first partial feature matrix obtained by the matrix acquisition unit, i.e., the first partial feature matrix, and calculates a first global singular value matrix containing the singular values of the first partial feature matrix as the first global singular value matrix, and a first global right singular matrix containing the right singular vectors corresponding to the singular values of the first partial feature matrix as the first global right singular matrix. The object matrix calculation unit calculates the matrix that becomes the object of the b-th singular value decomposition, i.e., the b-th partial feature matrix, the (b-1)-th global singular value matrix, and the (b-1)-th global right singular matrix, which is obtained by the b-th matrix acquisition unit, and is also called the b-th object matrix, where b is an integer greater than 2. as well as The second global matrix calculation unit performs singular value decomposition on the b-th object matrix calculated by the object matrix calculation unit, calculates the singular value matrix of the b-th object matrix containing the singular values of the b-th object matrix as the b-th global singular value matrix, and calculates the right singular matrix of the b-th object matrix containing the right singular vectors corresponding to the singular values of the b-th object matrix as the b-th global right singular matrix.
12. A system, characterized in that, have: The compression device according to claim 3; and The restoration device restores the segmentation source image of the plurality of partial images based on the b-th second left singular matrix calculated by the second singular matrix calculation unit, the b-th global singular value matrix calculated by the second global matrix calculation unit, and the b-th global right singular matrix calculated by the second global matrix calculation unit.
13. The system according to claim 12, characterized in that, An inspection apparatus is provided that inspects objects contained in an image restored by the restoration device.
Citation Information
Patent Citations
Image processing device and imaging device provided with the same, image processing method and image processing program
JP2014010495A