TCM image recognition system (APP + server)

TCM image recognition system (APP + server)

2022-09-05 0 548
Resource Number 38086 Last Updated 2025-02-24
¥ 0USD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

What is recommended in this issue is the traditional Chinese medicine image recognition system.

TCM image recognition system (APP + server)插图

Item Description

Traditional Chinese medicine recognition system mainly adopts the method of photo uploading on the APP side, and constructs convolutional neural network (CNN) to recognize images, which has the characteristics of high recognition efficiency and accuracy. The functions of the APP include but are not limited to photo recognition, Chinese medicine question and answer (paid consultation), search and query, Chinese medicine properties and efficacy review, prescription intelligent recommendation [under development], etc. This system includes APP side and server side.

Project Introduction

This project consists of six modules:

  • medicine-app: APP
  • medicine-server: Server
  • medicine-crawler: Crawler engineering
  • medicine-model: Convolutional neural network
  • medicine-util: Utility class
  • medicine-dataset: dataset

Technical Introduction

medicine-app

Flutter development

medicine-server Server engineering

Gradle build +SpringBoot framework

One-click launch and deployment document database: MongoDB Full-text search: Elasticsearch + IK Word classifier database

MySQL deep Learning runtime architecture: ONNX Runtime (ONNX Runtime is a cross-platform inference and training machine-learning accelerator)

medicine-crawler

Crawler is mainly used to climb the training set and the detailed information of Chinese medicine , including but not limited to: Chinese medicine name, Chinese medicine form, picture, alias, English name, matching prescription, efficacy and function, clinical application, origin distribution, medicinal parts, sex and taste return to the meridian, pharmacological research, main ingredients, use conscription, harvesting and processing, medicinal material properties and other information.

data structure

  • Primary Classification Information of Chinese medicine

TCM image recognition system (APP + server)插图1

  • Chinese Medicine details

TCM image recognition system (APP + server)插图2

medicine-model Convolutional Neural network engineering

  • Language: Python
  • Using TensorFlow deep learning framework, using Keras will significantly reduce the amount of code

Xception function definition:

def Xception(include_top=True,
    weights='imagenet',
    input_tensor=None,
    input_shape=None,
    pooling=None,
    classes=1000,
    **kwargs)

# Parameter 
# include_top: Whether to keep the top-level fully connected network 
# weights: None means random initialization, i.e. no pre-trained weights are loaded. 'imagenet 'stands for load pretraining weight 
# input_tensor: Keras tensor can be filled in as the image input of the model tensor
# input_shape: Optional, valid only if include_top=False, should be a tuple of length 3, indicating the shape of the input image, the image width and height must be greater than 71, such as (150,150,3)
# pooling: specifies pooling when include_top=False. None means no pooling, and the output of the last convolution layer is a 4D tensor. 'avg' stands for global average pooling and 'max' for global maximum pooling. 
# classes: Optional, number of categories for picture classification, available only if include_top=True and no pre-training weights are loaded 

Build code

Set Xception parameters

Transfer learning parameter weights loading: xception_weights

# Set the width and height of the input image and the number of channels 
img_size = (299, 299, 3)

base_model = keras.applications.xception.Xception(include_top=False,
                                                weights='..\\resources\\keras-model\\xception_weights_tf_dim_ordering_tf_kernels_notop.h5',
                                                input_shape=img_size,
                                                pooling='avg')
  
# Full connection layer, using softmax activation function to calculate probability value, classification size is 628
model = keras.layers.Dense(628, activation='softmax',  name='predictions')(base_model.output)
model = keras.Model(base_model.input, model)

# Lock convolution layer 
for layer in base_model.layers:
  layer.trainable = False

Full connection layer training (v1.0)

from base_model import model

# Set training set image size and directory parameters 
img_size = (299, 299)
dataset_dir = '.. \\dataset\\dataset'
img_save_to_dir = 'resources\\image-traing\\'
log_dir = 'resources\\train-log'

model_dir = ‘resources\\keras-model\\’

# Use data enhancement

train_datagen = keras.preprocessing.image.ImageDataGenerator(
rescale=1. / 255,
shear_range=0.2,
width_shift_range=0.4,
height_shift_range=0.4,
rotation_range=90,
zoom_range=0.7,
horizontal_flip=True,
vertical_flip=True,
preprocessing_function=keras.applications.xception.preprocess_input)

test_datagen = keras.preprocessing.image.ImageDataGenerator(
preprocessing_function=keras.applications.xception.preprocess_input)

train_generator = train_datagen.flow_from_directory(
dataset_dir,
save_to_dir=img_save_to_dir,
target_size=img_size,
class_mode=‘categorical’)

validation_generator = test_datagen.flow_from_directory(
dataset_dir,
save_to_dir=img_save_to_dir,
target_size=img_size,
class_mode=‘categorical’)

# Early stop method and dynamic learning rate setting

early_stop = EarlyStopping(monitor=’val_loss’, patience=13)
reduce_lr = ReduceLROnPlateau(monitor=’val_loss’, patience=7, mode=’auto’, factor=0.2)
tensorboard = keras.callbacks.tensorboard_v2.TensorBoard(log_dir=log_dir)

for layer in model.layers:
layer.trainable = False

# Model compilation

model.compile(optimizer=‘rmsprop’, loss=’categorical_crossentropy’, metrics=[‘accuracy’])

history = model.fit_generator(train_generator,
steps_per_epoch=train_generator.samples // train_generator.batch_size,
epochs=100,
validation_data=validation_generator,
validation_steps=validation_generator.samples // validation_generator.batch_size,
callbacks=[early_stop, reduce_lr, tensorboard])
# Model export
model.save(model_dir + ‘chinese_medicine_model_v1. 0. H5) < / span > < / code > < / pre >

Description of Dependent environment

Dependency

Version

JDK

11+

Python

3.6

Gradle

6.5

TensorFlow

2.0

MongoDB

4.2.2

MySQL

8.0+

Spring Boot

2.2.2

Elasticsearch

7.4.2

IK word segmentation

7.4.2

ONNX Runtime

1.8.1


资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free source code TCM image recognition system (APP + server) https://ictcoder.com/kyym/tcm-image-recognition-system-app-server.html

Share free open-source source code

Q&A
  • 1, automatic: after taking the photo, click the (download) link to download; 2. Manual: After taking the photo, contact the seller to issue it or contact the official to find the developer to ship.
View details
  • 1, the default transaction cycle of the source code: manual delivery of goods for 1-3 days, and the user payment amount will enter the platform guarantee until the completion of the transaction or 3-7 days can be issued, in case of disputes indefinitely extend the collection amount until the dispute is resolved or refunded!
View details
  • 1. Heptalon will permanently archive the process of trading between the two parties and the snapshots of the traded goods to ensure that the transaction is true, effective and safe! 2, Seven PAWS can not guarantee such as "permanent package update", "permanent technical support" and other similar transactions after the merchant commitment, please identify the buyer; 3, in the source code at the same time there is a website demonstration and picture demonstration, and the site is inconsistent with the diagram, the default according to the diagram as the dispute evaluation basis (except for special statements or agreement); 4, in the absence of "no legitimate basis for refund", the commodity written "once sold, no support for refund" and other similar statements, shall be deemed invalid; 5, before the shooting, the transaction content agreed by the two parties on QQ can also be the basis for dispute judgment (agreement and description of the conflict, the agreement shall prevail); 6, because the chat record can be used as the basis for dispute judgment, so when the two sides contact, only communicate with the other party on the QQ and mobile phone number left on the systemhere, in case the other party does not recognize self-commitment. 7, although the probability of disputes is very small, but be sure to retain such important information as chat records, mobile phone messages, etc., in case of disputes, it is convenient for seven PAWS to intervene in rapid processing.
View details
  • 1. As a third-party intermediary platform, Qichou protects the security of the transaction and the rights and interests of both buyers and sellers according to the transaction contract (commodity description, content agreed before the transaction); 2, non-platform online trading projects, any consequences have nothing to do with mutual site; No matter the seller for any reason to require offline transactions, please contact the management report.
View details

Related Article

make a comment
No comments available at the moment
Official customer service team

To solve your worries - 24 hours online professional service