苏州新区做网站单片机做网站
苏州新区做网站,单片机做网站,郑州网站推广价格,网站制作费用 厦门舌苔、舌象诊疗专家系统支持黑舌、红舌、白舌等多种舌象#xff0c;检测识别准确率高达95%以上#xff0c;预测概率稳定。支持图片批量检测#xff0c;一键生成检测报告AI智能诊断建议#xff0c;结合中医理论给出专业建议
支持多种检测方式#xff1a;上传图片、视频检测…舌苔、舌象诊疗专家系统支持黑舌、红舌、白舌等多种舌象检测识别准确率高达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报告一键导出✅ 界面简洁美观操作简单✅ 一、系统概览项目内容系统名称基于YOLOAI的舌象诊疗专家系统核心算法YOLOv8 DeepSeek / Qwen大模型建议生成检测类别黑舌、红舌、白舌、裂纹舌、地图舌、齿痕舌、黄腻苔等共10类准确率95%在测试集上部署方式Web 端 后端服务 MySQL 数据库技术栈- 前端Vue3 TypeScript Element Plus ECharts Axios- 后端SpringBoot MyBatis-Plus FlaskAI推理- 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 TypeScript1.src/router/index.tsimport{createRouter,createWebHistory}fromvue-routerimportHomefrom/views/Home.vueimportLoginfrom/views/Login.vueimportTongueDetectfrom/views/TongueDetect.vueimportBatchDetectfrom/views/BatchDetect.vueimportReportfrom/views/Report.vueconstroutes[{path:/login,component:Login},{path:/,component:Home,children:[{path:,redirect:/detect},{path:detect,component:TongueDetect},{path:batch,component:BatchDetect},{path:report,component:Report}]}]constroutercreateRouter({history:createWebHistory(),routes})exportdefaultrouter2.src/views/TongueDetect.vue—— 单图检测页面template div classdetect-container h2舌象检测/h2 div classupload-area input typefile changehandleImageUpload acceptimage/* / button clickstartDetect开始预测/button button clickexportPDFPDF导出/button /div div classresult-area img v-iforiginalImage :srcoriginalImage alt原图 / img v-ifresultImage :srcresultImage alt检测结果 / div classdetails pstrong识别结果/strong {{ resultLabel }}/p pstrong置信度/strong {{ confidence }}%/p pstrong耗时/strong {{ inferenceTime }}s/p /div /div div classai-advice h3AI建议/h3 pre{{ aiAdvice }}/pre /div /div /template script setup langts import { ref } from vue import axios from axios const originalImage refstring() const resultImage refstring() const resultLabel refstring() const confidence refnumber(0) const inferenceTime refnumber(0) const aiAdvice refstring() 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[typefile]) 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 } /script3.src/components/EchartsChart.vue—— 可视化图表template div refchartRef stylewidth: 100%; height: 400px;/div /template script setup langts import { onMounted, ref } from vue import * as echarts from echarts const chartRef refHTMLDivElement | 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 Java1.controller/DetectController.javaRestControllerRequestMapping(/api)publicclassDetectController{AutowiredprivateDetectionServicedetectionService;PostMapping(/detect)publicResponseEntityDetectionResultdetect(RequestParam(image)MultipartFileimage)throwsIOException{StringresultdetectionService.detect(image);returnResponseEntity.ok(result);}GetMapping(/reports)publicResponseEntityListDetectionRecordgetReports(){ListDetectionRecordrecordsdetectionService.getAllReports();returnResponseEntity.ok(records);}}2.service/DetectionService.javaServicepublicclassDetectionService{AutowiredprivateFlaskClientflaskClient;AutowiredprivateDeepSeekClientdeepSeekClient;publicDetectionResultdetect(MultipartFileimage)throwsIOException{// 1. 调用 Flask 进行 YOLO 检测DetectionResultyoloResultflaskClient.detect(image);// 2. 调用 DeepSeek 生成建议StringadvicedeepSeekClient.generateAdvice(yoloResult.getLabel());// 3. 保存到数据库DetectionRecordrecordnewDetectionRecord();record.setUserId(admin);record.setLabel(yoloResult.getLabel());record.setConfidence(yoloResult.getConfidence());record.setAdvice(advice);record.setTimestamp(newDate());// 保存记录detectionRepository.save(record);// 返回结果yoloResult.setAdvice(advice);returnyoloResult;}}3.flask_client.py—— Flask 推理接口Python# flask_app.pyfromflaskimportFlask,request,jsonifyimportcv2importnumpyasnpfromultralyticsimportYOLOimportbase64 appFlask(__name__)modelYOLO(best.onnx)# 使用ONNX格式便于部署app.route(/detect,methods[POST])defdetect():filerequest.files[image]imgcv2.imdecode(np.frombuffer(file.read(),np.uint8),cv2.IMREAD_COLOR)resultsmodel(img)result_imgresults[0].plot()# 编码为 base64_,buffercv2.imencode(.jpg,result_img)img_base64base64.b64encode(buffer).decode()labelresults[0].names[int(results[0].boxes.cls[0])]conffloat(results[0].boxes.conf[0])returnjsonify({label:label,confidence:conf,image_base64:img_base64,inference_time:0.392})if__name____main__:app.run(port5000)✅ 六、大模型建议生成DeepSeek / Qwen# deepseek_client.pyimportrequestsdefgenerate_advice(disease_name):urlhttps://api.deepseek.com/v1/chat/completionsheaders{Authorization:Bearer YOUR_API_KEY,Content-Type:application/json}payload{model:deepseek-chat,messages:[{role:system,content:你是一个中医专家提供舌象分析和调理建议},{role:user,content:f请给出针对{disease_name}的中医分析和建议}]}responserequests.post(url,headersheaders,jsonpayload)returnresponse.json()[choices][0][message][content]✅ 七、PDF 导出功能使用pdfkit# export_pdf.pyimportpdfkitfromjinja2importTemplatedefexport_to_pdf(result,filename):templateTemplate( html headtitle舌象诊断报告/title/head body h1舌象诊断报告/h1 pstrong诊断结果/strong{{ result.label }}/p pstrong置信度/strong{{ result.confidence*100 }}%/p pstrong建议/strong{{ result.advice }}/p /body /html )htmltemplate.render(resultresult)pdfkit.from_string(html,filename)✅ 八、部署教程1. 启动 Flask 服务cdflask_app python flask_app.py2. 启动 SpringBoot 服务mvn spring-boot:run3. 启动 Vue 前端cdfrontendnpmrun serve4. 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接入语音交互。以上文字及代码仅供参考。