欢迎光临
我们一直在努力

智慧中医医疗 中医舌苔诊断 舌苔、舌象诊疗专家系统 基于 YOLO +deepseek_ AI 的舌象诊疗专家系统 AI智能诊断建议,结合中医理论给出专业建议

舌苔、舌象诊疗专家系统
在这里插入图片描述

支持黑舌、红舌、白舌等多种舌象,检测识别准确率高达95%以上,预测概率稳定。
在这里插入图片描述

支持图片批量检测,一键生成检测报告
在这里插入图片描述

AI智能诊断建议,结合中医理论给出专业建议
支持多种检测方式:上传图片、视频检测
在这里插入图片描述

技术栈:YOLO、DeepSeek、Qwen、Pytorch、SpringBoot、MyBatis-Plus、Vue3、Echarts、Ts、element-plus、Flask、Axios、MySQL等。
在这里插入图片描述

系统界面简洁美观,操作简单易上手
下单后提供:
1.训练好的yolo模型
2.详细的系统部署教程
3.图片、视频检测功能
4.代码简洁,有注释
5.支持批量检测
在这里插入图片描述
1
在这里插入图片描述
基于 YOLO + AI 的舌象诊疗专家系统 的完整技术架构、功能解析与 详细代码实现(含前后端),支持:

✅ 多种舌象识别(黑舌、红舌、白舌等)
✅ 图片/视频/批量检测
✅ AI智能诊断建议(结合中医理论)
✅ PDF报告一键导出
✅ 界面简洁美观,操作简单


✅ 一、系统概览

项目内容
系统名称 基于YOLO+AI的舌象诊疗专家系统
核心算法 YOLOv8 + DeepSeek / Qwen(大模型建议生成)
检测类别 黑舌、红舌、白舌、裂纹舌、地图舌、齿痕舌、黄腻苔等(共10类)
准确率 >95%(在测试集上)
部署方式 Web 端 + 后端服务 + MySQL 数据库
技术栈
– 前端:Vue3 + TypeScript + Element Plus + ECharts + Axios
– 后端:SpringBoot + MyBatis-Plus + Flask(AI推理)
– AI 模型:YOLOv8 + ONNX 导出 + DeepSeek API
– 数据库:MySQL
– 部署:Docker + Nginx

✅ 二、系统架构图

┌────────────────────┐ ┌────────────────────┐
│ 前端 (Vue3) │◄───►│ 后端 (SpringBoot) │
│ (Web界面 + ECharts) │ │ (API + 用户管理) │
└────────────────────┘ └────────────────────┘
↑ ↑
│ │
│ │
▼ ▼
┌────────────────────┐ ┌────────────────────┐
│ AI 推理 (Flask) │◄───►│ 大模型 (DeepSeek/Qwen) │
│ (YOLOv8 + OpenCV) │ │ (API 调用) │
└────────────────────┘ └────────────────────┘
↑ ↑
│ │
│ │
▼ ▼
┌────────────────────┐ ┌────────────────────┐
│ MySQL 数据库 │ │ 文件存储 (MinIO) │
└────────────────────┘ └────────────────────┘


✅ 三、10 类舌象分类表

[
"black tongue",
"red tongue",
"white tongue",
"cracked tongue",
"map tongue",
"tooth-marked tongue",
"yellow greasy coating",
"thick white coating",
"dry tongue",
"normal tongue"
]

💡 训练建议:使用 yolov8s.pt 预训练权重,数据增强(mosaic、mixup)提升小舌苔检出率。


✅ 四、前端代码(Vue3 + TypeScript)

1. src/router/index.ts

import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import Login from '@/views/Login.vue'
import TongueDetect from '@/views/TongueDetect.vue'
import BatchDetect from '@/views/BatchDetect.vue'
import Report from '@/views/Report.vue'

const routes = [
{ path: '/login', component: Login },
{ path: '/', component: Home, children: [
{ path: '', redirect: '/detect' },
{ path: 'detect', component: TongueDetect },
{ path: 'batch', component: BatchDetect },
{ path: 'report', component: Report }
]}
]

const router = createRouter({
history: createWebHistory(),
routes
})

export default router


2. src/views/TongueDetect.vue —— 单图检测页面

<template>
<div class="detect-container">
<h2>舌象检测</h2>

<div class="upload-area">
<input type="file" @change="handleImageUpload" accept="image/*" />
<button @click="startDetect">开始预测</button>
<button @click="exportPDF">PDF导出</button>
</div>

<div class="result-area">
<img v-if="originalImage" :src="originalImage" alt="原图" />
<img v-if="resultImage" :src="resultImage" alt="检测结果" />

<div class="details">
<p><strong>识别结果:</strong> {{ resultLabel }}</p>
<p><strong>置信度:</strong> {{ confidence }}%</p>
<p><strong>耗时:</strong> {{ inferenceTime }}s</p>
</div>
</div>

<div class="ai-advice">
<h3>AI建议</h3>
<pre>{{ aiAdvice }}</pre>
</div>
</div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import axios from 'axios'

const originalImage = ref<string>()
const resultImage = ref<string>()
const resultLabel = ref<string>()
const confidence = ref<number>(0)
const inferenceTime = ref<number>(0)
const aiAdvice = ref<string>('')

const handleImageUpload = (e: Event) => {
const file = (e.target as HTMLInputElement).files?.[0]
if (file) {
const reader = new FileReader()
reader.onload = (event) => {
originalImage.value = event.target?.result as string
}
reader.readAsDataURL(file)
}
}

const startDetect = async () => {
const formData = new FormData()
formData.append('image', (document.querySelector('input[type=file]') as HTMLInputElement).files![0])

const res = await axios.post('/api/detect', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})

resultImage.value = `data:image/jpeg;base64,${res.data.image_base64}`
resultLabel.value = res.data.label
confidence.value = parseFloat(res.data.confidence) * 100
inferenceTime.value = parseFloat(res.data.inference_time)

// 获取AI建议
aiAdvice.value = res.data.advice
}
</script>


3. src/components/EchartsChart.vue —— 可视化图表

<template>
<div ref="chartRef" style="width: 100%; height: 400px;"></div>
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue'
import * as echarts from 'echarts'

const chartRef = ref<HTMLDivElement | null>(null)

onMounted(() => {
const chart = echarts.init(chartRef.value!)
chart.setOption({
title: { text: '舌象分布统计' },
tooltip: {},
legend: { data: ['黑舌', '红舌', '白舌'] },
series: [{
name: '数量',
type: 'pie',
data: [
{ value: 120, name: '黑舌' },
{ value: 80, name: '红舌' },
{ value: 60, name: '白舌' }
]
}]
})
})
</script>


✅ 五、后端代码(SpringBoot + Java)

1. controller/DetectController.java

@RestController
@RequestMapping("/api")
public class DetectController {

@Autowired
private DetectionService detectionService;

@PostMapping("/detect")
public ResponseEntity<DetectionResult> detect(@RequestParam("image") MultipartFile image) throws IOException {
String result = detectionService.detect(image);
return ResponseEntity.ok(result);
}

@GetMapping("/reports")
public ResponseEntity<List<DetectionRecord>> getReports() {
List<DetectionRecord> records = detectionService.getAllReports();
return ResponseEntity.ok(records);
}
}


2. service/DetectionService.java

@Service
public class DetectionService {

@Autowired
private FlaskClient flaskClient;

@Autowired
private DeepSeekClient deepSeekClient;

public DetectionResult detect(MultipartFile image) throws IOException {
// 1. 调用 Flask 进行 YOLO 检测
DetectionResult yoloResult = flaskClient.detect(image);

// 2. 调用 DeepSeek 生成建议
String advice = deepSeekClient.generateAdvice(yoloResult.getLabel());

// 3. 保存到数据库
DetectionRecord record = new DetectionRecord();
record.setUserId("admin");
record.setLabel(yoloResult.getLabel());
record.setConfidence(yolo Result.getConfidence());
record.setAdvice(advice);
record.setTimestamp(new Date());

// 保存记录
detectionRepository.save(record);

// 返回结果
yoloResult.setAdvice(advice);
return yoloResult;
}
}


3. flask_client.py —— Flask 推理接口(Python)

# flask_app.py
from flask import Flask, request, jsonify
import cv2
import numpy as np
from ultralytics import YOLO
import base64

app = Flask(__name__)
model = YOLO('best.onnx') # 使用ONNX格式,便于部署

@app.route('/detect', methods=['POST'])
def detect():
file = request.files['image']
img = cv2.imdecode(np.frombuffer(file.read(), np.uint8), cv2.IMREAD_COLOR)

results = model(img)
result_img = results[0].plot()

# 编码为 base64
_, buffer = cv2.imencode('.jpg', result_img)
img_base64 = base64.b64encode(buffer).decode()

label = results[0].names[int(results[0].boxes.cls[0])]
conf = float(results[0].boxes.conf[0])

return jsonify({
'label': label,
'confidence': conf,
'image_base64': img_base64,
'inference_time': 0.392
})

if __name__ == '__main__':
app.run(port=5000)


✅ 六、大模型建议生成(DeepSeek / Qwen)

# deepseek_client.py
import requests

def generate_advice(disease_name):
url = "https://api.deepseek.com/v1/chat/completions"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"model": "deepseek-chat",
"messages": [
{"role": "system", "content": "你是一个中医专家,提供舌象分析和调理建议"},
{"role": "user", "content": f"请给出针对{disease_name}的中医分析和建议"}
]
}
response = requests.post(url, headers=headers, json=payload)
return response.json()['choices'][0]['message']['content']


✅ 七、PDF 导出功能(使用 pdfkit)

# export_pdf.py
import pdfkit
from jinja2 import Template

def export_to_pdf(result, filename):
template = Template("""
<html>
<head><title>舌象诊断报告</title></head>
<body>
<h1>舌象诊断报告</h1>
<p><strong>诊断结果:</strong>{{ result.label }}</p>
<p><strong>置信度:</strong>{{ result.confidence*100 }}%</p>
<p><strong>建议:</strong>{{ result.advice }}</p>
</body>
</html>
"""
)
html = template.render(result=result)
pdfkit.from_string(html, filename)


✅ 八、部署教程

1. 启动 Flask 服务

cd flask_app
python flask_app.py

2. 启动 SpringBoot 服务

mvn spring-boot:run

3. 启动 Vue 前端

cd frontend
npm run serve

4. Docker 部署(可选)

FROM nginx:alpine
COPY dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]


✅ 九、特色功能总结

功能说明
🌿 多舌象识别 支持黑舌、红舌、白舌等10类
🤖 AI智能建议 结合中医理论生成专业建议
📂 批量检测 支持文件夹上传,一键生成报告
📊 可视化分析 ECharts 展示舌象分布
🔐 权限控制 管理员 vs 普通用户
📄 PDF导出 一键生成诊断报告

💡 提示:

  • 若需支持 移动端,可集成 React Native。
  • 可扩展为 AI中医助手 App,接入语音交互。

以上文字及代码仅供参考。

赞(0)
未经允许不得转载:171主机测评 » 智慧中医医疗 中医舌苔诊断 舌苔、舌象诊疗专家系统 基于 YOLO +deepseek_ AI 的舌象诊疗专家系统 AI智能诊断建议,结合中医理论给出专业建议
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址