CN116069969A - Image retrieval method, device and storage medium - Google Patents

Image retrieval method, device and storage medium Download PDF

Info

Publication number
CN116069969A
CN116069969A CN202310078116.6A CN202310078116A CN116069969A CN 116069969 A CN116069969 A CN 116069969A CN 202310078116 A CN202310078116 A CN 202310078116A CN 116069969 A CN116069969 A CN 116069969A
Authority
CN
China
Prior art keywords
image
index
sample image
sample
features
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
CN202310078116.6A
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.)
Zhongshan Xunhua Software Co ltd
Original Assignee
Zhongshan Xunhua Software Co ltd
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 Zhongshan Xunhua Software Co ltd filed Critical Zhongshan Xunhua Software Co ltd
Priority to CN202310078116.6A priority Critical patent/CN116069969A/en
Publication of CN116069969A publication Critical patent/CN116069969A/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/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
    • G06F16/5838Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using colour
    • 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/535Filtering based on additional data, e.g. user or group profiles
    • 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
    • G06F16/5854Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using shape and object relationship
    • 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
    • G06F16/5862Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/42Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation
    • G06V10/422Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation for representing the structure of the pattern or shape of an object therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/54Extraction of image or video features relating to texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/07Target detection
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Image Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to an image retrieval method, an image retrieval device and a storage medium, comprising the following steps: according to a sample image of a user, marking the outline and the category of the image, training the marked image based on a yolac++ instance segmentation model and a yolov5s target detection model, generating a sample image training model, establishing a sample image feature index database according to the sample image training model, extracting feature information of an image to be searched, matching in the sample image feature index database, generating a search result, enabling a picture to only keep object pixels, removing background interference, and enabling vector features extracted from color features to be truly reflected to a target object by using a traditional shape, texture and the fact that the background interference does not exist in the segmented picture.

Description

Image retrieval method, device and storage medium
[ field of technology ]
The present disclosure relates to the field of communications technologies, and in particular, to an image retrieval method, an image retrieval device, and a storage medium.
[ background Art ]
The image retrieval is to retrieve the images meeting the conditions from the image retrieval database, and the image retrieval technology can be divided into two types according to different ways of describing the image content: the first is a text-based image retrieval technology, abbreviated as TBIR; the second category is content-based image retrieval technology, CBIR for short.
TBIR techniques are the use of text description to retrieve pictures; the CBIR technology is to search pictures by using the color, texture and object, category and other information contained in the pictures, and it is divided into searching different pictures of the same object and searching pictures of the same category. The CBIR-based image retrieval technique mainly comprises several steps: inputting pictures, extracting features, learning measures and reordering.
The image feature indexing and searching method based on the traditional image feature extraction mode generally carries out the image feature indexing and searching through some global feature or local feature extraction algorithms and based on the traditional image feature extraction mode, and has the advantages of high feature extraction speed, small feature vector dimension and high matching speed, but has the disadvantage of low precision, because one image is often required to be searched for one or more objects in the image, namely a target detection object or an image main body, but the shot image has background interference, and the traditional image feature extraction method is severely affected by the background interference and extremely influences the matching precision.
The image retrieval method based on the deep learning target detection comprises the steps of firstly detecting an image to be retrieved through an artificial intelligence method of a target detection model (such as a yolov5 target detection network model), determining a target object to be searched, comparing the similarity between image features extracted by the target detection model and features of a picture library to be retrieved, reordering according to the ranking of the similarity, and finally displaying the image features to a user. The object detection model firstly determines the object to be searched on the image, so that background interference is reduced, the accuracy is higher than that of the traditional method, but the background interference cannot be completely removed, in addition, the image features extracted by the object detection model are focused on the shape and texture of the object, and the defect that the color attribute of the object cannot be well distinguished exists.
[ invention ]
In order to better search the image and solve the problem of poor search precision caused by background interference in the search process, the invention trains the image based on a yolac++ instance segmentation model and a yolov5s target detection model by marking the outline and the category of the image, and matches the extracted information of the image to be searched according to the established index, thereby generating a search result and achieving higher matching precision.
The application proposes the following scheme:
an image retrieval method comprising:
marking the outline and the category of the image according to the sample image of the user;
training the marked image based on a yolac++ example segmentation model and a yolov5s target detection model to generate a sample image training model;
according to the sample image training model, a sample image feature index database is established;
extracting feature information of an image to be searched, and matching the feature information in the sample image feature index database to generate a search result.
The image retrieval method as described above, the step of marking the outline and the category of the image according to the sample image of the user, includes:
acquiring a sample image of a user;
determining the object category in the sample image according to the sample image;
the contours of the items in the sample image are marked according to the category of the items.
The image retrieval method, based on the yolac++ instance segmentation model and the yolov5s target detection model, trains the marked image and generates a sample image training model, comprising the following steps:
generating an instance segmentation model M1 based on the yolact++ instance segmentation model and the marked image;
based on the yolov5s object detection model and the marked image, an object detection model M2 is generated.
The image retrieval method as described above, the step of creating a sample image feature index database according to a sample image training model, includes:
according to the example segmentation model, segmenting elements in the index image to be built to obtain a first image containing the elements;
determining category information of elements in the first image according to the target detection model;
preprocessing the first image to obtain a second image, wherein the second image comprises elements and an edge background;
performing binarization processing on the second image to obtain a third image, wherein elements of the third image protrude out of the edge background;
acquiring color features in an index image to be built according to the second image;
acquiring texture features in an index image to be built according to the second image;
acquiring outline features in an index image to be built according to the third image;
and aggregating the color features, texture features, contour features and category information into the sample image index database.
The image retrieval method includes the steps of extracting feature information of an image to be retrieved, matching the feature information in the sample image feature index database, and generating a retrieval result, wherein the step includes:
extracting feature information of an image to be retrieved, wherein the feature information comprises the color features, texture features, contour features and category information;
matching the category information of the image to be searched with the corresponding category information of the sample image index database, and determining a first index sub-database;
and further screening the first index sub-library according to the outline features, the texture features and the color features of the image to be searched, and determining a second index sub-library.
An image retrieval apparatus comprising:
the marking module is used for marking the outline and the category of the image according to the sample image of the user;
the first generation module is used for training the marked image based on the yolac++ instance segmentation model and the yolov5s target detection model to generate a sample image training model;
the establishing module is used for establishing a sample image characteristic index database according to the sample image training model;
and the second generation module is used for extracting the characteristic information of the image to be searched, and matching the characteristic information in the sample image characteristic index database to generate a search result.
The image retrieval apparatus as described above, the marking module includes:
a first acquisition unit configured to acquire a sample image of a user;
a first determining unit, configured to determine an item category in a sample image according to the sample image;
a marking unit for marking the outline of the article in the sample image according to the article category;
the first generation module includes:
the first generation unit is used for generating an instance segmentation model M1 based on the yolact++ instance segmentation model and the marked image;
a second generation unit for generating a target detection model M2 based on the yolov5s target detection model and the marked image;
the establishing module comprises:
the segmentation unit is used for segmenting elements in the index image to be built according to the example segmentation model to obtain a first image containing the elements;
a second determining unit configured to determine category information of the element in the first image according to the target detection model;
the preprocessing unit is used for preprocessing the first image to obtain a second image, wherein the second image comprises elements and an edge background;
the binarization unit is used for carrying out binarization processing on the second image to obtain a third image, and the elements of the third image protrude out of the edge background;
the second acquisition unit is used for acquiring color features in the index image to be built according to the second image;
the third acquisition unit is used for acquiring texture features in the index image to be built according to the second image;
a fourth obtaining unit, configured to obtain profile features in the index image to be built according to the third image;
the aggregation unit is used for aggregating the color features, the texture features, the contour features and the category information into the sample image index database;
the second generation module includes:
the extraction unit is used for extracting the characteristic information of the image to be retrieved, wherein the characteristic information comprises the color characteristic, the texture characteristic, the contour characteristic and the category information;
the third determining unit is used for matching the category information of the image to be retrieved with the corresponding category information of the sample image index database to determine a first index sub-database;
and the fourth determining unit is used for further screening the first index sub-library according to the outline characteristics, the texture characteristics and the color characteristics of the image to be searched and determining the second index sub-library.
A computer-readable storage medium having stored thereon a computer program which, when executed by image retrieval means, implements an image retrieval method as described above.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements an image retrieval method as described above when executing the computer program.
According to the embodiment of the invention, the contour and the category of the image are marked, the image is trained based on a yolac++ instance segmentation model and a yolov5s target detection model, the instance segmentation model of deep learning is adopted, then the information extracted from the image to be searched is matched according to the established index, so that a search result is generated, the image to be matched is input for target detection, the detected object is subjected to pixel level segmentation, so that the image only retains the object pixels, the background interference is removed, and the vector features extracted by the color features can be truly reflected to the target object due to the fact that the background interference does not exist in the segmented image, so that higher matching precision is achieved.
[ description of the drawings ]
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an image retrieval method according to an embodiment of the present invention;
fig. 2 is a detailed flowchart of step S11 in fig. 1;
FIG. 3 is a detailed flowchart of step S12 of FIG. 1;
fig. 4 is a detailed flowchart of step S13 in fig. 1;
fig. 5 is a detailed flowchart of step S14 in fig. 1;
fig. 6 is a block diagram showing the construction of an image retrieval apparatus according to a second embodiment of the present invention;
FIG. 7 is a detailed block diagram of the labeling module of FIG. 6;
FIG. 8 is a detailed block diagram of the first generation module of FIG. 6;
FIG. 9 is a detailed block diagram of the setup module of FIG. 6;
FIG. 10 is a detailed block diagram of the second generation module of FIG. 6;
FIG. 11a is an original image to be indexed;
FIG. 11b is the first image after segmentation by example;
FIG. 11c is a second image after preprocessing;
FIG. 11d is a third image after binarization;
fig. 12 is a block diagram of a computer device according to yet another embodiment of the present invention.
[ detailed description ] of the invention
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the invention, and that well-known modules, units and their connections, links, communications or operations with each other are not shown or described in detail. Also, the described features, architectures, or functions may be combined in any manner in one or more implementations. It will be appreciated by those skilled in the art that the various embodiments described below are for illustration only and are not intended to limit the scope of the invention. It will be further appreciated that the modules or units or processes of the embodiments described herein and illustrated in the drawings may be combined and designed in a wide variety of different configurations. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The definitions of the various terms or methods set forth in the following embodiments are generally based on the broad concepts that may be practiced with the disclosure in the examples except where logically no such definitions are set forth, and in the following understanding, each specific lower specific definition of a term or method is to be considered an inventive subject matter and should not be interpreted as a narrow sense or as a matter of prejudice to the contrary that the specification does not disclose such a specific definition. Illustratively, when the present invention refers to databases, it includes not only virtual network servers, but also real physical devices, which have not only the ability to store data, but also the ability to compute data, intelligently analyze and infer. Similarly, the order of the steps in the method is flexible and variable on the premise that the steps can be logically implemented, and specific lower limits in various nouns or generalized concepts of the method are within the scope of the invention.
First embodiment:
referring to fig. 1 to 5, the present embodiment provides an image retrieval method, which includes S11-S14, wherein:
s11, marking the outline and the category of the image according to the sample image of the user.
According to the embodiment, according to the actual needs of a user, sample images to be searched are acquired at the user side, different sample images exist in different scenes according to different purposes, and after the images are acquired, the outlines and the categories of the images are required to be marked, so that follow-up work is facilitated.
As a preferred embodiment, but not particularly limited thereto, step S11 further includes S111-S113, wherein:
s111, acquiring a sample image of a user.
According to the embodiment, corresponding sample images are acquired according to actual needs of users to continue processing, and the sample images are different according to different purposes and different scenes.
S112, determining the object type in the sample image according to the sample image.
According to the embodiment, the types of the images are divided according to the acquired sample images, so that the later work of index establishment is convenient, the subsequent use of users is also convenient, meanwhile, the images can be more efficiently preprocessed by classifying the images, and unnecessary errors in the processing process caused by misjudgment of a system are avoided.
S113, marking the outline of the object in the sample image according to the class of the object.
According to the method and the device, after the classification of the object types is completed, the outline of the object is marked according to the different object types, so that the follow-up binarization processing of the image is facilitated, the accuracy and the efficiency can be improved, and the retrieval precision is improved.
And S12, training the marked image based on the yolac++ example segmentation model and the yolov5S target detection model to generate a sample image training model.
In the embodiment, in the prior art, a yolact++ algorithm with stable segmentation and higher precision is adopted to segment an image instance, and then a target detection model visualized by yolov5s is combined, and a certain amount of training is carried out on a sample image in a machine learning mode, so that a corresponding sample image training model is generated, and the training model is high in precision and good in stability.
As a preferred embodiment, but not particularly limited thereto, step S12 further includes S121-S122, wherein:
s121, generating an instance segmentation model M1 based on the yolact++ instance segmentation model and the marked image.
In the embodiment, in the prior art, a yolact++ algorithm with stable segmentation and high precision is adopted to segment an image instance, so that an instance segmentation model M1 is generated, a corresponding sample image training model can be better generated, and the training model has high precision and good stability.
S122, generating a target detection model M2 based on the yolov5S target detection model and the marked image.
In the embodiment, the example segmentation model M1 can be stably and efficiently detected visually by combining the yolov5s algorithm, and the marked image is detected in a machine learning mode, so that the accuracy is high and the stability is good.
S13, building a sample image feature index database according to the sample image training model.
After the sample image training model is built, the index database is required to be built for the sample image features, the index database is equivalent to a catalog, the follow-up retrieval work is convenient to carry out, and the retrieval efficiency is higher and the retrieval result is more accurate through the establishment of the retrieval.
As a preferred embodiment, but not particularly limited thereto, step S13 further includes S131-S138, wherein:
s131, dividing elements in the index image to be built according to the example division model to obtain a first image containing the elements.
In this embodiment, elements in an index image to be built are segmented according to an example segmentation model M1, wherein an original image of the index image to be built is shown in fig. 11a, a segmented image is shown in fig. 11b, and after the first image is segmented by the example segmentation model M1, the first image is clearer, the preprocessing effect is obvious, the efficiency is high, the accuracy is high, and the image quality is more stable.
S132, determining category information of elements in the first image according to the target detection model.
According to the embodiment, the category of the element in the first image is detected according to the yolov5s algorithm, so that the category information of the object is determined, and the category information is acquired from the manual database, so that the category of the element can be determined efficiently and accurately.
S133, preprocessing the first image to obtain a second image, wherein the second image comprises elements and edge backgrounds.
In this embodiment, the first image is cut into only elements and the boundary distances of about 10 pixels above, below, and about the distance elements, and the edge background of the cut image is filled with white processing, so as to obtain a second image, and the preprocessed second image is shown in fig. 11 c.
S134, performing binarization processing on the second image to obtain a third image, wherein elements of the third image protrude out of the edge background.
In order to better identify the shape of the image, the embodiment obtains a third image with only two colors of black and white by performing binarization processing on the image, the third image is shown in fig. 11d, the binarization is performed to fill the object with white pixels with the pixel value of 255, and the background is filled with black pixels with the pixel value of 0, so that the shape of the object can be better highlighted, the processing effect is better, and the precision is higher.
S135, acquiring color features in the index image to be built according to the second image.
The color features of the image are identified by adopting a COMO color feature descriptor algorithm, including identifying an RGB color space and an HSV color space, and adopting a color histogram feature matching method: the histogram intersection method, the distance method, the center distance method, the reference color table method and the accumulated color histogram method are used for matching, so that the processing effect is better and the precision is higher.
S136, obtaining texture features in the index image to be built according to the second image.
According to the embodiment, the Tamura texture feature descriptor algorithm is adopted to extract textures of the image, the Tamura texture features comprise roughness, contrast, direction degree, linearity, regularity and coarseness, and compared with texture features obtained by a gray level co-occurrence matrix, the Tamura texture features are more visual and more advantageous in visual effect.
S137, acquiring outline features in the index image to be built according to the third image.
According to the embodiment, the edge histogram algorithm, namely the edge histogram descriptor, is a simple and effective shape representation method, has wide application in aspects of target detection, target identification and the like, can determine the feature of the contour more efficiently and rapidly, and can determine the contour feature better.
S138, aggregating the color features, the texture features, the contour features and the category information into the sample image index database.
In this embodiment, after the color feature, the texture feature, the contour feature and the class information are processed respectively, in order to improve the detection accuracy, the four feature information are combined, and then the combined sample image is stored in the sample image index database, so that the index during the subsequent retrieval is facilitated.
S14, extracting characteristic information of the image to be searched, and matching in the sample image characteristic index database to generate a search result.
The operation of extracting the feature information of the image to be retrieved in this embodiment is the same as the above-mentioned image processing method and steps for establishing the index, which are not described in detail herein, and after the feature extraction is completed, the image to be retrieved and the similar image existing in the sample image feature index database are compared and matched, so as to determine which element in the image to be retrieved belongs to, and determine the final retrieval result.
As a preferred embodiment, but not particularly limited thereto, step S14 further includes S141-S143, wherein:
s141, extracting feature information of the image to be retrieved, wherein the feature information comprises the color feature, the texture feature, the contour feature and the category information.
According to the embodiment, the characteristic information of the image to be searched is extracted, and is consistent with the operation when the sample image characteristic index database is established, so that the matching can be performed quickly and efficiently, the accuracy of the comparison is ensured, and the accuracy of the search result is higher.
S142, matching the category information of the image to be retrieved with the corresponding category information of the sample image index database, and determining a first index sub-database.
In order to ensure accurate in-place retrieval, the embodiment separately lists and compares category information, category information of images to be retrieved is matched with an index database system, the same image index information as the category information is obtained and matched with a first index sub-library, similarity comparison is performed based on feature vectors, filtering of shapes higher than 70 minutes is performed, the preset total system is divided into 480 minutes, the higher the score is, the lower the similarity is, the full score is completely dissimilar, and a second index sub-library is left after filtering, so that retrieval time can be reduced, efficiency is higher, and processing speed is higher.
S143, further screening the first index sub-library according to the outline features, the texture features and the color features of the image to be searched, and determining a second index sub-library.
In this embodiment, after the class information is processed, the contour feature, the texture feature and the color feature of the image to be retrieved are continuously screened in the first index sub-library according to the edge histogram descriptor, the Tamura texture feature descriptor and the COMO color feature descriptor of the edgehistory, so as to determine a second sub-library, the comparison process of the second sub-library is consistent with the class information, the comparison process is evaluated through scores, and finally the nearest result is displayed to the client.
According to the embodiment, the contour and the category of the image are marked, the image is trained based on a yolac++ instance segmentation model and a yolov5s target detection model, the instance segmentation model of deep learning is adopted, then the information extracted from the image to be searched is matched according to the established index, so that a search result is generated, the image to be matched is input for target detection, the detected object is subjected to pixel level segmentation, so that the image only keeps object pixels, background interference is removed, and vector features extracted from the segmented image by using traditional shapes, textures and color features can be truly reflected to a target object due to the fact that the background interference does not exist, and therefore higher matching precision is achieved.
Second embodiment:
referring to fig. 6 to 10, the present embodiment provides an image retrieval device 100, which includes a marking module 110, a first generating module 120, a creating module 130, and a second generating module 140, wherein:
the marking module 110 is connected to the first generating module 120, and is configured to mark the contour and the category of the image according to the sample image of the user.
As a preferred solution, but not particularly limited, the marking module 110 includes a first acquisition unit 111, a first determination unit 112, and a marking unit 113, wherein:
the first acquisition unit 111 is connected to the first determination unit 112 for acquiring a sample image of the user.
The first determining unit 112 is connected to the marking unit 113 for determining the category of the item in the sample image from the sample image.
And a marking unit 113 for marking the outline of the article in the sample image according to the article category.
The first generating module 120 is connected to the establishing module 130, and is configured to train the marked image based on the yolac++ instance segmentation model and the yolov5s target detection model, and generate a sample image training model.
As a preferred solution, but not particularly limited, the first generating module 120 includes a first generating unit 121 and a second generating unit 122, wherein:
the first generating unit 121 is connected to the second generating unit 122, and is configured to generate an instance segmentation model M1 based on the yoact++ instance segmentation model and the marked image.
A second generating unit 122 for generating a target detection model M2 based on the yolov5s target detection model and the marked image.
The establishing module 130 is connected to the second generating module 140, and is configured to establish a sample image feature index database according to the sample image training model.
As a preferred solution, but not particularly limited, the building module 130 includes a dividing unit 131, a second determining unit 132, a preprocessing unit 133, a binarizing unit 134, a second acquiring unit 135, a third acquiring unit 136, a fourth acquiring unit 137, and an aggregating unit 138, wherein:
a segmentation unit 131, connected to the second determination unit 132, is configured to segment the elements in the index image to be built according to the example segmentation model, to obtain a first image containing the elements.
The second determining unit 132 is connected to the preprocessing unit 133, and is configured to determine category information of the elements in the first image according to the object detection model.
The preprocessing unit 133 is connected to the binarizing unit 134, and is configured to perform preprocessing on the first image to obtain a second image, where the second image includes an element and an edge background.
The binarization unit 134 is connected to the second obtaining unit 135, and is configured to perform binarization processing on the second image to obtain a third image, where an element of the third image protrudes from the edge background.
The second obtaining unit 135 is connected to the third obtaining unit 136, and is configured to obtain the color feature in the index image to be built according to the second image.
The third obtaining unit 136 is connected to the fourth obtaining unit 137, and is configured to obtain texture features in the index image to be built according to the second image.
A fourth obtaining unit 137 is connected to the aggregation unit 138, and is configured to obtain the contour feature in the index image to be built according to the third image.
An aggregation unit 138, configured to aggregate the color feature, texture feature, contour feature, and class information into the sample image index database.
The second generating module 140 is configured to extract feature information of an image to be retrieved, and match the feature information in the sample image feature index database to generate a retrieval result.
As a preferred solution, but not particularly limited, the second generating module 140 includes an extracting unit 141, a third determining unit 142, and a fourth determining unit 143, wherein:
the extracting unit 141 is connected to the third determining unit 142, and is configured to extract feature information of the image to be retrieved, where the feature information includes the color feature, the texture feature, the contour feature, and the category information.
The third determining unit 142 is connected to the fourth determining unit 143, and is configured to match the category information of the image to be retrieved with the corresponding category information of the sample image index database, and determine the first index sub-library.
And a fourth determining unit 143, configured to further screen the first index sub-library according to the contour feature, the texture feature and the color feature of the image to be retrieved, and determine the second index sub-library.
The modules and units of the present embodiment correspond to the steps in the first embodiment one by one, and are not repeated herein.
According to the embodiment, the contour and the category of the image are marked, the image is trained based on a yolac++ instance segmentation model and a yolov5s target detection model, the instance segmentation model of deep learning is adopted, then the information extracted from the image to be searched is matched according to the established index, so that a search result is generated, the image to be matched is input for target detection, the detected object is subjected to pixel level segmentation, so that the image only keeps object pixels, background interference is removed, and vector features extracted from the segmented image by using traditional shapes, textures and color features can be truly reflected to a target object due to the fact that the background interference does not exist, and therefore higher matching precision is achieved.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above. The specific working processes of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which are not described herein.
The embodiment of the present invention also provides a computer storage medium having stored thereon a computer program which, when executed by a processor, implements an image retrieval method as in the above embodiments.
Those skilled in the art will appreciate that implementing all or part of the above-described embodiments of the method may be accomplished by way of a computer program stored in a non-transitory computer readable storage medium, which when executed, may comprise the steps of embodiments of an image retrieval method as described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
Alternatively, the above-described integrated units of the present invention may be stored in a computer-readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the embodiments of the present invention may be essentially or part contributing to the related art, and the computer software product may be stored in a storage medium, and include several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the methods of the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program code, such as a removable storage device, RAM, ROM, magnetic or optical disk.
Corresponding to the above-mentioned computer storage medium, in one embodiment there is also provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements an image retrieval method as in the above-mentioned embodiments when executing the program.
The computer device may be a terminal, and its internal structure may be as shown in fig. 12. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an image retrieval method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
According to the embodiment, the contour and the category of the image are marked, the image is trained based on a yolac++ instance segmentation model and a yolov5s target detection model, the instance segmentation model of deep learning is adopted, then the information extracted from the image to be searched is matched according to the established index, so that a search result is generated, the image to be matched is input for target detection, the detected object is subjected to pixel level segmentation, so that the image only keeps object pixels, background interference is removed, and vector features extracted from the segmented image by using traditional shapes, textures and color features can be truly reflected to a target object due to the fact that the background interference does not exist, and therefore higher matching precision is achieved.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the invention, which are described in detail and are not to be construed as limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.
The above description of one embodiment provided in connection with a particular disclosure is not intended to limit the practice of this application to that particular disclosure. Any approximation, or substitution of techniques for the methods, structures, etc. of the present application or for the purposes of making a number of technological deductions or substitutions based on the concepts of the present application should be considered as the scope of protection of the present application.

Claims (9)

1. An image retrieval method, comprising:
marking the outline and the category of the image according to the sample image of the user;
training the marked image based on a yolac++ example segmentation model and a yolov5s target detection model to generate a sample image training model;
according to the sample image training model, a sample image feature index database is established;
extracting feature information of an image to be searched, and matching the feature information in the sample image feature index database to generate a search result.
2. The image retrieval method according to claim 1, wherein the step of marking the outline and category of the image based on the sample image of the user comprises:
acquiring a sample image of a user;
determining the object category in the sample image according to the sample image;
the contours of the items in the sample image are marked according to the category of the items.
3. The image retrieval method according to claim 1, wherein the step of training the marked image based on the yoact++ instance segmentation model and the yolov5s object detection model to generate a sample image training model comprises:
generating an instance segmentation model M1 based on the yolact++ instance segmentation model and the marked image;
based on the yolov5s object detection model and the marked image, an object detection model M2 is generated.
4. The image retrieval method as recited in claim 3, wherein the step of building a sample image feature index database from a sample image training model comprises:
according to the example segmentation model, segmenting elements in the index image to be built to obtain a first image containing the elements;
determining category information of elements in the first image according to the target detection model;
preprocessing the first image to obtain a second image, wherein the second image comprises elements and an edge background;
performing binarization processing on the second image to obtain a third image, wherein elements of the third image protrude out of the edge background;
acquiring color features in an index image to be built according to the second image;
acquiring texture features in an index image to be built according to the second image;
acquiring outline features in an index image to be built according to the third image;
and aggregating the color features, texture features, contour features and category information into the sample image index database.
5. The image retrieval method according to claim 1, wherein the step of extracting feature information of an image to be retrieved and matching in the sample image feature index database to generate a retrieval result comprises:
extracting feature information of an image to be retrieved, wherein the feature information comprises the color features, texture features, contour features and category information;
matching the category information of the image to be searched with the corresponding category information of the sample image index database, and determining a first index sub-database;
and further screening the first index sub-library according to the outline features, the texture features and the color features of the image to be searched, and determining a second index sub-library.
6. An image retrieval apparatus, comprising:
the marking module is used for marking the outline and the category of the image according to the sample image of the user;
the first generation module is used for training the marked image based on the yolac++ instance segmentation model and the yolov5s target detection model to generate a sample image training model;
the establishing module is used for establishing a sample image characteristic index database according to the sample image training model;
and the second generation module is used for extracting the characteristic information of the image to be searched, and matching the characteristic information in the sample image characteristic index database to generate a search result.
7. The image retrieval device of claim 6, wherein the marking module comprises:
a first acquisition unit configured to acquire a sample image of a user;
a first determining unit, configured to determine an item category in a sample image according to the sample image;
a marking unit for marking the outline of the article in the sample image according to the article category;
the first generation module includes:
the first generation unit is used for generating an instance segmentation model M1 based on the yolact++ instance segmentation model and the marked image;
a second generation unit for generating a target detection model M2 based on the yolov5s target detection model and the marked image;
the establishing module comprises:
the segmentation unit is used for segmenting elements in the index image to be built according to the example segmentation model to obtain a first image containing the elements;
a second determining unit configured to determine category information of the element in the first image according to the target detection model;
the preprocessing unit is used for preprocessing the first image to obtain a second image, wherein the second image comprises elements and an edge background;
the binarization unit is used for carrying out binarization processing on the second image to obtain a third image, and the elements of the third image protrude out of the edge background;
the second acquisition unit is used for acquiring color features in the index image to be built according to the second image;
the third acquisition unit is used for acquiring texture features in the index image to be built according to the second image;
a fourth obtaining unit, configured to obtain profile features in the index image to be built according to the third image;
the aggregation unit is used for aggregating the color features, the texture features, the contour features and the category information into the sample image index database;
the second generation module includes:
the extraction unit is used for extracting the characteristic information of the image to be retrieved, wherein the characteristic information comprises the color characteristic, the texture characteristic, the contour characteristic and the category information;
the third determining unit is used for matching the category information of the image to be retrieved with the corresponding category information of the sample image index database to determine a first index sub-database;
and the fourth determining unit is used for further screening the first index sub-library according to the outline characteristics, the texture characteristics and the color characteristics of the image to be searched and determining the second index sub-library.
8. A computer-readable storage medium, on which a computer program is stored which, when executed by image retrieval means, implements an image retrieval method as claimed in any one of claims 1-5.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements an image retrieval method according to any one of claims 1-5 when executing the computer program.
CN202310078116.6A 2023-01-17 2023-01-17 Image retrieval method, device and storage medium Pending CN116069969A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310078116.6A CN116069969A (en) 2023-01-17 2023-01-17 Image retrieval method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310078116.6A CN116069969A (en) 2023-01-17 2023-01-17 Image retrieval method, device and storage medium

Publications (1)

Publication Number Publication Date
CN116069969A true CN116069969A (en) 2023-05-05

Family

ID=86179831

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310078116.6A Pending CN116069969A (en) 2023-01-17 2023-01-17 Image retrieval method, device and storage medium

Country Status (1)

Country Link
CN (1) CN116069969A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116756352A (en) * 2023-06-25 2023-09-15 北京建科研软件技术有限公司 Method and device for acquiring construction engineering standard based on AI technology
CN116910695A (en) * 2023-09-11 2023-10-20 哈尔滨工程大学三亚南海创新发展基地 Marking method of equipment monitoring result and checking method of equipment monitoring data

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116756352A (en) * 2023-06-25 2023-09-15 北京建科研软件技术有限公司 Method and device for acquiring construction engineering standard based on AI technology
CN116910695A (en) * 2023-09-11 2023-10-20 哈尔滨工程大学三亚南海创新发展基地 Marking method of equipment monitoring result and checking method of equipment monitoring data
CN116910695B (en) * 2023-09-11 2024-01-05 哈尔滨工程大学三亚南海创新发展基地 Marking method of equipment monitoring result and checking method of equipment monitoring data

Similar Documents

Publication Publication Date Title
CN107833213B (en) Weak supervision object detection method based on false-true value self-adaptive method
Cheng et al. Global contrast based salient region detection
CN105518668B (en) Content-based image retrieval
CN110717534B (en) Target classification and positioning method based on network supervision
US8200010B1 (en) Image segmentation by clustering web images
CN116069969A (en) Image retrieval method, device and storage medium
AU2014321165A1 (en) Image searching method and apparatus
CN109426831B (en) Image similarity matching and model training method and device and computer equipment
CN109389115B (en) Text recognition method, device, storage medium and computer equipment
US8027978B2 (en) Image search method, apparatus, and program
Payet et al. Sledge: Sequential labeling of image edges for boundary detection
CN115115825B (en) Method, device, computer equipment and storage medium for detecting object in image
Maaten et al. Computer vision and machine learning for archaeology
Lodh et al. Flower recognition system based on color and GIST features
CN110766075A (en) Tire area image comparison method and device, computer equipment and storage medium
Sima et al. Bottom-up merging segmentation for color images with complex areas
CN114463767A (en) Credit card identification method, device, computer equipment and storage medium
An et al. Content-based image retrieval using color features of salient regions
Devareddi et al. Review on content-based image retrieval models for efficient feature extraction for data analysis
AlyanNezhadi et al. Content-based image retrieval considering colour difference histogram of image texture and edge orientation
CN111191584B (en) Face recognition method and device
Meng et al. Merged region based image retrieval
CN110704667A (en) Semantic information-based rapid similarity graph detection algorithm
JP7357708B2 (en) Image matching system
CN115984588A (en) Image background similarity analysis method and device, electronic equipment and storage medium

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