CN112182260A - Similar picture searching method and device and computer readable storage medium - Google Patents

Similar picture searching method and device and computer readable storage medium Download PDF

Info

Publication number
CN112182260A
CN112182260A CN202011085037.0A CN202011085037A CN112182260A CN 112182260 A CN112182260 A CN 112182260A CN 202011085037 A CN202011085037 A CN 202011085037A CN 112182260 A CN112182260 A CN 112182260A
Authority
CN
China
Prior art keywords
picture
index
matrix
feature
similar
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011085037.0A
Other languages
Chinese (zh)
Inventor
徐国诚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202011085037.0A priority Critical patent/CN112182260A/en
Publication of CN112182260A publication Critical patent/CN112182260A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • G06F16/532Query formulation, e.g. graphical querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/55Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Software Systems (AREA)
  • Pure & Applied Mathematics (AREA)
  • Library & Information Science (AREA)
  • Computing Systems (AREA)
  • Algebra (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to artificial intelligence, and discloses a similar picture searching method, which comprises the following steps: indexing and marking each picture contained in the picture set to obtain an index picture set; performing feature extraction and matrixing processing on each index picture contained in the index picture set to obtain a target picture feature matrix; performing feature extraction and matrixing processing on the picture to be detected to obtain a feature matrix of the picture to be detected; performing matrix operation on the target picture characteristic matrix and the picture characteristic matrix to be detected to obtain a result matrix; and performing index association extraction in the index picture set according to the result matrix to obtain a similar picture set. The invention also relates to a blockchain technique, wherein the similar picture set can be stored in the blockchain. The invention also provides a similar picture searching device, electronic equipment and a computer readable storage medium. The method can improve the searching speed of the similar picture, and can be applied to automatic diagnosis of medical images.

Description

Similar picture searching method and device and computer readable storage medium
Technical Field
The invention relates to the field of artificial intelligence, in particular to a method and a device for searching similar pictures, electronic equipment and a computer readable storage medium.
Background
In the internet era, the application of image retrieval is more and more extensive, so that the inquiry of similar images is more and more emphasized by people, but the current similar image inquiry mode directly compares the similar images with the inquired images each time, so that the consumed computing resources are more, and the searching speed is slow.
Disclosure of Invention
The invention provides a similar picture searching method, a similar picture searching device, electronic equipment and a computer readable storage medium, and mainly aims to improve the speed of searching similar pictures.
In order to achieve the above object, the present invention provides a method for searching for similar pictures, comprising:
acquiring a picture set, and performing index marking on each picture contained in the picture set to obtain an index picture set;
performing feature extraction and matrixing processing on each index picture contained in the index picture set to obtain a target picture feature matrix;
when a picture to be detected is received, performing feature extraction and matrixing processing on the picture to be detected to obtain a feature matrix of the picture to be detected;
performing matrix operation on the target picture characteristic matrix and the picture characteristic matrix to be detected to obtain a result matrix;
and performing index association extraction in the index picture set according to the result matrix to obtain a similar picture set.
Optionally, the performing feature extraction and matrixing processing on each index picture included in the index picture set to obtain a target picture feature matrix includes:
extracting the features of each index picture by using a pre-constructed picture classification model to obtain an index picture feature vector set;
and performing matrix construction by using the index picture feature vector set to obtain the target picture feature matrix.
Optionally, the performing feature extraction on each index picture by using a pre-constructed picture classification model to obtain an index picture feature vector set includes:
acquiring the output of all nodes of a full connection layer contained in the image classification model to obtain an index image characteristic value set;
according to the sequence of all nodes of the full connection layer, longitudinally combining the characteristic values in the index picture characteristic value set to obtain an index picture characteristic vector;
and summarizing all the index picture feature vectors to obtain the index picture feature vector set.
Optionally, the matrix construction by using the index picture feature vector set to obtain the target picture feature matrix includes:
transversely combining all index picture characteristic vectors in the index picture characteristic vector set to obtain an initial picture characteristic matrix;
and marking the initial picture characteristic matrix to obtain the target picture characteristic matrix.
Optionally, the performing index association extraction in the index picture set according to the result matrix to obtain a similar picture set includes:
summing all numerical values contained in each row of the result matrix after taking absolute values to obtain an initial result matrix;
sequencing all columns contained in the initial result matrix according to the value of each column contained in the initial result matrix to obtain a standard result matrix;
selecting columns in the standard result matrix, which are positioned at a preset ranking digit, to obtain a target result matrix;
selecting digital codes of index vectors corresponding to the target picture characteristic matrix according to the target result matrix to obtain a digital code set;
and selecting the corresponding index picture in the index picture set according to the digital coding set to obtain the similar picture set.
Optionally, the indexing and marking each picture included in the picture set to obtain an index picture set includes:
indexing and marking each picture contained in the picture set by using digital codes with preset digits to obtain an index picture;
and summarizing all the index pictures to obtain the index picture set.
Optionally, the marking the initial picture feature matrix to obtain the target picture feature matrix includes:
and correspondingly marking each column of the initial picture characteristic matrix according to the digital coding of the index picture corresponding to the index picture characteristic vector to obtain the target picture characteristic matrix.
In order to solve the above problem, the present invention further provides a similar picture searching apparatus, including:
the image matrixing module is used for acquiring an image set, and indexing and marking each image contained in the image set to obtain an index image set; performing feature extraction and matrixing processing on each index picture contained in the index picture set to obtain a target picture feature matrix; when a picture to be detected is received, performing feature extraction and matrixing processing on the picture to be detected to obtain a feature matrix of the picture to be detected;
the matrix operation module is used for performing matrix operation on the target picture characteristic matrix and the picture characteristic matrix to be detected to obtain a result matrix;
and the association extraction module is used for performing index association extraction on the index picture set according to the result matrix to obtain a similar picture set.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the similar picture searching method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, where at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is executed by a processor in an electronic device to implement the similar picture searching method described above.
In the embodiment of the invention, each picture contained in the picture set is indexed and marked, so that the subsequent index search of the pictures is facilitated; each index picture contained in the index picture set is subjected to feature extraction and matrixing processing to obtain a target picture feature matrix, and the pictures are matrixed without acquiring the pictures in real time for searching similar pictures, so that the consumption of computing resources is reduced; the image to be detected is subjected to feature extraction and matrixing processing to obtain an image feature matrix to be detected, matrix operation is carried out on the target image feature matrix and the image feature matrix to be detected to obtain a result matrix, and image comparison and search are carried out through the matrix operation, so that the calculation speed of the image comparison and search is improved; and performing index association extraction on the index picture set according to the result matrix to obtain a similar picture set, and performing index extraction on the similar picture through the result matrix to further improve the searching speed of the similar picture.
Drawings
Fig. 1 is a schematic flowchart of a similar picture searching method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart illustrating a process of obtaining S2 in the similar picture searching method according to an embodiment of the present invention;
fig. 3 is a schematic flow chart illustrating a process of obtaining an index picture feature vector set in a similar picture searching method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a process of obtaining a target picture feature matrix in a similar picture searching method according to an embodiment of the present invention;
fig. 5 is a schematic flowchart illustrating a process of obtaining a similar picture set in a similar picture searching method according to an embodiment of the present invention;
fig. 6 is a schematic block diagram of a similar picture searching apparatus according to an embodiment of the present invention;
fig. 7 is a schematic diagram of an internal structure of an electronic device implementing a similar picture searching method according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a similar picture searching method. Fig. 1 is a schematic flow chart of a similar picture searching method according to an embodiment of the present invention. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the similar picture searching method includes:
s1, acquiring a picture set, and performing index marking on each picture contained in the picture set to obtain an index picture set;
in the embodiment of the invention, the picture set is a set of a plurality of pictures in a uniform format, and the picture set can be acquired through a picture uploading module of a webpage.
Further, in order to distinguish the pictures in the picture set, the embodiments of the present invention perform index marking on each picture included in the picture set by using a digital code with a preset number of bits to obtain an index picture, and summarize all the index pictures to obtain the index picture set, where the digital code is equivalent to a picture ID, the digital code corresponds to the index picture one to one, and each index picture has a unique digital code, for example: the total number of 10 pictures in the picture set is 10, and 10 pictures are respectively marked by two-digit codes 01, 02, 03, 04, 05, 06, 07, 08, 09 and 10, so that an index picture set containing 10 pictures with corresponding digit codes is obtained.
In the embodiment of the invention, each picture contained in the picture set is indexed and marked, so that the subsequent index search of the pictures is facilitated.
S2, performing feature extraction and matrixing processing on each index picture contained in the index picture set to obtain a target picture feature matrix;
in detail, referring to fig. 2, in the embodiment of the present invention, the performing the feature extraction and the matrixing on each index picture included in the index picture set includes:
s21, extracting the features of each index picture by using a pre-constructed picture classification model to obtain an index picture feature vector set;
preferably, in the embodiment of the present invention, the pre-constructed picture classification model is a VGG16 model.
In detail, referring to fig. 3, in the embodiment of the present invention, the performing feature extraction on each index picture by using a pre-constructed picture classification model to obtain an index picture feature vector set includes:
s211, obtaining the output of all nodes of a full connection layer contained in the picture classification model to obtain a feature value set of each index picture;
for example: the total connection layer of the image classification model comprises 1000 nodes, the index image T is input into the image classification model, 1000 node output values are obtained, and an index image characteristic value set of the index image T is obtained, wherein the output of each node is one characteristic value of the index image T, so that the index image characteristic value set of the index image T has 1000 characteristic values.
S212, longitudinally combining the characteristic values in the index picture characteristic value set according to the sequence of all the nodes of the full connection layer to obtain an index picture characteristic vector;
for example: the full connection layer is provided with 3 nodes which are respectively a first node, a second node and a third node in sequence, the index picture characteristic value set of the index picture A is provided with 3 characteristic values which are 3,5 and 1, wherein the characteristic value 1 is output of the first node, the characteristic value 3 is output of the second node, the characteristic value 5 is output of the third node, and the three characteristic values in the index picture characteristic value set of the index picture A are longitudinally combined in the node sequence to obtain the index picture characteristic vector of the index picture A
Figure BDA0002720089360000051
And S213, summarizing all the index picture feature vectors to obtain the index picture feature vector set.
In the embodiment of the present invention, through the above steps, each index picture in the index picture set has a corresponding index picture feature vector, and all the index picture feature vectors are summarized to obtain the index picture feature vector set.
And S22, constructing a matrix by using the index picture feature vector set to obtain the target picture feature matrix.
In detail, referring to fig. 4, in the embodiment of the present invention, the matrix construction by using the index picture feature vector set includes:
s221, transversely combining all index picture characteristic vectors in the index picture characteristic vector set to obtain an initial picture characteristic matrix;
for example: the index picture feature vector set has 3 index picture feature vectors X, Y, Z in total, and the index picture feature vector X is
Figure BDA0002720089360000061
Index Picture feature vector Y of
Figure BDA0002720089360000062
Index Picture feature vector Z of
Figure BDA0002720089360000063
Each index picture feature vector is a 3 x 1 column vector, and all index picture feature vectors are transversely combined to obtain a 3 x 3 initial picture feature matrix
Figure BDA0002720089360000064
S222, marking the initial picture feature matrix to obtain the target picture feature matrix.
The inventionIn the application, each column in the initial picture characteristic matrix is the index picture characteristic vector, and each column of the initial picture characteristic matrix is correspondingly marked according to the digital coding of the index picture corresponding to the index picture characteristic vector to obtain a target picture characteristic matrix. For example: the index picture set has 3 pictures O, P, Q, the numerical codes of the index pictures corresponding to the index picture O, P, Q are 001, 002 and 003, respectively, and the index picture feature vector corresponding to the index picture O is
Figure BDA0002720089360000065
The index picture P corresponds to an index picture feature vector of
Figure BDA0002720089360000066
The index picture Q corresponds to an index picture feature vector of
Figure BDA0002720089360000067
Initial picture feature matrix
Figure BDA0002720089360000068
And marking the first column of the initial picture feature matrix 001, the second column of the initial picture feature matrix 002 and the third column of the initial picture feature matrix 003 to obtain the target picture feature matrix.
In the embodiment of the invention, the images in the index image set are matrixed through the steps, so that the images do not need to be acquired in real time for searching similar images, and the consumption of computing resources is reduced.
Furthermore, in the embodiment of the present invention, the mark of each column in the subsequent target picture feature matrix is fixed and is not affected by the correlation calculation.
S3, when receiving the picture to be detected, performing feature extraction and matrixing processing on the picture to be detected to obtain a feature matrix of the picture to be detected;
in the embodiment of the invention, the pictures to be detected are pictures with the same format as the pictures in the picture set.
Further, in the embodiment of the present invention, the performing feature extraction and matrix processing on the picture to be detected includes: performing feature extraction on the picture to be detected by using the picture classification model, and acquiring the output of all nodes of a full connection layer contained in the picture classification model to obtain a feature value set of the picture to be detected; and longitudinally combining the characteristic values of the pictures to be detected corresponding to the characteristic values of the pictures to be detected in the set according to the sequence of all nodes of the full connection layer contained in the picture classification model to obtain a picture vector to be detected, and performing matrix conversion processing on the picture vector to be detected to obtain a picture characteristic matrix to be detected.
In detail, the matrix conversion processing of the picture vector to be detected in the embodiment of the present invention includes: performing matrix representation on the picture vector to be detected to obtain a picture characteristic matrix to be detected, for example: and the picture vector to be detected is a column vector of 1 x 1000, and the picture vector to be detected is subjected to matrix representation to obtain a picture feature matrix to be detected of 1 x 1000.
S4, performing matrix operation on the target picture characteristic matrix and the picture characteristic matrix to be detected to obtain a result matrix;
in the embodiment of the present invention, in order to find a picture in the picture set that is most similar to the picture to be detected, performing matrix operation on the target picture feature matrix and the picture feature matrix to be detected includes: and subtracting the characteristic matrix of the picture to be detected from each column of the characteristic matrix of the target picture in sequence to obtain a result matrix.
According to the embodiment of the invention, the image comparison and search are carried out through the matrix operation, so that the calculation speed of the image comparison and search is improved.
And S5, performing index association extraction in the index picture set according to the result matrix to obtain a similar picture set.
In the embodiment of the present invention, referring to fig. 5, the performing index association extraction on the index set according to the result matrix includes:
s51, taking absolute values of all numerical values contained in each row of the result matrix, and then summing to obtain an initial result matrix;
for example: the result matrix is a 2 x 2 matrix, the first column is-2 and 1, the second column is 0 and-4, the absolute values of all the values in the first column are summed, i.e. 2+1 is 3, the absolute values of all the values in the second column are summed, i.e. 0+4 is 4, and the initial result matrix becomes a 1 x 2 matrix, the first column is 3, and the second column is 4.
S52, sorting all columns contained in the initial result matrix according to the value of each column contained in the initial result matrix to obtain a standard result matrix.
In this embodiment of the present invention, after the processing of S51, the initial result matrix is a row matrix, so each column of the initial result matrix has only one value, and all columns included in the initial result matrix are sorted according to the value of each column included in the initial result matrix to obtain a standard result matrix.
S53, selecting a column with a preset ranking digit in the standard result matrix to obtain a target result matrix, and selecting a digital code corresponding to the index vector corresponding to the target picture set feature matrix according to the target result matrix to obtain a digital code set;
for example: the smaller the column number value in the standard result matrix represents that the similarity between the picture to be detected and the index picture corresponding to the column is higher, the column with the top rank of 10 in the standard result matrix is selected to obtain a target result matrix, and according to the index vector corresponding to the target picture set corresponding to each column in the target result matrix, the index vectors in the target picture characteristic matrix are marked by digital codes, so that the digital codes corresponding to the index vectors corresponding to the target picture characteristic matrix are selected to obtain a digital code set;
and S54, selecting the corresponding index picture in the index picture set according to the digital coding set to obtain the similar picture set.
In the embodiment of the present invention, each index picture in the index picture set has a corresponding digital code, and therefore, the corresponding index picture in the index picture set is selected according to the digital code set to obtain the similar picture set.
In another embodiment of the present invention, in order to ensure the privacy of the picture search, the similar picture set may be stored in a blockchain.
In the embodiment of the invention, the similar pictures are indexed and extracted through the result matrix, so that the searching speed of the similar pictures is further improved.
Fig. 6 is a functional block diagram of the similar picture searching apparatus according to the present invention.
The similar picture searching apparatus 100 according to the present invention may be installed in an electronic device. According to the implemented functions, the similar picture searching device may include a picture matrixing module 101, a matrix operation module 102, and an association extraction module 103. A module according to the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the picture matrixing module 101 is configured to obtain a picture set, and index and mark each picture included in the picture set to obtain an index picture set; performing feature extraction and matrixing processing on each index picture contained in the index picture set to obtain a target picture feature matrix; when a picture to be detected is received, feature extraction and matrixing processing are carried out on the picture to be detected, and a picture feature matrix to be detected is obtained.
In the embodiment of the invention, the picture set is a set of a plurality of pictures in a uniform format, and the picture set can be acquired through a picture uploading module of a webpage.
Further, in order to distinguish the pictures in the picture set, in the embodiment of the present invention, the picture matrixing module 101 performs index marking on each picture included in the picture set by using a digital code with a preset bit number to obtain an index picture, and summarizes all the index pictures to obtain the index picture set, where the digital code is equivalent to a picture ID, the digital code corresponds to the index picture one to one, and each index picture has a unique digital code, for example: the total number of 10 pictures in the picture set is 10, and 10 pictures are respectively marked by two-digit codes 01, 02, 03, 04, 05, 06, 07, 08, 09 and 10, so that an index picture set containing 10 pictures with corresponding digit codes is obtained.
In the embodiment of the invention, each picture contained in the picture set is indexed and marked, so that the subsequent index search of the pictures is facilitated.
In detail, in the embodiment of the present invention, the image matrixing module 101 performs feature extraction and matrixing on each index image included in the index image set by using the following means, including:
extracting the features of each index picture by using a pre-constructed picture classification model to obtain an index picture feature vector set;
preferably, in the embodiment of the present invention, the pre-constructed picture classification model is a VGG16 model.
In detail, in the embodiment of the present invention, the image matrixing module 101 performs feature extraction on each index image by using the following means to obtain an index image feature vector set, including:
acquiring the output of all nodes of a full connection layer contained in the picture classification model to obtain a characteristic value set of each index picture;
for example: the total connection layer of the image classification model comprises 1000 nodes, the index image T is input into the image classification model, 1000 node output values are obtained, and an index image characteristic value set of the index image T is obtained, wherein the output of each node is one characteristic value of the index image T, so that the index image characteristic value set of the index image T has 1000 characteristic values.
And longitudinally combining the characteristic values in the index picture characteristic value set according to the sequence of all the nodes of the full connection layer to obtain an index picture characteristic vector.
For example: the total connection layer has 3 nodes which are divided in sequenceThe index image feature values of the index image A are respectively a first node, a second node and a third node, 3 feature values in the index image feature value set of the index image A are 3,5 and 1, wherein the feature value 1 is the output of the first node, the feature value 3 is the output of the second node, the feature value 5 is the output of the third node, and the three feature values in the index image feature value set of the index image A are longitudinally combined according to the order of the nodes to obtain the index image feature vector of the index image A
Figure BDA0002720089360000101
And summarizing all the index picture feature vectors to obtain the index picture feature vector set.
In the embodiment of the present invention, through the above steps, each index picture in the index picture set has a corresponding index picture feature vector, and all the index picture feature vectors are summarized to obtain the index picture feature vector set.
And performing matrix construction by using the index picture feature vector set to obtain the target picture feature matrix.
In detail, in the embodiment of the present invention, the image matrixing module 101 performs matrix construction by using the index image feature vector set through the following means, including:
transversely combining all index picture characteristic vectors in the index picture characteristic vector set to obtain an initial picture characteristic matrix;
for example: the index picture feature vector set has 3 index picture feature vectors X, Y, Z in total, and the index picture feature vector X is
Figure BDA0002720089360000111
Index Picture feature vector Y of
Figure BDA0002720089360000112
Index Picture feature vector Z of
Figure BDA0002720089360000113
Each index picture feature vector is a column vector of 3 x 1, and all indexes are addedGuiding the picture feature vectors to be transversely combined to obtain an initial picture feature matrix of 3 x 3
Figure BDA0002720089360000114
Marking the initial picture feature matrix to obtain the target picture feature matrix;
in the implementation of the present invention, each column in the initial picture feature matrix is the index picture feature vector, and each column of the initial picture feature matrix is correspondingly marked according to the digital coding of the index picture corresponding to the index picture feature vector, so as to obtain a target picture feature matrix. For example: the index picture set has 3 pictures O, P, Q, the numerical codes of the index pictures corresponding to the index picture O, P, Q are 001, 002 and 003, respectively, and the index picture feature vector corresponding to the index picture O is
Figure BDA0002720089360000115
The index picture P corresponds to an index picture feature vector of
Figure BDA0002720089360000116
The index picture Q corresponds to an index picture feature vector of
Figure BDA0002720089360000117
Initial picture feature matrix
Figure BDA0002720089360000118
And marking the first column of the initial picture feature matrix 001, the second column of the initial picture feature matrix 002 and the third column of the initial picture feature matrix 003 to obtain the target picture feature matrix.
In the embodiment of the invention, the images in the index image set are matrixed through the steps, so that the images do not need to be acquired in real time for searching similar images, and the consumption of computing resources is reduced.
Furthermore, in the embodiment of the present invention, the mark of each column in the subsequent target picture feature matrix is fixed and is not affected by the correlation calculation.
In the embodiment of the invention, the pictures to be detected are pictures with the same format as the pictures in the picture set.
Further, in the embodiment of the present invention, the image matrixing module 101 performs feature extraction and matrix processing on the image to be detected by using the following means, including: performing feature extraction on the picture to be detected by using the picture classification model, and acquiring the output of all nodes of a full connection layer contained in the picture classification model to obtain a feature value set of the picture to be detected; and longitudinally combining the characteristic values of the pictures to be detected corresponding to the characteristic values of the pictures to be detected in the set according to the sequence of all nodes of the full connection layer contained in the picture classification model to obtain a picture vector to be detected, and performing matrix conversion processing on the picture vector to be detected to obtain a picture characteristic matrix to be detected.
In detail, the image matrixing module 101 in the embodiment of the present invention performs matrix transformation on the image vector to be detected, including: performing matrix representation on the picture vector to be detected to obtain a picture characteristic matrix to be detected, for example: and the picture vector to be detected is a column vector of 1 x 1000, and the picture vector to be detected is subjected to matrix representation to obtain a picture feature matrix to be detected of 1 x 1000.
The matrix operation module 102 is configured to perform matrix operation on the target picture feature matrix and the to-be-detected picture feature matrix to obtain a result matrix.
In the embodiment of the present invention, in order to find a picture in the picture set that is most similar to the picture to be detected, the matrix operation module 102 performs matrix operation on the target picture feature matrix and the picture feature matrix to be detected, including: and subtracting the characteristic matrix of the picture to be detected from each column of the characteristic matrix of the target picture in sequence to obtain a result matrix.
According to the embodiment of the invention, the image comparison and search are carried out through the matrix operation, so that the calculation speed of the image comparison and search is improved.
The association extraction module 103 is configured to perform index association extraction in the index picture set according to the result matrix to obtain a similar picture set.
In this embodiment of the present invention, the association extraction module 103 performs index association extraction on the index picture set according to the result matrix by using the following means, including:
summing all numerical values contained in each row of the result matrix after taking absolute values to obtain an initial result matrix;
for example: the result matrix is a 2 x 2 matrix, the first column is-2 and 1, the second column is 0 and-4, the absolute values of all the numerical values in the first column are summed, namely 2+1 is 3, the absolute values of all the numerical values in the second column are summed, namely 0+4 is 4, the initial result matrix is a 1 x 2 matrix, the first column is 3, and the second column is 4.
And sequencing all the columns contained in the initial result matrix according to the value of each column contained in the initial result matrix to obtain a standard result matrix.
In the embodiment of the present invention, after the processing in the above steps, the initial result matrix is a row matrix, so that each column of the initial result matrix has only one numerical value, and all columns included in the initial result matrix are sorted according to the value of each column included in the initial result matrix to obtain a standard result matrix.
Selecting columns in the standard result matrix at a preset ranking digit to obtain a target result matrix, and selecting digital codes corresponding to index vectors corresponding to the target picture set feature matrix according to the target result matrix to obtain a digital code set;
for example: the smaller the column number value in the standard result matrix represents that the similarity between the picture to be detected and the index picture corresponding to the column is higher, the column with the top rank of 10 in the standard result matrix is selected to obtain a target result matrix, and according to the index vector corresponding to the target picture set corresponding to each column in the target result matrix, the index vectors in the target picture characteristic matrix are all marked by digital codes, so that the digital codes corresponding to the index vectors corresponding to the target picture characteristic matrix are selected to obtain a digital code set;
and selecting the corresponding index picture in the index picture set according to the digital coding set to obtain the similar picture set.
In the embodiment of the present invention, each index picture in the index picture set has a corresponding digital code, and therefore, the corresponding index picture in the index picture set is selected according to the digital code set to obtain the similar picture set.
In another embodiment of the present invention, in order to ensure the privacy of the picture search, the similar picture set may be stored in a blockchain.
In the embodiment of the invention, the similar pictures are indexed and extracted through the result matrix, so that the searching speed of the similar pictures is further improved, and when the method is used in the technical field of medical science and technology, the searching speed of the similar case pictures can be effectively improved, and the development states of the previous and the next illness states can be judged.
Fig. 7 is a schematic structural diagram of an electronic device implementing a similar picture searching method according to the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a similar picture search program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of a similar picture search program, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (such as a similar picture search program) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 7 only shows an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The similar picture searching program 12 stored in the memory 11 of the electronic device 1 is a combination of instructions, and when running in the processor 10, can realize:
acquiring a picture set, and performing index marking on each picture contained in the picture set to obtain an index picture set;
performing feature extraction and matrixing processing on each index picture contained in the index picture set to obtain a target picture feature matrix;
when a picture to be detected is received, performing feature extraction and matrixing processing on the picture to be detected to obtain a feature matrix of the picture to be detected;
performing matrix operation on the target picture characteristic matrix and the picture characteristic matrix to be detected to obtain a result matrix;
and performing index association extraction in the index picture set according to the result matrix to obtain a similar picture set.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiment corresponding to fig. 1, which is not described herein again.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method for searching for similar pictures, the method comprising:
acquiring a picture set, and performing index marking on each picture contained in the picture set to obtain an index picture set;
performing feature extraction and matrixing processing on each index picture contained in the index picture set to obtain a target picture feature matrix;
when a picture to be detected is received, performing feature extraction and matrixing processing on the picture to be detected to obtain a feature matrix of the picture to be detected;
performing matrix operation on the target picture characteristic matrix and the picture characteristic matrix to be detected to obtain a result matrix;
and performing index association extraction in the index picture set according to the result matrix to obtain a similar picture set.
2. The method for searching for similar pictures according to claim 1, wherein the performing feature extraction and matrixing on each index picture included in the index picture set to obtain a target picture feature matrix comprises:
extracting the features of each index picture by using a pre-constructed picture classification model to obtain an index picture feature vector set;
and performing matrix construction by using the index picture feature vector set to obtain the target picture feature matrix.
3. The method for searching for similar pictures according to claim 2, wherein said extracting features of each of the index pictures by using the pre-constructed picture classification model to obtain an index picture feature vector set comprises:
acquiring the output of all nodes of a full connection layer contained in the image classification model to obtain an index image characteristic value set;
according to the sequence of all nodes of the full connection layer, longitudinally combining the characteristic values in the index picture characteristic value set to obtain an index picture characteristic vector;
and summarizing all the index picture feature vectors to obtain the index picture feature vector set.
4. The method for searching for similar pictures according to claim 2, wherein the matrix construction by using the index picture feature vector set to obtain the target picture feature matrix comprises:
transversely combining all index picture characteristic vectors in the index picture characteristic vector set to obtain an initial picture characteristic matrix;
and marking the initial picture characteristic matrix to obtain the target picture characteristic matrix.
5. The method for searching for similar pictures according to claim 1, wherein the performing index association extraction in the index picture set according to the result matrix to obtain a similar picture set comprises:
summing all numerical values contained in each row of the result matrix after taking absolute values to obtain an initial result matrix;
sequencing all columns contained in the initial result matrix according to the value of each column contained in the initial result matrix to obtain a standard result matrix;
selecting columns in the standard result matrix, which are positioned at a preset ranking digit, to obtain a target result matrix;
selecting digital codes of index vectors corresponding to the target picture characteristic matrix according to the target result matrix to obtain a digital code set;
and selecting the corresponding index picture in the index picture set according to the digital coding set to obtain the similar picture set.
6. The method for searching for similar pictures according to claim 1, wherein said indexing each picture included in the picture set to obtain an indexed picture set comprises:
indexing and marking each picture contained in the picture set by using digital codes with preset digits to obtain an index picture;
and summarizing all the index pictures to obtain the index picture set.
7. The method as claimed in claim 4, wherein said marking the initial picture feature matrix to obtain the target picture feature matrix comprises:
and correspondingly marking each column of the initial picture characteristic matrix according to the digital coding of the index picture corresponding to the index picture characteristic vector to obtain the target picture characteristic matrix.
8. A similar picture searching apparatus, comprising:
the image matrixing module is used for acquiring an image set, and indexing and marking each image contained in the image set to obtain an index image set; performing feature extraction and matrixing processing on each index picture contained in the index picture set to obtain a target picture feature matrix; when a picture to be detected is received, performing feature extraction and matrixing processing on the picture to be detected to obtain a feature matrix of the picture to be detected;
the matrix operation module is used for performing matrix operation on the target picture characteristic matrix and the picture characteristic matrix to be detected to obtain a result matrix;
and the association extraction module is used for performing index association extraction on the index picture set according to the result matrix to obtain a similar picture set.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a similar picture finding method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the similar picture searching method according to any one of claims 1 to 7.
CN202011085037.0A 2020-10-12 2020-10-12 Similar picture searching method and device and computer readable storage medium Pending CN112182260A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011085037.0A CN112182260A (en) 2020-10-12 2020-10-12 Similar picture searching method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011085037.0A CN112182260A (en) 2020-10-12 2020-10-12 Similar picture searching method and device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN112182260A true CN112182260A (en) 2021-01-05

Family

ID=73949268

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011085037.0A Pending CN112182260A (en) 2020-10-12 2020-10-12 Similar picture searching method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112182260A (en)

Similar Documents

Publication Publication Date Title
CN111932562B (en) Image identification method and device based on CT sequence, electronic equipment and medium
CN112231586A (en) Course recommendation method, device, equipment and medium based on transfer learning
CN112396005A (en) Biological characteristic image recognition method and device, electronic equipment and readable storage medium
CN112050820A (en) Road matching method and device, electronic equipment and readable storage medium
CN114491047A (en) Multi-label text classification method and device, electronic equipment and storage medium
CN113298159A (en) Target detection method and device, electronic equipment and storage medium
CN113868529A (en) Knowledge recommendation method and device, electronic equipment and readable storage medium
CN113886708A (en) Product recommendation method, device, equipment and storage medium based on user information
CN114781832A (en) Course recommendation method and device, electronic equipment and storage medium
CN111930897B (en) Patent retrieval method, device, electronic equipment and computer-readable storage medium
CN114708461A (en) Multi-modal learning model-based classification method, device, equipment and storage medium
CN114913371A (en) Multitask learning model training method and device, electronic equipment and storage medium
CN113505273B (en) Data sorting method, device, equipment and medium based on repeated data screening
CN112464619B (en) Big data processing method, device and equipment and computer readable storage medium
CN113656690A (en) Product recommendation method and device, electronic equipment and readable storage medium
CN113157739A (en) Cross-modal retrieval method and device, electronic equipment and storage medium
CN113157864A (en) Key information extraction method and device, electronic equipment and medium
CN112632264A (en) Intelligent question and answer method and device, electronic equipment and storage medium
CN111538768A (en) Data query method and device based on N-element model, electronic equipment and medium
CN111651625A (en) Image retrieval method, image retrieval device, electronic equipment and storage medium
CN115238179A (en) Project pushing method and device, electronic equipment and computer readable storage medium
CN112182260A (en) Similar picture searching method and device and computer readable storage medium
CN113343102A (en) Data recommendation method and device based on feature screening, electronic equipment and medium
CN112631589A (en) Application program home page layout configuration method and device, electronic equipment and storage medium
CN112215336A (en) Data labeling method, device, equipment and storage medium based on user behavior

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination