Picture classification method and device based on mobile terminal

文档序号:1875549 发布日期:2021-11-23 浏览:41次 中文

阅读说明:本技术 一种基于移动终端的图片分类方法及装置 (Picture classification method and device based on mobile terminal ) 是由 刘烨 仵鹏飞 于 2021-08-25 设计创作,主要内容包括:本发明提供一种基于移动终端的图片分类方法及装置,涉及大数据技术领域。所述方法包括:若判断获知待分类图片的数量大于阈值,则获取所述待分类图片的属性信息;其中,所述待分类图片中每张图片的属性信息包括时间信息和位置信息;根据预设时间段和所述待分类图片的每张图片的时间信息,获得第一类图片;根据预设位置和所述第一类图片的每张图片的位置信息,获得第二类图片;根据所述第二类图片以及图片分类模型,获得所述第二类图片中每张图片所属的类别;其中,所述图片分类模型是预先训练获得并迁移到本地的。所述装置用于执行上述方法。本发明实施例提供的基于移动终端的图片分类方法及装置,提高了图片分类的准确性。(The invention provides a picture classification method and device based on a mobile terminal, and relates to the technical field of big data. The method comprises the following steps: if the number of the pictures to be classified is judged to be larger than the threshold value, acquiring attribute information of the pictures to be classified; the attribute information of each picture in the pictures to be classified comprises time information and position information; obtaining a first type of picture according to a preset time period and time information of each picture of the pictures to be classified; obtaining a second type of picture according to a preset position and the position information of each picture of the first type of picture; obtaining the category of each picture in the second class of pictures according to the second class of pictures and the picture classification model; and the image classification model is obtained by pre-training and is migrated to the local. The device is used for executing the method. The picture classification method and device based on the mobile terminal provided by the embodiment of the invention improve the accuracy of picture classification.)

1. A picture classification method based on a mobile terminal is characterized by comprising the following steps:

if the number of the pictures to be classified is judged to be larger than the threshold value, acquiring attribute information of the pictures to be classified; the attribute information of each picture in the pictures to be classified comprises time information and position information;

obtaining a first type of picture according to a preset time period and time information of each picture of the pictures to be classified;

obtaining a second type of picture according to a preset position and the position information of each picture of the first type of picture;

obtaining the category of each picture in the second class of pictures according to the second class of pictures and the picture classification model; and the image classification model is obtained by pre-training and is migrated to the local.

2. The method according to claim 1, wherein the obtaining attribute information of the picture to be classified comprises:

acquiring Exif information of each picture;

the shooting time of each picture is acquired from the Exif information of each picture as time information of each picture.

3. The method of claim 1, further comprising:

and if the shooting time of the picture is not obtained from the Exif information of the picture, obtaining the last modification time of the picture as the time information of the picture.

4. The method according to claim 1, wherein the obtaining attribute information of the picture to be classified comprises:

acquiring Exif information of each picture, and acquiring longitude and latitude information of each picture from the Exif information of each picture;

sending a geographical position acquisition request to a third-party server, wherein the geographical position acquisition request comprises longitude and latitude information of each picture;

and receiving a response result returned by the third-party server, wherein the response result comprises the position information of each picture.

5. The method according to claim 1, wherein the picture classification model is obtained based on ShuffleNet model training.

6. The method of claim 1, further comprising:

after obtaining the second type of picture, preprocessing the second type of picture.

7. The method of any of claims 1 to 6, further comprising:

and if the number of the acquired pictures to be classified is less than or equal to the threshold value, acquiring the category of each picture in the pictures to be classified according to the pictures to be classified and the picture classification model.

8. The utility model provides a picture classification device based on mobile terminal which characterized in that includes:

the acquisition module is used for acquiring the attribute information of the pictures to be classified after judging that the number of the pictures to be classified is larger than a threshold value; the attribute information of each picture in the pictures to be classified comprises time information and position information;

the first obtaining module is used for obtaining a first type of picture according to a preset time period and the time information of each picture of the pictures to be classified;

the second obtaining module is used for obtaining a second type of picture according to a preset position and the position information of each picture of the first type of picture;

the classification module is used for obtaining the category of each picture in the second class of pictures according to the second class of pictures and the picture classification model; and the image classification model is obtained by pre-training and is migrated to the local.

9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented when the computer program is executed by the processor.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.

Technical Field

The invention relates to the technical field of big data, in particular to a picture classification method and device based on a mobile terminal.

Background

With the common application of smart phones, a large number of pictures are stored in the smart phones, and the pictures in the smart phones are classified into a common function of the smart phones.

For a large number of pictures stored in a smart phone, in various picture classification programs in the prior art, some pictures are classified according to the time sequence of the pictures, some pictures are classified according to the shooting places of the pictures, and some pictures are classified according to the titles of the pictures, which is limited by the hardware configuration of the smart phone, so that the smart phone can only perform simple classification generally, and when the number of the pictures is large, the classification efficiency is low.

Disclosure of Invention

To solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for classifying pictures based on a mobile terminal, which can at least partially solve the problems in the prior art.

On one hand, the invention provides a picture classification method based on a mobile terminal, which comprises the following steps:

if the number of the pictures to be classified is judged to be larger than the threshold value, acquiring attribute information of the pictures to be classified; the attribute information of each picture in the pictures to be classified comprises time information and position information;

obtaining a first type of picture according to a preset time period and time information of each picture of the pictures to be classified;

obtaining a second type of picture according to a preset position and the position information of each picture of the first type of picture;

obtaining the category of each picture in the second class of pictures according to the second class of pictures and the picture classification model; and the image classification model is obtained by pre-training and is migrated to the local.

In another aspect, the present invention provides a picture classifying device based on a mobile terminal, including:

the acquisition module is used for acquiring the attribute information of the pictures to be classified after judging that the number of the pictures to be classified is larger than a threshold value; the attribute information of each picture in the pictures to be classified comprises time information and position information;

the first obtaining module is used for obtaining a first type of picture according to a preset time period and the time information of each picture of the pictures to be classified;

the second obtaining module is used for obtaining a second type of picture according to a preset position and the position information of each picture of the first type of picture;

the classification module is used for obtaining the category of each picture in the second class of pictures according to the second class of pictures and the picture classification model; and the image classification model is obtained by pre-training and is migrated to the local.

In another aspect, the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method for classifying pictures based on a mobile terminal according to any of the embodiments described above when executing the computer program.

In still another aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the mobile terminal-based picture classification method according to any of the above embodiments.

According to the picture classification method and device based on the mobile terminal, provided by the embodiment of the invention, after the number of the pictures to be classified is judged to be larger than the threshold value, the attribute information of the pictures to be classified is obtained, the first class of pictures are obtained according to the preset time period and the time information of each picture of the pictures to be classified, the second class of pictures are obtained according to the preset position and the position information of each picture of the first class of pictures, the class of each picture in the second class of pictures is obtained according to the second class of pictures and the picture classification model, the picture classification model can be applied to the mobile terminal to classify the pictures, and the accuracy of picture classification is improved.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:

fig. 1 is a flowchart illustrating a picture classification method based on a mobile terminal according to a first embodiment of the present invention.

Fig. 2 is a flowchart illustrating a picture classification method based on a mobile terminal according to a second embodiment of the present invention.

Fig. 3 is a flowchart illustrating a picture classification method based on a mobile terminal according to a third embodiment of the present invention.

Fig. 4 is a schematic structural diagram of a picture classifying device based on a mobile terminal according to a fourth embodiment of the present invention.

Fig. 5 is a schematic structural diagram of a picture classifying device based on a mobile terminal according to a fifth embodiment of the present invention.

Fig. 6 is a schematic structural diagram of a picture classifying device based on a mobile terminal according to a sixth embodiment of the present invention.

Fig. 7 is a schematic structural diagram of a picture classifying device based on a mobile terminal according to a seventh embodiment of the present invention.

Fig. 8 is a schematic structural diagram of a picture classifying device based on a mobile terminal according to an eighth embodiment of the present invention.

Fig. 9 is a schematic structural diagram of a picture classifying device based on a mobile terminal according to a ninth embodiment of the present invention.

Fig. 10 is a schematic physical structure diagram of an electronic device according to a tenth embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.

Fig. 1 is a schematic flowchart of a picture classification method based on a mobile terminal according to an embodiment of the present invention, and as shown in fig. 1, the picture classification method based on the mobile terminal according to the embodiment of the present invention includes:

s101, if the number of the pictures to be classified is judged to be larger than a threshold value, acquiring attribute information of the pictures to be classified; the attribute information of each picture in the pictures to be classified comprises time information and position information;

specifically, when picture classification needs to be performed on the mobile terminal, a user can designate pictures to be classified on the mobile terminal, the mobile terminal takes the pictures to be classified as the pictures to be classified, the number of the pictures included in the pictures to be classified is counted, and the number of the pictures to be classified is obtained. The mobile terminal compares the number of the pictures to be classified with a threshold value, if the number of the pictures to be classified is larger than the threshold value, the number of the pictures to be classified is large, and then the mobile terminal acquires the attribute information of the pictures to be classified so as to conveniently narrow the range of the classified pictures based on the attribute information. The attribute information of each picture in the pictures to be classified comprises time information and position information. The threshold is set according to practical experience, and the embodiment of the invention is not limited. The mobile terminal includes, but is not limited to, an electronic device such as a smart phone and a tablet computer.

S102, obtaining a first type of picture according to a preset time period and time information of each picture of the pictures to be classified;

specifically, the mobile terminal may obtain time information of each picture of the pictures to be classified, compare the time information of each picture with a preset time period, determine whether the time information of each picture is within the preset time period, and classify the pictures into a first class of pictures if the time information of the pictures is within the preset time period; if the time information of the picture is not within the preset time period, the picture is not classified as the first type picture. The mobile terminal may obtain the first type of picture. Wherein the preset time period may be input by a user in real time. The preset time period may be 1 year, a quarter, or 1 month, and is set according to actual needs, which is not limited in the embodiments of the present invention. Understandably, the first category of pictures reduces the number of pictures that need to be classified.

S103, obtaining a second type of picture according to a preset position and position information of each picture of the first type of picture;

specifically, the mobile terminal may obtain position information of each picture of the first type of picture, compare the position information of each picture with the preset position information, classify the picture with the same position information as the preset position information into a second type of picture, and obtain the second type of picture. Wherein the preset position can be input by the user in real time. It will be appreciated that the second class of pictures further reduces the number of pictures that need to be sorted.

S104, obtaining the category of each picture in the second class of pictures according to the second class of pictures and the picture classification model; and the image classification model is obtained by pre-training and is migrated to the local.

Specifically, the mobile terminal inputs each picture in the second class of pictures into a picture classification model, and the picture classification model identifies each picture to obtain the class to which each picture in the second class of pictures belongs. And the image classification model is obtained by pre-training and is migrated to the mobile terminal. The type of the picture is preset, and the picture is set according to actual needs, which is not limited in the embodiment of the invention.

Wherein, in order to train the image classification model quickly, model training can be performed on a server. The method includes the steps of firstly, collecting model training data, wherein the model training data comprise preset types of pictures, and the data of the pictures of each type are set according to actual needs. In order to improve the accuracy of image recognition, image preprocessing including, but not limited to, filtering or extraction, scaling, normalization, and other processing modes may be performed on the model training data, and the image preprocessing is selected according to actual needs, which is not limited in the embodiments of the present invention.

The image classification model is applied to the mobile terminal, so that the complexity of the model needs to be reduced in consideration of the hardware processing capacity of the mobile terminal, and a lightweight network model ShuffleNet model can be used as an original model. And training to obtain a picture classification model based on the training data and the original model. During training, the model training data can be split into training data and verification data, a model to be verified is obtained through training through the training data and the original model, then the model to be verified is verified through the verification data, and the model to be verified after the verification is passed is used as the picture classification model. If the verification fails, the model training may be resumed by adjusting the model training data and the parameters of the original model.

After the image classification model is trained and obtained on the server, the image classification model needs to be transferred to the mobile terminal, for example, for an Android smart phone, the image classification model trained and obtained on the server can be transplanted to Android studio to generate an Apk file, and the Apk file is stored in the smart phone.

According to the picture classification method based on the mobile terminal, provided by the embodiment of the invention, after the number of the pictures to be classified is judged to be larger than the threshold value, the attribute information of the pictures to be classified is obtained, the first class of pictures are obtained according to the preset time period and the time information of each picture of the pictures to be classified, the second class of pictures are obtained according to the preset position and the position information of each picture of the first class of pictures, the class of each picture in the second class of pictures is obtained according to the second class of pictures and the picture classification model, the picture classification model can be applied to the mobile terminal to classify the pictures, and the accuracy of picture classification is improved. In addition, the number of the pictures classified by the picture classification model is limited, so that the picture classification efficiency is improved.

Fig. 2 is a schematic flowchart of a picture classification method based on a mobile terminal according to a second embodiment of the present invention, and as shown in fig. 2, on the basis of the foregoing embodiments, further acquiring attribute information of the picture to be classified includes:

s201, acquiring Exif information of each picture;

specifically, the shooting time is stored in the Exif (changeable Image File format) information through the pictures shot by the mobile terminal, and the mobile terminal can acquire the Exif information of each picture in the pictures to be classified.

And S202, acquiring the shooting time of each picture from the Exif information of each picture as the time information of each picture.

Specifically, the mobile terminal acquires the shooting time of each picture from the Exif information of each picture, and then takes the acquired shooting time as the time information of each picture. The Exif information may include information such as a picture name, a picture identifier, a shooting time, and a longitude and latitude of shooting.

On the basis of the foregoing embodiments, further, the method for classifying pictures based on a mobile terminal according to an embodiment of the present invention further includes:

and if the shooting time of the picture is not obtained from the Exif information of the picture, obtaining the last modification time of the picture as the time information of the picture.

Specifically, the mobile terminal may acquire the last modification time of the picture as the time information of the picture if the photographing time of the picture is not obtained from the Exif information of the picture.

Fig. 3 is a schematic flowchart of a picture classification method based on a mobile terminal according to a third embodiment of the present invention, and as shown in fig. 3, on the basis of the foregoing embodiments, further acquiring attribute information of a picture to be classified includes:

s301, obtaining Exif information of each picture, and obtaining longitude and latitude information of each picture from the Exif information of each picture;

specifically, the mobile terminal may obtain Exif information of each picture, where the Exif information may include latitude and longitude information. The mobile terminal can acquire the longitude and latitude information of each picture from the Exif information of each picture.

S302, sending a geographical position acquisition request to a third-party server, wherein the geographical position acquisition request comprises longitude and latitude information of each picture;

specifically, after obtaining the longitude and latitude information of each picture, the mobile terminal may send a geographic position obtaining request to the third-party server, where the geographic position obtaining request includes the longitude and latitude information of each picture. The third-party server provides positioning service, and the corresponding position can be obtained through latitude and longitude information.

S303, receiving a response result returned by the third-party server, wherein the response result comprises the position information of each picture.

Specifically, after receiving the geographic position acquisition request, the third-party server obtains corresponding position information according to the longitude and latitude information of each picture, uses the position information corresponding to the longitude and latitude information of each picture as the position information of each picture, and returns a response result carrying the position information of each picture to the mobile terminal. And the mobile terminal receives the response result so as to obtain the position information of each picture. The location information may include information such as a city name and a district and county of a city subordinate.

On the basis of the above embodiments, further, the picture classification model is obtained based on ShuffleNet model training.

Specifically, the image classification model can be obtained based on ShuffleNet model training, the ShuffleNet model uses two operations of grouping and rolling and channel mixing point by point, and the depth residual error is adopted to improve the training efficiency of the model, reduce the calculated amount and improve the image classification efficiency.

For example, a shuffle net model with a shuffle net 0.25x, g ═ 8 scale can be adopted, and the calculation complexity is relatively low, so that the method is suitable for mobile terminals.

On the basis of the foregoing embodiments, further, the method for classifying pictures based on a mobile terminal according to an embodiment of the present invention further includes:

after obtaining the second type of picture, preprocessing the second type of picture.

Specifically, in order to improve the accuracy of image classification, after the second class of images are obtained, the second class of images may be preprocessed, and then the class to which each image belongs may be obtained based on the preprocessed second class of images and the image classification model. The preprocessing includes, but is not limited to, picture filtering, scaling, normalization, and the like, and is set according to actual needs, which is not limited in the embodiments of the present invention.

For example, the second type of picture is scaled, the actually shot picture can have a plurality of different sizes, and the scaling method is adopted to unify the sizes of the second type of picture, so that the recognition efficiency of the model can be improved.

On the basis of the foregoing embodiments, further, the method for classifying pictures based on a mobile terminal according to an embodiment of the present invention further includes:

and if the number of the pictures to be classified is judged to be less than or equal to the threshold value, obtaining the category of each picture in the pictures to be classified according to the pictures to be classified and the picture classification model.

Specifically, the mobile terminal compares the number of the pictures to be classified with a threshold, and if the number of the pictures to be classified is less than or equal to the threshold, it indicates that the number of the pictures to be classified is limited, the mobile terminal may input each of the pictures to be classified into a picture classification model, and the picture classification model may identify each of the pictures to obtain the type to which each of the pictures to be classified belongs.

The following describes an implementation process of the mobile terminal-based picture classification method according to an embodiment of the present invention with a specific embodiment.

For the fact that a staffing investigator (hereinafter, called as an administrator) in the banking industry can store a plurality of pictures such as customer investigation pictures and business handling pictures in the mobile terminal a, the administrator cannot quickly locate the needed pictures due to the fact that the number of the pictures is large. Pictures taken by the person through the mobile terminal a and saved pictures are saved in the MediaStore folder. In order to classify pictures stored in the MediaStore folder, a picture classification model X is obtained by pre-training and is migrated to the mobile terminal a. The picture classification model X is used to classify pictures in the MediaStore folder into survey pictures, group photo pictures, product creation pictures, performance screenshot pictures, customer signature pictures, and other types of pictures. The mobile terminal A adopts an android system.

The scheduling personnel select a MediaStore folder on the mobile terminal a, and all pictures in the MediaStore folder are taken as pictures to be classified. The mobile terminal A counts the number of the pictures to be classified, obtains the number of the pictures to be classified, compares the number of the pictures to be classified with a threshold value, if the number of the pictures to be classified is larger than the threshold value, obtains Exif information of each picture from a MediaStore class of an android system, then obtains shooting time of each picture from the Exif information of each picture as time information of each picture, and if the shooting information of the pictures is not obtained, can obtain last time modification time of the pictures as the time information of the pictures. The mobile terminal A can also acquire the longitude and latitude information of each picture from the Exif information of each picture, and then sends a geographic position acquisition request to a third-party server B of a third-party service provider for providing position information conversion, wherein the geographic position acquisition request comprises the longitude and latitude information of each picture. And the third-party server B acquires the position information of each picture according to the longitude and latitude information of each picture. The mobile terminal A can also download the geographic position data provided by the third-party service provider from the third-party server B, so that the position information of each picture can be obtained through the latitude and longitude information inquiry of each picture locally.

The mobile terminal A can prompt an exhaustor to select a classification time period and classified position information, the exhaustor enters the time period and the position information in the mobile terminal A, the mobile terminal A takes the time period entered by the exhaustor as a preset time period, and takes the position information entered by the exhaustor as a preset position. The mobile terminal A obtains a first type of picture according to a preset time period and the time information of each picture, and then obtains a second type of picture according to a preset position and the position information of each picture of the first type of picture.

And the mobile terminal A inputs each picture in the second class of pictures into a picture classification model X, and the picture classification model X identifies each picture to obtain the class of each picture in the second class of pictures. The picture ordering personnel can check the pictures needed by the personnel from various pictures, and the personnel can conveniently and quickly find the target picture.

The picture classification model X may be trained in a Linux system. When model training data is obtained, the images can be zoomed into the same size, hue values of the images can be randomly adjusted, the saturation of the images can be randomly adjusted, left and right images are randomly adjusted, and mechanical energy image normalization is performed, so that the robustness of the image classification model X obtained by training is improved. The picture classification model X can be obtained based on ShuffleNet model training. The ShuffleNet model training is completed through a GTX 1070GPU, a CUDA 7.5 and a CuDNN 5.1 acceleration operation library can be used, the CUDA is a general framework for a parallel programming model, and efficient calculation is performed by combining a parallel calculation engine of the GPU. CuDNN is mainly used for a GPU acceleration library of a deep neural network, can be integrated into an advanced machine learning framework, and has the advantages of high performance and low memory overhead. The loss function is defined as the sum of cross entropy and weight attenuation, the training adopts a random gradient descent algorithm to optimize parameters, and random gradient descent randomly takes one sample from a training set for learning each time, so that the convergence speed is higher. Wherein, the size of each picture in the model training is 224x224x3, each batch is 32, and the learning rate can be set to 0.01.

Fig. 4 is a schematic structural diagram of a mobile terminal-based picture classifying device according to a fourth embodiment of the present invention, and as shown in fig. 4, the mobile terminal-based picture classifying device according to the embodiment of the present invention includes an obtaining module 401, a first obtaining module 402, a second obtaining module 403, and a classifying module 404, where:

the obtaining module 401 is configured to obtain attribute information of the pictures to be classified after it is determined that the number of the pictures to be classified is greater than a threshold; the attribute information of each picture in the pictures to be classified comprises time information and position information; the first obtaining module 402 is configured to obtain a first type of picture according to a preset time period and time information of each picture of the pictures to be classified; the second obtaining module 403 is configured to obtain a second type of picture according to a preset position and position information of each picture of the first type of picture; the classification module 404 is configured to obtain a category to which each picture in the second class of pictures belongs according to the second class of pictures and the picture classification model; and the image classification model is obtained by pre-training and is migrated to the local.

Specifically, when the pictures need to be classified, the user may designate the pictures that need to be classified, and the obtaining module 401 takes the pictures that need to be classified as the pictures to be classified, counts the number of the pictures included in the pictures to be classified, and obtains the number of the pictures to be classified. The obtaining module 401 compares the number of the pictures to be classified with a threshold, and if the number of the pictures to be classified is greater than the threshold, which indicates that the number of the pictures to be classified is large, the mobile terminal obtains the attribute information of the pictures to be classified, so as to narrow the range of the classified pictures based on the attribute information. The attribute information of each picture in the pictures to be classified comprises time information and position information. The threshold is set according to practical experience, and the embodiment of the invention is not limited.

The first obtaining module 402 may obtain time information of each picture of the pictures to be classified, compare the time information of each picture with a preset time period, determine whether the time information of each picture is within the preset time period, and classify the pictures into a first class of pictures if the time information of the pictures is within the preset time period; if the time information of the picture is not within the preset time period, the picture is not classified as the first type picture. The first obtaining module 402 may obtain the first type of picture. Wherein the preset time period may be input by a user in real time. The preset time period may be 1 year, a quarter, or 1 month, and is set according to actual needs, which is not limited in the embodiments of the present invention. Understandably, the first category of pictures reduces the number of pictures that need to be classified.

The second obtaining module 403 may obtain position information of each picture of the first type of picture, compare the position information of each picture with the preset position information, classify the pictures with the same position information as the preset position information into a second type of picture, and the mobile terminal may obtain the second type of picture. Wherein the preset position can be input by the user in real time. It will be appreciated that the second class of pictures further reduces the number of pictures that need to be sorted.

The classification module 404 inputs each of the second class of pictures into a picture classification model, where the picture classification model identifies each picture to obtain a class to which each picture in the second class of pictures belongs. And the image classification model is obtained by pre-training and is migrated to the mobile terminal. The type of the picture is preset, and the picture is set according to actual needs, which is not limited in the embodiment of the invention.

The picture classification device based on the mobile terminal provided by the embodiment of the invention can acquire the attribute information of the pictures to be classified after judging that the number of the acquired pictures to be classified is larger than the threshold value, acquire the first class of pictures according to the preset time period and the time information of each picture of the pictures to be classified, acquire the second class of pictures according to the preset position and the position information of each picture of the first class of pictures, acquire the class of each picture in the second class of pictures according to the second class of pictures and the picture classification model, and can classify the pictures by applying the picture classification model on the mobile terminal, thereby improving the accuracy of picture classification. In addition, the number of the pictures classified by the picture classification model is limited, so that the picture classification efficiency is improved.

Fig. 5 is a schematic structural diagram of a picture classifying device based on a mobile terminal according to a fifth embodiment of the present invention, and as shown in fig. 5, on the basis of the foregoing embodiments, further, the first obtaining module 402 includes a first obtaining unit 4021 and a second obtaining unit 4022, where:

the first acquiring unit 4021 is configured to acquire Exif information of each picture; the second acquisition unit 4022 is configured to acquire the shooting time of each picture from the Exif information of each picture as time information of each picture.

Fig. 6 is a schematic structural diagram of a picture classifying device based on a mobile terminal according to a sixth embodiment of the present invention, and as shown in fig. 6, on the basis of the foregoing embodiments, further, the picture classifying device based on a mobile terminal according to the embodiment of the present invention further includes a third obtaining unit 4023, where:

the third obtaining unit 4023 is configured to obtain the last modification time of the picture as the time information of the picture if the shooting time of the picture is not obtained from the Exif information of the picture.

Fig. 7 is a schematic structural diagram of a picture classifying device based on a mobile terminal according to a seventh embodiment of the present invention, as shown in fig. 7, on the basis of the foregoing embodiments, further, the second obtaining module 403 includes a fourth obtaining unit 4031, a sending unit 4032 and a receiving unit 4033, where:

the fourth acquiring unit 4031 is configured to acquire Exif information of each picture, and acquire longitude and latitude information of each picture from the Exif information of each picture; the sending unit 4032 is configured to send a geographic location acquisition request to the third-party server, where the geographic location acquisition request includes latitude and longitude information of each picture; the receiving unit 4033 is configured to receive a response result returned by the third-party server, where the response result includes location information of each picture.

On the basis of the above embodiments, further, the picture classification model is obtained based on ShuffleNet model training.

Fig. 8 is a schematic structural diagram of a mobile terminal-based picture classifying device according to an eighth embodiment of the present invention, and as shown in fig. 8, on the basis of the foregoing embodiments, further, the mobile terminal-based picture classifying device according to the embodiment of the present invention further includes a preprocessing module 405, where:

the pre-processing module 405 is configured to pre-process the second type of pictures after obtaining the second type of pictures.

Fig. 9 is a schematic structural diagram of a mobile terminal-based picture classifying device according to a ninth embodiment of the present invention, and as shown in fig. 9, on the basis of the foregoing embodiments, further, the mobile terminal-based picture classifying device according to the embodiment of the present invention further includes a determining module 406, where:

the judging module 406 is configured to, when it is judged that the number of the obtained pictures to be classified is less than or equal to a threshold, obtain a category to which each picture in the pictures to be classified belongs according to the pictures to be classified and the picture classification model.

The embodiment of the apparatus provided in the embodiment of the present invention may be specifically configured to execute the processing flows of the above method embodiments, and the functions of the apparatus are not described herein again, and refer to the detailed description of the above method embodiments.

Fig. 10 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 10, the electronic device may include: a processor (processor)1001, a communication Interface (communication Interface)1002, a memory (memory)1003 and a communication bus 1004, wherein the processor 1001, the communication Interface 1002 and the memory 1003 complete communication with each other through the communication bus 1004. Processor 1001 may call logic instructions in memory 1003 to perform the following method: if the number of the pictures to be classified is judged to be larger than the threshold value, acquiring attribute information of the pictures to be classified; the attribute information of each picture in the pictures to be classified comprises time information and position information; obtaining a first type of picture according to a preset time period and time information of each picture of the pictures to be classified; obtaining a second type of picture according to a preset position and the position information of each picture of the first type of picture; obtaining the category of each picture in the second class of pictures according to the second class of pictures and the picture classification model; and the image classification model is obtained by pre-training and is migrated to the local.

In addition, the logic instructions in the memory 1003 may be implemented in the form of software functional units and may be stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, comprising: if the number of the pictures to be classified is judged to be larger than the threshold value, acquiring attribute information of the pictures to be classified; the attribute information of each picture in the pictures to be classified comprises time information and position information; obtaining a first type of picture according to a preset time period and time information of each picture of the pictures to be classified; obtaining a second type of picture according to a preset position and the position information of each picture of the first type of picture; obtaining the category of each picture in the second class of pictures according to the second class of pictures and the picture classification model; and the image classification model is obtained by pre-training and is migrated to the local.

The present embodiment provides a computer-readable storage medium, which stores a computer program, where the computer program causes the computer to execute the method provided by the above method embodiments, for example, the method includes: if the number of the pictures to be classified is judged to be larger than the threshold value, acquiring attribute information of the pictures to be classified; the attribute information of each picture in the pictures to be classified comprises time information and position information; obtaining a first type of picture according to a preset time period and time information of each picture of the pictures to be classified; obtaining a second type of picture according to a preset position and the position information of each picture of the first type of picture; obtaining the category of each picture in the second class of pictures according to the second class of pictures and the picture classification model; and the image classification model is obtained by pre-training and is migrated to the local.

As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

In the description herein, reference to the description of the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:图片信息抽取方法、装置、计算机设备及存储介质

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!