A method and system for identifying marine-related books based on computer vision

Through a computer vision-based method, machine learning technology is used to identify Chinese sea-related books, which solves the problems of low recognition efficiency and poor accuracy in the existing technology, and achieves rapid and accurate book recognition and resource-saving effects.

CN115424274BActive Publication Date: 2025-02-07OCEAN UNIV OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211068071.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-01
Publication Date
2025-02-07
Estimated Expiration
2042-09-01

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and accurately identify Chinese maritime books, especially in a large number of books. The lack of effective automated methods leads to difficulty in manual judgment.

Method used

Using a computer vision-based method, machine learning technology is used to classify Chinese books involving sea from other Chinese books. The specific steps include collecting book cover images, performing grayscale and binarization processing, morphological transformation, text recognition, and generating feature data sets. Then, a CNN network is built, and the feature data set is used for training to realize the identification of the book cover.

Benefits of technology

It realizes the rapid and accurate identification of Chinese sea-related books, improves the efficiency of marine books, saves machine storage and time costs, and provides technical support for the construction of Chinese sea-related documents information resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115424274B_ABST
    Figure CN115424274B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for identifying marine-related books based on computer vision, comprising: collecting a first cover page image of a marine-related book, recognizing text through grayscale and binarization processing and morphological transformation, and generating a feature data set for identifying marine-related books; constructing a CNN network with an AdamOptimier optimizer and a cross entropy function as a loss function, training through the feature data set, and recognizing the second cover page image of the book based on the trained CNN network to determine whether the book is a marine-related book; the present invention overcomes the problems of excessive operations and misjudgment in the current recognition of Chinese marine-related books, and saves machine running memory and time costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the application of computer vision technology in the field of library and information, and in particular to a method and system for identifying marine-related books based on computer vision. Background Art

[0002] In a broad sense, marine-related Chinese books refer to Chinese books with contents related to the ocean. At present, most of the Chinese books in the library collection are classified according to the "Chinese Library Classification System", which is referred to as "Zhongtu Classification". It is based on the content, form, genre and reader use of the books. Under the guidance of certain philosophical ideas, it uses the principle of knowledge classification and adopts logical methods to classify all disciplines into five major categories of philosophy, social sciences, natural sciences and comprehensive books according to their subject content. There are 22 basic categories, each of which is divided into many subcategories. Each book can be classified into a certain category, and each category has a category number. According to the classification principles of "Zhongtu Classification", books with marine themes are involved in all 22 major categories and will not be concentrated in the same category number and category.

[0003] Chinese has rich meanings. Take the word "sea" as an example. In the "Cihai", it can be divided into 14 categories according to the parts of speech: nouns, adjectives, and auxiliary words. Only some of them are related to the ocean. This greatly increases the difficulty of judging sea-related books according to the characteristics of Chinese titles. In the process of building sea-related book document resources, the identification of sea-related books cannot rely solely on the title to determine whether a Chinese book is sea-related. It is necessary to use manual judgment based on the bibliographic information, copyright page information, and content summary to accurately determine whether the book is sea-related. The annual publication volume of Chinese books is huge, involving a wide variety of categories. In actual work, there is a lack of time and a large amount of manual investment, and it is impossible to quickly and accurately batch identify Chinese sea-related books.

[0004] The cover of a book, also known as a book jacket or cover, records the title, volume, book, author, edition, publisher and other information. The cover contains the ideological and artistic nature of the book's content. It not only has text, but also has a design that is different from ordinary paintings. The cover of a book is subordinate to the content of the book, and the design will consider the convenience of readers' reading and understanding. The cover of Chinese books on the sea often has certain characteristics. The color, pattern, and design of the book cover contain rich information, which can reflect the title and content of the book, and can supplement the content beyond the title. Using these characteristics, Chinese books on the sea can be screened and distinguished from other types of Chinese books.

[0005] If we use the existing bibliographies and covers of Chinese marine-related books to distinguish between marine-related and non-marine-related Chinese books, and use machine learning methods to classify the book covers, we can create a binary classification method for marine-related Chinese books and other types of Chinese books based on Python software compilation, which is of great significance to the identification of Chinese marine-related books. It can not only improve the efficiency of marine book identification, provide direct or indirect application value for the construction of Chinese marine-related literature information resources, but also provide scientific and accurate statistical information and technical support for the decision-making of marine research institutions, publishing institutions, libraries and other cultural institutions. However, there is no technical application in this field for the identification of marine-related books through the recognition technology of marine-related book covers. Therefore, there is an urgent need for a marine-related book recognition method and system based on computer vision to solve the technical problems existing in the identification of the above-mentioned Chinese marine-related books. Summary of the invention

[0006] In order to solve the above problems, the purpose of the present invention is to provide a method and system for identifying maritime-related books based on computer vision, which is used to use machine learning methods to distinguish maritime-related Chinese books from other types of Chinese books, so as to achieve the purpose of identifying Chinese maritime-related books.

[0007] In order to achieve the above technical objectives, the present application provides a method for identifying marine-related books based on computer vision, comprising the following steps:

[0008] The first cover page image of marine-related books is collected, and the text is recognized after grayscale and binarization processing and morphological transformation, so as to generate a feature data set for identifying marine-related books;

[0009] A CNN network with AdamOptimier optimizer and cross entropy loss function is constructed and trained with feature data set. Based on the trained CNN network, the second cover page image of the book is recognized to determine whether the book is marine-related.

[0010] Preferably, in the process of grayscale processing the first cover page image, the size of the first cover page image is limited in length and width, and then grayscale processing is performed to generate a grayscale image;

[0011] The grayscale image is binarized and then subjected to morphological transformation.

[0012] Preferably, in the process of binarizing the first cover page image, the grayscale image is binarized according to the grayscale value of the grayscale image, wherein the binarization method includes one of the over-binarization method, the binary inversion method, the truncation method, the retention method, and the retention inversion method.

[0013] Preferably, in the process of binarizing the grayscale image, a threshold of the binarization is set based on the background color of the first cover page image, and a binarization method is selected to process the grayscale image before performing a morphological transformation.

[0014] Preferably, in the process of morphological transformation, the grayscale image after binarization is subjected to corrosion and dilation operations before text recognition, wherein the morphological transformation is used to remove noise around important information in the image and refine the important information.

[0015] Preferably, in the process of text recognition, the book titles in the image after morphological transformation are identified, and a feature data set is generated according to the feature words and / or the length of the book titles, wherein the feature words are used to represent the feature words of marine-related books.

[0016] Preferably, in the process of generating the feature data set, at least two feature words are collected according to the length of the book title to generate feature data for representing marine-related books, wherein the feature data is generated according to the semantics of the feature words or the semantic relationship between the feature words;

[0017] Generate a feature data set based on the feature data.

[0018] Preferably, in the process of constructing the CNN network, the CNN network is a 5-layer neural network, and the first and second layers of the neural network are convolutional networks with weights and bias variables;

[0019] The third and fourth layers of the neural network are fully connected layers for flatten and relu operations;

[0020] The fifth layer of the neural network is the output layer with a softmax function.

[0021] Preferably, in the process of constructing the output layer of the CNN network, the cross entropy function is set in the output layer, and after being simultaneously operated with the softmax function through spares, the output layer is formed through the AdamOptimier optimizer.

[0022] The present invention also discloses a marine-related book recognition system based on computer vision, comprising:

[0023] The data set generation module is used to collect the first cover page image of marine-related books, recognize the text through grayscale and binarization processing, and perform morphological transformation to generate a feature data set for identifying marine-related books;

[0024] The recognition module is used to construct a CNN network with an AdamOptimier optimizer and a cross entropy function as the loss function. It is trained through a feature data set and the second cover page image of the book is recognized based on the trained CNN network to determine whether the book is a marine-related book.

[0025] The present invention discloses the following technical effects:

[0026] By adjusting the recognition target, the present invention can overcome the current problems of excessive operations and misjudgment in the recognition of Chinese maritime books by respectively realizing the optimized recognition effect of title text recognition and specific color intervals, or by making a large number of learnings on the existing number of maritime books, when requiring books to be classified into simple binary classifications of maritime-related books and non-maritime-related books, according to different task requirements for single books or groups of books, enabling the computer to distinguish a large number of new samples after learning a large number of existing maritime-related books; when identifying group books, the CNN convolutional neural network is built using the Tensorflow architecture to realize the classification task of pictures. While meeting the task requirements, it saves machine running memory and time costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 is the text matching flow chart of the present invention;

[0029] Figure 2 It is a schematic diagram of the process of building a convolutional neural network CNN described in the present invention. DETAILED DESCRIPTION

[0030] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0031] like Figure 1-2As shown, the present invention provides a computer vision-based method, which uses the Opencv architecture to build TesseractOCR to realize text recognition of book cover images when identifying a single book. Opencv is a cross-platform computer vision library released based on the BSD license, which can implement many general algorithms in image processing and computer vision. TensorFlow is a second-generation artificial intelligence learning system developed by Google based on DistBelief, which can transfer complex data structures to artificial intelligence neural networks for analysis and processing. This book recognition and classification method is based on Opencv and Tensorflow.

[0032] The present invention implements a binary classification method for images based on Opencv and Tensorflow architecture in Python, comprising the following steps:

[0033] S1: Computer environment configuration and import,

[0034] Configure the required computer environment for Python, EclipseIDE, Opencv, Tensorflow, etc., and import the databases and toolkits required for subsequent processing;

[0035] S2: single image processing, text recognition, information matching,

[0036] Perform grayscale processing, threshold processing, morphological transformation, etc. on the input image, check the image processing status and process the recognized cover information, make a judgment based on the sea book title library, and provide three judgment methods.

[0037] S3: group data processing, training framework, calculation parameters, test judgment,

[0038] Read the image dataset and form batches. After training the neural network model, import the processed dataset for iterative learning and parameter adjustment. After completion, perform a test to check the final learning status of the model.

[0039] The specific process disclosed by the present invention is as follows:

[0040] S1: Computer environment configuration and import

[0041] 1. Configure environment variables

[0042] Right-click "My Computer" - "Properties" - "Advanced" - "Environment Variables". Configure the system environment variables for Python, EclipseIDE, Opencv and Tensorflow.

[0043] 2. Import database and toolkit

[0044] Download and import the databases and toolkits required for image reading, text recognition, and machine learning. Enter the command "pipinstall database name" in AnacondaPrompt to download. Details are as follows.

[0045] PIL, or Python Image Library, is a third-party image processing library for Python. It provides image processing capabilities for the Python interpreter and is suitable for writing image archiving and batch processing applications. Pytesseract is a Python encapsulation class for the optical character recognition Tesseract OCR engine. It is common to use pytesseract to recognize verification codes. This method is used and improved in this program. After adding the Chinese training package, text recognition in the image is performed. cv2 That is OpenCV, which is a cross-platform computer vision library released under the BSD license, mainly used for image recognition; the os module in Python uses multiple operating system-dependent functions. This toolkit abstracts the functions of the platform and provides related Python functions to navigate, create, delete and modify files and folders; sys is the abbreviation of system, which is used to obtain some configurations, settings and operations of the operating system and compiler, such as determining whether files and folders exist, creating file folders, and obtaining system versions; numpy is a scientific computing package that can be used to store and process matrices, which is more efficient than Python's own nested list structure; re is regular expression, which describes a string matching pattern, which can be used to check whether a string contains a certain substring, replace the matching substring, or extract a substring that meets a certain condition from a string.

[0046] S2: Single image processing, text recognition, information matching:

[0047] 1. Preprocessing and introduction of Chinese language package:

[0048] Pytesseract recognizes English information by default, which is widely used to recognize verification code information during login. To recognize Chinese marine-related books, you need to introduce a Chinese language package. The English font is retained here, and the simplified Chinese font is added.

[0049] 2. Read in the image:

[0050] The meaning of the command image=cv2.imread() is that the path information of the input image is in the brackets, that is, manually input the path information of the cover image to be recognized; the meaning of the command image=cv2.resize() is to uniformly set the length and width of the input image to ensure that important information of the image is not lost. Considering the shape of most marine book covers, the horizontal length is set to 605 and the vertical width is set to 807.

[0051] 3. Process the image in grayscale:

[0052] At the beginning of image processing, grayscale conversion is performed first. The most fundamental purpose of grayscale conversion is to simplify information. For example, a color image has three color values ​​and transparency, and only grayscale values ​​are left after grayscale conversion. On the one hand, grayscale operation is a preliminary process for color binarization, and on the other hand, it can reduce the number of bits and reduce the amount of transmission.

[0053] 4. Threshold processing:

[0054] Threshold processing is the binarization of images. Binarization of images is to set the grayscale value of pixels on the image to 0 or 255. It is an important preliminary image processing, the purpose of which is to distinguish the foreground and background, and obtain the part of interest through "dimensionality reduction". The source command of this line is ret, thresh = cv2.threshold (gray, thresh, maxval, type), that is, to perform a binarization operation on the grayscale image in the previous step, set the thresh threshold, input the pixel maximum value maxval, and type to select the threshold method.

[0055] There are five common threshold methods: binary method (cv2.THRESH_BINARY), binary inversion method (cv2.THRESH_BINARY_INV), truncation method (cv2.THRESH_TRUNC), retention method (cv2.THRESH_TOZERO), retention inversion method (cv2.THRESH_TOZERO_INV)

[0056] Because most of the books related to the ocean are blue, in the selection of the threshold method, we can manually select the threshold method and threshold value that is more suitable for the blue cover image background after multiple trials. Here, after many experiments, we select the threshold of 100 and the binary method (cv2.THRESH_BINARY) as the binarization processing method.

[0057] 5. Set the convolution kernel and perform morphological transformation on the image.

[0058] Mathematical morphology can be understood as a filtering operation. In this invention, we hope to obtain accurate and useful text information by scanning the book covers. However, in the picture acquisition step, due to the source of the picture or the pixel value of the picture itself, there will be more or less noise points surrounding the target information, causing recognition interference, so the picture needs to be morphologically transformed. Here the convolution kernel size is set to 3×3, and cv2.morphologyEx (img, cv2.MORPH_OPEN, kernel) is an opening operation in morphology, that is, corrosion first, then expansion. The corrosion operation can remove the noise around the important information in the picture, but it will also "refine" the important information, so further expansion operation is required to re-strengthen the important information.

[0059] 6. Identify strings in images

[0060] Use the os.getpid() command to return the real group id of the current process, then format it and rewrite it.

[0061] text=pytesseract.image_to_string(Image.open(filename),c ongig=config)

[0062] The command means to specify the Chinese language package, scan the image to identify the string, and delete the file from the current process after the identification is completed.

[0063] 7. Write the text recognition results into a txt file and process it:

[0064] Step 7 The text results recognized by the image will be directly displayed in the console, which cannot be compared and matched with all the maritime bibliographies, so the recognized text results need to be transferred to a txt file. Use Python's built-in open function to open a file named text.txt with the parameters (name of the file to be opened, mode mode). The w mode means that only writing can be done and it can be automatically created. If there is data in the file, writing the content here will overwrite the original one. Traverse the previously recognized text information, write it into the text.txt file, close it and save it automatically.

[0065] The recognized text results will produce multiple lines and contain spaces. For general books, the title will occupy one line on the cover, but there are also book titles that are too long and will occupy two or even three lines on the cover, as shown in Figure 3. Since the program matches according to line information, it is necessary to remove spaces and merge lines of the recognized text information. The specific operation is to first use Python's built-in open function to open the text.txt file that just imported the information, traverse all lines, remove line breaks, and then split the resulting line string into individual characters, and then combine them into one line, thereby removing all spaces and multiple lines.

[0066] Create a new txt file, name it text_output.txt, traverse the string after processing spaces and multiple lines, write it into it, save and close it.

[0067] Above, the text recognized from the image is processed and put into a txt file, waiting for the next step of search and matching operations.

[0068] 8. Find and match:

[0069] In search and matching, two different methods are designed here to deal with the different number of lines occupied by the book title on the cover, the first and second methods, respectively, to deal with the two situations where the book title only occupies one line on the cover and the book title occupies two or more lines on the cover. In the search and matching process, both methods are put into the calculation program at the same time (in no particular order). In addition, in response to different situations such as lighting, resolution, background effects, and new books, the third method adds additional keywords to the library to improve the program's learning ability and recognition efficiency.

[0070] (1) The title of the book only occupies one line on the cover

[0071] Because the book title occupies a single line of the recognition result, and the presence of spaces does not affect the match with the book title library, there is no need to remove spaces or merge lines in the recognition result. Create matrices for the ocean-related book title library "ocean.txt" and the txt file where the recognition result "text.txt" is located, and traverse the two matrices respectively. If a row is the same, the output result should be the book title. That is, it can be determined that the book is a book related to the ocean.

[0072] (2) The title of the book occupies two or more lines on the cover

[0073] Since the program matches each other according to line information, it is necessary to use the text file that has been removed spaces and merged lines in the previous step for matching. Open the txt file "ocean.txt" of the ocean-related book name library and the text file "text_output.txt" that has been processed by removing spaces and merging lines. First read "text_output.txt", then traverse all the lines of "ocean.txt" and read them in, and use re.research to scan the string in the entire "ocean.txt" and return the first successful match. If it can be matched, the book title result is output. That is, it can be judged that the book is a marine-related book.

[0074] (3) Key Information Learning and Discrimination Method

[0075] Since the acquired images are affected by the collection factors and new books are constantly published, the accuracy of text recognition may decrease during actual recognition, or new books may not be included in the marine book title library in a timely manner. At this time, the following keywords are added to the marine book title library: animals, China, earth, engineering, ocean, science, geography, report, seawater, nature, coastal, climate, tide, biology, navigation, buoy, overview, invention, aquatic products, archipelago, survey, fish, research, and breeding. If the information in the recognition result can be successfully compared with the keywords, the book is judged to be a marine book.

[0076] If both methods cannot output the book title results, there will be no output, and it is judged that the text information recognized by the image cannot be matched with the marine-related book title library, that is, it is not a marine-related book.

[0077] S3: Group data processing, training framework, calculation parameters, test judgment:

[0078] 1. Processing of data sets:

[0079] First, you need to manually label the images. Put the images you want to learn into folders and label them, such as ocean.1.jpg, ocean.2.jpg, and so on, as well as other.1.jpg, other.2.jpg, and so on.

[0080] Create an empty list and wait for the marked images and labels to be read into the list. It should be noted here that after all the image data is read, it must be processed in shuffle and the label list must be converted into int format. Then, batches are created for the imported images, and the list is converted into a format that tensorflow can recognize to generate a queue. We can understand the queue in this way: each time training is performed, a batch is taken from the queue and sent to the network for training, and then new images will enter the queue from the training library, and the cycle will repeat in turn. Then the queue is equivalent to the role of a data transmission pipeline from the training library to the network model, and the training data enters the network through the queue. Finally, the image is preprocessed by unifying the size and format, and established as a TFrecords file class.

[0081] 2. Establishment of training model framework:

[0082] First, we need to build a large framework. Here we can choose the built VGG-16, AlexNet, LeNet-5 and other models, and we can also choose the size of the convolution layer and convolution kernel at will. A 5-layer neural network is constructed here.

[0083] The first and second layers are convolutional layers. The convolution kernels are set to 3×3 and 16 respectively. At the same time, weights and bias variables are established, the padding layer filling method is determined, the nonlinear processing of the activation function is the relu function, the pooling method of the pooling layer selects the max method, the step size is one more than the convolution kernel, the window size is the step size, and normalized feature scaling is applied.

[0084] The third and fourth layers are fully connected layers. First, a flatten operation is performed to flatten the convolved multidimensional tensor into a two-dimensional tensor. The number of connected neurons is set and the relu operation is performed.

[0085] The fifth layer is the output layer. The activation function of the last fully connected layer is usually nonlinearly processed using the softmax function. After the softmax function is used in the classification process, it maps the outputs of multiple neurons to the interval (0,1), which can be understood as probability. However, it is only named softmax_linear here. The real softmax function is placed in the losses function below and combined with cross entropy, which can effectively improve the calculation speed.

[0086] After defining the five-layer CNN network, you need to further set the loss function. The loss function can be the least squares method or the cross entropy method. Here, the cross entropy function is used and written together with softmax to increase the calculation speed through spares. After completion, calculate the average loss of all samples. Finally, select the AdamOptimier optimizer, set the learning rate and accuracy function, and calculate whether the maximum index value and label are the same.

[0087] 3. Training and calculation model parameters

[0088] First, set the size of each parameter. N_CLASSES=2 represents the two categories of ocean and other. IMG_W and IMG_H are the length and width of the reset image. BATCH_SIZE is to send 16 images to the network for training each time. After setting various parameters, save the model and wait for testing on the test set.

[0089] Using the existing marine book covers as available data, we collected 2,000 marine book covers named ocean and 2,000 other pictures. In the training phase, we used 1,250 ocean pictures and 1,250 other pictures for training. We set the dataset to be learned 10,000 times, and the training process continuously iterated and optimized the parameters to achieve the best learning effect.

[0090] 4. Testing and determination:

[0091] The remaining 750 ocean pictures and 750 other pictures were used for testing. Each time, a randomly selected picture was used to determine whether it was a marine book or not. The test results were good. In actual applications, the test set can be changed to the group-based pictures that need to be identified, and the trained network can be used for group-based identification. The output column will directly output the identification results.

[0092] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

Claims

1. A marine book recognition system based on computer vision, characterized in that: include: The data set generation module is used to collect the first cover page image of the marine-related books, recognize the text through grayscale and binarization processing, and perform morphological transformation to generate a feature data set for identifying the marine-related books; A recognition module is used to construct a CNN network with an AdamOptimier optimizer and a loss function that is a cross entropy function, train the network through the feature data set, and recognize the second cover page image of the book based on the trained CNN network to determine whether the book is a marine-related book; In the process of grayscale processing the first cover page image, the size of the first cover page image is limited in length and width, and then grayscale processing is performed to generate a grayscale image; Performing the morphological transformation after binarizing the grayscale image; The system performs binarization processing on the first cover page image according to the grayscale value of the grayscale image during the binarization processing on the first cover page image; In the process of binarizing the grayscale image, the system sets the threshold of the binarization based on the background color of the first cover page image, selects the binarization method to process the grayscale image, and then performs the morphological transformation, wherein the binarization method is the binary method cv2.THRESH_BINARY, the threshold is set to 100, and the convolution kernel size is set to 3×3; In the process of morphological transformation, the system first erodes and then dilates the grayscale image after binarization, and then performs text recognition, wherein the morphological transformation is used to remove the noise around important information in the image and refine the important information; During the text recognition process, the system identifies the book title in the image after morphological transformation, and generates the feature data set according to the feature words and / or the length of the book title, wherein the feature words are used to represent the feature words of the marine-related books; In the process of generating the feature data set, the system collects at least two feature words according to the length of the book title, and generates feature data for representing the marine-related books, wherein the feature data is generated according to the semantics of the feature words or the semantic relationship between the feature words; Generate the feature data set according to the feature data; In the process of constructing a CNN network, the system constructs a 5-layer neural network, wherein the first and second layers of the neural network are convolutional networks with weights and bias variables, wherein the first and second layers are convolutional layers, and the convolution kernels are set to 3×3 and 16 respectively; at the same time, weights and bias variables are established, the padding layer filling method is determined, the nonlinear processing of the activation function is the relu function, the pooling method of the pooling layer selects the max method, the step size is one more than the convolution kernel, the window size is the step size, and normalized feature scaling is applied; The third and fourth layers of the neural network are fully connected layers for flattening and relu operations; The fifth layer of the neural network is an output layer with a softmax function, where the softmax function is placed in the following losses function and combined with the cross entropy; In the process of constructing the output layer of the CNN network, the system sets the cross entropy function in the output layer, and after simultaneously operating with the softmax function through spares, the output layer is formed through the AdamOptimier optimizer; The system is also used to find and match: In search and matching, the first and second methods are used to deal with the two situations where the book title occupies only one line on the cover and the book title occupies two or more lines on the cover respectively, according to the number of lines occupied by the book title on the cover. In the search and matching process, both methods are put into the calculation program at the same time, and the order is not in particular order. In addition, the third method adds additional keywords to the library to deal with different situations such as lighting, resolution, background effects and new books. The first method: the title of the book only occupies one line of the cover; Because the book title occupies a single line of the recognition result, and the existence of spaces does not affect the matching with the book title library, there is no need to remove spaces or merge lines in the recognition result; establish matrices for the ocean-related book title library "ocean.txt" and the txt file where the recognition result "text.txt" is located, and traverse the two matrices respectively; if a row is the same, the output result should be the book title, that is, it can be judged that the book is a book related to the ocean; The second method is that the title occupies two or more lines on the cover: Since the program matches each other according to line information, it is necessary to use the text file that has been removed spaces and merged lines in the first method for matching; open the txt file "ocean.txt" of the ocean-related book name library and the text file "text_output.txt" that has been processed by removing spaces and merging lines; first read "text_output.txt", then traverse all the lines of "ocean.txt" and read them in, and use re.research to scan the string in the entire "ocean.txt" and return the first successful match; if it can be matched, the book title result is output, that is, it can be judged that the book is a ocean-related book; The third method is key information learning and discrimination method: The following keywords are added to the marine-related book title database: animals, China, earth, engineering, ocean, science, geography, report, seawater, nature, coastal, climate, tide, biology, navigation, buoy, overview, invention, aquatic products, archipelago, survey, fish, research, and breeding. If the information in the recognition result can be successfully compared with the keywords, the book is judged to be a marine-related book; If both methods cannot output the book title results, there will be no output, and it is judged that the text information recognized by the image cannot be matched with the marine-related book title library, that is, it is not a marine-related book.

Citation Information

Patent Citations

  • Cover-based book type deep learning classification method

    CN112749682A